A method, device and storage medium for synchronizing switch message forwarding table entries

By monitoring the switch's operating system kernel and virtual LAN configuration information, timely synchronization of the switch's packet forwarding table entries is achieved, solving the problems of untimely synchronization and aging entries, and improving the redundancy performance and entry accuracy of cross-device link aggregation groups.

CN117834520BActive Publication Date: 2026-06-19INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2023-12-29
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing technologies, untimely synchronization of switch packet forwarding entries and aging of entries seriously affect the redundancy performance of cross-device link aggregation groups.

Method used

By monitoring the operating system kernel of the local switch, the virtual LAN configuration information is obtained, and it is determined whether there is a multi-point connection aggregation port and it belongs to a Layer 3 virtual LAN. If so, the switch packet forwarding table entry is recorded in the database, and when the conditions are met, it is synchronized from the database to the peer switch to achieve timely synchronization.

Benefits of technology

It improves the integrity and accuracy of message forwarding table entries and enhances the redundancy performance of cross-device link aggregation groups.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117834520B_ABST
    Figure CN117834520B_ABST
Patent Text Reader

Abstract

This application discloses a method for synchronizing switch packet forwarding table entries, comprising: monitoring the operating system kernel of the local switch to obtain the switch packet forwarding table entries; obtaining the virtual LAN configuration information of the local switch; determining, based on the virtual LAN configuration information, whether there exists a virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN; if not, recording the switch packet forwarding table entries in a database; when a virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN exists, retrieving the switch packet forwarding table entries from the database and synchronizing them to the peer switch corresponding to the multi-point connection aggregation port; if yes, synchronizing the switch packet forwarding table entries to the peer switch corresponding to the multi-point connection aggregation port. This application achieves timely synchronization of packet forwarding table entries, improving the accuracy of packet forwarding table entries. This application also discloses a device, equipment, and storage medium, which have corresponding technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer application technology, and in particular to a method, apparatus, device, and computer-readable storage medium for synchronizing message forwarding entries in a switch. Background Technology

[0002] AMLAG (Multi-Chassis Link Aggregation Group) is a mechanism for implementing cross-device link aggregation, virtualizing two physical devices into a single logical device, providing device-level redundancy. When one device fails, traffic is quickly switched to the other, achieving zero or minimal packet loss. For example, server 1 aggregates with switches 1 and 2 across devices. From server 1's perspective, switches 1 and 2 are the same device. When switch 1 or switch 2 fails, server 1 can quickly switch traffic to the other device, ensuring uninterrupted data forwarding.

[0003] To ensure that server 1 can quickly switch traffic to the other switch with minimal packet loss when either switch 1 or switch 2 fails, it's necessary to synchronize forwarding-related entries between the two switches in advance. These entries include MAC (Media Access Control) address tables and ARP (Address Resolution Protocol) tables. This way, when one device fails, traffic forwarding is largely unaffected because the other switch has already prepared the necessary entries. Current technologies primarily record and synchronize packet forwarding entries at the unit level (cross-device link aggregation group). When a cross-device link aggregation group is not established, the learned switch packet forwarding entries cannot be stored; after the group is established, these entries are ignored. This often results in untimely synchronization and aging entries, severely impacting the redundancy performance of cross-device link aggregation groups.

[0004] In summary, effectively solving the problems of untimely synchronization and aging of message forwarding entries, which seriously affect the redundancy performance of cross-device link aggregation groups, is an urgent issue that needs to be addressed by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a method for synchronizing packet forwarding table entries of a switch. This method enables timely synchronization of packet forwarding table entries, improves the redundancy performance of cross-device link aggregation groups, and enhances the accuracy of packet forwarding table entries. Another purpose of this application is to provide a device, apparatus, and computer-readable storage medium for synchronizing packet forwarding table entries of a switch.

[0006] To solve the above-mentioned technical problems, this application provides the following technical solution:

[0007] A method for synchronizing packet forwarding table entries in a switch, comprising:

[0008] Monitor the operating system kernel of the local switch to obtain the switch's packet forwarding table entries;

[0009] Obtain the virtual LAN configuration information of the local switch;

[0010] Based on the virtual LAN configuration information, determine whether there is a virtual LAN that contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN.

[0011] If not, the switch packet forwarding table entry is recorded in the database so that when a virtual LAN contains a multipoint connection aggregation port and belongs to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multipoint connection aggregation port.

