Message sending method and device and communication system
By copying and forwarding packets on the first chip based on the multi-came group table in a multi-came grouping scenario, the bandwidth waste and hardware resource overhead caused by cross-chip multi-came grouping forwarding are solved, and more efficient forwarding and simplified management and maintenance are achieved.
Patent Information
- Application Number
- CN202411994707.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
AI Technical Summary
In multi-chip stacking scenarios, the current cross-chip multicast message forwarding method leads to waste of stacking port bandwidth and large hardware resource overhead, which is not conducive to post-management and maintenance.
By determining the multicast transmission situation based on the received initial message on the first chip, copying and forwarding messages based on the pre-created multicast group table, copying and forwarding are performed only on the local port and stacking port exits, and looking for the local multicast group table in each chip, reducing the need for global storage and maintenance.
It realizes reducing hardware resource overhead in stacking scenarios, simplifying management and maintenance, and improving the efficiency of multicast cross-film forwarding, reducing unnecessary occupation and waste of stacking port bandwidth, so that stacking channel traffic only needs to occupy 1 times the bandwidth of service flow.
Smart Images

Figure CN119854393A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and in particular, relates to a message sending method, device and communication system. Background Art
[0002] Switch chip multi-chip stacking belongs to multi-chip collaborative technology, which requires multiple switch chips to work together to handle cross-chip forwarding of multicast traffic, and requires communication and coordination mechanisms between chips. It also involves related fields such as network switching technology and multicast technology. The main purpose of switch chip stacking is to achieve higher switching capacity and performance, while cross-chip forwarding of multicast traffic requires an efficient switching mechanism to ensure fast data transmission.
[0003] In the related art, the current stacking scenario usually requires multiple copies of the cross-chip multicast message to be made in the first chip, and then the outbound port search and forwarding are performed. This method has a heavy traffic burden when the stack port is forwarded. For example, in a three-chip stacking scenario, the first chip has a local port for sending messages, and the other two non-first chips each have two local ports. When the message is to be forwarded from the first chip to the four outbound ports of the non-first chip, four copies of the message need to be copied in the first chip. Then the stacking port between the first chip and the second chip needs to forward four identical messages, that is, the stacking channel traffic occupies 4 times the bandwidth of the business flow, and the stacking port between the second chip and the third chip needs to forward two identical messages, that is, the stacking channel traffic occupies 2 times the bandwidth of the business flow; this will waste a large part of the bandwidth of the stacking port and unnecessary occupation, and the traffic replication is all performed in the first chip, which will also have a certain efficiency impact. In addition, the storage and maintenance of the multicast group table inside each chip must be global, and the hardware resource overhead of each chip is large, which is not conducive to later management and maintenance. Summary of the invention
[0004] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes a message sending method, device and communication system, which can achieve in a stacking scenario, reduce hardware resource overhead and facilitate later management and maintenance, while optimizing the process and method of multicast cross-slice forwarding, improving forwarding efficiency and reducing unnecessary occupation and waste of stack port bandwidth.
[0005] In a first aspect, the present application provides a method for sending a message, the method comprising:
[0006] In a case where the first chip determines to perform multicast transmission based on the received initial message, determining the total number of transmission ports and stack port egresses in the first chip for sending the initial message based on a pre-created multicast group table related to the first chip;
[0007] The initial message is copied based on the total number, and the copied initial messages are sent to the sending port and the stack port exit in a one-to-one correspondence, so that the stack port exit adds target header information to the initial message, and sends the added initial message to the second chip connected to the stack port exit; the target header information is used to instruct the second chip to search for a multicast group table related to the second chip;
[0008] The multicast group table associated with each chip only supports the local sending port and the stack port egress of the corresponding chip.
[0009] According to the message sending method of the present application, when the first chip determines to perform multicast sending based on the received initial message, based on the pre-created multicast group table related to the first chip, the total number of sending ports and stack port exits used to send the initial message in the first chip is determined, the initial message is copied based on the total number, and the copied initial message is sent to the sending port and the stack port exit one by one, so that the stack port exit adds target header information to the initial message, and sends the added initial message to the second chip connected to the stack port exit, so as to realize the message with encapsulated target header information. The flow of the text is realized, and when the multicast message is forwarded across slices, each chip only needs to find its own local port and stack port export to perform its own copy forwarding, and the above process is still used for the next chip, so that the storage and maintenance of the multicast member table in the stacking scenario is changed from global to local. In this way, in the stacking scenario, while reducing the hardware resource overhead and facilitating the subsequent management and maintenance, the process and method of multicast cross-slice forwarding are optimized, so that the stacking channel traffic between each chip in the stacking scenario only occupies 1 times the bandwidth of the business flow, thereby improving the forwarding efficiency and reducing the unnecessary occupation and waste of the stacking port bandwidth.
[0010] According to one embodiment of the present application, it includes:
[0011] When the second chip receives the initial message sent by the previous chip and after the target header information is added, based on the target header information, obtain the multicast group table pre-stored in the second chip;
[0012] Determine the number of sending ports in the second chip for sending the initial message based on the multicast group table;
[0013] When the number is not 0, the initial message is copied based on the number, and the copied initial messages are sent to the sending port one by one.
[0014] According to one embodiment of the present application, it includes:
[0015] When the second chip receives the initial message sent by the previous chip and after the target header information is added, based on the target header information, obtain the multicast group table pre-stored in the second chip;
[0016] When it is determined based on the multicast group table that there is a stack port exit in the second chip, the initial message is copied and sent to the stack port exit of the second chip, so that the stack port exit can add target header information to the initial message and send the added initial message to the next chip connected to the stack port exit.
[0017] According to an embodiment of the present application, acquiring a multicast group table pre-stored in the chip based on the target header information field includes:
[0018] In the case of determining to perform multicast transmission based on the target header information, acquiring address information from the target header information;
[0019] When it is determined that the address information is valid, the multicast group table is obtained.
[0020] According to an embodiment of the present application, after the first chip determines to perform multicast transmission based on the received initial message, the method further includes:
[0021] Acquiring address information based on the initial message;
[0022] When it is determined that the address information is invalid, the initial message is sent to each of the sending ports and the stack port exit of the first chip to send the message;
[0023] Alternatively, after the second chip receives the initial message sent by the previous chip with the target header information added, the method further includes:
[0024] Acquire address information based on the target header information;
[0025] When it is determined that the address information is invalid, the initial message is sent to each of the sending ports and the stack port exit of the second chip for message sending.
[0026] In a second aspect, the present application provides a message sending device, the device comprising:
[0027] A first processing module, when the first chip determines to perform multicast transmission based on the received initial message, determines the total number of transmission ports and stack port egresses in the first chip for sending the initial message based on a pre-created multicast group table related to the first chip;
[0028] a second processing module, configured to copy the initial message based on the total number, and send the copied initial message to the sending port and the stack port exit in a one-to-one correspondence, so that the stack port exit can add target header information to the initial message, and send the added initial message to a second chip connected to the stack port exit; the target header information is used to instruct the second chip to search for a multicast group table related to the second chip;
[0029] The multicast group table associated with each chip only supports the local sending port and the stack port egress of the corresponding chip.
[0030] According to the message sending device of the present application, when the first chip determines to perform multicast sending based on the received initial message, based on the pre-created multicast group table related to the first chip, the total number of sending ports and stack port exits used to send the initial message in the first chip is determined, the initial message is copied based on the total number, and the copied initial message is sent to the sending port and the stack port exit one by one, so that the stack port exit adds target header information to the initial message, and sends the added initial message to the second chip connected to the stack port exit, so as to realize the packet with encapsulated target header information. The flow of the text is realized, and when the multicast message is forwarded across slices, each chip only needs to find its own local port and stack port export to perform its own copy forwarding, and the above process is still used for the next chip, so that the storage and maintenance of the multicast member table in the stacking scenario is changed from global to local. In this way, in the stacking scenario, while reducing the hardware resource overhead and facilitating the subsequent management and maintenance, the process and method of multicast cross-slice forwarding are optimized, so that the stacking channel traffic between each chip in the stacking scenario only occupies 1 times the bandwidth of the business flow, thereby improving the forwarding efficiency and reducing the unnecessary occupation and waste of the stacking port bandwidth.
[0031] In a third aspect, the present application provides a communication system, the system comprising:
[0032] At least two chips arranged in a stack, wherein the chips are communicatively connected to each other via a stack port;
[0033] Each of the chips sends a message based on the message sending method described in the first aspect.
[0034] In a fourth aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the message sending method as described in the first aspect above is implemented.
[0035] In a fifth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the message sending method as described in the first aspect above is implemented.
[0036] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the message sending method as described in the first aspect above.
[0037] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0038] By, when the first chip determines to perform multicast transmission based on the received initial message, based on the pre-created multicast group table related to the first chip, determining the total number of sending ports and stack port exits in the first chip for sending the initial message, copying the initial message based on the total number, and sending the copied initial message to the sending port and the stack port exit one by one, so that the stack port exit adds target header information to the initial message, and sending the added initial message to the second chip connected to the stack port exit, the flow of the message encapsulated with the target header information can be realized, and when the multicast message is forwarded across chips, each chip only needs to find its own local port and stack port exit to perform its own copy and forwarding, and the above process is still used for the next chip, so that the storage and maintenance of the multicast member table in the stacking scenario is changed from global relative to local, so as to achieve in the stacking scenario, while reducing the hardware resource overhead and facilitating the subsequent management and maintenance, the process and method of multicast cross-chip forwarding are optimized, so that the stacking channel traffic between the chips in the stacking scenario only needs to occupy 1 times the bandwidth of the business flow, thereby improving the forwarding efficiency and reducing the unnecessary occupation and waste of the stacking port bandwidth.
[0039] Furthermore, by obtaining address information from the target header information when determining to perform multicast transmission based on the target header information, and obtaining the multicast group table when determining that the address information is valid, it is possible to effectively obtain the multicast group table corresponding to the initial message based on the address information in the target header information, reduce the risk of message sending errors due to invalid address information, and improve the logical rigor of obtaining the multicast group table.
[0040] Furthermore, when the second chip receives the initial message with the target header information added sent by the previous chip, based on the target header information, the multicast group table pre-stored in the second chip is obtained, and then the target port is determined based on the multicast group table, and the initial message is copied based on the number of target ports, and the copied initial message is sent one-to-one to the target port. This allows the second chip that receives the initial message with the target header information to no longer repeatedly encapsulate the target header information, and can directly determine the initial message forwarding mode and obtain the multicast group table based on the target header information, and perform local message copying and forwarding based on the multicast group table, which can simplify the stacked chip message processing flow, improve processing efficiency, and improve the convenience of maintaining the multicast group table inside each chip.
[0041] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0043] Figure 1 This is one of the flow diagrams of the message sending method provided in the embodiment of the present application;
[0044] Figure 2 This is the second flow chart of the message sending method provided in the embodiment of the present application;
[0045] Figure 3 is a schematic diagram of the structure of a chain stacking topology provided in an embodiment of the present application;
[0046] Figure 4 It is a structural diagram of a message sending device provided in an embodiment of the present application;
[0047] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0049] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0050] The message sending method, message sending device, communication system, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below in combination with the accompanying drawings through specific embodiments and their application scenarios.
[0051] The message sending method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.
[0052] The terminal includes but is not limited to portable communication devices such as mobile phones or tablet computers. It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer.
[0053] The message sending method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the message sending method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The message sending method provided in the embodiment of the present application is described below using an electronic device as an example of an execution subject.
[0054] like Figure 1 As shown, the message sending method includes: step 110 and step 120.
[0055] Step 110: When the first chip determines to perform multicast transmission based on the received initial message, determine the total number of transmission ports and stack port egresses in the first chip for sending the initial message based on a pre-created multicast group table related to the first chip;
[0056] In this step, the first chip is the first chip in the chain stacking topology, that is, the first chip.
[0057] In actual implementation, two or more chips can be stacked to form a chain stack topology, which can be used for cross-chip forwarding of multicast messages.
[0058] The initial message is a message sent based on the chain stack topology.
[0059] Multicast transmission is a message transmission method in which the same message is sent to multiple receiving devices.
[0060] The multicast group table is a multicast member table corresponding to the initial message pre-stored in the chip, and can be stored in a specific storage space in the chip.
[0061] The multicast group table of the first chip stores the sending port number and the stack port exit number of the first chip.
[0062] The sending port is a local port used by the chip to forward messages to other devices.
[0063] The stack port exit is a stack port of a current chip for connecting to a stack port entry of a next chip.
[0064] In actual implementation, two or more stacking chips connected by the stacking port egress of the previous chip and the stacking port ingress of the next chip form a chain stacking topology, which can be used for cross-chip forwarding of multicast messages.
[0065] It should be noted that the sending port and the stacking port are conceptual divisions, and are essentially local service ports of the chip.
[0066] The first chip may send the initial message based on the sending port number and the stack port exit number stored in the multicast group table.
[0067] In actual execution, upon receiving the initial message, the first chip may analyze the information carried in the initial message to determine whether to perform multicast transmission and, if it is determined to perform multicast transmission, the multicast group table corresponding to the initial message.
[0068] In some embodiments, the first chip can determine the expected sending method of the initial message and the multicast group table corresponding to the initial message based on the unicast or multicast address, source port and destination port information or source IP address and destination IP address carried by the initial message, and then determine the total number of sending ports and stack port exits in the first chip used to send the initial message based on the multicast group table.
[0069] During the actual execution process, based on different categories of initial messages, the multicast group table related to each chip in the chain stacking topology corresponding to each initial message can be pre-constructed and stored inside each chip. Therefore, when each chip receives a certain initial message, the total number of sending ports and stacking port exits used to send this type of initial message can be determined based on the multicast group table corresponding to this type of initial message.
[0070] It is understandable that the multicast group table associated with each chip may only support the local sending port and stacking port egress of the corresponding chip, thereby facilitating the subsequent maintenance of the multicast group table inside each chip.
[0071] In some embodiments, before the first chip determines to perform multicast transmission based on the received initial message, the method may further include:
[0072] Based on the initial messages of different categories, determining the sending port corresponding to each chip and matching the category from all the ports in each chip;
[0073] Based on the determined sending ports of the chips matching the same category and the stack port egress corresponding to the chips, a multicast group table corresponding to the messages of the category is constructed and stored inside the chip.
[0074] In this embodiment, the stack port inlet and outlet in each chip are determined when a chain stack topology is constructed before determining the sending port of each chip corresponding to the initial message.
[0075] It can be understood that the sending port of each chip corresponding to each category of initial message can be determined based on different categories of initial messages, and then based on the stacking port exit in each chip and the sending port in each chip corresponding to each category of initial message, a multicast group table corresponding to each category of initial message inside each chip is constructed and stored.
[0076] During the actual execution process, in the chain stack topology, each chip will determine the sending port corresponding to each category of initial message from the local port of each chip based on each category of initial message before the first chip receives the initial message. It can be understood that each chip stores a multicast group table corresponding to each category of initial message.
[0077] In some embodiments, the storage addresses of the multicast group tables corresponding to the initial messages of the same category in each chip can be consistent, thereby facilitating the acquisition of the multicast group tables corresponding to the initial messages of the same category stored at the same storage address in each chip based on the target header information when the initial messages of the same category flow to any chip.
[0078] For example, Figure 3As shown, three chips are used for stacking in the current environment, including: chip 0, chip 1 and chip 2; among them, the physical port port_11 of chip 0 is used as the stacking port exit of chip 0; the physical port port_11 of chip 1 is used as the stacking port entry of chip 1, the physical port port_12 of chip 1 is used as the stacking port exit of chip 1, the physical port port_11 of chip 2 is used as the stacking port entry of chip 2, the physical port port_11 of chip 0 is connected to the physical port port_11 of chip 1, and the physical port port_12 of chip 1 is connected to the physical port port_11 of chip 2, forming a chain stacking topology.
[0079] Multicast group table 1 can be set based on initial message 1 at the same storage location in chip 0, chip 1 and chip 2, respectively, wherein multicast group table 1 of chip 0 includes local port (sending port) 0port_1 of chip 0 and stack port exit port_11 of chip 0, multicast group table 1 of chip 1 includes local port port_0 of chip 1 and stack port exit port_12 of chip 1, and multicast group table 1 of chip 2 includes local ports port_2 and port_3 of chip 2.
[0080] In actual implementation, the number of sending ports corresponding to each type of initial message in each chip may be different, and the number of sending ports corresponding to the same type of initial message in each chip may be different.
[0081] In some embodiments, the number of sending ports in certain chips determined based on the initial message may also be 0.
[0082] In some embodiments, the category of the initial message can be based on a user-defined judgment. For example, the initial message carrying a foreign address can be classified into one category, and the initial message not carrying a foreign address can be classified into another category, and the multicast group tables corresponding to the two categories of initial messages in each chip are respectively constructed, wherein the storage address of the multicast group table corresponding to the initial message of the same category in each chip can be the same, so that the first chip that subsequently receives the initial message can judge the category of the initial message based on the relevant information carried by the initial message, and then, based on the category of the initial message, encapsulate the initial message with the target header information containing the address information of the multicast group table corresponding to the initial message of this category, so as to facilitate the next chip to process the message of this category of the initial message.
[0083] According to the message sending method provided in the embodiment of the present application, based on initial messages of different categories, the sending port corresponding to each chip that matches the category is determined from all ports in each chip; based on the determined sending port of the chip matching the same category and the stacking port exit corresponding to the chip, a multicast group table corresponding to the message of the category is constructed and stored inside the chip, which can facilitate the management of the multicast group members stored in the multicast group table related to each chip by each chip in the subsequent chain stacking topology, and facilitate the smooth transmission and flow of subsequent messages.
[0084] Step 120, copy the initial message based on the total number, and send the copied initial message to the sending port and the stack port outlet one by one, so that the stack port outlet can add target header information to the initial message, and send the added initial message to the second chip connected to the stack port outlet.
[0085] In this step, the target header information is the stack header information that is exported by the stack port of the first chip to the initial message encapsulation.
[0086] The target header information is used to instruct the second chip to search for a multicast group table related to the second chip.
[0087] The second chip is any chip except the first chip in the chain stacking topology, that is, not the first chip.
[0088] In the actual execution process, the target header information can be obtained by the first chip analyzing the initial message based on the unicast or multicast address, source port and destination port information or source IP address and destination IP address information carried by the initial message.
[0089] The target header information may include: information for indicating the unicast or multicast forwarding mode of the initial message, and information for indicating the multicast group table corresponding to the initial message.
[0090] During the actual execution process, after the second chip receives the initial message with the target header information added, it can obtain the forwarding indication information of the initial message in the second chip based on the target header information, and search the multicast group table related to the second chip based on the forwarding indication information, which is the multicast group table corresponding to the initial message, and forward the initial message based on the multicast group table.
[0091] It can be understood that in the chain stacking topology formed by the first chip and each second chip, when the initial message is forwarded across chips, only one copy of the initial message needs to be forwarded between the chips, and then the initial message is copied inside each chip that receives it, that is, each stacking channel traffic only needs to occupy 1 times the bandwidth of the business flow.
[0092] Moreover, in the non-first chip of the chain stacking topology, it is possible to obtain the sending port and stacking port exit corresponding to the initial message directly based on the target header information and send the message without having to process and analyze the relevant information carried by the initial message, thereby reducing the processing flow and improving the efficiency of cross-chip forwarding of messages.
[0093] The inventor discovered during the research and development process that the current stacking scenario usually requires multiple copies of cross-chip multicast messages to be made in the first chip, and then the outbound port search and forwarding are performed. This method has a heavy traffic burden when the stack port is forwarded. For example, in a three-chip stacking scenario, the first chip has a local port for sending messages, and the other two non-first chips each have two local ports. When the message is to be forwarded from the first chip to the four outbound ports of the non-first chip, four copies of the message need to be copied in the first chip. Then the stacking port between the first chip and the second chip needs to forward four identical messages, that is, the stacking channel traffic occupies 4 times the bandwidth of the business flow, and the stacking port between the second chip and the third chip needs to forward two identical messages, that is, the stacking channel traffic occupies 2 times the bandwidth of the business flow; this will waste a large part of the bandwidth of the stacking port and unnecessary occupation, and the replication of traffic is all performed in the first chip, which will also have a certain efficiency impact. In addition, the storage and maintenance of the multicast group table inside each chip must be global, and the hardware resource overhead of each chip is large, which is not conducive to later management and maintenance.
[0094] In the present application, when the first chip determines to perform multicast transmission based on the received initial message, based on the pre-created multicast group table related to the first chip, the total number of sending ports and stack port exits in the first chip for sending the initial message is determined, the initial message is copied based on the total number, and the copied initial message is sent to the sending port and the stack port exit one by one, so that the stack port exit can add target header information to the initial message, and send the added initial message to the second chip connected to the stack port exit, so as to realize the flow of the message encapsulated with the target header information, and realize the transmission based on When a multicast message is forwarded across slices, the first chip only needs to find the local port (sending port) plus the stacking port exit to copy and forward the traffic after receiving the message, and the above process is still followed for the next chip, so that the storage and maintenance of the multicast member table in the stacking scenario is changed from global to local. In this way, in the stacking scenario, while reducing the hardware resource overhead and facilitating the subsequent management and maintenance, the process and method of multicast cross-slice forwarding are optimized, so that the stacking channel traffic between each chip in the stacking scenario only needs to occupy 1 times the bandwidth of the business flow, thereby improving forwarding efficiency and reducing unnecessary occupation and waste of stacking port bandwidth.
[0095] According to the message sending method provided in the embodiment of the present application, when the first chip determines to perform multicast sending based on the received initial message, based on the pre-created multicast group table related to the first chip, the total number of sending ports and stack port exits used to send the initial message in the first chip is determined, the initial message is copied based on the total number, and the copied initial message is sent to the sending port and the stack port exit one by one, so that the stack port exit adds target header information to the initial message, and sends the added initial message to the second chip connected to the stack port exit, so as to realize the encapsulated target header information. The flow of messages based on information is realized, and when multicast messages are forwarded across chips, each chip only needs to find its own local port and stack port exit to perform its own copy and forwarding, and the above process is still used for the next chip, so that the storage and maintenance of the multicast member table in the stacking scenario is changed from global to local, thereby achieving in the stacking scenario, while reducing the hardware resource overhead and facilitating the subsequent management and maintenance, the process and method of multicast cross-chip forwarding are optimized, so that the stacking channel traffic between each chip in the stacking scenario only occupies 1 times the bandwidth of the business flow, thereby improving the forwarding efficiency and reducing the unnecessary occupation and waste of the stacking port bandwidth.
[0096] In some embodiments, the message sending method includes:
[0097] When the second chip receives the initial message sent by the previous chip and after the target header information is added, based on the target header information, the multicast group table pre-stored in the second chip is obtained;
[0098] Based on the multicast group table, determine the destination port;
[0099] The initial message is copied based on the number of target ports, and the copied initial messages are sent to the target ports one by one.
[0100] In this embodiment, the previous chip may include the first chip or another second chip.
[0101] The target port may include a sending port (local port) and a stack port egress corresponding to the initial message in the second chip.
[0102] It can be understood that when the second chip receives the initial message sent by the previous chip with the target header information added, it can directly obtain the multicast group table corresponding to the initial message related to the second chip based on the target header information, and thus obtain the sending port (local port) and stack port exit corresponding to the initial message based on the multicast group table, and then copy the initial message based on the total number of sending ports (local ports) and stack port exits, and then send the copied initial message one by one to each sending port (local port) and stack port exit corresponding to the initial message in the second chip.
[0103] Acquiring the multicast group table based on the target header information may include reading the target header information, and determining to multicast the initial message based on the read forwarding indication information, and acquiring the multicast group table corresponding to the initial message.
[0104] In some embodiments, determining to multicast the initial message based on the target header information may include:
[0105] The multicast transmission is determined based on the unicast information bytes in the target header information.
[0106] In this embodiment, the target header information may include multiple bytes.
[0107] During the actual execution process, when the stack port exit of the first chip adds target header information to the initial message, the single multicast information byte in the target header information can be set to a specific value for identifying the multicast message, for example, 1, 2 or 3. After the second chip receives the initial message with the added target header information, the second chip identifies that the single multicast information byte corresponds to 1, 2 or 3 based on the target header information, and considers that the current sending mode of the initial message is multicast sending. The multicast group table corresponding to the initial message in the second chip is obtained, and the initial message is multicast sent.
[0108] Among them, when the sending port number is not stored in the multicast group table, it is considered that the number of sending ports used to send the initial message in the second chip is 0, and the message sending of the sending port of the second chip is not performed; when the sending port number is stored in the multicast group table, it is considered that the number of sending ports used to send the initial message in the second chip is not 0, then based on the number of sending port numbers stored in the multicast group table, they are copied and sent to the sending ports one by one.
[0109] According to the message sending method provided in the embodiment of the present application, when the second chip receives the initial message sent by the previous chip with the target header information added, based on the target header information, the multicast group table pre-stored in the second chip is obtained, and then based on the multicast group table, the target port is determined, and the initial message is copied based on the number of target ports, and the copied initial message is sent to the target port one by one. This allows the second chip that receives the initial message with the target header information added to no longer repeatedly encapsulate the target header information, so that the initial message forwarding mode can be determined directly based on the target header information and the multicast group table can be obtained, and local message copying and forwarding can be performed based on the multicast group table, which can simplify the stacked chip message processing flow, improve processing efficiency, and improve the convenience of maintaining the multicast group table inside each chip.
[0110] In some embodiments, when there is a stack port exit in the target port, the copied initial message is used for the stack port exit to add target header information to the initial message, and the added initial message is sent to the next chip connected to the stack port exit.
[0111] In this embodiment, if there is a stack port exit in the second chip, it can be understood that the second chip is the last chip in the non-chain stacking topology, and the initial message after adding the target header information can continue to flow to the next chip.
[0112] It can be understood that, in the actual execution process, it can be determined based on the multicast group table whether there is a stacking port exit in the second chip. If so, the second chip is considered to be the last chip in the non-chain stacking topology. Then, when the copied initial message is sent to the stacking port exit, the stacking port exit will add target header information to the initial message, and send the added initial message to the next chip connected to the stacking port exit so that the next chip can send the message.
[0113] According to the message sending method provided in the embodiment of the present application, when there is a stack port exit in the target port, the copied initial message is used for the stack port exit to add target header information to the initial message, and the added initial message is sent to the next chip connected to the stack port exit. This can achieve cross-chip flow of the initial message with added target header information, thereby facilitating independent processing of the initial message by each chip and reducing the bandwidth occupied by the stack port.
[0114] In some embodiments, step 120 may include:
[0115] In the case of determining to perform multicast transmission based on the target header information, obtaining address information from the target header information;
[0116] When it is determined that the address information is valid, a multicast group table is obtained.
[0117] In this embodiment, if Figure 2 As shown, the address information may be index information (index) used to indicate the storage address of the multicast group table.
[0118] During the actual execution process, the first chip can analyze the relevant information carried by the initial message to obtain the multicast group table expected by the initial message, and then search for the corresponding storage address of the multicast group table stored in the chip based on the expected multicast group table, and encapsulate the address information corresponding to the storage address, that is, the index information, into the target header information.
[0119] In some embodiments, the index information can be encapsulated into the index information byte after the single multicast information byte of the target header information, and a specific value can be set based on the actual storage address of the multicast group table corresponding to the initial message. The specific value is used to represent the index information of the actual storage address of the multicast group table corresponding to the initial message, that is, the address information. The address information corresponds to a specific storage space inside the chip, and the multicast group table corresponding to the initial message is stored in the storage space. In the actual execution process, after the second chip recognizes that the initial message is sent in a multicast manner based on the single multicast information byte, it can find the storage space based on the specific value of the index information byte and obtain the multicast group table stored in the storage space.
[0120] For example, if the index information byte of the target header information encapsulated in the initial message 1 is a value of 1, then 1 may be the index address of the multicast group 1 corresponding to the initial message 1 stored in a specific storage space inside the chip. During the actual execution process, when the second chip recognizes that the index information byte of the target header information is a value of 1, it will query the actual storage address of the multicast group 1 corresponding to 1, thereby obtaining the multicast group table 1 stored inside the chip.
[0121] In some embodiments, the multicast group table corresponding to the same category of initial messages in each chip in a chain stacking topology can be stored at the same storage address inside each chip, that is, after the same category of initial messages is encapsulated with target header information containing address information, each chip in the chain stacking topology can query the actual storage address of the multicast group table corresponding to the same initial message in each chip based on the address information.
[0122] like Figure 2 As shown, it can be understood that before obtaining the multicast group table based on the address information, it can be first determined whether the address information is valid.
[0123] Judging whether the address information is valid may include two aspects: 1) whether the ID (specific value of the index information byte) is valid; 2) whether the address is empty.
[0124] In some embodiments, specific values of multiple index information bytes can be pre-set, for example, 0, 1, 2, 3 and 4, each of which corresponds to a specific storage space in the chip, and each storage space stores a multicast group table corresponding to the specific value. The multicast group tables corresponding to different specific values are multicast group tables corresponding to different categories of initial messages; among them, 0, 1, 2, 3 and 4 are IDs.
[0125] Whether the ID is valid may include whether a specific value of the index information byte is out of bounds or out of range, that is, whether it is a non-preset value. For example, the ID includes 0, 1, 2, 3 and 4, but due to logical errors in the first chip, etc., the ID in the target header information added to the initial message is 5, then the ID is considered to be out of bounds or out of range.
[0126] A valid ID means that the ID is within the bounds and range.
[0127] Whether the address is empty refers to whether a multicast group table is stored in the internal storage space of the chip corresponding to the ID.
[0128] It can be understood that the address information is valid when the ID is valid and the address is not empty.
[0129] According to the message sending method provided in the embodiment of the present application, by obtaining address information from the target header information when determining to perform multicast sending based on the target header information, and obtaining the multicast group table when determining that the address information is valid, it is possible to effectively obtain the multicast group table corresponding to the initial message based on the address information in the target header information, reduce the risk of message sending errors caused by invalid address information, and improve the logical rigor of obtaining the multicast group table.
[0130] In some embodiments, when the first chip determines to perform multicast transmission based on the received initial message, and a multicast group table corresponding to the category of the initial message is stored in the first chip, address information corresponding to the multicast group table is obtained, and the address information is used for the stack port egress to add target header information to the initial message.
[0131] In this embodiment, it can be understood that when the first chip determines to perform multicast transmission based on the received initial message, the first chip can first query whether it has stored a multicast group table corresponding to the initial message category, and the query result may include: 1) the first chip stores a multicast group table corresponding to the initial message category; 2) the first chip does not store a multicast group table corresponding to the initial message category.
[0132] During the actual execution process, when a multicast group table corresponding to the initial message category is stored in the first chip, the address information corresponding to the multicast group table can be directly obtained, and when the copied initial message is sent to the stack port exit, the target header information is added to the initial message based on the stack port exit, that is, the address information is encapsulated into the target header information, so that the next chip connected to the stack port exit of the first chip can obtain the target port corresponding to the initial message and send the initial message based on the address information in the target header information.
[0133] When the multicast group table corresponding to the initial message category is not stored in the first chip, other measures may be taken to send the message.
[0134] According to the message sending method provided in the embodiment of the present application, when the first chip determines to perform multicast sending based on the received initial message and a multicast group table corresponding to the category of the initial message is stored in the first chip, address information corresponding to the multicast group table is obtained, so that when the first chip performs initial message flow based on the stack port exit in the multicast group table, the address information is encapsulated into the target header information of the initial message, so that the subsequent chip can directly obtain the address information of the multicast group table corresponding to the initial message based on the target header information, and directly obtain the multicast group table corresponding to the locally stored initial message without parsing the initial message itself, thereby improving the message sending efficiency.
[0135] In some embodiments, after the first chip determines to perform multicast transmission based on the received initial message, the method may further include:
[0136] When there is no multicast group table corresponding to the category of the initial message in the first chip, the initial message is sent by flooding.
[0137] In this embodiment, flooding means sending a message received from a certain port to all ports except the port.
[0138] It can be understood that, when there is no multicast group table corresponding to the category of the initial message in the first chip, the initial message can be copied and sent to the first chip, and the message is sent to each local service port except the port for receiving the initial message, instead of sending the message based on a specific multicast group table. In this way, when the multicast group table corresponding to the category of the initial message in the first chip is not found due to errors in parsing the initial message by the first chip or errors in constructing the multicast group table, the first chip sends and circulates the initial message, so that the expected target port of the initial message can receive the initial message.
[0139] According to the message sending method provided in the embodiment of the present application, by flooding the initial message when there is no multicast group table corresponding to the category of the initial message in the first chip, it is possible to achieve the sending and circulation of the initial message by the first chip when the multicast group table corresponding to the category of the initial message in the first chip is not found due to errors in parsing the initial message by the first chip or errors in constructing the multicast group table. This allows the target port related to the first chip expected by the initial message to receive the initial message, thereby improving the fault tolerance of message processing in the stacking scenario.
[0140] In some embodiments, after the second chip receives the initial message sent by the previous chip with the target header information added, the method may further include:
[0141] The address information is obtained based on the target header information; when it is determined that the address information is invalid, the initial message is flooded.
[0142] In this embodiment, invalid address information includes that the ID is invalid or the address is empty.
[0143] It can be understood that when the address information is invalid, the processing flow inside the second chip can be similar to that of the first chip, that is, flooding can be performed, the initial message can be copied and sent to the second chip, and the message can be sent to each local service port except the port that receives the initial message. In this way, when the address information is invalid due to reasons such as an error in the construction of the multicast group table of the second chip, the second chip can send and circulate the initial message, so that the expected target port of the initial message can receive the initial message.
[0144] According to the message sending method provided in the embodiment of the present application, by obtaining address information based on the target header information, and when it is determined that the address information is invalid, the initial message is flooded and sent. This can achieve the sending and circulation of the initial message by the second chip when the address information is invalid, which may be caused by an error in the construction of the multicast group table of the second chip. This allows the target port related to the second chip expected by the initial message to receive the initial message, thereby improving the fault tolerance rate of message processing in the stacking scenario.
[0145] The message sending method provided in the embodiment of the present application may be executed by a message sending device. In the embodiment of the present application, the message sending device executing the message sending method is taken as an example to illustrate the message sending device provided in the embodiment of the present application.
[0146] The embodiment of the present application also provides a message sending device.
[0147] like Figure 4 As shown, the message sending device includes: a first processing module 410 and a second processing module 420.
[0148] A first processing module 410 is used to determine the total number of sending ports and stack port egresses in the first chip for sending the initial message based on a pre-created multicast group table related to the first chip when the first chip determines to perform multicast transmission based on the received initial message;
[0149] The second processing module 420 is used to copy the initial message based on the total number, and send the copied initial message to the sending port and the stack port egress one by one, so that the stack port egress can add target header information to the initial message, and send the added initial message to the second chip connected to the stack port egress; the target header information is used to instruct the second chip to search for a multicast group table related to the second chip;
[0150] The multicast group table associated with each chip only supports the local sending port and stacking port egress of the corresponding chip.
[0151] According to the message sending device provided by the embodiment of the present application, when the first chip determines to perform multicast sending based on the received initial message, based on the pre-created multicast group table related to the first chip, the total number of sending ports and stack port exits used to send the initial message in the first chip is determined, the initial message is copied based on the total number, and the copied initial message is sent to the sending port and the stack port exit one by one, so that the stack port exit adds the target header information to the initial message, and sends the added initial message to the second chip connected to the stack port exit, so as to realize the encapsulated target header information. The flow of messages based on information is realized, and when multicast messages are forwarded across chips, each chip only needs to find its own local port and stack port exit to perform its own copy and forwarding, and the above process is still used for the next chip, so that the storage and maintenance of the multicast member table in the stacking scenario is changed from global to local, thereby achieving in the stacking scenario, while reducing the hardware resource overhead and facilitating the subsequent management and maintenance, the process and method of multicast cross-chip forwarding are optimized, so that the stacking channel traffic between each chip in the stacking scenario only occupies 1 times the bandwidth of the business flow, thereby improving the forwarding efficiency and reducing the unnecessary occupation and waste of the stacking port bandwidth.
[0152] In some embodiments, the apparatus may further include a third processing module, configured to:
[0153] When the second chip receives the initial message sent by the previous chip and after the target header information is added, based on the target header information, the multicast group table pre-stored in the second chip is obtained;
[0154] Based on the multicast group table, determine the destination port;
[0155] The initial message is copied based on the number of target ports, and the copied initial messages are sent to the target ports one by one.
[0156] In some embodiments, the third processing module may also be used to:
[0157] In the case of determining to perform multicast transmission based on the target header information, obtaining address information from the target header information;
[0158] When it is determined that the address information is valid, a multicast group table is obtained.
[0159] In some embodiments, the apparatus may further include a fourth processing module, configured to:
[0160] When the first chip determines to perform multicast transmission based on the received initial message and a multicast group table corresponding to the category of the initial message is stored in the first chip, address information corresponding to the multicast group table is obtained, and the address information is used for the stack port egress to add target header information to the initial message.
[0161] In some embodiments, the apparatus may further include a fifth processing module, configured to:
[0162] After the first chip determines to perform multicast transmission based on the received initial message, if there is no multicast group table corresponding to the category of the initial message in the first chip, the initial message is flooded;
[0163] Alternatively, after the second chip receives the initial message sent by the previous chip with the target header information added, the method further includes:
[0164] The address information is obtained based on the target header information; when it is determined that the address information is invalid, the initial message is flooded.
[0165] The message sending device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0166] The message sending device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0167] An embodiment of the present application also provides a communication system.
[0168] In this embodiment, the communication system includes: at least two stacked chips.
[0169] The chips are connected to each other through stacking ports, thereby forming a chain stacking topology.
[0170] Each chip sends a message based on the message sending method described in any of the above embodiments.
[0171] According to the communication system provided by the embodiment of the present application, when the first chip determines to perform multicast transmission based on the received initial message, based on the pre-created multicast group table related to the first chip, the total number of sending ports and stack port exits used to send the initial message in the first chip is determined, the initial message is copied based on the total number, and the copied initial message is sent to the sending port and the stack port exit one by one, so that the stack port exit adds the target header information to the initial message, and sends the added initial message to the second chip connected to the stack port exit, so as to realize the encapsulation of the target header information. The flow of messages is realized, and when multicast messages are forwarded across chips, each chip only needs to find its own local port and stack port exit to perform its own copy and forwarding, and the above process is still used for the next chip, so that the storage and maintenance of the multicast member table in the stacking scenario is changed from global to local, thereby achieving in the stacking scenario, while reducing the hardware resource overhead and facilitating the subsequent management and maintenance, the process and method of multicast cross-chip forwarding are optimized, so that the stacking channel traffic between each chip in the stacking scenario only occupies 1 times the bandwidth of the business flow, thereby improving the forwarding efficiency and reducing the unnecessary occupation and waste of the stacking port bandwidth.
[0172] like Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, each process of the above-mentioned message sending method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0173] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0174] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned message sending method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0175] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0176] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned message sending method when executed by a processor.
[0177] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0178] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned message sending method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0179] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0180] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0181] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0182] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0183] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0184] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. A message sending method, characterized in that: include: In a case where the first chip determines to perform multicast transmission based on the received initial message, determining the total number of transmission ports and stack port egresses in the first chip for sending the initial message based on a pre-created multicast group table related to the first chip; The initial message is copied based on the total number, and the copied initial messages are sent to the sending port and the stack port exit in a one-to-one correspondence, so that the stack port exit adds target header information to the initial message, and sends the added initial message to the second chip connected to the stack port exit; the target header information is used to instruct the second chip to search for a multicast group table related to the second chip; The multicast group table associated with each chip only supports the local sending port and the stack port egress of the corresponding chip.
2. The message sending method according to claim 1, characterized in that: include: When the second chip receives the initial message sent by the previous chip and after the target header information is added, based on the target header information, obtain the multicast group table pre-stored in the second chip; Based on the multicast group table, determining a target port; The initial message is copied based on the number of the target ports, and the copied initial messages are sent to the target ports in a one-to-one correspondence.
3. The message sending method according to claim 2, characterized in that: In the case that the stack port exit exists in the target port, the copied initial message is used by the stack port exit to add target header information to the initial message, and send the added initial message to the next chip connected to the stack port exit.
4. The message sending method according to claim 2, characterized in that: The acquiring, based on the target header information, a multicast group table pre-stored in the second chip includes: In the case of determining to perform multicast transmission based on the target header information, acquiring address information from the target header information; When it is determined that the address information is valid, the multicast group table is obtained.
5. The message sending method according to any one of claims 1 to 4, characterized in that: When the first chip determines to perform multicast transmission based on the received initial message, and a multicast group table corresponding to the category of the initial message is stored in the first chip, address information corresponding to the multicast group table is obtained, and the address information is used for the stack port egress to add the target header information to the initial message.
6. The message sending method according to any one of claims 1 to 4, characterized in that: After the first chip determines to perform multicast transmission based on the received initial message, the method further includes: When there is no multicast group table corresponding to the category of the initial message in the first chip, flooding the initial message; Alternatively, after the second chip receives the initial message sent by the previous chip with the target header information added, the method further includes: Acquire address information based on the target header information; and when it is determined that the address information is invalid, flood send the initial message.
7. A message sending device, characterized in that: include: A first processing module, configured to determine, when the first chip determines to perform multicast transmission based on the received initial message, the total number of transmission ports and stack port egresses in the first chip for sending the initial message based on a pre-created multicast group table related to the first chip; a second processing module, configured to copy the initial message based on the total number, and send the copied initial message to the sending port and the stack port exit in a one-to-one correspondence, so that the stack port exit can add target header information to the initial message, and send the added initial message to a second chip connected to the stack port exit; the target header information is used to instruct the second chip to search for a multicast group table related to the second chip; The multicast group table associated with each chip only supports the local sending port and the stack port egress of the corresponding chip.
8. A communication system, characterized in that: include: At least two chips arranged in a stack, wherein the chips are communicatively connected to each other via a stack port; Each of the chips sends a message based on the message sending method according to any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the message sending method according to any one of claims 1 to 6 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the message sending method according to any one of claims 1 to 6 is implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the message sending method according to any one of claims 1 to 6 is implemented.