Consistency detection method, device and storage medium of multi-chassis link aggregation group
By using detection notifications and termination messages to perform port consistency detection in the multi-chassis link aggregation group (MLAG) system, and combining this with a digital signature mechanism, the accuracy problem of switch operation information consistency detection is solved, thereby improving network stability and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU DPTECH TECH
- Filing Date
- 2026-04-16
- Publication Date
- 2026-07-14
Smart Images

Figure CN122395084A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network technology, and more specifically, to a consistency detection method, device, and storage medium for multi-chassis link aggregation groups. Background Technology
[0002] Multi-Chassis Link Aggregation Group (MLAG) is a cross-device link aggregation technology that allows two independent physical switches to remain independent at the control level but work together at the data level, virtualizing themselves into a single "logical switch" to provide services to the outside world, thus avoiding service interruptions caused by single points of failure in the network.
[0003] The implementation complexity of MLAG technology is far higher than that of a single device link. Its stable operation is based on the fact that the two member switches must maintain highly consistent operating information. Therefore, the consistency detection of the operating information of the two member switches is one of the important links in network service assurance. Summary of the Invention
[0004] In view of this, this application provides a consistency detection method, apparatus, device and storage medium for multi-chassis link aggregation groups, so as to at least solve the problems existing in the related technologies.
[0005] Specifically, this application is implemented through the following technical solution: This application provides a consistency detection method for a multi-chassis link aggregation group (MLAG), applied to a first device in a MLAG, the method comprising: Obtain change flag information corresponding to each functional module of the first device; the change flag information is used to indicate whether the operating information of the functional module has changed; For a target functional module whose operating information has changed, a detection notification message is sent to the second device in the MLAG; the detection notification message is used to instruct the second device to clear the historical detection results of the previous detection cycle locally; the target functional module includes at least one first MLAG port, and the operating information of the target functional module includes the operating information corresponding to at least one first MLAG port respectively; For each first MLAG port, the operation information of the first MLAG port is sent to the second device, so that the second device performs a consistency check on the operation information of the first MLAG port based on the operation information of the second MLAG port corresponding to the first MLAG port, and obtains the first port detection result; Send a termination message to the second device; the termination message is used to instruct the second device to generate a first module detection result based on the detection results of each of the first ports; The system receives the detection result of the first module sent by the second device and performs consistency processing on the MLAG based on the detection result of the first module.
[0006] This application also provides another consistency detection method for multi-chassis link aggregation groups, applied to a second device in a multi-chassis link aggregation group (MLAG), the method comprising: The system receives a detection notification message from the first device in the MLAG and clears the historical detection results of the previous detection cycle based on the detection notification message. The detection notification message is generated when the operating information of the target functional module in the first device changes. Receive at least one first MLAG port operation information sent by the first device; For any of the first MLAG ports, based on the running information of the second MLAG port corresponding to the first MLAG port, a consistency check is performed on the running information of the first MLAG port to obtain the first port check result; The system receives a termination message and generates a first module detection result based on the detection results of each of the first ports, and sends the first module detection result to the first device; the first module detection result is used to perform consistency processing on the MLAG.
[0007] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the consistency detection method for the multi-chassis link aggregation group described in any of the foregoing embodiments.
[0008] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the consistency detection method for multi-chassis link aggregation groups described in any of the foregoing embodiments.
[0009] This application also provides a computer program product, including a computer program that, when run by a processor, performs the steps of any of the possible multi-chassis link aggregation group consistency detection methods described above.
[0010] The technical solutions provided by the embodiments of this application may include the following beneficial effects: In this embodiment, when the operating information of the target functional module in the first device changes, the first device first sends a detection notification message to the second device, and then sends the operating information of the first MLAG port to the second device, so that the second device sequentially performs consistency verification on the operating information of each first MLAG port. After the operating information of each first MLAG port has been sent, the first device sends a termination message to the second device. In this way, the detection process can accurately cover each MLAG port, avoid port omissions, and improve the detection accuracy of the target functional module.
[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description
[0012] Figure 1 This is an exemplary embodiment of the MLAG network topology diagram shown in this application; Figure 2 This is a flowchart illustrating a consistency detection method for a multi-chassis link aggregation group according to an exemplary embodiment of this application; Figure 3 This is an exemplary embodiment of the present application illustrating the interaction flowchart between the first device and the second device; Figure 4 This is a flowchart illustrating another consistency detection method for multi-chassis link aggregation groups, as shown in an exemplary embodiment of this application; Figure 5 This is a flowchart illustrating a consistency detection method according to an exemplary embodiment of this application; Figure 6 This is a hardware structure diagram of an electronic device illustrated in an exemplary embodiment of this application. Detailed Implementation
[0013] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0014] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0015] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0016] Introduction to relevant technical terms: Multi-Chassis Link Aggregation Group (MLAG): A link aggregation technology that spans multiple physical network devices (typically two switches). It allows multiple physical links connected to different physical devices to be bundled into a single logical link (i.e., an MLAG port group), logically treated as a single link. MLAG achieves device-level redundancy and link-level redundancy, avoiding the single point of failure problem inherent in traditional single-chassis link aggregation.
[0017] LAG stands for Link Aggregation Group, a technology that bundles multiple physical ports into a single logical port on a network device. Its purpose is to increase bandwidth, provide link redundancy, and achieve load balancing. Common standard protocols such as IEEE 802.3ad (LACP) manage aggregation groups that fall under the LAG category.
[0018] Peer-Link: In an MLAG system, a peer-to-peer link is one or more dedicated high-bandwidth, high-reliability links used to connect two physical devices (usually called peer devices) that form an MLAG partnership. Its main function is to synchronize control plane information (such as MAC address tables, STP status) and data plane traffic between the two devices (such as forwarding traffic that should be sent to the failed device when one device fails).
[0019] ERROR DOWN: An automatic protection state for a network device port. When a device detects a specific type of serious error or abnormal behavior on a port that may jeopardize network stability or integrity, it will proactively and forcibly place the port into a logically closed (Down) state.
[0020] To facilitate understanding of this embodiment, the multi-chassis link aggregation group involved in this application will be described in detail first.
[0021] Please see Figure 1 This is a topology diagram of a multi-chassis link aggregation group provided as an exemplary embodiment of this application. For example... Figure 1 As shown, the network topology includes a Spine-Leaf architecture, the core of which is implemented using a multi-chassis link aggregation group (MLAG).
[0022] Spine Layer: The two core switches located at the top. They are the high-speed backbone of the network, responsible for forwarding traffic from the Leaf layer.
[0023] Leaf layer: The access switch located at the bottom layer. It is responsible for connecting terminal devices (such as servers and PCs) and uplink connections to the Spine layer.
[0024] In this system, the two devices in the Spine layer are connected via Peer-Link and each uses an mlag port to connect to the Leaf layer. This is the core feature of M-LAG: logically treated as one device: to the Leaf layer devices below, the two Spine devices appear to be a single switch; link aggregation: the Leaf layer connects to both Spine devices simultaneously via an aggregated link (BOND5 in the diagram); high availability: if one Spine device fails, traffic automatically switches to the other, ensuring uninterrupted service.
[0025] Peer-Link: This is a direct connection between two devices in the Spine layer. Its function is to synchronize the control information, MAC address table, and ARP entries of the two devices. The diagram shows that this link transmits data for VLANs 1-4094, which means that it carries the synchronization of most of the service traffic.
[0026] Keepalive (heartbeat link): This is a link between two Spine devices used to monitor each other's liveness (usually logically or physically independent). If the heartbeat is interrupted, the device will determine that the other end is "dead", thus avoiding the formation of a network loop (split-brain situation).
[0027] BOND5: This is the Link Aggregation Group (LAG) between the Leaf and Spine layers. It bundles multiple physical links into a single logical link, increasing bandwidth and providing redundancy.
[0028] VLAN tags: VLAN100, VLAN101: Service VLANs that connect to the "network side" (such as the core network or egress gateway) via the Spine layer uplink.
[0029] VLAN1-20: Service VLANs for downlink connections to terminal devices in the Leaf layer.
[0030] The workflow of a multi-chassis link aggregation group (MLAG) includes the following steps: Uplink traffic: Servers or PCs in the Leaf layer send data, which reaches the Spine layer via the BOND5 link.
[0031] Load balancing: The two devices in the Spine layer process traffic according to the load balancing algorithm.
[0032] Synchronization mechanism: If data arrives at a Spine device that is not on the optimal path, the device can forward the data to another device via Peer-Link, or forward it directly through its uplink (VLAN100 / 101).
[0033] Failover: If the left-side Spine device goes down, the BOND5 on the Leaf layer will automatically switch all traffic to the right-side Spine device. The entire process is seamless for end users.
[0034] The M-LAG technology described above solves the bandwidth waste problem caused by port blocking in the traditional Spanning Tree Protocol (STP) and enables active-active link utilization.
[0035] With the widespread application of MLAG (Multi-Chassis Link Aggregation) technology in data center networks to provide high availability, ensuring configuration and state consistency among switches in an MLAG system has become crucial for stable network operation. Currently, several solutions exist for MLAG consistency assurance, but each has limitations to varying degrees: 1. Manual command-line inspection solution For each switch in the MLAG, execute specific command-line instructions one by one and manually compare key configuration parameters, such as MLAG group ID, member ports, list of allowed VLANs, STP port status, QoS policy, etc.
[0036] It is understandable that manual command-line inspection solutions typically suffer from drawbacks such as low efficiency, susceptibility to omissions, poor real-time performance, and lack of systematic approach. Specifically: Low efficiency: For large networks, MLAG pairs are numerous and configuration items are complex. Manual inspection is time-consuming and labor-intensive, and cannot adapt to frequent configuration changes.
[0037] Easy to overlook: Manual comparison is prone to errors due to fatigue or negligence, especially for non-intuitive or hidden configuration items, making it difficult to guarantee the coverage of consistency checks.
[0038] Poor real-time performance: This solution is a reactive check and cannot achieve real-time monitoring. Troubleshooting typically only occurs after a network failure has already happened, thus failing to provide preventative protection.
[0039] Lack of systematic approach: It is difficult to automatically assess and record the overall health status of MLAG (such as control plane communication status and data plane synchronization status).
[0040] 2. Semi-automation solution based on simple scripts To improve efficiency, some operations and maintenance teams write scripts (such as Python, Expect, or Ansible scripts) to capture configuration information and then perform text comparison locally.
[0041] This approach typically has the following drawbacks: Poor flexibility: Scripts are usually written for specific device models, operating system versions, or configuration structures. When the device model is upgraded, the operating system version is changed, or the configuration command format is changed, the scripts need to be modified and maintained extensively, resulting in poor adaptability.
[0042] Weak analytical capabilities: This scheme is essentially a comparison of text or simple key-value pairs, lacking deep semantic understanding. For example, it may fail to recognize configurations that are functionally equivalent but presented in different orders (such as VLAN lists 10,20,30 and 30,20,10), while generating false alarms for insignificant formatting differences (such as spaces and indentation).
[0043] Insufficient scalability: As the network scales up, the scripts have limited capabilities in concurrent execution, result aggregation, and visualization, making it difficult to integrate them into modern network operation and maintenance platforms.
[0044] Lack of state awareness: This solution mainly focuses on the comparison of static configurations and is not capable of detecting dynamic operating states (such as MLAG peer connection status, port error count, etc.).
[0045] 3. Monitoring solutions based on network management systems or NMS Similar to the second approach mentioned above, monitoring solutions based on network management systems or NMS also involve writing scripts (such as Python, Expect, or Ansible scripts) to capture configuration information and then performing text comparisons locally.
[0046] This approach typically has the following drawbacks: Functionality is too generalized and lacks depth: General-purpose network management systems are designed for global monitoring, but their deep support for specific technologies like MLAG is often insufficient. They may only be able to detect a limited number of basic configuration items, failing to cover all the subtle inconsistencies that could potentially cause faults.
[0047] Dependency Model Support: The NETCONF / YANG-based solution is highly dependent on whether the equipment manufacturer provides a complete and easily accessible data model. In many existing network environments, older equipment may not support the standard YANG model, making this solution unfeasible.
[0048] Real-time performance and performance overhead: Using SNMP polling incurs significant network and management station performance overhead, and the polling interval limits the real-time performance of detection, making it difficult to trigger consistency verification immediately after configuration changes.
[0049] Passive response mode: Most existing systems are still in a passive data collection and alarm mode, lacking a proactive closed-loop process that performs simulation verification before configuration changes or atomic verification immediately after changes.
[0050] Based on the above research, this disclosure provides a consistency detection method for a multi-chassis link aggregation group (MLAG). This method is applied to a first device in a MLAG. First, change flag information corresponding to each functional module of the first device is obtained. The change flag information indicates whether the operating information of the functional module has changed. For the target functional module whose operating information has changed, a detection notification message is sent to a second device in the MLAG. The detection notification message instructs the second device to clear the historical detection results of the previous detection cycle. The target functional module includes at least one first MLAG port, and the operating information of the target functional module includes operating information corresponding to at least one first MLAG port. Then, for each first MLAG port, the operating information of the first MLAG port is sent to the second device, so that the second device performs consistency detection on the operating information of the first MLAG port based on the operating information of the second MLAG port corresponding to the first MLAG port, obtaining a first port detection result. A termination message is sent to the second device. The termination message instructs the second device to generate a first module detection result based on each first port detection result. Finally, the first module detection result sent by the second device is received, and consistency processing is performed on the MLAG based on the first module detection result.
[0051] In this embodiment, when the operating information of the target functional module in the first device changes, the first device first sends a detection notification message to the second device, and then sends the operating information of the first MLAG port to the second device, so that the second device sequentially performs consistency verification on the operating information of each first MLAG port. After the operating information of each first MLAG port has been sent, the first device sends a termination message to the second device. In this way, the detection process can accurately cover each MLAG port, avoid port omissions, and improve the detection accuracy of the target functional module.
[0052] Please see Figure 2 This is a flowchart illustrating a consistency detection method for a multi-chassis link aggregation group, provided as an exemplary embodiment of this application. Figure 2 As shown, the consistency detection method for a multi-chassis link aggregation group in this embodiment of the present disclosure is applied to the first device in the multi-chassis link aggregation group. The method includes the following steps S201~S205: S201: Obtain change flag information corresponding to each functional module of the first device; the change flag information is used to indicate whether the operating information of the functional module has changed.
[0053] Here, the first and second devices in the multi-chassis link aggregation group are pre-configured to establish a TCP session connection between them. Consistency checks are performed between the two devices, and based on this session connection, detection messages and results are sent and received. Simultaneously, consistency checks are enabled on both the first and second devices, and the same consistency check mode (either strict or loose) is configured.
[0054] In this embodiment of the application, the first device and the second device refer to two physical switches or routers in the MLAG system. One device is elected as the master device and the other is used as the backup device through an election process.
[0055] The change flag information can refer to a flag bit or a status bit, used to determine whether the operating information of the functional module has changed. Here, the change flag information can be obtained through the detection mechanism inside the first device.
[0056] In this embodiment, the first device and the second device are divided into modules to obtain multiple functional modules. Specifically, these include a Spanning Tree Protocol (STP) module, a Virtual Local Area Network (VLAN) module, and an aggregation Bond module. The operational information of the functional modules includes configuration information and status information. The configuration information can refer to the basic configuration parameters for the operation of the functional modules, and the status information can refer to the dynamic data that the device calculates or learns in real time based on the configuration information and the network environment.
[0057] Each functional module includes multiple ports, including a first MLAG port and a first non-MLAG port. The operational information of the functional module includes the operational information of the first MLAG port (including configuration information and status information) and the operational information of the first non-MLAG port (including configuration information and status information).
[0058] For example, the configuration information is shown in Table 1: Table 1 S202: For the target functional module whose operating information has changed, a detection notification message is sent to the second device in the MLAG; the detection notification message is used to instruct the second device to clear the historical detection results of the previous detection cycle locally; the target functional module includes at least one first MLAG port, and the operating information of the target functional module includes the operating information corresponding to at least one first MLAG port respectively.
[0059] The detection notification message is the START message.
[0060] Here, after obtaining the change flag information corresponding to each functional module, the target functional module whose operation information has changed is determined according to the change flag information. For the target functional module whose operation information has changed, a detection notification message is sent to the second device so that the second device can clear its local historical detection results of the previous detection cycle to avoid old data interfering with the detection results of the current cycle.
[0061] In this embodiment, to facilitate the distinction between the ports of the first device and the second device, the ports of the first device include a first MLAG port and a first non-MLAG port, and the ports of the second device include a second MLAG port and a second non-MLAG port.
[0062] S203: For each first MLAG port, the operation information of the first MLAG port is sent to the second device, so that the second device performs a consistency check on the operation information of the first MLAG port based on the operation information of the second MLAG port corresponding to the first MLAG port, and obtains the first port detection result.
[0063] In this step, the first device sends the operation information of the first MLAG port to the second device. After receiving the operation information of the first MLAG port, the second device compares the operation information of its local second MLAG port corresponding to the first MLAG port with the received operation information of the first MLAG port to obtain the first port detection result.
[0064] S204: Send a termination message to the second device; the termination message is used to instruct the second device to generate a first module detection result based on the detection results of each of the first ports.
[0065] Here, after the first device sends the operation information of each first MLAG port to the second device, the first device sends a termination message to the second device. After receiving the termination message, the second device can sequentially traverse the detection results of each first port and generate the detection results of the first module based on the detection results of each first port.
[0066] The detection results of the first module are used to indicate whether there are differences in operating information between the first device and the second device for each MLAG port. If there are differences in operating information, the detection results of the first module include the port identifier of the target MLAG port with the difference.
[0067] S205: Receive the detection result of the first module sent by the second device, and perform consistency processing on the MLAG based on the detection result of the first module.
[0068] In this step, after the first device receives the first module detection result sent by the second device, it can perform consistency processing on the multi-chassis link aggregation group based on the first module detection result.
[0069] Consistency processing may include at least one of the following: log generation, port shutdown, and port operation information correction.
[0070] It is understandable that if the detection results of the first module indicate that there is no difference in operating information between the first and second devices for each MLAG port, no processing is required, and the system will wait for the next detection cycle.
[0071] If the detection result of the first module indicates that there is a difference in operating information between the first and second devices for each MLAG port (for example, the STP function of one of the first MLAG ports is enabled, while the STP function of the corresponding second MLAG port is not enabled), then consistency processing can be performed.
[0072] Please see Figure 3 This is a flowchart illustrating the interaction between a first device and a second device, provided as an exemplary embodiment of this application. Figure 3 As shown, the first device establishes a TCP connection with the second device. If the operating information of the target functional module in the first device changes, the first device sends a detection notification message to the second device. After receiving the detection notification message, the second device clears the detection results of the previous detection cycle locally. The first device sends the operating information of the first MLAG port to the second device. The second device performs a consistency check on the operating information of the first MLAG port and generates a first port detection result. After the first device finishes sending the operating information of each first MLAG port, it sends a termination message to the second device. The second device iterates through each first port detection result and generates a first module detection result for the target functional module based on each first port detection result. The second device then sends the first module detection result to the first device. After receiving the first module detection result, the first device performs consistency processing on the MLAG system.
[0073] In this embodiment, when the operating information of the target functional module in the first device changes, the first device first sends a detection notification message to the second device, and then sends the operating information of the first MLAG port to the second device, so that the second device sequentially performs consistency verification on the operating information of each first MLAG port. After the operating information of each first MLAG port has been sent, the first device sends a termination message to the second device. In this way, the detection process can accurately cover each MLAG port, avoid port omissions, and improve the detection accuracy of the target functional module.
[0074] Optionally, for step S105, after performing consistency processing on the MLAG based on the detection result of the first module, the consistency detection mode of the first device can be obtained. If the consistency detection mode of the first device is strict mode and the port type of the target MLAG port is critical configuration type, the target MLAG port in the backup device is closed.
[0075] The backup device is the one with low interface utilization between the first device and the second device.
[0076] Here, the fact that the target MLAG port is a critical configuration type indicates that the target MLAG port is of high importance. Therefore, the target MLAG port in the backup device needs to be shut down to prevent network loops or traffic black holes.
[0077] It should be noted that since the primary and backup devices are selected based on their respective interface utilization rates, in order to reduce subsequent calibration costs, devices with low interface utilization rates are usually designated as backup devices.
[0078] Furthermore, when the first device is a backup device, in response to the correction command, the operating information of the target MLAG port in the backup device can be corrected based on the operating information of the target MLAG port in the master device (i.e., the second device), so that the backup device can be aligned with the master device with better link status and higher health value, and the correction efficiency of the MLAG system can be improved.
[0079] As mentioned above, the target functional module includes the first MLAG port and the first non-MLAG port. It can be understood that since the same MLAG port belonging to different devices is logically regarded as a virtual port, it is necessary to maintain the consistency of the operation information. However, the first non-MLAG port is completely independent. Port 1 of the first device and port 2 of the second device B have no logical binding relationship, and the traffic of the first non-MLAG port is usually forwarded within the local device (both inbound and outbound are on the same device), without the need for cross-device synchronization. However, in the MLAG system, the two devices are usually regarded as a logical entity. In order to achieve fault switching between devices, the operation information usually needs to be kept consistent to avoid configuration drift. For example, if VLAN 10 is configured on the first device but not on the second device, if the first device fails, the related services of VLAN 10 will be interrupted.
[0080] Therefore, in this embodiment of the application, the first device will also send the operation information of at least one first non-MLAG port to the second device. In this way, after receiving the operation information of at least one first non-MLAG port, the second device can compare the operation information of the second non-MLAG port corresponding to the first non-MLAG port in its local storage with the operation information of the first non-MLAG port to obtain the detection result of the second module, and send the detection result of the second module to the first device.
[0081] When the first device receives the detection results from the second module and the detection results from the second module, it performs consistency processing on the MLAG system to ensure that the operating information of the non-MLAG ports between the first device and the second device remains consistent.
[0082] In other implementations, consistency checks for static entries that can be configured in large batches can be performed using a quicksort-digital signature mechanism. Specifically, this can include the following steps (1) to (3): (1) For the first static table entry in the configuration information of the target functional module, obtain the table entry content of each first static table entry in the configuration information of the target functional module.
[0083] The first static table entry may include static MAC table, static ARP table, static ND table, etc., without limitation.
[0084] (2) Based on the content of each of the first static table entries, a first digital signature is generated and sent to the second device; the first digital signature is used to perform a consistency comparison with the second digital signature of the second device to obtain the detection result of the third module; the second digital signature is generated based on the content of each of the second static table entries in the target functional module of the second device.
[0085] Here, after obtaining the contents of each first static table entry in the configuration information of the target functional module, a first digital signature is generated based on the contents of each first static table entry, and the first digital signature is sent to the second device. The second device uses its local second digital signature to perform a consistency check on the first digital signature, obtains the third module detection result, and sends the third module detection result to the first device. In this way, the first device can perform consistency processing on the system based on the third module detection result.
[0086] Specifically, when generating a first digital signature based on the content of each first static table entry, the content of each static table entry can be stored in a buffer, and the memory capacity occupied by the content of the static table entry in the buffer can be determined. Then, the content of each static table entry is sorted according to the corresponding memory capacity, and the first digital signature is generated based on the memory size corresponding to each sorted static table entry using a message digest algorithm.
[0087] It's easy to understand that the contents of static table entries are stored in a buffer, sorted by memory size in units of table entry data structure size, and a message digest algorithm (such as SHA256 hash algorithm) is used to generate the first digital signature (such as a 256-bit digital signature) for each sorted memory capacity.
[0088] In other implementations, the message digest algorithm can be selected according to actual needs, and no limitation is made here.
[0089] It should be noted that the process of generating the second digital signature for the second device is similar to the process of generating the first digital signature for the first device, and will not be elaborated here.
[0090] (3) Receive the detection results of the first module and the detection results of the third module sent by the second device, and perform consistency processing on the MLAG based on the detection results of the first module and the detection results of the third module.
[0091] It is understandable that after receiving the detection results of the first module and the third module, the first device can perform consistency processing on MLAG based on the detection results of the first module and the third module.
[0092] Of course, in order to ensure the integrity of the consistency processing, the first device can also perform consistency processing on the system based on the detection results of the first module, the detection results of the second module, and the detection results of the third module.
[0093] Specifically, based on the detection results of the first module, the second module, and the third module, consistency difference information between the first device and the second device can be determined, and a log file can be generated based on the consistency difference information.
[0094] The consistency difference information can include difference type and difference information. The difference type includes port difference (including MLAG port difference and non-MLAG port difference) and static entry difference. If it is a port difference, the difference information can include the port identifier with difference, the operation information of the port, etc. If it is a static entry difference, the difference information is generated based on the first digital signature.
[0095] Please see Figure 4 This is a flowchart illustrating another consistency detection method for multi-chassis link aggregation groups provided in this application. This method is applied to the second device in a multi-chassis link aggregation group (MLAG), such as... Figure 4 As shown, steps S401 to S404 are included: S401: Receive a detection notification message sent by the first device in the MLAG, and clear the historical detection results of the previous detection cycle locally based on the detection notification message; the detection notification message is generated when the operating information of the target functional module in the first device changes.
[0096] S402: Receive the operation information of at least one first MLAG port sent by the first device.
[0097] S403: For any of the first MLAG ports, based on the operating information of the second MLAG port corresponding to the first MLAG port, perform a consistency check on the operating information of the first MLAG port to obtain the first port detection result.
[0098] S404: Receive the termination message, generate the first module detection result based on the detection results of each of the first ports, and send the first module detection result to the first device; the first module detection result is used to perform consistency processing on the MLAG.
[0099] For the content of steps S401 to S404, please refer to steps S201 to S205 above, which will not be repeated here.
[0100] Optionally, the second device may also receive the operation information of at least one first non-MLAG port sent by the first device, and perform a consistency comparison on the operation information of at least one second non-MLAG port corresponding to at least one first non-MLAG port to obtain the second module detection result, and then send the first module detection result and the second module detection result to the first device.
[0101] Alternatively, the second device may also receive the first digital signature sent by the first device, perform a consistency comparison between the first digital signature and the second digital signature to obtain the third module detection result, and send the first module detection result and the third module detection result to the first device.
[0102] The first digital signature is generated based on the contents of each first static table entry in the configuration information of the target functional module in the first device, and the second digital signature is generated based on the contents of each second static table entry in the target functional module of the second device.
[0103] Corresponding to the aforementioned embodiments of the consistency detection method for multi-chassis link aggregation groups, this application also provides embodiments of the consistency detection device for multi-chassis link aggregation groups.
[0104] Please refer to Figure 5 The above is a flowchart illustrating a consistency detection method for a multi-chassis link aggregation group, as shown in an exemplary embodiment of this application. Figure 5 As shown, after the first device and the second device establish a TCP connection, the change flag information of each functional module of the first device is obtained through a timed program. For each change flag information, it is determined whether the change flag information indicates a change. If so, the first device calculates a first digital signature for the target functional module that has been changed, and the second device calculates a second digital signature for the changed module. The first device sends the first digital signature to the second device, and the second device performs a consistency check on the first digital signature and the second digital signature to obtain the detection result of the third module.
[0105] For the first MLAG port, the first device sends a detection notification message to the second device. After receiving the detection notification message, the second device clears the detection results of the previous detection cycle locally. The first device sends the operation information of the first MLAG port to the second device. The second device performs a consistency check on the operation information of the first MLAG port and generates a first port detection result. After the first device has finished sending the operation information of each first MLAG port, it sends a termination message to the second device. The second device iterates through the detection results of each first port and generates a first module detection result for the target functional module based on the detection results of each first port.
[0106] For the first non-MLAG port, the first device sends the operation information of the first non-MLAG port to the second device. The second device performs a consistency check on the operation information of the first non-MLAG port based on its local operation information of the second non-MLAG port, and obtains the detection result of the second module.
[0107] The second device sends the test results of the first module, the second module, and the third module to the first device. The first device performs consistency processing based on the test results of each module, completes the consistency test for the current test cycle, and waits for the next test cycle.
[0108] Corresponding to the above-described consistency detection method for multi-chassis link aggregation groups, this disclosure also provides an electronic device, such as... Figure 6The diagram shown is a structural schematic of an electronic device provided in an embodiment of this disclosure, including: Electronic device 600 includes a processor 610, an internal bus 620, memory 630, a network interface 640, and non-volatile memory 650, and may also include other hardware required for its functions. One or more embodiments of this specification can be implemented in software, for example, the processor 610 reads the corresponding computer program from the non-volatile memory 650 into the memory 630 and then runs it. Of course, besides software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution entity of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.
[0109] The memory 630, also known as internal memory, is used to temporarily store the computational data in the processor 610, as well as the data exchanged with non-volatile memory 650 such as hard disk. The processor 610 exchanges data with non-volatile memory 650 through the memory 630.
[0110] In this embodiment, memory 630 is specifically used to store application code that executes the solution of this application, and its execution is controlled by processor 610. That is, when the electronic device is running, processor 610 communicates with network interface 640, memory 630 and non-volatile memory 650 through internal bus 620, so that processor 610 executes the application code stored in memory 630 and non-volatile memory 650, thereby executing the consistency detection method of multi-chassis link aggregation group described in the above method embodiment.
[0111] Processor 610 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.
[0112] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 600. In other embodiments of this application, the electronic device 600 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0113] This disclosure also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program performs the steps of the consistency detection method for multi-chassis link aggregation groups described in the above method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0114] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the consistency detection method for multi-chassis link aggregation groups in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0115] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0116] The embodiments of the subject matter and functional operation described in this specification can be implemented in the following ways: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or combinations thereof. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by a data processing apparatus or for controlling the operation of a data processing apparatus. Alternatively or additionally, the program instructions may be encoded on artificially generated propagation signals, such as machine-generated electrical, optical, or electromagnetic signals, which are generated to encode information and transmit it to a suitable receiving device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or combinations thereof.
[0117] The processing and logic flow described in this specification can be executed by one or more programmable computers that execute one or more computer programs to perform corresponding functions by operating on input data and generating output. The processing and logic flow can also be executed by dedicated logic circuitry—such as FPGAs (Field-Programmable Gate Arrays) or ASICs (Application-Specific Integrated Circuits), and the device can also be implemented as dedicated logic circuitry.
[0118] Suitable computers for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as disks, magneto-optical disks, or optical disks, or the computer will be operatively coupled to such mass storage devices to receive data from or transfer data to them, or both. However, a computer is not required to have such devices. Furthermore, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.
[0119] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. Processors and memory may be supplemented by or incorporated into dedicated logic circuitry.
[0120] While this specification contains numerous specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily intended to describe features of specific embodiments of a particular invention. Certain features described in the various embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation thereof.
[0121] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
[0122] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.
[0123] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A consistency detection method for multi-chassis link aggregation groups, characterized in that, The method, applied to a first device in a multi-chassis link aggregation group (MLAG), includes: Obtain change flag information corresponding to each functional module of the first device; the change flag information is used to indicate whether the operating information of the functional module has changed; For a target functional module whose operating information has changed, a detection notification message is sent to the second device in the MLAG; the detection notification message is used to instruct the second device to clear the historical detection results of the previous detection cycle locally; the target functional module includes at least one first MLAG port, and the operating information of the target functional module includes the operating information corresponding to at least one first MLAG port respectively; For each first MLAG port, the operation information of the first MLAG port is sent to the second device, so that the second device performs a consistency check on the operation information of the first MLAG port based on the operation information of the second MLAG port corresponding to the first MLAG port, and obtains the first port detection result; Send a termination message to the second device; the termination message is used to instruct the second device to generate a first module detection result based on the detection results of each of the first ports; The system receives the detection result of the first module sent by the second device and performs consistency processing on the MLAG based on the detection result of the first module.
2. The method according to claim 1, characterized in that, The target functional module further includes at least one first non-MLAG port, and the operation information of the target functional module further includes operation information corresponding to at least one of the first non-MLAG ports respectively; the second device includes a second non-MLAG port corresponding to at least one of the first non-MLAG ports respectively; the method further includes: The operation information of at least one of the first non-MLAG ports is sent to the second device; the operation information of the first non-MLAG port is used to perform a consistency comparison with the operation information of the corresponding second non-MLAG port in the second device to obtain the detection result of the second module. The step of receiving the detection result of the first module sent by the second device and performing consistency processing on the MLAG based on the detection result of the first module includes: The system receives the detection results of the first module and the second module from the second device, and performs consistency processing on the MLAG based on the detection results of the first module and the second module.
3. The method according to claim 1, characterized in that, The operational information of the target functional module includes the configuration information of the target functional module, and the method further includes: For the first static table entry in the configuration information of the target functional module, obtain the table entry content of each first static table entry in the configuration information of the target functional module; Based on the content of each of the first static table entries, a first digital signature is generated and sent to the second device; the first digital signature is used to perform a consistency comparison with the second digital signature of the second device to obtain the detection result of the third module; the second digital signature is generated based on the content of each of the second static table entries in the target functional module of the second device; The step of receiving the detection result of the first module sent by the second device and performing consistency processing on the MLAG based on the detection result of the first module includes: The system receives the detection results of the first module and the third module sent by the second device, and performs consistency processing on the MLAG based on the detection results of the first module and the third module.
4. The method according to claim 3, characterized in that, The step of generating a first digital signature based on the content of each of the first static table entries includes: For each static table entry, the table entry content of the static table entry is stored in a buffer, and the memory capacity occupied by the table entry content of the static table entry in the buffer is determined. The contents of each static table entry are sorted according to their corresponding memory capacity, and the first digital signature is generated based on the memory size of each sorted static table entry using a message digest algorithm.
5. The method according to claim 1, characterized in that, The receiving of the first module detection result sent by the second device includes: Receive the detection results of the first module, the detection results of the second module, and the detection results of the third module sent by the second device; The method further includes: Based on the detection results of the first module, the second module, and the third module, consistency difference information between the first device and the second device is determined, and a log file is generated based on the consistency difference information.
6. The method according to claim 1, characterized in that, The detection result of the first module is used to indicate the port identifiers of target MLAG ports that differ; the consistency processing of the MLAG based on the detection result of the first module includes: Obtain the consistency detection mode of the first device; If the consistency detection mode of the first device is strict mode and the port type of the target MLAG port is critical configuration type, the target MLAG port in the backup device is closed; wherein, the backup device is the device with low interface utilization between the first device and the second device.
7. The method according to claim 6, characterized in that, The method further includes: When the first device is a backup device, in response to a correction command, the operating information of the target MLAG port in the backup device is corrected based on the operating information of the target MLAG port in the master device; the master device is the second device.
8. A consistency detection method for multi-chassis link aggregation groups, characterized in that, The method, applied to a second device in a multi-chassis link aggregation group (MLAG), includes: The system receives a detection notification message from the first device in the MLAG and clears the historical detection results of the previous detection cycle based on the detection notification message. The detection notification message is generated when the operating information of the target functional module in the first device changes. Receive at least one first MLAG port operation information sent by the first device; For any of the first MLAG ports, based on the running information of the second MLAG port corresponding to the first MLAG port, a consistency check is performed on the running information of the first MLAG port to obtain the first port check result; The system receives a termination message and generates a first module detection result based on the detection results of each of the first ports, and sends the first module detection result to the first device; the first module detection result is used to perform consistency processing on the MLAG.
9. The method according to claim 8, characterized in that, The method further includes: Receive operating information of at least one first non-MLAG port sent by the first device; Based on the operation information of at least one second non-MLAG port corresponding to at least one first non-MLAG port, a consistency comparison is performed on the operation information of the at least one first non-MLAG port to obtain the detection result of the second module. Sending the detection result of the first module to the first device includes: The detection results of the first module and the detection results of the second module are sent to the first device.
10. The method according to claim 8, characterized in that, The method further includes: Receive the first digital signature sent by the first device; the first digital signature is generated based on the contents of each first static table entry in the configuration information of the target functional module in the first device; The first digital signature and the second digital signature are compared for consistency to obtain the detection result of the third module; the second digital signature is generated based on the table content of each second static table entry in the target functional module of the second device; Sending the detection result of the first module to the first device includes: The detection results of the first module and the detection results of the third module are sent to the first device.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the consistency detection method for multi-chassis link aggregation groups as described in any one of claims 1-7 or 8-10.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the consistency detection method for multi-chassis link aggregation groups as described in any one of claims 1-7 or 8-10.