[0012] If so, the switch message forwarding table entry will be synchronized to the peer switch corresponding to the multipoint connection aggregation port.

[0013] In one specific embodiment of this application, after retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multipoint connection aggregation port, the method further includes:

[0014] When it is detected that a virtual LAN containing a multi-point connection aggregation port is changing from a Layer 3 virtual LAN to a Layer 2 virtual LAN due to international interconnection address deletion, a switch packet forwarding table entry deletion command is sent to the peer switch so that the peer switch deletes the switch packet forwarding table entry.

[0015] In one specific embodiment of this application, after retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multipoint connection aggregation port, the method further includes:

[0016] When the multipoint connection aggregation port is detected to be removed from the multipoint connection aggregation, a switch packet forwarding table entry deletion command is sent to the peer switch so that the peer switch deletes the switch packet forwarding table entry.

[0017] In one specific embodiment of this application, after synchronizing the switch packet forwarding table entries to the peer switch corresponding to the multipoint connection aggregation port, the method further includes:

[0018] When it is detected that the virtual LAN that synchronizes the packet forwarding table entries of the switch is changing from a Layer 3 virtual LAN to a Layer 2 virtual LAN due to the deletion of the international interconnection address, and the multipoint connection aggregation port is removed from the multipoint connection aggregation, a switch packet forwarding table entry deletion command is sent to the peer switch so that the peer switch deletes the switch packet forwarding table entries.

[0019] In one specific embodiment of this application, when a virtual LAN contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN, retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multi-point connection aggregation port includes:

[0020] When it is detected that a virtual LAN containing a multi-point connection aggregation port is changing its international interconnection address configuration from a Layer 2 virtual LAN to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port.

[0021] In one specific embodiment of this application, when a virtual LAN contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN, retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multi-point connection aggregation port includes:

[0022] When it is detected that a port of a VLAN belonging to a Layer 3 VLAN has been added as a multipoint connection aggregation port, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multipoint connection aggregation port.

[0023] In one specific embodiment of this application, when a virtual LAN contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN, retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multi-point connection aggregation port includes:

[0024] When it is detected that a Layer 2 VLAN without a multipoint connection aggregation port is being converted to a Layer 3 VLAN with an international Internet address configuration and a port is being added as a multipoint connection aggregation port, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multipoint connection aggregation port.

[0025] A synchronization device for message forwarding table entries of a switch, comprising:

[0026] The forwarding entry acquisition module is used to monitor the local switch operating system kernel and obtain the switch's packet forwarding entry.

[0027] The configuration information acquisition module is used to acquire the virtual LAN configuration information of the local switch;

[0028] The judgment module is used to determine whether there is a virtual local area network (VLAN) that contains a multi-point connection aggregation port and belongs to a Layer 3 VLAN based on the VLAN configuration information.

[0029] The first entry synchronization module is used to record the switch packet forwarding table entry into the database when it is determined from the virtual LAN configuration information that there is currently no virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN, so that when there is a virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port;

[0030] The second entry synchronization module is used to synchronize the switch packet forwarding table entry to the peer switch corresponding to the multi-point connection aggregation port when it is determined from the virtual LAN configuration information that there is a virtual LAN that contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN.

[0031] A device for synchronizing switch message forwarding table entries, comprising:

[0032] Memory, used to store computer programs;

[0033] A processor is configured to implement the steps of the method for synchronizing switch message forwarding table entries as described above when executing the computer program.

[0034] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method for synchronizing switch message forwarding table entries as described above.

[0035] The method for synchronizing switch packet forwarding entries provided in this application monitors the operating system kernel of the local switch to obtain the switch packet forwarding entries; acquires the virtual LAN configuration information of the local switch; determines whether there is a virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN based on the virtual LAN configuration information; if not, the switch packet forwarding entries are recorded in the database so that when a virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN exists, the switch packet forwarding entries are retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port; if so, the switch packet forwarding entries are synchronized to the peer switch corresponding to the multi-point connection aggregation port.

[0036] As can be seen from the above technical solution, by maintaining the switch packet forwarding table entries on a system-by-system basis, and given the dynamic configurability of the current cross-device link aggregation group, the switch packet forwarding table entries can be recorded in the database. When a VLAN contains a multi-point connection aggregation port and belongs to a Layer 3 VLAN, the switch packet forwarding table entries are retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port. This achieves timely synchronization of packet forwarding table entries, improves the integrity of packet forwarding table entries, and enhances the redundancy performance of the cross-device link aggregation group. Furthermore, switch packet forwarding table entry synchronization is only performed when the VLAN contains a multi-point connection aggregation port and belongs to a Layer 3 VLAN, improving the accuracy of the packet forwarding table entries.

