Forwarding table entry synchronization method and stacking system
By encapsulating forwarding table entry information into control messages and having them copied and saved locally by the slave device in the stacking system, the problems of high master device resource consumption and stacking port bandwidth waste are solved, and efficient forwarding table entry synchronization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU CENTEC COMM CO LTD
- Filing Date
- 2023-06-26
- Publication Date
- 2026-05-01
AI Technical Summary
In existing stacking technologies, the master device needs to distribute forwarding table entry information to each slave device one by one, resulting in high CPU resource consumption and duplicate traffic between stacking ports, wasting bandwidth.
The master device encapsulates the forwarding table entry information into the data segment of the control message, and encapsulates the exit information for forwarding table entry synchronization based on the instruction into the stack header, inserts it into the front end of the control message, and sends it to the slave device via multicast or unicast. The slave device copies and saves it locally until all slave devices are synchronized.
This reduces the resource consumption of the main device, avoids redundant traffic between stacked ports, and improves the efficiency and reliability of information synchronization.
Smart Images

Figure CN116708292B_ABST
Abstract
Description
Forwarding Item Synchronization Methods and Stacking Systems Technical Field
[0001] This application relates to the field of communication technology, and more specifically, to a method for synchronizing forwarding entries and a stacking system. Background Technology
[0002] With the development of network technology, higher requirements have been placed on the port density and switching capacity of network switching equipment. Since the switching capacity and port density of a single device are limited, in order to increase bandwidth and expand port density, switching equipment needs to support stacking functions, combining multiple switching devices into a stacked device.
[0003] Stacked devices are interconnected via stacking ports. When a packet is forwarded across devices, the ingress device encapsulates forwarding and editing information generated during processing into a stacking header, and then inserts the stacking header at the very beginning of the original packet before sending it to the next device. The stacking header is carried along with the original packet to the next device. The next device will then process the packet accordingly based on the information in the stacking header.
[0004] When multiple devices are stacked, one device needs to be elected as the master device, and the others as slave devices. The master device runs a control protocol to manage the slave devices. A crucial function in this management process is that the master device distributes forwarding tables to all slave devices and synchronizes the forwarding table entries. Current solutions distribute these tables one by one from the master device to each slave device, similar to unicast transmission. In existing stacking technologies, control commands and forwarding table synchronization information are centrally distributed by the master device. The master device needs to send multiple copies of the same information, consuming significant CPU resources, and there are multiple identical traffic streams between stacking ports, wasting the performance of the master device and the bandwidth between stacking ports. Summary of the Invention
[0005] The purpose of this application includes, for example, providing a forwarding table entry synchronization method and a stacking system that can reduce the occupation of master device resources and avoid the same traffic between stack heads while achieving forwarding table entry information synchronization.
[0006] The embodiments of this application can be implemented as follows:
[0007] In a first aspect, this application provides a forwarding entry synchronization method applied to a stacked system comprising multiple devices, each of which is connected to at least one other device, the multiple devices including master devices and slave devices, the method comprising:
[0008] The master device encapsulates the forwarding table entry information of the obtained forwarding table into the data segment of the control message, encapsulates the exit information for forwarding table entry synchronization based on the instruction into a stacking header, inserts the stacking header into the front end of the control message, and sends the control message to the slave device connected to it.
[0009] The slave device that receives the control message parses the control message. When it determines that the control message instructs the device to synchronize the forwarding table information, it copies the control message and saves it locally. Then, it sends the control message to the slave device connected to it until all slave devices in the stacking system have copied and saved the control message.
[0010] In an optional implementation, the step of parsing the control message by the slave device that receives the control message includes:
[0011] The slave device that receives the control message parses the stack header in the control message and queries the message type field and the outgoing information field in the stack header;
[0012] When the message type field indicates that the control message is a control type and the exit information in the exit information field is multicast group information, the slave device determines whether it belongs to the multicast group. If it does, it determines that the control message instructs the device to synchronize the forwarding table entry information.
[0013] In an optional implementation, the method further includes:
[0014] When a slave device receives a control message, parses the control message, and determines that the control message indicates a control operation, it queries the exit information in the stack header of the control message. The exit information is a single CPU information.
[0015] The system determines whether its own CPU information is consistent with the output information. If the CPU information is inconsistent with the output information, the system forwards the control message to the slave device connected to it. If the CPU information is consistent with the output information, the system executes the corresponding control operation based on the control message.
[0016] In an optional implementation, the step of the master device sending the control message to the slave device connected to it includes one of the following:
[0017] When the stacking topology of the stacking system is a linear topology, and the master device is connected to two slave devices, the master device sends the control message to each of the two slave devices; or
[0018] When the stacking topology of the stacking system is a ring topology, the master device sends the control message to either of the two slave devices connected to it.
[0019] In an optional implementation, the forwarding table entry information obtained by the master device is either forwarding table entry information obtained through the control plane, or forwarding table entry information learned by the slave device through a data stream and sent to the master device.
[0020] In an optional implementation, the stacking head contains the device ID of the master device, and the method further includes:
[0021] The master device receives control messages sent by the slave device connected to it;
[0022] The master device parses the stack header of the control message, and if the stack header contains the device ID of the master device, it discards the control message.
[0023] In an optional implementation, the plurality of devices includes an inlet device and other devices, wherein the inlet device and each of the other devices are any device in the stacking system, and the method further includes:
[0024] After receiving a data packet, the ingress device looks up the forwarding table to obtain the egress information, encapsulates the egress information into the stacking head and inserts it into the data packet, and sends the data packet to other devices connected to it.
[0025] Other devices that receive the data packet parse the data packet and determine whether the exit information is local. If it is local, the data packet is sent locally; otherwise, the data packet is sent to other devices connected to it.
[0026] In an optional implementation, when the egress information of the data packet is multicast group information, the step of the other device receiving the data packet parsing the stacking header in the data packet, determining whether the egress information is local, and if it is local, then sending the data packet locally includes:
[0027] Other devices that receive the data packet parse the multicast group information in the stack header of the data packet, and determine the number of multicast ports when they determine that there are multicast ports under the multicast group locally;
[0028] The corresponding number of data packets are copied according to the number of multicast ports. The copied data packets are then sent through the multicast ports to other devices connected to them.
[0029] In an optional implementation, when other devices are slave devices, the method further includes:
[0030] When the other devices receive data packets and control packets, determine whether the total transmission bandwidth required by the data packets and control packets exceeds the current actual transmission bandwidth;
[0031] If the number of packets exceeds the limit, the data packets will be dropped, and then the control packets and the dropped data packets will be parsed.
[0032] Secondly, this application provides a stacking system, the stacking system including a plurality of devices, each of the devices being connected to at least one other device, the plurality of devices including a master device and a slave device;
[0033] The master device is used to encapsulate the forwarding table entry information of the obtained forwarding table into the data segment of the control message, encapsulate the exit information for forwarding table entry synchronization based on the instruction into a stacking header, insert the stacking header into the front end of the control message, and send the control message to the slave device connected to it.
[0034] The slave device that receives the control message parses the control message. When it determines that the control message instructs the device to synchronize forwarding table information, it copies the control message and saves it locally. Then, it sends the control message to the slave device connected to it until all slave devices in the stacking system have copied and saved the control message.
[0035] The beneficial effects of the embodiments of this application include, for example:
[0036] This application provides a forwarding table entry synchronization method and a stacking system. The master device encapsulates the forwarding table entry information obtained from the forwarding table into the data segment of a control message. Based on the exit information indicating forwarding table entry synchronization, it encapsulates a stacking header, inserts the stacking header into the front end of the control message, and sends the control message to its connected slave devices. The slave devices receiving the control message parse it. If the control message instructs the device to synchronize forwarding table entry information, it copies the control message and saves it locally, then sends the control message to its connected slave devices. This process continues until all slave devices in the stacking system have copied and saved the control message. In this scheme, each slave device locally copies and forwards the control message, eliminating the need for the master device to send multiple copies of the control message. This reduces the resource consumption of the master device and avoids identical traffic between stacking ports, thus preventing wasted bandwidth between stacking ports. Attached Figure Description
[0037] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 is a schematic diagram of one of the topologies of a stacked system;
[0039] Figure 2 is a second schematic diagram of the topology of the stacked system;
[0040] Figure 3 is a schematic diagram of the topology of the stacked system;
[0041] Figure 4 is a flowchart of the forwarding entry synchronization method provided in an embodiment of this application;
[0042] Figure 5 is a schematic diagram of control message distribution in the prior art;
[0043] Figure 6 is a flowchart of the sub-steps included in step S12 of Figure 4;
[0044] Figure 7 is a schematic diagram of control message distribution in an embodiment of this application;
[0045] Figure 8 is a flowchart of the control operation method in the forwarding entry synchronization method provided in the embodiment of this application;
[0046] Figure 9 is a flowchart of the ring-forming destruction method in the forwarding entry synchronization method provided in the embodiment of this application;
[0047] Figure 10 is a flowchart of the data packet processing method in the forwarding table entry synchronization method provided in the embodiments of this application;
[0048] Figure 11 is one of the data packet forwarding diagrams in the embodiments of this application;
[0049] Figure 12 is a flowchart of the sub-steps included in step S42 of Figure 10;
[0050] Figure 13 is a second schematic diagram of data packet forwarding in an embodiment of this application. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0052] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0053] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0054] In the description of this application, it should be noted that, unless otherwise specified, the features in the embodiments of this application can be combined with each other.
[0055] Please refer to Figure 1, which is a schematic diagram of the architecture of the stacking system provided in this application embodiment. The stacking system includes multiple devices, each of which can be a switch, such as a Layer 2 / 3 network switch or other related network switching devices. Each device can be connected to at least one other device. The connection topology of the multiple devices can be a linear topology (shown in Figure 1), a ring topology as shown in Figure 2, or a Full Mesh topology as shown in Figure 3. The line cards and fabrics of the distributed chassis also communicate with each other using the stacking principle. If the distributed chassis is more complex, such as supporting primary / backup protection, then the stacking between line cards and fabrics involves a combination of the above three topologies.
[0056] Ring topology is commonly used for stacking box switches, which are typically connected end-to-end with network cables to form a bidirectional ring. Linear topology is essentially the same as ring topology, except that it lacks the end-to-end connection. Linear topology can be considered a special case of ring topology. In a full mesh topology scenario, every two devices are directly connected, and no intermediate devices are needed between the source and destination devices.
[0057] From the perspective of the actual packet forwarding path, the devices in a stacked system can be divided into ingress devices, intermediate devices, and egress devices. Generally, data packets enter from the ingress device's ingress port, pass through the intermediate devices, and are finally sent out from the egress device's egress port. Of course, data packets may also enter from the ingress device's ingress port and be sent out directly from the ingress device's egress port. This embodiment mainly focuses on the scenario where data packets enter from the ingress device, pass through the intermediate devices, and are sent out from the egress device.
[0058] The ingress device serves as the overall traffic entry point for the stacking system, and the egress device serves as the overall traffic exit point. There can be one or more intermediate devices. Generally, each intermediate device is connected to the preceding ingress device and the following egress device. When there are multiple intermediate devices, the first intermediate device is connected to the preceding ingress device and then to the next intermediate device. The last intermediate device is connected to the following egress device and then to the previous intermediate device. The remaining intermediate devices, excluding the first and last ones, are connected sequentially between them.
[0059] Furthermore, from a control perspective, the devices in a stacked system can be divided into master devices and slave devices. The master device is one of several devices, while the remaining devices act as slave devices. The master device runs a control protocol and manages the slave devices. The master device can send control operation commands to the slave devices, and send control messages to synchronize forwarding table entries, etc.
[0060] For each device, it can be any of the following roles: inlet device, intermediate device, or outlet device; it can also be any of the following roles: master device or slave device. For example, a master device can be an inlet device or an intermediate device, etc. A slave device can be an inlet device, an intermediate device, an outlet device, etc.
[0061] Therefore, within the stacking system, there is forwarding of data packets and transmission of control packets between the various stacking ports. Two transmission paths exist within the stacking system: data packet forwarding is performed based on the roles of ingress device, intermediate device, and egress device, while control packet transmission is performed based on the roles of master device and slave device.
[0062] Please refer to Figure 4, which is a flowchart of the forwarding entry synchronization method provided in this embodiment of the application. This forwarding entry synchronization method can be applied to the stacking system described above and is implemented by multiple devices in the stacking system. Referring to Figure 4, the implementation of the forwarding entry synchronization method will be described below.
[0063] S11, the master device encapsulates the forwarding table entry information of the obtained forwarding table into the data segment of the control message, encapsulates the stacking header based on the exit information indicating forwarding table entry synchronization, inserts the stacking header into the front end of the control message, and sends the control message to the slave device connected to it.
[0064] S12, the slave device that receives the control message parses the control message. When it determines that the control message instructs the device to synchronize the forwarding table entry information, it copies the control message and saves it locally, and sends the control message to the slave device connected to it, until all slave devices in the stacking system have copied and saved the control message.
[0065] In applications requiring forwarding table synchronization among devices in a stacked system, the existing technology involves the master device sending the forwarding table entries to be synchronized to all slave devices. That is, the master device distributes the forwarding table entries to each slave device individually, similar to unicast transmission. Taking a linear topology as an example, the distribution method is shown in Figure 5.
[0066] In the current technology, for a stacked system with four devices as shown in Figure 5, master device B needs to send the same forwarding table entry information to devices A / C / D respectively, meaning it needs to send three copies. There are two identical traffic entries between master device B and slave device C. Assuming there are n devices stacked, the master device needs to send the forwarding table entry information (n-1) times. Since the forwarding table is synchronized in real time, this action consumes a significant amount of the master device's CPU resources. Furthermore, the identical traffic between stacked ports wastes bandwidth between them.
[0067] Based on the above research findings, in order to overcome the shortcomings of existing technologies, this embodiment provides a forwarding table entry synchronization scheme. When multiple devices form a stacked system, they appear as a single entity to the outside world. The devices need to synchronize forwarding table information in real time to ensure that any data stream, regardless of which port it enters from on which device, can be forwarded by consulting the forwarding table. The forwarding table is a broad concept, specifically including Layer 2 / 3 forwarding tables, edit tables, multicast group tables, Linkagg tables, etc. In conventional stacked systems, after a data packet enters a device, the forwarding table is consulted on the entry device, and the packet is transparently transmitted on intermediate devices. If editing is required, the packet is edited on the exit device.
[0068] In a stacked system, devices exchange information through a stacking header. Necessary information generated during processing at the ingress device is encapsulated in the stacking header and inserted at the very beginning of the original message before being passed to the next device. The next device can then process the message directly based on the information in the stacking header.
[0069] Based on this, in this embodiment, the master device encapsulates the obtained forwarding table entry information into the data segment of a control message, and encapsulates a stack header based on the exit information indicating which slave devices in the stacking system should synchronize forwarding table entries. The stack header is inserted into the front end of the control message and sent to neighboring slave devices. The forwarding table entry information obtained by the master device is obtained through the control plane; that is, it is static forwarding table entry information, such as rule information configured by the designer or rule information received from external devices. Alternatively, the forwarding table entry information obtained by the master device can also be forwarding table entry information learned by slave devices through data streams and sent to the master device; that is, it is dynamic forwarding table entry information.
[0070] The stack header contains ingress port information, egress information obtained from the forwarding table, and editing information. Table 1 lists some of the information contained in the stack header.
[0071] Table 1 contains information about the stacking head.
[0072]
[0073] In this embodiment, the master device only sends control messages to the slave devices connected to it, that is, the neighboring slave devices of the master device. For example, it can be one neighboring slave device or two neighboring slave devices.
[0074] For example, in a stacking system with a linear topology and a master device connected to two slave devices, the master device will send control messages to the two slave devices respectively.
[0075] Alternatively, when the stacking topology of the stacking system is a ring topology, the master device will send control messages to either of the two slave devices connected to it.
[0076] When a slave device receives a control message, based on the information in the stack header of the control message, it determines that it needs to synchronize forwarding table entries. It then copies the forwarding table entries locally and saves them before sending the control message to its connected slave device. This process continues; each connected slave device receives a control message, copies it locally, and transmits it until all slave devices have copied and saved the control message, thus achieving synchronization of the forwarding tables between devices in the stacked system. The slave device that has locally copied and saved the control message can parse the data segment of the control message to obtain the forwarding table entries and then distribute these entries to the switching chip.
[0077] In this way, when synchronizing forwarding table entries, the master device only needs to send one or two copies of the forwarding table entries, and then the slave device copies the forwarding table entries locally and saves them locally. This can reduce the CPU load of the master device while successfully synchronizing the forwarding table entries in the stacking system, and effectively solve the problem of duplicate traffic between stacking ports.
[0078] In this embodiment, after receiving a control message, the slave device can parse the control message to determine whether the control message instructs the device to synchronize the forwarding table entry information. Please refer to Figure 6. As one possible implementation, the control message can be parsed in the following way:
[0079] S121, the slave device that receives the control message parses the stack header in the control message and queries the message type field and the outgoing information field in the stack header.
[0080] S122, when the message type field indicates that the control message is a control type and the exit information in the exit information field is multicast group information, the slave device determines whether it belongs to the multicast group. If it does, it determines that the control message instructs the device to synchronize the forwarding table entry information.
[0081] As described above, the stack header of a control message contains a message type field (is C2C) and an exit information field (Dest Map). When the message type field is "is C2C," it indicates a CPU-to-CPU control message. The exit information field uses corresponding bits to identify whether the control message is multicast or unicast. Since forwarding tables generally need to be synchronized among all devices in the stacked system, control messages instructing forwarding table entry information synchronization are typically multicast messages; that is, the exit information in the exit information field is multicast group information.
[0082] Based on this, if a device parses a control message of type C2C (CPU to CPU) and the outgoing information is multicast group information, it can determine that the control message is an instruction to synchronize forwarding table entries. Furthermore, the device can determine whether it belongs to the multicast group of the control message's outgoing information; if so, it can further determine that the message is used to instruct the device to synchronize forwarding table entries.
[0083] Referring to Figure 7, when a stacked system includes devices A, B, C, and D, each device can reserve a multicast group. The members of the multicast group are the CPUs of that device. In the linear topology shown in Figure 7, the CPUs of all slave devices are added to multicast group 5120. When the master device sends a control message to synchronize forwarding table entry information, it specifies the multicast group 5120 as the message exit point and sets the isC2C flag. The master device encapsulates multicast group 5120 and isC2C into the stack header and inserts it into the control message. Furthermore, it encapsulates the forwarding table entry information into the data segment of the control message and sends the control message to slave devices B and C through the stack port. After receiving the control message, slave device C parses the stack header to obtain the multicast group information and the isC2C flag of 5120. It can then copy the control message to its local CPU and simultaneously send a copy of the control message to slave device D. This process continues until all slave devices in the stacked system have received the control message.
[0084] In this embodiment, from a control perspective, in addition to instructing each slave device to synchronize forwarding table entry information via multicast, the master device can also send control operation commands to a specific slave device point-to-point. The master device can send a C2C unicast message, the output of which is the CPU information of the corresponding slave device. Based on this, referring to Figure 8, the forwarding table entry information synchronization method provided in this embodiment may further include the following steps:
[0085] S21, when the slave device that received the control message parses the control message and determines that the control message indicates a control operation, it queries the exit information in the stack header of the control message, where the exit information is a single CPU information.
[0086] S22, determine whether its own CPU information is consistent with the output information. If its own CPU information is inconsistent with the output information, execute the following step S23. If its own CPU information is consistent with the output information, execute the following step S24.
[0087] S23, forward the control message to the slave device connected to it.
[0088] S24, execute the corresponding control operation based on the control message.
[0089] In this embodiment, control messages can be divided into control messages instructing slave devices to synchronize forwarding table entry information, and control messages instructing slave devices to perform corresponding control operations. The overall message type field of the control message can be "is C2C," while control messages for synchronizing forwarding table entry information are generally multicast messages, and point-to-point control messages instructing a slave device to perform a control operation are unicast messages.
[0090] Based on this, after parsing the control message, if the device determines that the control message is an instruction to perform a control operation based on the message type field and the output information field, it will further determine whether it is an instruction for the device to perform the corresponding control operation.
[0091] Specifically, the slave device receiving the control message can query the specific egress information. In this case, the egress information is a single CPU information, that is, the CPU information used to indicate the slave device executing the control operation. If the queried CPU information matches its own CPU information, it indicates that the control message instructs this device to execute the corresponding control operation, and the slave device will execute the corresponding control operation based on the control message. Otherwise, it indicates that the control message instructs other slave devices to execute the corresponding control operation, and the slave device can forward the control message to other slave devices connected to it. After receiving the control message, the connected slave devices will perform the same judgment process as described above until a slave device determines that the control message instructs it to execute the corresponding control operation and executes the corresponding control operation based on the control message.
[0092] In this embodiment, considering that the stacking system has a ring topology, after the master device sends a control message to a neighboring slave device, the control message is transmitted between slave devices. Eventually, the slave device may forward the control message back to the master device, causing the control message to circulate repeatedly between devices in the stacking system, wasting bandwidth between stacking ports. Based on this consideration, referring to Figure 9, the forwarding table entry synchronization method provided in this embodiment may further include the following steps:
[0093] S31, the master device receives a control message sent by the slave device connected to it.
[0094] S32, the master device parses the stack header of the control message, and if the stack header contains the device ID of the master device, discards the control message.
[0095] In this embodiment, when the master device sends a control message to a neighboring slave device, it adds its own device ID to the stack header. This device ID, named chip ID, indicates the device ID of the source device that sent the control message. The chip ID is unique within the stacking system. Therefore, when the control message is sent back to the master device via the slave device, if the stack header contains the master device's device ID after the master device parses the stack header, it indicates that the control message was sent via the master device. Thus, the master device can discard the control message instead of forwarding it to the next device, preventing control messages from forming a loop in the stacking system.
[0096] As described above, both control messages and data messages are transmitted between devices in a stacked system. Based on the actual transmission path of the data messages, the multiple devices can be divided into ingress devices, transmission devices, and egress devices. Referring to Figure 10, while each device transmits control messages in the manner described above, it also forwards data messages in the following manner:
[0097] S41, after receiving the data packet, the ingress device looks up the forwarding table to obtain the egress information, encapsulates the egress information into the stack header and inserts it into the data packet, and sends the data packet to other devices connected to it.
[0098] S42, the other device that receives the data packet parses the stack header of the data packet to determine whether the egress information is local. If it is local, the data packet is sent locally; if it is not local, the data packet is sent to the other device connected to it.
[0099] In this embodiment, the other devices refer to all devices in the stacking system other than the ingress device, including transmission devices and egress devices. After a data packet enters through the ingress port of the ingress device, it will look up the forwarding table at the ingress device to obtain egress information.
[0100] It should be noted that when a message is marked with the isC2C flag, it indicates that the message is a control message. The exit information obtained based on the control message is the CPU information of each device, which indicates the CPU information of the device that is instructing to synchronize the forwarding table entry information.
[0101] When the message is not marked with the isC2C flag, it indicates that the message is a data message. The outgoing information obtained based on the data message refers to the port information from which the data message is sent, indicating which port of which device the data message needs to be sent from.
[0102] For example, in the DestMap field of the stack header, one bit can be used to identify the exit information of a data packet, and another bit can be used to identify the exit information of a control packet. Specifically, for unicast, the information following the DestMap field indicates the exit port; for multicast, the information following the DestMap field indicates a multicast group ID. The multicast group ID for data packets and the multicast group ID for control packets are distinguished.
[0103] Referring to Figure 11, assume devices A, B, and C form a stack. A data packet enters from the ingress device A. Ingress device A queries the forwarding table to obtain the data packet's egress information. If the egress information indicates it's on a port of its own device, the data packet will be forwarded at that port. If the egress information indicates it's not on its own device, for example, if the egress is on device C, then ingress device A encapsulates the egress information in the DestMap field of the stack header and inserts it before the data packet, forwarding it along with the data packet to device B through the stack port.
[0104] For both transmission device B and egress device C, their processing methods after receiving data packets are identical; therefore, they can be uniformly named "Other Devices." Upon receiving a data packet, device B does not need to look up the forwarding table. It can directly parse the egress information in the stack header of the data packet. If it finds that the data packet is a unicast packet and the egress is not local, it will send the data packet to device C through the stack port. After receiving the data packet at the stack port, device C parses the DestMap field of the stack header. If it finds that the egress is local, it can delete the stack header in the data packet and send the data packet out from the corresponding egress.
[0105] When the egress information of the data packet is multicast group information, please refer to Figure 12. The other devices mentioned above can achieve the following when forwarding data packets:
[0106] S421, other devices that receive the data packet parse the multicast group information in the stack header of the data packet, and determine the number of multicast ports when they determine that there are multicast ports under the multicast group locally.
[0107] S422: Based on the number of multicast ports, a corresponding number of data packets are copied, and the copied data packets are sent through the multicast ports to other devices connected to them.
[0108] In multicast scenarios, multicast members, i.e., multicast ports, are distributed across multiple devices. Each device replicates and forwards packets for its own multicast port. The multicast group is global, and each device in the stacking system maintains its own multicast ports. When a data packet enters the ingress device, if the forwarding table shows an exit point as a multicast group, it checks the local multicast port based on the multicast group ID. The number of copies of the data packet is determined by the number of multicast ports. Regardless of whether a local multicast port exists, the multicast group ID is encapsulated in the DestMap field of the stack header and inserted before the data packet before being sent to the stacking port. The next device directly checks its local port based on the multicast group ID in the stack header. If a local multicast port exists, it replicates and sends the packet, following a similar process to the ingress device.
[0109] It should be noted that if other devices receiving the data packet are not in the multicast group (i.e., they have no local multicast members), they will send a copy of the data packet to all stacking ports they are connected to when forwarding the data packet. However, due to the chip's source-in / source-out check mechanism, the stacking port that received the data packet will not re-expose the data packet.
[0110] Referring to Figure 13, the six multicast ports of multicast group 100 are distributed across devices A, B, and C. Device A has three multicast ports, device B has one, and device C has two. When a data packet enters device A, it queries the forwarding table and finds an exit point indicating a multicast group. It then looks up the local ports based on the multicast group, discovering three multicast ports. Therefore, it copies the data packet three times and sends them out sequentially. The multicast group ID is then encapsulated in the stack header and inserted at the beginning of the data packet before being sent to device B. Device B receives the data packet from the stack port, parses the DestMap, and finds it is multicast. It looks up the local ports based on the multicast group ID, finding one multicast port. It then copies the data packet once and forwards it, before sending the data packet from the stack port to device C. Device C receives the data packet from the stack port, parses the DestMap, and finds it is multicast. It looks up the local ports based on the multicast group ID, finding two multicast ports. It then copies the data packet twice and forwards it.
[0111] In this embodiment, multicast replication is completed on this device, which can effectively reduce the multicast replication pressure on the ingress device and reduce the problem of multicast traffic occupying the bandwidth of the stacking port.
[0112] As can be seen, data packets and control packets are transmitted in the stacked system. In this embodiment, a dedicated queue is reserved for control packets, and this queue has a higher scheduling priority than the data packet queue, thereby ensuring that forwarding entries can be synchronized in a timely manner within the stacked system.
[0113] Based on this, in this embodiment, when other devices are slave devices, when other devices receive data packets and control packets, it can determine whether the total transmission bandwidth required for the data packets and control packets exceeds the current actual transmission bandwidth. If it does, packet loss processing is performed on the data packets, and then parsing of the control packets and the data packets after packet loss processing are performed.
[0114] In this embodiment, control messages have a higher priority than data messages. Therefore, in the event of insufficient bandwidth, the processing of control messages will be prioritized.
[0115] As mentioned above, control messages are also divided into control messages for synchronizing forwarding table entries and control messages that instruct control operations, such as closing a port. Different control messages also have different priorities; control messages for synchronizing forwarding table entries have a higher priority than other control messages that instruct control operations.
[0116] In summary, the forwarding table entry synchronization method provided in this embodiment supports adding the CPUs of each slave device in the stacking system to the multicast group. Multicast replication is local replication. For control messages that need to be continuously synchronized, multicast local replication can effectively reduce duplicate traffic between stacking ports and reduce the CPU resource occupation of the master device.
[0117] Furthermore, dedicated queue resources are allocated for control messages, and these queues have a higher priority than those for data messages, improving the real-time performance and reliability of information synchronization. Moreover, different priorities are set for different types of control messages, allowing for message categorization and further ensuring reliability while increasing flexibility.
[0118] In addition, in another embodiment of the stacking system provided in this application, the master device is used to encapsulate the forwarding table entry information of the obtained forwarding table into the data segment of the control message, encapsulate the stacking header based on the exit information indicating forwarding table entry synchronization, insert the stacking header into the front end of the control message, and send the control message to the slave device connected to it.
[0119] The slave device that receives the control message parses the control message. When it determines that the control message instructs the device to synchronize forwarding table information, it copies the control message and saves it locally. Then, it sends the control message to the slave device connected to it until all slave devices in the stacking system have copied and saved the control message.
[0120] In one possible implementation, the slave device that receives the control message is used to parse the stack header in the control message and query the message type field and the egress information field in the stack header;
[0121] When the message type field indicates that the control message is a control type and the exit information in the exit information field is multicast group information, the slave device is also used to determine whether it belongs to the multicast group. If it does, it determines that the control message instructs the device to synchronize the forwarding table entry information.
[0122] In one possible implementation, the slave device that receives the control message is further configured to parse the control message and, when determining that the control message indicates a control operation, query the exit information in the stack header of the control message, wherein the exit information is single CPU information.
[0123] The slave device is also used to determine whether its own CPU information is consistent with the output information. If its own CPU information is inconsistent with the output information, it forwards the control message to the slave device connected to it. If its own CPU information is consistent with the output information, it executes the corresponding control operation based on the control message.
[0124] In one possible implementation, when the stacking topology of the stacking system is a linear topology and the master device is connected to two slave devices, the master device is used to send the control message to each of the two slave devices respectively; or
[0125] When the stacking topology of the stacking system is a ring topology, the master device is used to send the control message to either of the two slave devices connected to it.
[0126] In one possible implementation, the forwarding table entry information obtained by the master device is either forwarding table entry information obtained through the control plane, or forwarding table entry information learned by the slave device through a data stream and sent to the master device.
[0127] In one possible implementation, the stack header contains the device ID of the master device, and the master device is further configured to receive control messages sent by slave devices connected to it; the master device is also configured to parse the stack header of the control message, and discard the control message if the stack header contains the device ID of the master device.
[0128] In one possible implementation, the plurality of devices include an ingress device and other devices, wherein the ingress device and each of the other devices are any device in the stacking system. The ingress device is used to receive a data packet, look up the forwarding table to obtain the exit information, encapsulate the exit information into the stacking header and insert it into the data packet, and send the data packet to the other devices connected to it.
[0129] Other devices that receive the data packet parse the data packet and determine whether the exit information is local. If it is local, the data packet is sent locally; otherwise, the data packet is sent to other devices connected to it.
[0130] In one possible implementation, other devices that receive the data packet parse the multicast group information in the stack header of the data packet, and determine the number of multicast ports when it is determined that there are multicast ports under the multicast group locally.
[0131] The other devices are used to copy a corresponding number of data packets according to the number of multicast ports, send the copied data packets through the multicast ports, and send the data packets to other devices connected to them.
[0132] In one possible implementation, when the other device is a slave device, the other device is further configured to, upon receiving a data packet and a control packet, determine whether the total transmission bandwidth required by the data packet and the control packet exceeds the current actual transmission bandwidth; if it exceeds, then perform packet loss processing on the data packet, and then perform parsing on the control packet and parsing on the data packet after packet loss processing.
[0133] It should be noted that in the stacking system provided in this embodiment, the forwarding table entry synchronization method corresponding to the above embodiments can be implemented based on each device. For details not covered in this embodiment, please refer to the description of the relevant parts of the above embodiments. This embodiment will not repeat them here.
[0134] In summary, the forwarding table entry synchronization method and stacking system provided in this application involve the master device encapsulating the forwarding table entry information obtained from the forwarding table into the data segment of a control message, encapsulating a stacking header based on the exit information indicating forwarding table entry synchronization, inserting the stacking header into the front end of the control message, and sending the control message to the slave device connected to it. The slave device receiving the control message parses the control message, and when it determines that the control message instructs it to synchronize forwarding table entry information, it copies the control message and saves it locally, then sends the control message to the slave device connected to it, until all slave devices in the stacking system have copied and saved the control message. In this scheme, each slave device locally copies and forwards the control message, eliminating the need for the master device to send multiple control messages, reducing the resource consumption of the master device, and avoiding identical traffic between stacking ports, thus avoiding the problem of wasting bandwidth between stacking ports.
[0135] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for synchronizing forwarding entries, characterized in that, A method applicable to a stacked system comprising multiple devices, each device connected to at least one other device, the multiple devices including a master device and slave devices, the method comprising: the master device encapsulating forwarding table entry information obtained from a forwarding table into a data segment of a control message; encapsulating a stack header based on exit information instructing forwarding table entry synchronization; inserting the stack header into the front end of the control message; and sending the control message to a slave device connected to it; the slave device receiving the control message parses the control message; and if it determines that the control message instructs the device to synchronize forwarding table entry information, it copies the control message and saves it locally. The control message is then sent to the slave device connected to it until all slave devices in the stacking system have copied and saved the control message. Within the stacking system, there is forwarding of data packets and transmission of control messages between the various stacking ports. The exit information obtained from the control message is the CPU information of each device, used to indicate the CPU information of the device performing forwarding table entry information synchronization. The exit information obtained from the data packet is the port information of the port that sends the data packet. The control message is divided into control messages instructing slave devices to perform forwarding table entry information synchronization, and control messages instructing slave devices to perform corresponding control operations.
2. The forwarding entry synchronization method according to claim 1, characterized in that, The step of the slave device receiving the control message parsing the control message includes: the slave device receiving the control message parsing the stack header in the control message, querying the message type field and the egress information field in the stack header; when the message type field indicates that the control message is a control type and the egress information in the egress information field is multicast group information, the slave device determines whether it belongs to the multicast group; if it does, it determines that the control message instructs the device to synchronize the forwarding table entry information.
3. The forwarding entry synchronization method according to claim 1, characterized in that, The method further includes: when a slave device receiving a control message parses the control message and determines that the control message indicates a control operation, it queries the exit information in the stack header of the control message, where the exit information is a single CPU information; it determines whether its own CPU information is consistent with the exit information; if its own CPU information is inconsistent with the exit information, it forwards the control message to the slave device connected to it; if its own CPU information is consistent with the exit information, it executes the corresponding control operation based on the control message.
4. The forwarding entry synchronization method according to claim 1, characterized in that, The step of the master device sending the control message to the slave device connected to it includes one of the following: when the stacking topology of the stacking system is a linear topology and the master device is connected to two slave devices, the master device sends the control message to the two slave devices respectively; or when the stacking topology of the stacking system is a ring topology, the master device sends the control message to any one of the two slave devices connected to it.
5. The forwarding entry synchronization method according to claim 1, characterized in that, The forwarding table entry information obtained by the master device is either forwarding table entry information obtained through the control layer, or forwarding table entry information learned by the device through data stream and sent to the master device.
6. The forwarding entry synchronization method according to claim 1, characterized in that, The stack header contains the device ID of the master device, and the method further includes: the master device receiving a control message sent by a slave device connected to it; the master device parsing the stack header of the control message, and discarding the control message if the stack header contains the device ID of the master device.
7. The forwarding entry synchronization method according to claim 1, characterized in that, The plurality of devices includes an ingress device and other devices, wherein the ingress device and each of the other devices are any device in the stacking system. The method further includes: after receiving a data packet, the ingress device searches a forwarding table to obtain egress information, encapsulates the egress information into a stack header and inserts it into the data packet, and sends the data packet to other devices connected to it; the other devices that receive the data packet parse the data packet, determine whether the egress information is local, and if it is local, send the data packet locally; if it is not local, send the data packet to other devices connected to it.
8. The forwarding entry synchronization method according to claim 7, characterized in that, When the egress information of the data packet is multicast group information, the step of the other device receiving the data packet parsing the stacking header in the data packet and determining whether the egress information is local, and if it is local, sending the data packet locally, includes: the other device receiving the data packet parsing the multicast group information in the stacking header of the data packet, determining the number of multicast ports when it is determined that there is a multicast port under the multicast group locally; copying the corresponding number of data packets according to the number of multicast ports, sending the copied data packets through the multicast ports, and sending the data packets to other devices connected to it.
9. The forwarding entry synchronization method according to claim 7, characterized in that, When other devices are slave devices, the method further includes: when the other devices receive data packets and control packets, determining whether the total transmission bandwidth required by the data packets and control packets exceeds the current actual transmission bandwidth; if it exceeds, then performing packet loss processing on the data packets, and then performing parsing on the control packets and parsing on the data packets after packet loss processing.
10. A stacking system, characterized in that, For implementing the forwarding entry synchronization method according to any one of claims 1-9, the stacking system includes multiple devices, each of the devices being connected to at least one other device, the multiple devices including master devices and slave devices; The master device is used to encapsulate the forwarding table entry information of the obtained forwarding table into the data segment of the control message, encapsulate the exit information for forwarding table entry synchronization based on the instruction into a stacking header, insert the stacking header into the front end of the control message, and send the control message to the slave device connected to it. The slave device that receives the control message parses the control message. When it determines that the control message instructs the device to synchronize forwarding table information, it copies the control message and saves it locally. Then, it sends the control message to the slave device connected to it until all slave devices in the stacking system have copied and saved the control message.
Citation Information
Patent Citations
Method and device for forwarding flow rate
CN101599909A
Multicast loop prevention method and device based on spanning tree protocol
CN103581028A
Cross-network stacking system and message processing method thereof
CN105141538A