[0037] Accordingly, this application also provides a device, equipment, and computer-readable storage medium for synchronizing switch message forwarding table entries corresponding to the above-mentioned synchronization method for switch message forwarding table entries, which have the above-mentioned technical effects, and will not be elaborated here. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a flowchart illustrating one implementation of the synchronization method for switch message forwarding table entries in this application.

[0040] Figure 2 This is a flowchart illustrating another implementation of the synchronization method for switch message forwarding table entries in this application.

[0041] Figure 3 This is an architecture diagram of a synchronization system for a switch message forwarding table entry in an embodiment of this application;

[0042] Figure 4 This is a structural block diagram of a synchronization system for a switch message forwarding table entry in an embodiment of this application;

[0043] Figure 5 This is a structural block diagram of a synchronization device for a switch message forwarding table entry in an embodiment of this application;

[0044] Figure 6 This is a structural block diagram of a synchronization device for a switch message forwarding table entry in an embodiment of this application;

[0045] Figure 7This is a schematic diagram of the specific structure of a synchronization device for a switch message forwarding table provided in this embodiment. Detailed Implementation

[0046] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0047] See Figure 1 , Figure 1 This is a flowchart illustrating an implementation of a method for synchronizing switch message forwarding table entries in this application. The method may include the following steps:

[0048] S101: Monitors the operating system kernel of the local switch to obtain the switch's packet forwarding table entries.

[0049] The system monitors the local switch's operating system (Linux) kernel using ICCP (Inter-Chassis Communication Protocol) to obtain the switch's packet forwarding table entries.

[0050] Switch packet forwarding table entries can be ARP (Address Resolution Protocol) entries, ND (Neighbor Discovery Protocol) entries, etc.

[0051] S102: Obtain the virtual LAN configuration information of the local switch.

[0052] After listening to the packet forwarding table entries of the switch, obtain the Virtual Local Area Network (VLAN) configuration information of the local switch.

[0053] Switch ports have two VLAN attributes: VLAN ID (identity number) and VLAN TAG (tag). These correspond to setting VLAN tags and allowing VLAN TAG packets for VLANs. Ports with different VLAN IDs can build VLANs by allowing each other's VLAN TAGs.

[0054] S103: Determine whether there is a virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN based on the virtual LAN configuration information. If not, proceed to step S104; if yes, proceed to step S105.

[0055] After obtaining the virtual LAN configuration information of the local switch, determine whether there is a virtual LAN containing a multi-point connection aggregation (mclag) port and belonging to a Layer 3 virtual LAN based on the virtual LAN configuration information. If not, it means that the table entry synchronization condition is not met, and step S104 is executed. If yes, it means that the table entry synchronization condition is met, and step S105 is executed.

[0056] VLANs are divided into Layer 2 and Layer 3, with differences in their segmentation methods and functions. Experimental network deployments typically divide different departments into different network segments. Devices within the same network segment can communicate directly without Layer 3 forwarding; this communication method is called Layer 2 communication. However, VLANs require Layer 3 communication to communicate with each other, which necessitates the use of Layer 3 devices; this is Layer 3 VLAN communication. Layer 2 switch ports cannot be directly configured with IP addresses or other related information, but they can be used to assign VLAN information; while Layer 3 switch ports can both assign IP addresses and other related information and assign VLANs.

[0057] S104: Record the switch packet forwarding table entries into the database so that when a VLAN contains a multipoint connection aggregation port and belongs to a Layer 3 VLAN, the switch packet forwarding table entries are retrieved from the database and synchronized to the peer switch corresponding to the multipoint connection aggregation port.

[0058] The system pre-configures the database to record switch packet forwarding entries. When it is determined, based on the VLAN configuration information, that no VLAN currently contains a multi-point connection aggregation port and belongs to a Layer 3 VLAN, the switch packet forwarding entry is recorded in the database. When a VLAN containing a multi-point connection aggregation port and belonging to a Layer 3 VLAN is detected, the switch packet forwarding entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port. Compared to recording switch packet forwarding entries through configuration files, setting the database to record switch packet forwarding entries eliminates the need for an ICCP restart. This enables synchronization of switch packet forwarding entries generated before the synchronization conditions are met, significantly improving the timely synchronization of packet forwarding entries, enhancing the integrity of packet forwarding entries, and improving the redundancy performance of cross-device link aggregation groups.

[0059] S105: Synchronize the switch's packet forwarding table entries to the peer switch corresponding to the multipoint connection aggregation port.

[0060] When the VLAN configuration information determines that a VLAN contains a multi-point aggregation port and belongs to a Layer 3 VLAN, the switch's packet forwarding table entries are synchronized to the peer switch corresponding to the multi-point aggregation port. By setting the table entry synchronization condition, switch packet forwarding table entry synchronization is only performed when the VLAN contains a multi-point aggregation port and belongs to a Layer 3 VLAN, thus improving the accuracy of packet forwarding table entries.

[0061] As can be seen from the above technical solution, by maintaining the switch packet forwarding table entries on a system-by-system basis, and given the dynamic configurability of the current cross-device link aggregation group, the switch packet forwarding table entries can be recorded in the database. When a VLAN contains a multi-point connection aggregation port and belongs to a Layer 3 VLAN, the switch packet forwarding table entries are retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port. This achieves timely synchronization of packet forwarding table entries, improves the integrity of packet forwarding table entries, and enhances the redundancy performance of the cross-device link aggregation group. Furthermore, switch packet forwarding table entry synchronization is only performed when the VLAN contains a multi-point connection aggregation port and belongs to a Layer 3 VLAN, improving the accuracy of the packet forwarding table entries.

[0062] It should be noted that, based on the above embodiments, this application also provides corresponding improvement solutions. In subsequent embodiments, steps that are the same as or corresponding to those in the above embodiments can be referred to each other, and the corresponding beneficial effects can also be referred to each other. These improvements will not be elaborated upon in the following improved embodiments.

[0063] See Figure 2 , Figure 2 This is another implementation flowchart of the synchronization method for switch message forwarding table entries in this application embodiment. The method may include the following steps:

[0064] S201: Monitor the operating system kernel of the local switch to obtain the switch's packet forwarding table entries.

[0065] S202: Obtain the virtual LAN configuration information of the local switch.

[0066] S203: Determine whether there is a virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN based on the virtual LAN configuration information. If yes, proceed to step S204; otherwise, proceed to step S205.

[0067] S204: Synchronize the switch's packet forwarding table entries to the peer switch corresponding to the multipoint connection aggregation port.

[0068] S205: Record the switch message forwarding table entries into the database.

[0069] When the VLAN configuration information determines that there is no VLAN containing a multi-point connection aggregation port and belonging to a Layer 3 VLAN, the switch packet forwarding table entry is recorded in the database. Specifically, the switch packet forwarding table entry can be recorded in the database using a Red-Black Tree structure. By changing the storage format of the switch packet forwarding table entry from a linked list to a Red-Black Tree, the structure is closer to that of Linux for monitoring. Less conversion is needed during processing and transmission, making it easier to trace the source of problems. It is more efficient than linked lists, requires less storage space, and simplifies querying and traversal.

[0070] A red-black tree is a self-balancing binary search tree, a data structure used in computer science, typically for implementing associative arrays.

[0071] S206: Determine whether a virtual LAN containing a multi-point connection aggregation port is detected to be changing its international internet address configuration from a Layer 2 virtual LAN to a Layer 3 virtual LAN. If yes, proceed to step S207; otherwise, proceed to step S209.

[0072] Currently, MQLAG is dynamically configurable, so forwarding links can join or leave MQLAG at any time, and the link between two switches can switch from Layer 2 to Layer 3 and back again. After recording the switch packet forwarding table entries in the database using a red-black tree structure, it checks whether a VLAN containing a multi-point connection aggregation port has been detected changing its Internet Protocol (IP) configuration from a Layer 2 VLAN to a Layer 3 VLAN. If yes, the table entry synchronization condition has been met, and step S207 is executed; otherwise, the table entry synchronization condition has not been met, and step S209 is executed.

[0073] S207: Retrieve the switch packet forwarding table entries from the database and synchronize the switch packet forwarding table entries to the peer switch.

[0074] When a VPN containing multi-point connection aggregation ports is detected to be changing its international internet address configuration from a Layer 2 VPN to a Layer 3 VPN, it indicates that the table synchronization conditions have been met. The switch packet forwarding table entries are retrieved from the database, such as those stored in a red-black tree structure, and synchronized to the peer switch. MQLAG refers to the configuration on the device; it is only configured if needed in the live network. However, ICCP comes with the system, and regardless of whether MQLAG is configured, an ICCP container (Docker) is running. The ICCP program primarily handles MQLAG configuration. The switch packet forwarding table entries stored in DockerICCP are consistent with the system, preventing situations where MQLAG is not created and switch packet forwarding table entries cannot be stored or retrieved.

[0075] In one specific embodiment of this application, when a virtual LAN contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN, retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multi-point connection aggregation port includes:

[0076] When it is detected that a Layer 2 VLAN without a multi-point connection aggregation port is being converted to a Layer 3 VLAN for international internet access and a port is being added as a multi-point connection aggregation port, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port.

[0077] When a VLAN that does not contain a multi-point connection aggregation port and belongs to a Layer 2 VLAN is detected to undergo an international internet address configuration change to a Layer 3 VLAN and a port is added as a multi-point connection aggregation port, it indicates that the table entry synchronization condition has been met. The switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port, thereby achieving synchronization of the switch packet forwarding table entries between the two switches.

[0078] S208: When it is detected that a VLAN containing a multipoint connection aggregation port is changing from a Layer 3 VLAN to a Layer 2 VLAN due to the deletion of the Internet address, or when the multipoint connection aggregation port is removed from the multipoint connection aggregation, a switch packet forwarding table entry deletion command is sent to the peer switch so that the peer switch deletes the switch packet forwarding table entry.

[0079] After synchronizing the switch's packet forwarding table entries to the peer switch, the status of the local switch's VLAN continues to be monitored. When it is detected that a VLAN containing a multi-point connection aggregation port is changing from a Layer 3 VLAN to a Layer 2 VLAN due to internet address deletion, or when a multi-point connection aggregation port is removed from the multi-point connection aggregation, a switch packet forwarding table entry deletion command is sent to the peer switch. The peer switch deletes the switch packet forwarding table entries according to the received command, thereby ensuring that the switch packet forwarding table entries stored by each switch in the cross-device link aggregation group remain consistent.

[0080] S209: Determine whether a port of a Layer 3 VLAN has been added as a multi-point connection aggregation port. If yes, return to step S207; otherwise, proceed to step S210.

[0081] If no VLAN containing a multi-point connection aggregation port is detected changing its Internet address configuration from a Layer 2 VLAN to a Layer 3 VLAN, it indicates that the table entry synchronization condition has not yet been met. The system then checks whether a VLAN belonging to the Layer 3 VLAN has had its port added as a multi-point connection aggregation port. If yes, the table entry synchronization condition has been met, and the system returns to step S207. If no, the table entry synchronization condition has not yet been met, and the system proceeds to step S210.

[0082] S210: Output a message indicating that the table entry synchronization condition is not met.

[0083] When no Layer 3 VLAN is detected with a port added as a multi-point aggregation port, a message indicating that the table synchronization condition is not met is output. Conversely, when a Layer 2 VLAN without a multi-point aggregation port is detected, but is transformed into a Layer 3 VLAN through IP configuration and a port is added as a multi-point aggregation port, it indicates that the table synchronization condition is met. The switch packet forwarding table entry, stored in a red-black tree structure, is retrieved from the database and synchronized to the peer switch.

[0084] In one specific embodiment of this application, after synchronizing the switch packet forwarding table entries to the peer switch corresponding to the multipoint connection aggregation port, the method may further include the following steps:

[0085] When it is detected that the virtual LAN of the synchronous switch packet forwarding table entry has changed from a Layer 3 virtual LAN to a Layer 2 virtual LAN due to the deletion of the international interconnection address, and the multipoint connection aggregation port is removed from the multipoint connection aggregation, a switch packet forwarding table entry deletion command is sent to the peer switch so that the peer switch deletes the switch packet forwarding table entry.

[0086] When it is detected that the virtual LAN of the synchronous switch packet forwarding table entry has changed from a Layer 3 virtual LAN to a Layer 2 virtual LAN due to the deletion of the international interconnection address, and the multi-point connection aggregation port is removed from the multi-point connection aggregation, it indicates that the current table entry synchronization condition is no longer met. A switch packet forwarding table entry deletion command is sent to the peer switch, and the peer switch deletes the switch packet forwarding table entry according to the switch packet forwarding table entry deletion command.

[0087] See Figure 3 , Figure 3 This is an architecture diagram of a synchronization system for switch message forwarding table entries according to an embodiment of this application. A Layer 3 link (MCLAG peer keepalive link) exists between switch 1 and switch 2, which acts as a neighbor heartbeat link, sending periodic heartbeats to synchronize the states between the two MC-LAG switches. A backup forwarding path (MC-LAG peer link) is connected between switch 1 and switch 2 as neighbors. This connection can be a physical port, aggregation, or VXLAN tunnel, used to forward data after the MC-LAG downlink port fails. Switch 1 and switch 2 have port aggregation (TEAM DEV) for both server 1 and server 2. Switch 1 is connected to server 1 through a non-multipoint connection aggregation port (Orphan port), and switch 2 is connected to server 2 through a non-multipoint connection aggregation port.

[0088] See Figure 4 , Figure 4 This is a block diagram illustrating the structure of a synchronization system for switch packet forwarding table entries according to an embodiment of this application. Switch 1 learns the switch packet forwarding table entries of device 4 from aggregation port 1, and sends these entries to switch 2 via ICCP. Switch 2 receives these entries and installs them into the Linux kernel, learning the interface name as aggregation port 1.

[0089] ICCP periodically floods switch forwarding table entries to peers. To prevent switch forwarding table entries from aging, ICCP uses Netlink sockets to monitor the switch forwarding table entry responses received by the Linux kernel. For example, when a switch forwarding table entry in switch 2 becomes aging, the Linux kernel will send a switch forwarding table entry request through aggregation port 1. Device 4 receives the switch forwarding table entry request and returns a switch forwarding table entry response. For device 4, switches 1 and 2 are treated as the same device, and the switch forwarding table entry response can be sent to either switch 2 or switch 1. If switch 2 receives the switch forwarding table entry response, it relearns the switch forwarding table entries and updates the information in its kernel. Simultaneously, switch 2 will notify switch 1 via an ICCP synchronization message. If switch 1 receives a response to a switch forwarding table entry, since the switch forwarding table entry already exists in the kernel, the kernel will send an ARP packet to its application via Netlink. ICCP will collect the switch forwarding table entry information from the response packet and send it to switch 2. In this way, switch 2 can update the switch forwarding table entry in the Linux kernel.

[0090] Corresponding to the above method embodiments, this application also provides a synchronization device for switch packet forwarding table entries. The synchronization device for switch packet forwarding table entries described below can be referred to in correspondence with the synchronization method for switch packet forwarding table entries described above.

[0091] See Figure 5 , Figure 5 This is a structural block diagram of a synchronization device for a switch message forwarding table entry according to an embodiment of this application. The device may include:

[0092] Forwarding entry acquisition module 51 is used to monitor the operating system kernel of the local switch and obtain the switch's packet forwarding entry;

[0093] Configuration information acquisition module 52 is used to acquire the virtual LAN configuration information of the local switch;

[0094] The judgment module 53 is used to determine whether there is a virtual local area network (VLAN) containing a multi-point connection aggregation port and belonging to a Layer 3 VLAN based on the VLAN configuration information.

[0095] The first entry synchronization module 54 is used to record the switch packet forwarding table entry into the database when it is determined from the virtual LAN configuration information that there is no virtual LAN that contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN, so that when there is a virtual LAN that contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port.

[0096] The second table entry synchronization module 55 is used to synchronize the switch packet forwarding table entry to the peer switch corresponding to the multi-point connection aggregation port when it is determined from the virtual LAN configuration information that there is a virtual LAN that contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN.

[0097] As can be seen from the above technical solution, by maintaining the switch packet forwarding table entries on a system-by-system basis, and given the dynamic configurability of the current cross-device link aggregation group, the switch packet forwarding table entries can be recorded in the database. When a VLAN contains a multi-point connection aggregation port and belongs to a Layer 3 VLAN, the switch packet forwarding table entries are retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port. This achieves timely synchronization of packet forwarding table entries, improves the integrity of packet forwarding table entries, and enhances the redundancy performance of the cross-device link aggregation group. Furthermore, switch packet forwarding table entry synchronization is only performed when the VLAN contains a multi-point connection aggregation port and belongs to a Layer 3 VLAN, improving the accuracy of the packet forwarding table entries.

[0098] In one specific embodiment of this application, the device may further include:

[0099] The first entry deletion module is used to send a switch packet forwarding table entry deletion command to the peer switch after retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multipoint connection aggregation port. When it detects that the VLAN containing the multipoint connection aggregation port has changed from a Layer 3 VLAN to a Layer 2 VLAN due to international address deletion, the module causes the peer switch to delete the switch packet forwarding table entry.

[0100] In one specific embodiment of this application, the device may further include:

[0101] The second entry deletion module is used to send a switch packet forwarding table entry deletion command to the peer switch after retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multipoint connection aggregation port. When it detects that the multipoint connection aggregation port has been removed from the multipoint connection aggregation, the peer switch deletes the switch packet forwarding table entry.

[0102] In one specific embodiment of this application, the device may further include:

[0103] The third entry deletion module is used to send a switch packet forwarding table deletion command to the peer switch after synchronizing the switch packet forwarding table entry to the peer switch corresponding to the multipoint connection aggregation port. When it is detected that the virtual LAN synchronizing the switch packet forwarding table entry has changed from a Layer 3 virtual LAN to a Layer 2 virtual LAN due to international address deletion, and the multipoint connection aggregation port has been removed from the multipoint connection aggregation, the module sends a switch packet forwarding table entry deletion command to the peer switch so that the peer switch deletes the switch packet forwarding table entry.

[0104] In one specific embodiment of this application, the first entry synchronization module is specifically a module that retrieves the switch packet forwarding table entry from the database and synchronizes it to the peer switch corresponding to the multi-point connection aggregation port when it detects that the Internet address configuration of the VLAN containing the multi-point connection aggregation port has changed from a Layer 2 VLAN to a Layer 3 VLAN.

[0105] In one specific embodiment of this application, the first entry synchronization module 54 is specifically a module that retrieves the switch packet forwarding table entry from the database and synchronizes it to the peer switch corresponding to the multipoint connection aggregation port when it detects that a port of a virtual local area network belonging to a Layer 3 virtual local area network has been added as a multipoint connection aggregation port.

[0106] In one specific embodiment of this application, the first entry synchronization module 54 is specifically configured to retrieve the switch packet forwarding table entry from the database and synchronize it to the peer switch corresponding to the multipoint connection aggregation port when it detects that a Layer 2 VLAN without a multipoint connection aggregation port is undergoing an international Internet address configuration change to a Layer 3 VLAN and a port is added as a multipoint connection aggregation port.

[0107] For the method embodiments described above, see [link to relevant documentation]. Figure 6 , Figure 6 This is a schematic diagram of a synchronization device for the switch message forwarding table entries provided in this application. The device may include:

[0108] Memory 332 is used to store computer programs;

[0109] The processor 322 is used to implement the steps of the method for synchronizing switch message forwarding table entries in the above method embodiment when executing a computer program.

[0110] For details, please refer to Figure 7 , Figure 7This is a schematic diagram illustrating the specific structure of a synchronization device for a switch message forwarding table provided in this embodiment. This device can vary significantly due to differences in configuration or performance, and may include a processor (central processing unit, CPU) 322 (e.g., one or more processors) and a memory 332. The memory 332 stores one or more computer programs 342 or data 344. The memory 332 can be temporary or persistent storage. The program stored in the memory 332 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the data processing device. Furthermore, the processor 322 may be configured to communicate with the memory 332 and execute the series of instruction operations stored in the memory 332 on the device 301.

[0111] The penetration testing equipment 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.

[0112] The steps in the method for synchronizing switch packet forwarding table entries described above can be implemented by the structure of the device for synchronizing switch packet forwarding table entries.

[0113] Corresponding to the above method embodiments, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the following steps:

[0114] The system monitors the operating system kernel of the local switch to obtain the switch's packet forwarding table entries; it retrieves the virtual LAN (VLAN) configuration information of the local switch; based on the VLAN configuration information, it determines whether a VLAN containing a multi-point connection aggregation port and belonging to a Layer 3 VLAN exists; if not, it records the switch's packet forwarding table entries in the database so that when a VLAN containing a multi-point connection aggregation port and belonging to a Layer 3 VLAN exists, the switch's packet forwarding table entries are retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port; if so, the switch's packet forwarding table entries are synchronized to the peer switch corresponding to the multi-point connection aggregation port.

[0115] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0116] For a description of the computer-readable storage medium provided in this application, please refer to the above method embodiments; further details will not be repeated here.

[0117] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatuses, devices, and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0118] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for synchronizing switch forwarding table entries, the method comprising: include: Monitor the operating system kernel of the local switch to obtain the switch's packet forwarding table entries; Obtain the virtual LAN configuration information of the local switch; Based on the virtual LAN configuration information, determine whether there is a virtual LAN that contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN. If not, the switch packet forwarding table entry is recorded in the database so that when a virtual LAN contains a multipoint connection aggregation port and belongs to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multipoint connection aggregation port. If so, the switch message forwarding table entry will be synchronized to the peer switch corresponding to the multipoint connection aggregation port.

2. The method of claim 1, wherein, After retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multipoint connection aggregation port, the process further includes: When it is detected that a virtual LAN containing a multi-point connection aggregation port is changing from a Layer 3 virtual LAN to a Layer 2 virtual LAN due to international interconnection address deletion, a switch packet forwarding table entry deletion command is sent to the peer switch so that the peer switch deletes the switch packet forwarding table entry.

3. The method of claim 1, wherein the step of synchronizing the switch forwarding table entries comprises the steps of: determining whether the switch forwarding table entries are synchronized; and if the switch forwarding table entries are not synchronized, synchronizing the switch forwarding table entries. After retrieving the switch packet forwarding table entry from the database and synchronizing it to the peer switch corresponding to the multipoint connection aggregation port, the process further includes: When the multipoint connection aggregation port is detected to be removed from the multipoint connection aggregation, a switch packet forwarding table entry deletion command is sent to the peer switch so that the peer switch deletes the switch packet forwarding table entry.

4. The method for synchronizing switch message forwarding table entries according to claim 1, characterized in that, After synchronizing the switch packet forwarding table entries to the peer switch corresponding to the multipoint connection aggregation port, the method further includes: When it is detected that the virtual LAN that synchronizes the packet forwarding table entries of the switch is changing from a Layer 3 virtual LAN to a Layer 2 virtual LAN due to the deletion of the international interconnection address, and the multipoint connection aggregation port is removed from the multipoint connection aggregation, a switch packet forwarding table entry deletion command is sent to the peer switch so that the peer switch deletes the switch packet forwarding table entries.

5. The method for synchronizing switch message forwarding table entries according to claim 1, characterized in that, When a virtual LAN contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port, including: When it is detected that a virtual LAN containing a multi-point connection aggregation port is changing its international interconnection address configuration from a Layer 2 virtual LAN to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port.

6. The method for synchronizing switch message forwarding table entries according to claim 1, characterized in that, When a virtual LAN contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port, including: When it is detected that a port of a VLAN belonging to a Layer 3 VLAN has been added as a multipoint connection aggregation port, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multipoint connection aggregation port.

7. The method for synchronizing switch message forwarding table entries according to claim 1, characterized in that, When a virtual LAN contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port, including: When it is detected that a Layer 2 VLAN without a multipoint connection aggregation port is being converted to a Layer 3 VLAN with an international Internet address configuration and a port is being added as a multipoint connection aggregation port, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multipoint connection aggregation port.

8. A synchronization device for message forwarding table entries of a switch, characterized in that, include: The forwarding entry acquisition module is used to monitor the operating system kernel of the local switch and obtain the switch's packet forwarding entry. The configuration information acquisition module is used to acquire the virtual LAN configuration information of the local switch; The judgment module is used to determine whether there is a virtual local area network (VLAN) that contains a multi-point connection aggregation port and belongs to a Layer 3 VLAN based on the VLAN configuration information. The first entry synchronization module is used to record the switch packet forwarding table entry into the database when it is determined from the virtual LAN configuration information that there is currently no virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN, so that when there is a virtual LAN containing a multi-point connection aggregation port and belonging to a Layer 3 virtual LAN, the switch packet forwarding table entry is retrieved from the database and synchronized to the peer switch corresponding to the multi-point connection aggregation port; The second entry synchronization module is used to synchronize the switch packet forwarding table entry to the peer switch corresponding to the multi-point connection aggregation port when it is determined from the virtual LAN configuration information that there is a virtual LAN that contains a multi-point connection aggregation port and belongs to a Layer 3 virtual LAN.

9. A synchronization device for switch message forwarding table entries, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the synchronization method for switch message forwarding table entries as described in any one of claims 1 to 7.