MLAG node keep-alive method, device and system
By implementing a health check mechanism within the MLAG device and an LPU keep-alive agent, the dual-master failure problem in MLAG systems under fault or abnormal conditions is resolved, enabling smooth fault handling and business recovery, and improving system reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MAIPU COMM TECH CO LTD
- Filing Date
- 2026-03-05
- Publication Date
- 2026-05-15
AI Technical Summary
In the MLAG system, when the MLAG process of the MLAG master device fails, the MPU master-slave switch occurs, or the CPU continues to be used at high frequencies, the MLAG system will experience a dual master failure, resulting in packet loss of service traffic and affecting user services.
By establishing a health check mechanism within the MLAG device, enabling the keep-alive agent using the LPU, adjusting the keep-alive detection cycle of the peer MLAG device, avoiding dual-master failures, and using the serial number and authentication mechanism contained in the MLAG protocol message to prevent counterfeiting, the normal operation of the MLAG system is ensured.
Reduce unnecessary network jitter, improve the reliability of the MLAG system, and ensure the normal operation of the MLAG system under fault or abnormal conditions.
Smart Images

Figure CN122053677A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data communication, and particularly relates to a method, apparatus and system for keeping MLAG nodes alive. Background Technology
[0002] like Figure 1 The diagram shows a network topology of a conventional MLAG (Multi-Chassis Link Aggregation Group) system. This MLAG system includes MLAG device 1 and MLAG device 2. The two MLAG devices exchange MLAG protocol messages, synchronize service data, and forward service traffic via a Peer-Link link, enabling MLAG protocol negotiation and keep-alive, service data synchronization, and service traffic forwarding between the MLAG devices. Access device 1 and access device 2 are dual-homed to MLAG device 1 and MLAG device 2, respectively.
[0003] exist Figure 1 In the MLAG system shown, if MLAG device 1, acting as the master device, fails or abnormally restarts, it will trigger the MLAG protocol keepalive timeout and keepalive timeout of MLAG device 2. MLAG device 2 will then consider MLAG device 1 to have failed or abnormally restarted, and will assume the role of master device, taking over the forwarding work of the entire MLAG system. In this way, it can be ensured that the entire MLAG system can still function normally when the MLAG master device restarts or fails.
[0004] However, in certain special circumstances, such as MLAG process failure of the MLAG master device, master-slave MPU (Main Processing Unit) switching, or abnormally high CPU utilization, the MPU may be unable to send and receive MLAG protocol messages and Keepalive protocol messages carrying keepalive timeouts within a certain timeframe. This causes the MPU of the peer MLAG device to detect that both the MLAG and Keepalive protocol keepalive timers have expired, and the peer MLAG device will enter master device role mode. Meanwhile, the original MLAG master device continues to operate normally, effectively functioning as the master device, as the business modules are unaware of this situation. In other words, the two ends of the MLAG system enter a dual-master abnormal state. At this time, because the two ends cannot synchronize business entries, such as ARP (Address Resolution Protocol) entries, ND (Neighbor Discovery) entries, and FDB (Forwarding Database) entries, packet loss occurs, impacting user services. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a method, apparatus, and system for keeping MLAG nodes alive, which prevents MLAG dual-master failures from being triggered and maintains the normal operation of the MLAG system under circumstances such as MLAG process failure, MPU master-slave switching, and abnormally high CPU utilization.
[0006] Based on the above objectives, in a first aspect, embodiments of the present invention provide a method for keeping MLAG nodes alive, applied to the LPU in a local MLAG device, wherein the local MLAG device further includes an MPU, and the LPU of the local MLAG device is connected to the LPU of a peer MLAG device via a Peer-Link link, the method comprising: Receive the Peer-Link aggregation group ID, health check timeout time, and keep-alive anomaly timeout time sent by the MPU; the health check timeout time is less than the keep-alive timeout time between the local MLAG device and the peer MLAG device. If the root port of the aggregation group corresponding to the Peer-Link aggregation group ID is determined to be on this LPU based on the Peer-Link aggregation group ID, then the keep-alive proxy is enabled. A first timer is started based on the health check timeout period. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, the first timer is reset. If the health notification message is not received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout period sent by the MPU is copied, and the keep-alive timeout period in the MLAG protocol message is modified to the keep-alive abnormal timeout period. The modified MLAG protocol message is then sent to the peer MLAG device.
[0007] In one possible implementation, after the step of sending the modified MLAG protocol message to the peer MLAG device, the method further includes: A second timer is started based on the keep-alive message transmission cycle between the local MLAG device and the peer MLAG device issued by the MPU. If a new MLAG protocol message sent by the MPU is received before the second timer expires, the new MLAG protocol message is cached locally, a copy of the new MLAG protocol message is sent to the peer MLAG device, and the second timer is closed. If no new MLAG protocol message is received after the second timer expires, a copy of the locally cached new MLAG protocol message is copied, the keep-alive timeout time in the new MLAG protocol message is modified to the keep-alive abnormal timeout time, and the modified new MLAG protocol message is sent to the peer MLAG device.
[0008] In one possible implementation, the method further includes: the MLAG protocol message includes a first sequence number, a second sequence number and an acknowledgment number, the first sequence number is accumulated by the MPU, the second sequence number is accumulated by the LPU of the local MLAG device, and the acknowledgment number is the first sequence number carried in the last received MLAG protocol message sent by the peer MLAG device; Receive the authentication type and authentication key issued by the MPU; After the step of modifying the keep-alive timeout in the MLAG protocol message to the keep-alive abnormal timeout, the method further includes: After modifying the second sequence number in the MLAG protocol message to the local second sequence number on this LPU, the authentication data is calculated based on the authentication type, the authentication key, and the entire content of the modified MLAG protocol message. The authentication data is then updated into the MLAG authentication header of the modified MLAG protocol message, and the modified MLAG protocol message is sent to the peer MLAG device.
[0009] Secondly, embodiments of the present invention provide a method for keeping MLAG nodes alive, applied to the MPU in a local MLAG device, wherein the local MLAG device further includes an LPU, and the LPU of the local MLAG device is connected to the LPU of the peer MLAG device via a Peer-Link link. The method includes: The Peer-Link aggregation group ID is sent to the LPU of the local MLAG device so that the LPU of the local MLAG device can determine the root port of the aggregation group corresponding to the Peer-Link aggregation group ID on the local LPU, and then the keep-alive proxy is enabled. A health check timeout and a keep-alive anomaly timeout are sent to the LPU with the keep-alive agent enabled, so that the LPU with the keep-alive agent enabled starts a first timer based on the health check timeout. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, the first timer is reset. If the health notification message is not received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout is copied, and the keep-alive timeout in the MLAG protocol message is modified to the keep-alive anomaly timeout. The modified MLAG protocol message is then sent to the peer MLAG device. The health check timeout is less than the keep-alive timeout between the local MLAG device and the peer MLAG device. A health notification message carrying its own MLAG process status information is sent to the LPU with the keep-alive agent enabled, according to the health notification sending cycle, wherein the health notification sending cycle is less than the health check timeout time.
[0010] In one possible implementation, the method further includes: Send an MLAG protocol message carrying the keep-alive timeout between the local MLAG device and the peer MLAG device to the LPU of the local MLAG device.
[0011] In one possible implementation, the method includes: The MLAG protocol message includes a first sequence number, a second sequence number, and an acknowledgment number. The first sequence number is accumulated by the MPU, the second sequence number is accumulated by the local MLAG device, and the acknowledgment number is the first sequence number carried in the last MLAG protocol message sent by the peer MLAG device. The authentication type and authentication key are issued to the LPU of the local MLAG device so that after the LPU with the keep-alive proxy enabled modifies the keep-alive timeout time in the MLAG protocol message to the keep-alive abnormal timeout time, modifies the second sequence number in the MLAG protocol message to the local second sequence number on the local LPU, calculates authentication data based on the authentication type, the authentication key and the entire content of the modified MLAG protocol message, updates the authentication data in the MLAG authentication header of the modified MLAG protocol message, and then sends the modified MLAG protocol message to the peer MLAG device.
[0012] Thirdly, embodiments of the present invention provide an MLAG node keep-alive device, applied to the LPU in a local MLAG device, wherein the local MLAG device further includes an MPU, and the LPU of the local MLAG device is connected to the LPU of a peer MLAG device via a Peer-Link link. The device includes: The receiving module is used to receive the Peer-Link aggregation group ID, health check timeout time, and keep-alive anomaly timeout time sent by the MPU; the health check timeout time is less than the keep-alive timeout time between the local MLAG device and the peer MLAG device; The proxy module is used to determine the root port of the aggregation group corresponding to the Peer-Link aggregation group ID on this LPU based on the Peer-Link aggregation group ID, and then enable the keep-alive proxy. The proxy module is further configured to start a first timer based on the health check timeout time. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, the first timer is reset. If the health notification message is not received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout time sent by the MPU is copied, and the keep-alive timeout time in the MLAG protocol message is modified to the keep-alive abnormal timeout time. The modified MLAG protocol message is then sent to the peer MLAG device.
[0013] Fourthly, embodiments of the present invention provide an MLAG node keep-alive device, applied to the MPU in a local MLAG device, wherein the local MLAG device further includes an LPU, and the LPU of the local MLAG device is connected to the LPU of the peer MLAG device via a Peer-Link link. The device includes: The configuration module is used to issue the Peer-Link aggregation group ID to the LPU of the local MLAG device, so that the LPU of the local MLAG device can determine the root port of the aggregation group corresponding to the Peer-Link aggregation group ID on the local LPU, and then enable the keep-alive proxy. The configuration module is further configured to send a health check timeout and a keep-alive abnormal timeout to the LPU with the keep-alive agent enabled, so that the LPU with the keep-alive agent enabled starts a first timer based on the health check timeout. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, the first timer is reset. If the health notification message is not received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout sent by the MPU is copied, and the keep-alive timeout in the MLAG protocol message is modified to the keep-alive abnormal timeout. The modified MLAG protocol message is then sent to the peer MLAG device. The health check timeout is less than the keep-alive timeout between the local MLAG device and the peer MLAG device. The sending module is used to send a health notification message carrying its own MLAG process status information to the LPU with the keep-alive agent enabled, according to the health notification sending cycle, wherein the health notification sending cycle is less than the health check timeout time.
[0014] Fifthly, embodiments of the present invention provide a service card, which is used to execute the MLAG node keep-alive method as described in the first aspect above.
[0015] In a sixth aspect, embodiments of the present invention provide a master control card, which is used to execute the MLAG node keep-alive method as described in the second aspect above.
[0016] In a seventh aspect, embodiments of the present invention provide an MLAG system, the MLAG system including two MLAG devices connected by a Peer-Link link, each MLAG device including a master control card and at least one service card, the master control card being used to execute the MLAG node keep-alive method as described in the second aspect above, and the at least one service card being used to execute the MLAG node keep-alive method as described in the first aspect above.
[0017] The present invention provides a method, apparatus and system for keeping MLAG nodes alive. By establishing an MLAG process health check mechanism inside the MLAG device, the keep-alive detection cycle of the peer MLAG device is adjusted in the event of MLAG process failure or MPU master-slave switching of the local MLAG device. This avoids the two MLAG devices from entering unnecessary dual-master failure handling process, reduces unnecessary network jitter and improves the reliability of the MLAG system. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic diagram of an example MLAG system structure in the prior art; Figure 2 A schematic diagram of an example MLAG system structure provided in an embodiment of the present invention; Figure 3 A flowchart illustrating a method for keeping an MLAG node alive according to an embodiment of the present invention; Figure 4 A flowchart illustrating a method for keeping an MLAG node alive according to an embodiment of the present invention; Figure 5 An example message format provided for an embodiment of the present invention; Figure 6 An example MLAG protocol message format provided for an embodiment of the present invention; Figure 7 A schematic diagram of an example MLAG device structure provided in an embodiment of the present invention; Figure 8 A schematic diagram of an example LPU structure provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of an example MPU structure provided in an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] The system architecture and business scenarios described in the embodiments of this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.
[0022] In the description of the embodiments of the present invention, it should be noted that the terms "first," "second," etc., are used only for distinguishing descriptions and are not intended to indicate or imply relative importance.
[0023] The above method will be described in detail below with reference to specific embodiments.
[0024] See above Figure 1 As shown, existing MLAG systems typically include two MLAG devices: a master MLAG device (as Master) and a slave MLAG device (as Slave). These devices communicate via a Peer-Link link, exchanging MLAG protocol messages, synchronizing service data, and forwarding service traffic. This enables MLAG protocol negotiation and keepalive, service data synchronization, and service traffic forwarding between the two devices. If the master MLAG device fails or restarts abnormally, it will trigger MLAG protocol keepalive timeouts and Keepalive timeouts. After these timeouts, the slave MLAG device will enter master mode, taking over the forwarding work of the entire MLAG system and ceasing synchronization of service entries with the original slave MLAG device. These service entries include ARP, ND, and FDB entries. Similarly, if the slave MLAG device fails or restarts abnormally, the master MLAG device will remain in master mode, taking over the forwarding work of the entire MLAG system and ceasing synchronization of service entries with the original slave MLAG device. This ensures that the MLAG system can still function normally even if the MLAG master or backup equipment fails or restarts abnormally.
[0025] However, in certain special circumstances, such as MLAG process failure in the MLAG master device or MPU master-slave failover, the MPU may be unable to properly send and receive MLAG protocol messages and Keepalive protocol messages carrying keep-alive timeouts. Furthermore, if the time between the MLAG process shutting down and the new MLAG process restarting exceeds the keep-alive timeout of the MLAG and Keepalive protocols, a dual-master failure may be triggered, halting the synchronization of service entries. Similarly, in cases of persistently high CPU usage, such as high-priority processes occupying the CPU for extended periods, the entire system may experience scheduling anomalies, preventing the MLAG process from being scheduled. The MLAG process itself may not be aware of this anomaly and may continue operating normally. If the persistently high CPU usage exceeds the keep-alive timeout of the MLAG control and Keepalive protocols, a dual-master failure will be triggered, halting the synchronization of service entries. However, in these scenarios, the Peer-link status is normal, and service entry synchronization and forwarding can still be completed normally. It is the dual-master failure itself that causes the cessation of service entry synchronization, leading to fluctuations in service traffic.
[0026] Therefore, there is an urgent need for a mechanism to properly address the issues triggered by MLAG process failures or upgrade restarts, MPU master-slave switching, and abnormal high CPU usage in the MLAG system.
[0027] To address the aforementioned issues, this invention provides a method for keeping MLAG nodes alive, which prevents MLAG dual-master failures from being triggered and maintains the normal operation of the MLAG system in situations such as MLAG process failure of the MLAG master device, MPU master-slave switching, and abnormal continuous high CPU usage.
[0028] like Figure 2 The diagram shown illustrates an example MLAG system architecture. This MLAG system includes MLAG device 1 and MLAG device 2. The MLAG devices primarily consist of an MPU (Main Processing Unit) and an LPU (Line Processing Unit). Figure 2In this example, MLAG device 1 includes one primary MPU, one backup MPU, and three LPUs: LPU1, LPU2, and LPU3. MLAG device 2 also includes one primary MPU, one backup MPU, and three LPUs: LPU1, LPU2, and LPU3. LPU1 of local MLAG device 1 is connected to LPU1 of peer MLAG device 2, and LPU2 of local MLAG device 1 is connected to LPU2 of peer MLAG device 2. LPU1 and LPU2 of local MLAG device 1 are added to the Peer-Link LAG, and LPU1 and LPU2 of peer MLAG device 2 are also added to the Peer-Link LAG. The Peer-Link LAG carries Peer-Link services. The MLAG process typically operates on the MPU. During normal operation, the two MLAG devices communicate via the Peer-Link link, exchanging MLAG protocol messages, synchronizing service data, and forwarding service traffic. This enables MLAG protocol negotiation and keep-alive, service data synchronization, and service traffic forwarding between the MLAG devices. (Example...) Figure 2 During the normal operation of the MLAG process, the MPU of MLAG device 1 sends MLAG protocol messages carrying the keep-alive timeout to LPU1 and LPU2 of MLAG device 1 through the communication channel between the MPU and LPU of MLAG device 1, and sends Keepalive messages carrying the keep-alive timeout to LPU3 of MLAG device 1. Then, LPU1 and LPU2 of MLAG device 1 forward the MLAG protocol messages to LPU1 and LPU2 of the peer MLAG device 2 through the Peer-Link link. LPU3 of MLAG device 1 forwards the Keepalive message to LPU3 of the peer MLAG device 2 through the Keepalive link. Finally, LPU1-LPU3 of the peer MLAG device 2 forward the MLAG protocol messages or Keepalive messages to the MPU of MLAG device 2 through the communication channel between the MPU and LPU of MLAG device 2. Based on this structure, this embodiment of the invention utilizes the LPU's independence from the MPU to optimize the MLAG system node keep-alive method, achieving smoother MLAG fault handling and service recovery.
[0029] like Figure 3 As shown in the embodiment of the present invention, a node keep-alive method for an MLAG system is provided, which is applied to the LPU in the local MLAG device. The local MLAG device also includes an MPU. The LPU of the local MLAG device is connected to the LPU of the peer MLAG device via a Peer-Link link. The method includes: Step 301: Receive the Peer-Link aggregation group ID, health check timeout time, and keep-alive anomaly timeout timeout time issued by the MPU.
[0030] In this step, the health check timeout is less than the keep-alive timeout between the local MLAG device and the remote MLAG device, and the keep-alive abnormal timeout is different from the keep-alive timeout.
[0031] Step 302: If the root port of the aggregation group corresponding to the Peer-Link aggregation group ID is located on this LPU based on the Peer-Link aggregation group ID, then enable the keep-alive agent.
[0032] In this step, after the LPU starts up, it receives the Peer-Link aggregation group ID, health check timeout time, and keep-alive anomaly timeout time from the MPU. Based on the Peer-Link aggregation group ID, the LPU identifies itself as the LPU containing the root port of the aggregation group corresponding to that Peer-Link aggregation group ID. If so, the LPU enables the keep-alive proxy and starts the first timer based on the health check timeout time. Whether the keep-alive proxy is enabled on the LPU can be determined by checking if the root port of the Link-Aggregation Group (LAG) is on this board, based on the aggregation group ID of the Peer-Link link. Only the LPU at the root port of the aggregation group where the Peer-Link resides needs to enable the keep-alive proxy. The LPU with the keep-alive proxy enabled receives health check notification messages sent by the MPU, checks the health status of the MLAG process, receives MLAG protocol messages sent by the MPU through the inter-card communication channel, caches and forwards the MLAG protocol messages. If no health notification message is received after the first timer expires, the MLAG process is considered abnormal. A copy of the locally cached MLAG protocol message is then copied, the keep-alive timeout time in the MLAG protocol message is modified to the keep-alive abnormal timeout time, and then sent to the peer MLAG device to modify the peer MLAG device's keep-alive timeout time.
[0033] In this embodiment of the invention, when the root port of the aggregation group to which the Peer-Link belongs changes, the LPU where the root port is located may also switch. At this time, the keep-alive proxy function of the LPU where the root port is located will automatically take effect, and the keep-alive proxy function of the original LPU will automatically become invalid. At the same time, the health notification messages and MLAG protocol messages sent by the MLAG process on the MPU will also automatically switch their destination channels, that is, be sent to the LPU where the root port is located.
[0034] Step 303: Start the first timer based on the health check timeout time. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, then reset the first timer. If no health notification message is received after the first timer expires, copy a locally cached MLAG protocol message carrying the keep-alive timeout time sent by the MPU, modify the keep-alive timeout time in the MLAG protocol message to the keep-alive abnormal timeout time, and send the modified MLAG protocol message to the peer MLAG device.
[0035] In this embodiment of the invention, during the normal operation of the MLAG process, the MPUs of both MLAG devices periodically send MLAG protocol messages carrying the keep-alive timeout to the peer MLAG device according to the MLAG protocol keep-alive timer, and periodically send health notification messages to the LPU of their own MLAG device according to the health notification timer. The LPU with the keep-alive proxy enabled will cache and forward the MLAG protocol messages, and upon receiving a health notification message, update the MLAG process health status and the timeout of the health check timeout timer. It will then forward the MLAG protocol message to the peer MLAG device. After receiving the MLAG protocol message, the peer MLAG device updates the MLAG protocol status and the timeout of the MLAG protocol keep-alive timer.
[0036] In this embodiment of the invention, the LPU also receives the keep-alive message transmission period between the local MLAG device and the peer MLAG device issued by the MPU, so that the LPU starts a second timer according to the keep-alive message transmission period and periodically sends MLAG protocol messages. Specifically, after sending the modified MLAG protocol message to the peer MLAG device in step 303, the method further includes: A second timer is started based on the keep-alive message transmission cycle between the local MLAG device and the peer MLAG device issued by the MPU. If a new MLAG protocol message is received from the MPU before the second timer expires, the new MLAG protocol message is cached locally, a copy of the new MLAG protocol message is sent to the peer MLAG device, and the second timer is closed. If no new MLAG protocol message is received after the second timer expires, a copy of the locally cached new MLAG protocol message is made, the keep-alive timeout time in the new MLAG protocol message is modified to the keep-alive abnormal timeout time, and the modified new MLAG protocol message is sent to the peer MLAG device.
[0037] In this embodiment of the invention, the LPU receives an MLAG protocol message sent by the MPU through the card-to-card communication channel. The MLAG protocol message carries the keep-alive timeout between the local MLAG device and the peer MLAG device.
[0038] In this step, the MLAG protocol message sent by the MPU can be sent periodically according to the keep-alive message sending cycle, or it can be sent irregularly by the MPU in cases of protocol negotiation, configuration modification, etc. Each MLAG protocol message carries a keep-alive timeout.
[0039] In this embodiment of the invention, after receiving the MLAG protocol message sent by the MPU, the LPU forwards the MLAG protocol message to the peer MLAG device. Furthermore, upon receiving the MLAG protocol message, the LPU records and caches the MLAG protocol message locally. If a cached record already exists locally, the latest MLAG protocol message replaces the original cached record.
[0040] As an optimized implementation, the MLAG protocol supports authentication to prevent spoofing or malicious copying of MLAG protocol messages to update the keep-alive timeout of MLAG devices. Therefore, this embodiment of the invention also provides an MLAG node keep-alive method that further includes: The MLAG protocol message includes a first sequence number, a second sequence number, and an acknowledgment number. The first sequence number is accumulated by the MPU of the local MLAG device, the second sequence number is accumulated by the LPU of the local MLAG device, and the acknowledgment number is the first sequence number carried in the last MLAG protocol message sent by the peer MLAG device.
[0041] In this embodiment of the invention, each time the LPU receives a new MLAG protocol message sent by the MPU, it resets the local second sequence number on the LPU to 1. Each time the LPU sends an MLAG protocol message, the local second sequence number is automatically incremented by 1.
[0042] Receive the authentication type and authentication key issued by the MPU.
[0043] In this step, after receiving the authentication type and authentication key from the MPU, the LPU saves the authentication type and authentication key locally.
[0044] After modifying the keep-alive timeout in the MLAG protocol message to a keep-alive exception timeout in step 303, the method further includes: After modifying the second serial number in the MLAG protocol message to the local second serial number on this LPU, the authentication data is calculated based on the authentication type, authentication key, and the entire content of the modified MLAG protocol message. The authentication data is then updated into the MLAG authentication header of the modified MLAG protocol message, and the modified MLAG protocol message is sent to the peer MLAG device.
[0045] like Figure 4As shown, this embodiment of the invention provides a method for keeping MLAG nodes alive, applied to the MPU in a local MLAG device. The local MLAG device also includes an LPU, which is connected to the LPU of the peer MLAG device via a Peer-Link link. The method includes: Step 401: Send the Peer-Link aggregation group ID to the LPU of the local MLAG device so that the LPU of the local MLAG device can determine the root port of the aggregation group corresponding to the Peer-Link aggregation group ID on the local LPU, and then enable the keep-alive agent.
[0046] In this step, the MPU generates a Peer-Link configuration message including the Peer-Link aggregation group ID, and after the LPU starts up, it sends this Peer-Link configuration message to the LPU via the inter-card communication channel. This Peer-Link configuration message can be in TLV format, for example, as shown below. Figure 5 As shown, the Peer-Link configuration message has type T=5, length L=4 bytes, and data field V includes a 4-byte Peer-Link aggregation group ID. This allows the LPU to obtain the aggregation group ID of the Peer-Link and determine whether to enable the keep-alive agent on this LPU based on the Peer-Link aggregation group ID.
[0047] In this embodiment of the invention, when the MLAG process starts, the MPU of the MLAG device initializes the program, loads the configuration, and calculates the keep-alive timeout, keep-alive message sending cycle, health check timeout, health notification sending cycle, keep-alive anomaly timeout, and graceful restart timeout between the local MLAG device and the peer MLAG device according to the configuration. The health notification sending cycle is shorter than the health check timeout, and the health check timeout is shorter than the keep-alive timeout, with a margin required. For example, the health check timeout is less than or equal to 1 / 2 to 2 / 3 of the keep-alive timeout, and the health notification sending cycle is less than 1 / 4 of the keep-alive timeout. The keep-alive anomaly timeout typically exceeds the sum of the time required for master / slave switchover, process restart, etc., plus the time required for MLAG process startup, MLAG negotiation completion, and data synchronization between the two MLAG endpoints. Alternatively, it can be directly equal to the graceful restart timeout, which typically exceeds the sum of the device restart time, MLAG negotiation completion, and data synchronization between the two MLAG endpoints.
[0048] Step 402: Send the health check timeout and keep-alive anomaly timeout to the LPU with the keep-alive agent enabled. This causes the LPU with the keep-alive agent enabled to start a first timer based on the health check timeout. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, the first timer is reset. If no health notification message is received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout sent by the MPU is copied, and the keep-alive timeout in the MLAG protocol message is modified to the keep-alive anomaly timeout. The modified MLAG protocol message is then sent to the peer MLAG device. The health check timeout is less than the keep-alive timeout between the local MLAG device and the peer MLAG device.
[0049] In this step, the MPU generates a time configuration message including the health check timeout and the keep-alive timeout, and sends this time configuration message to the LPU after startup. The health check timeout is shorter than the keep-alive timeout. This time configuration message can be in TLV format, for example, such as... Figure 5 As shown, the time configuration message has type T=1, length L=12 bytes, and data field V includes a 4-byte keep-alive message sending period T2, a 4-byte health check timeout period T3, and a 4-byte keep-alive exception timeout period T5. This allows the LPU to obtain the keep-alive message sending period, health check timeout period, and keep-alive exception timeout period.
[0050] Step 403: Send a health notification message carrying its own MLAG process status information to the LPU with the keep-alive agent enabled according to the health notification sending cycle, wherein the health notification sending cycle is less than the health check timeout time.
[0051] In this embodiment of the invention, the MLAG process on the MPU separates packet sending and receiving. The packet receiving process of the MLAG process is the same as the existing implementation, and will not be described again here. In this embodiment of the invention, the packet sending process of the MLAG process is modified as follows: The MPU constructs an MLAG protocol message carrying a keep-alive timeout and periodically sends it to the LPU according to the keep-alive message sending cycle. The MPU can send the MLAG protocol message to the LPU through the inter-card communication channel. For example, the MPU can send an MLAG protocol message to the LPU through the inter-card communication channel between the MPU and the LPU. This MLAG protocol message carries the MLAG protocol message, and the format of the MLAG protocol message can be TLV format. For example, Figure 5 As shown, the type of this MLAG protocol message is T=2, the length is L=the actual length of the protocol message, and the data field V includes the MLAG protocol message.
[0052] The MPU simultaneously constructs a health notification message carrying MLAG process status information and periodically sends it to the LPU with the keep-alive agent enabled, according to the health notification sending cycle. This health notification message is used by the LPU to detect the status of the MLAG process. The health notification sending cycle is shorter than the keep-alive timeout to ensure timely detection of MLAG process anomalies. For example, ... Figure 5 As shown, the health notification message can be in TLV format. The type of the health notification message is T=0, the length is L=12 bytes, and the data field V includes 4 bytes of MPU-ID, 4 bytes of process ID (Process-ID), and 4 bytes of process state (Process-state).
[0053] This invention provides a method for keeping MLAG nodes alive, which further includes: Step 404: Send an MLAG protocol message carrying the keep-alive timeout between the local MLAG device and the peer MLAG device to the LPU of the local MLAG device.
[0054] In one possible implementation, during the normal operation of MLAG, the MPU constructs MLAG protocol messages carrying keep-alive timeouts and periodically sends them to the LPU according to the keep-alive message sending cycle.
[0055] In another possible implementation, the MPU periodically sends MLAG protocol messages carrying keep-alive timeout durations to the LPU during protocol negotiation, configuration modifications, or other situations.
[0056] It should be noted that when the MPU deletes the MLAG configuration and disables the MLAG function, the MPU sends a stop keep-alive agent message to the LPU. This stop keep-alive agent message can be in TLV format, as shown in the example below. Figure 5 As shown, the keep-alive proxy stop message has a type T=2, a length L=4 bytes, and a data field V including a 4-byte keep-alive proxy stop reason ID. The LPU will stop the MLAG protocol message forwarding function and release related resources, such as deleting cached MLAG protocol messages.
[0057] As an optimized implementation, the MLAG protocol supports authentication to prevent spoofing or malicious copying of MLAG protocol messages to update the MLAG protocol keep-alive timeout of the MLAG device. Therefore, in this embodiment of the invention, when the MPU distributes the configuration, in addition to distributing the Peer-Link aggregation group ID, health check timeout, and keep-alive anomaly timeout, it also needs to distribute the authentication type and authentication key. Therefore, this embodiment of the invention also provides an MLAG node keep-alive method that further includes: The MLAG protocol message includes a first sequence number, a second sequence number, and an acknowledgment number. The first sequence number is accumulated by the MPU of the local MLAG device, the second sequence number is accumulated by the LPU of the local MLAG device, and the acknowledgment number is the first sequence number carried in the last MLAG protocol message sent by the peer MLAG device.
[0058] Step 405: Send the authentication type and authentication key to the LPU of the local MLAG device, so that after the local MLAG device's LPU modifies the keep-alive timeout in the MLAG protocol message to the keep-alive abnormal timeout, modifies the second sequence number in the MLAG protocol message to the local second sequence number on the LPU, calculates the authentication data based on the authentication type, authentication key and the entire content of the modified MLAG protocol message, updates the authentication data to the MLAG authentication header of the modified MLAG protocol message, and then sends the modified MLAG protocol message to the peer MLAG device.
[0059] In this process, when the MPU sends MLAG-related configurations to the LPU, it also sends the authentication type and authentication key. The authentication type represents the authentication algorithm used, and optional algorithms include HMAC-SHA256. The MPU can send the authentication configuration information, including the authentication type and authentication key, to the LPU via the inter-card communication channel. Upon receiving the authentication configuration message, the LPU will save it. The authentication configuration message can be in TLV format, for example, as shown below. Figure 5 As shown, the authentication configuration message has a type T=6, a length L=4 bytes + authentication key length, and a data field V including a 2-byte authentication type, a 2-byte authentication password length, and an authentication key.
[0060] In this step, the MLAG protocol message includes a first sequence number SEQ1, a second sequence number SEQ2, and an acknowledgment number ACK1, where ACK1 is equal to SEQ1 of the last received peer MLAG protocol message. When sending MLAG protocol messages, the MLAG process on the MPU always uses the locally stored first sequence number stored in the MPU to fill SEQ1, and SEQ2 is 0. The initial value of the locally stored first sequence number stored in the MPU is initialized to a random value when the MLAG protocol negotiation begins, and it is automatically incremented by 1 for each subsequent MLAG protocol message sent. The second sequence number field is allocated in the reserved space of the MLAG protocol header of the MLAG protocol message, such as... Figure 6As shown, the second sequence number SEQ2 allocates 4 bytes of space in the reserved space of the MLAG protocol header. Correspondingly, the reserved space of the MLAG protocol header is reduced by 4 bytes. When constructing the MLAG protocol message, the MPU first fills in all the contents of the authentication header of the MLAG protocol message except for the authentication data according to the authentication type, and initializes the authentication data to all zeros. Then, it calculates the authentication data based on the authentication type, authentication key, and all the contents of the MLAG protocol message, and updates the MLAG protocol message with the calculated authentication data.
[0061] For example, the following specific example will be used to illustrate in detail the complete implementation process of a node keep-alive method for an MLAG system provided by an embodiment of the present invention: When the MLAG process starts, the MPU of the local MLAG device initializes the program, loads the configuration, and calculates the keep-alive timeout T1, keep-alive message sending cycle T2, health check timeout T3, health notification sending cycle T4, keep-alive anomaly timeout T5, and graceful restart timeout T6 based on the configuration.
[0062] During the normal operation of the MLAG process, the MPU starts a health notification timer according to the health notification sending cycle T4, and periodically sends health notification messages to the LPU where the root port of the aggregation group corresponding to the Peer-Link aggregation group ID is located.
[0063] After negotiation with the peer MLAG device is completed and a stable state is reached, the MPU starts a keep-alive timer according to the keep-alive message sending cycle T2. It then periodically sends MLAG protocol keep-alive messages to the LPU located at the root port of the aggregation group corresponding to the Peer-Link aggregation group ID, according to the keep-alive message sending cycle T2. This enables the LPU to forward the MLAG protocol keep-alive messages to the peer MLAG device.
[0064] After the LPU starts up, if MLAG protocol authentication is not required, the MPU sends the Peer-Link aggregation group ID, health check timeout, keep-alive abnormal timeout, and keep-alive message sending cycle to the LPU of the local MLAG device. The health check timeout is less than the keep-alive timeout between the local MLAG device and the peer MLAG device. This keep-alive timeout is different from the keep-alive abnormal timeout.
[0065] After the LPU starts up, it receives the Peer-Link aggregation group ID from the MPU. Based on this ID, the LPU identifies itself as the LPU containing the root port of the aggregation group corresponding to that ID. The LPU then enables a keep-alive proxy, which starts the first timer based on the health check timeout. Upon receiving an MLAG protocol message from the MPU, the LPU caches and forwards the message. Upon receiving a health notification message, it updates the health status of the MLAG process and resets the first timer. The peer MLAG device, upon receiving the MLAG protocol message, updates its local MLAG protocol status and the keep-alive timer's timeout.
[0066] When the MLAG process of the local MLAG device restarts, the MPU switches between primary and backup, or the CPU is overloaded, the MPU will stop or be unable to send health notification messages and MLAG protocol messages. The LPU with keep-alive proxy enabled, after the first timer expires, considers the MLAG process to be in an abnormal state. It then copies a locally cached MLAG protocol message, modifies the keep-alive timeout in this MLAG protocol message to the keep-alive abnormal timeout time T5, and sends the modified MLAG protocol message to the peer MLAG device. Then, based on the keep-alive message sending cycle T2, a second timer is started. If a new MLAG protocol message is received before the second timer expires, the new MLAG protocol message is cached locally, the second timer is closed, the first timer is restarted, and a locally cached new MLAG protocol message is copied and sent to the peer MLAG device. If no new MLAG protocol message is received after the second timer expires, a locally cached new MLAG protocol message is copied, the keep-alive timeout in this new MLAG protocol message is modified to the keep-alive abnormal timeout time, and the modified new MLAG protocol message is sent to the peer MLAG device. When the peer MLAG device receives the modified MLAG protocol message sent by the LPU, it verifies the validity of the message and then uses the keep-alive exception timeout T5 in the modified MLAG protocol message to update the timeout of its local keep-alive timer.
[0067] If MLAG protocol authentication is required, the MPU of the local MLAG device sends the Peer-Link aggregation group ID, health check timeout, keep-alive anomaly timeout, keep-alive message sending cycle, authentication type, and authentication key to the LPU of the local MLAG device. The health check timeout is shorter than the keep-alive timeout between the local MLAG device and the peer MLAG device, and this keep-alive timeout is different from the keep-alive anomaly timeout.
[0068] During the normal operation of the MLAG process, the MPU starts a health notification timer according to the health notification sending cycle T4, and periodically sends health notification messages to the LPU where the root port of the aggregation group corresponding to the Peer-Link aggregation group ID is located.
[0069] After negotiation with the peer MLAG device is completed and a stable state is reached, the MPU of the local MLAG device fills SEQ1 of the MLAG protocol message with its local first sequence number SEQ1, fills ACK1 of the MLAG protocol message with SEQ1 of the last received peer MLAG protocol message, and fills SEQ2 into the reserved field of the MLAG protocol message. Then, it calculates authentication data based on the authentication type, authentication key, and the entire content of the MLAG protocol message, and updates the MLAG protocol message with the authentication data. Here, SEQ2 is 0. The initial value of the local first sequence number SEQ1 is initialized to a random value when the MLAG protocol negotiation begins, and is automatically incremented by 1 for each subsequent MLAG protocol message sent. The MPU of the local MLAG device then sends the MLAG protocol message to the LPU located at the root port of the aggregation group corresponding to the Peer-Link aggregation group ID, so that the LPU can forward the MLAG protocol message to the peer MLAG device.
[0070] After the local MLAG device's LPU starts, it identifies itself as the LPU containing the root port of the aggregation group corresponding to the Peer-Link aggregation group ID, based on the Peer-Link aggregation group ID issued by the local MLAG device's MPU. This LPU then enables keep-alive proxying and starts the first timer based on the health check timeout. Upon receiving MLAG protocol messages from the MPU, the LPU caches and forwards these messages. Upon receiving a health notification message, it updates the health status of the MLAG process and resets the first timer. The peer MLAG device, upon receiving the MLAG protocol message, updates its local MLAG protocol status and the keep-alive timer's timeout.
[0071] After receiving the authentication type and key from the MPU of the local MLAG device, the LPU of the local MLAG device saves the authentication type and key locally. Each time the local MLAG device's LPU receives an MLAG protocol message from the MPU of the local MLAG device, it automatically resets its local second sequence number to 1. Each time the local MLAG device's LPU retransmits an MLAG protocol message, the local second sequence number is automatically incremented by 1, for updating the sequence number in subsequent periodic MLAG protocol message transmissions.
[0072] When the MLAG process of the local MLAG device restarts, MPU master / slave switches, or the CPU becomes overloaded, the MPU of the local MLAG device will stop or be unable to send health notification messages and MLAG protocol messages. The LPU with keep-alive proxy enabled, after the first timer expires, considers the MLAG process abnormal. It then copies a locally cached MLAG protocol message, modifies the keep-alive timeout in the MLAG protocol message to the keep-alive abnormal timeout, modifies SEQ2 in the MLAG protocol message to the local second sequence number, calculates authentication data based on the authentication type, authentication key, and the entire content of the MLAG protocol message, updates the authentication data in the MLAG authentication header of the MLAG protocol message, and sends the modified MLAG protocol message to the peer MLAG device. A second timer is started according to the keep-alive message sending cycle T2. If a new MLAG protocol message is received before the second timer expires, the new MLAG protocol message is cached locally, the second timer is closed, the first timer is restarted, and a copy of the new MLAG protocol message is sent to the peer MLAG device. If no new MLAG protocol message is received after the second timer expires, a copy of the locally cached new MLAG protocol message is made. The keep-alive timeout in the new MLAG protocol message is modified to the keep-alive abnormal timeout timeout. SEQ2 in the new MLAG protocol message is modified to the local second serial number. Authentication data is calculated based on the authentication type, authentication key, and the entire content of the new MLAG protocol message. This authentication data is then updated in the MLAG authentication header of the new MLAG protocol message. Finally, the new MLAG protocol message is sent to the peer MLAG device. After successfully sending the new MLAG protocol message, the LPU automatically increments the local second serial number value by 1.
[0073] Upon receiving a new MLAG protocol message, the peer MLAG device verifies the MLAG authentication header if it recognizes that the message carries one. The MLAG process records SEQ1, SEQ2, and ACK1 of the previously received valid MLAG protocol message and assigns them to local global variables LastRcvSeq1, LastRcvSeq2, and LastRcvAck1, respectively. Therefore, the peer MLAG device's validation of the new MLAG protocol message includes: first, checking the sender's sequence number against SEQ1. The validity criteria are: if SEQ1 equals LastRcvSeq1 + 1, it is valid; or, if SEQ1 equals LastRcvSeq1, SEQ2 is greater than LastRcvSeq2, and |SEQ2 - LastRcvSeq2| < 16, it is valid; otherwise, it is invalid. Next, based on ACK1 in the MLAG protocol message, the validity of ACK1 is checked. The validity standard is: if the local first sequence number > ACK1 >= LastRcvAck1, it is considered valid; otherwise, it is invalid. Finally, based on the entire message content of the new MLAG protocol message, the locally stored authentication type, and the authentication key, the authentication data is recalculated using the same calculation method and compared with the authentication data in the authentication header. If the two match, it is valid. Otherwise, it is an invalid MLAG protocol message and is directly ignored and discarded. After the peer MLAG device successfully verifies and authenticates the new MLAG protocol message, it continues to process subsequent normal MLAG protocol messages.
[0074] After the MLAG process on the local MLAG device restarts or the MPU master / slave switch is completed, the MLAG process resends the health notification message and the MLAG protocol message. This MLAG protocol message also carries the GR flag to negotiate a graceful restart of the MLAG process, enabling a graceful restart in the event of MLAG process restart or MPU master / slave switch, thus avoiding disruption to the MLAG protocol and data forwarding services.
[0075] In scenarios where the CPU is busy and MLAG processes cannot be scheduled, the CPU will be freed up and MLAG processes will be rescheduled. There are two ways to handle this: Method 1: Inherit the original protocol state and continue sending MLAG protocol messages and health notification messages. During this process, simultaneously update the local keep-alive timer to prevent timeout exceptions.
[0076] Method 2: The original MLAG protocol state is reset. The MLAG process enters the graceful restart process without restarting, restarts the MLAG protocol negotiation, and carries the GR flag in the MLAG protocol message.
[0077] After the local MLAG device's LPU sends MLAG protocol messages to the peer MLAG device, the local MLAG device's LPU receives a new health notification message, updates its local MLAG process status, and resets the first timer. Upon receiving a new MLAG protocol message, the LPU closes its second timer, stops sending MLAG protocol messages, and caches the new MLAG protocol message locally. It then copies the new MLAG protocol message and forwards it to the peer MLAG device.
[0078] When the peer MLAG device receives the new MLAG protocol message, its handling varies depending on the abnormal situation: If the situation involves the MLAG process restarting, MPU master-slave switching, CPU overload, or MLAG protocol state reset, requiring the process to re-negotiate the MLAG protocol, then it enters the graceful restart process based on the MLAG protocol message type and GR flag. If the inability to send packets in a timely manner is due to CPU overload, then if it is determined that the received MLAG protocol message meets the requirements of the original MLAG protocol state, the previous MLAG protocol connection between the two ends is maintained, and data interaction and synchronization continue, with both ends of the device operating normally.
[0079] In this embodiment of the invention, there may be situations such as MLAG process failure and restart failure, MLAG module upgrade failure, MPU master-slave switch failure, or CPU abnormality and inability to recover. Therefore, after the LPU of the local MLAG device sends a certain number of MLAG protocol messages, it needs to stop sending the MLAG protocol messages to prevent the peer MLAG device from continuously updating the keep-alive timeout time and failing to trigger the normal MLAG device overall fault abnormality handling.
[0080] The present invention provides a method for keeping MLAG nodes alive. By establishing an MLAG process health check mechanism inside the MLAG device, the keep-alive detection cycle of the peer MLAG device is adjusted in the event of MLAG process failure or MPU master-slave switching on the local MLAG device. This avoids the two MLAG devices from entering unnecessary dual-master failure handling processes, reduces unnecessary network jitter, and improves the reliability of the MLAG system.
[0081] In scenarios such as MLAG process restart and MPU master-slave switching on the local MLAG device, a keep-alive agent combined with a GR (graceful restart) mechanism can be established inside the MLAG device. After restarting, the new MLAG process detects the startup type and confirms that it is a scenario such as MLAG process restart or MPU active switching. It then enters GR processing locally and notifies the peer MLAG device to enter GR processing through MLAG protocol messages, thus completing a smooth restart of MLAG, avoiding business traffic fluctuations, and improving the robustness of the MLAG system.
[0082] In the case of a persistently high CPU utilization anomaly, after the CPU utilization decreases, the MLAG process resumes scheduling and resends MLAG protocol messages. The LPU will stop sending packets for the keep-alive agent and resume the normal processing flow, thus avoiding scheduling problems caused by the persistently high CPU utilization anomaly that could trigger the MLAG devices at both ends to enter the anomaly handling process.
[0083] The above detailed description primarily uses the internal structure of a distributed device as an example. The method of this embodiment is also applicable to box devices. Given the differences in physical components between box devices and distributed devices, the MPU and LPU of a box device reside on the same hardware board and within the same operating system, operating as logical components. In a box device, the priority of the keep-alive proxy thread or keep-alive proxy process can be set to the highest priority (or real-time priority) to ensure that its scheduling is not affected by other high-priority processes or threads. The specific implementation process of the keep-alive proxy thread or keep-alive proxy process in the above embodiment will not be elaborated here.
[0084] In one possible implementation, the MLAG node keep-alive method provided in this embodiment of the invention can specifically add a proxy module to the LPU of the MLAG device, for example, such as... Figure 7 As shown, an MLAG device includes one MPU and three LPUs: LPU1, LPU2, and LPU3. LPU1 and LPU2 are added to the Peer-Link LAG. The link aggregation group of LPU1 and LPU2 carries Peer-Link services. LPU2's port includes the root port of this link aggregation group. The MLAG proxy on LPU2 is active. The MLAG proxy on LPU2 receives MLAG protocol messages from the MPU, caches the MLAG protocol packets within these messages, and copies the MLAG protocol packets for forwarding to the peer MLAG device. LPU2's local message transmission and reception receives other packets sent by the MPU and sends the received MLAG protocol packets and other packets back to the MPU. In this example, LPU1 and LPU3 may also include MLAG proxies (not shown in the figure), in which case the MLAG proxies on LPU1 and LPU3 are not active. LPU1's local message transmission and reception receives other packets sent by the MPU and sends the received other packets back to the MPU. The LPU3 receives Keepalive messages sent by the MPU in its local message transmission and reception, and then sends the received Keepalive messages back to the MPU.
[0085] This invention provides a method for keeping MLAG nodes alive. By establishing an independent keep-alive proxy and a health check mechanism for the MLAG process within the MLAG device, the keep-alive proxy senses the status of the MLAG master process. In the event of a MLAG process failure, it adjusts the keep-alive detection cycle of the peer MLAG device, changing the fast cycle to a slow cycle. This avoids the two MLAG devices from entering unnecessary dual-master failure handling processes, reduces unnecessary network jitter, and improves the reliability of the MLAG system.
[0086] This invention provides an MLAG node keep-alive device applied to the LPU of a local MLAG device. The local MLAG device also includes an MPU. The LPU of the local MLAG device is connected to the LPU of the peer MLAG device via a Peer-Link link. Figure 8 As shown, the device includes: The receiving module 801 is used to receive the Peer-Link aggregation group ID, health check timeout time and keep-alive abnormal timeout time sent by the MPU of the local MLAG device; the health check timeout time is less than the keep-alive timeout time between the local MLAG device and the peer MLAG device.
[0087] The proxy module 802 is used to determine the root port of the aggregation group corresponding to the Peer-Link aggregation group ID on this LPU based on the Peer-Link aggregation group ID, and then enable the keep-alive proxy.
[0088] The proxy module 802 is also used to start a first timer based on the health check timeout time. If a health notification message carrying its own MLAG process status information is received from the MPU of the local MLAG device before the first timer expires, the first timer is reset. If no health notification message is received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout time sent by the MPU of the local MLAG device is copied, and the keep-alive timeout time in the MLAG protocol message is modified to the keep-alive abnormal timeout time. The modified MLAG protocol message is then sent to the peer MLAG device.
[0089] The proxy module 802 is also used to start a second timer based on the keep-alive message sending cycle between the local MLAG device and the peer MLAG device issued by the MPU of the local MLAG device. If a new MLAG protocol message is received from the MPU of the local MLAG device before the second timer expires, the new MLAG protocol message is cached locally, a copy of the new MLAG protocol message is sent to the peer MLAG device, and the second timer is closed. If no new MLAG protocol message is received after the second timer expires, a copy of the locally cached new MLAG protocol message is copied, the keep-alive timeout time in the new MLAG protocol message is modified to the keep-alive abnormal timeout time, and the modified new MLAG protocol message is sent to the peer MLAG device.
[0090] In one possible implementation, the MLAG protocol message includes a first sequence number, a second sequence number, and an acknowledgment number. The first sequence number is accumulated by the MPU of the local MLAG device, the second sequence number is accumulated by the LPU of the local MLAG device, and the acknowledgment number is the first sequence number carried in the last MLAG protocol message sent by the peer MLAG device.
[0091] The receiving module 801 is also used to receive the authentication type and authentication key issued by the MPU of the local MLAG device.
[0092] The proxy module 802 is also used to modify the second serial number in the MLAG protocol message to the local second serial number on this LPU, calculate the authentication data based on the authentication type, authentication key and the entire content of the modified MLAG protocol message, update the authentication data into the MLAG authentication header of the modified MLAG protocol message, and then send the modified MLAG protocol message to the peer MLAG device.
[0093] This invention provides an MLAG node keep-alive device, applied to the MPU in a local MLAG device. The local MLAG device also includes an LPU, which is connected to the LPU of the peer MLAG device via a Peer-Link link. Figure 9 As shown, the device includes: Configuration module 901 is used to send the Peer-Link aggregation group ID to the LPU of the local MLAG device, so that the LPU of the local MLAG device can determine the root port of the aggregation group corresponding to the Peer-Link aggregation group ID on the local LPU, and then enable the keep-alive agent. Configuration module 901 is used to send health check timeout time and keep-alive abnormal timeout time to the LPU with keep-alive agent enabled, so that the LPU with keep-alive agent enabled starts a first timer based on the health check timeout time. If a health notification message carrying its own MLAG process status information is received from the MPU of the local MLAG device before the first timer expires, the first timer is reset; if no health notification message is received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout time sent by the MPU of the local MLAG device is copied, and the keep-alive timeout time in the MLAG protocol message is modified to the keep-alive abnormal timeout time. The modified MLAG protocol message is then sent to the peer MLAG device. The health check timeout time is less than the keep-alive timeout time between the local MLAG device and the peer MLAG device. The sending module 902 is used to send a health notification message carrying its own MLAG process status information to the LPU that has enabled the keep-alive agent according to the health notification sending cycle, wherein the health notification sending cycle is less than the health check timeout time.
[0094] The sending module 902 is also used to send an MLAG protocol message carrying the keep-alive timeout between the local MLAG device and the peer MLAG device to the LPU of the local MLAG device.
[0095] In one possible implementation, the MLAG protocol message includes a first sequence number, a second sequence number, and an acknowledgment number. The first sequence number is accumulated by the MPU of the local MLAG device, the second sequence number is accumulated by the LPU of the local MLAG device, and the acknowledgment number is the first sequence number carried in the last MLAG protocol message sent by the peer MLAG device.
[0096] The configuration module 901 is also used to send the authentication type and authentication key to the LPU of the local MLAG device, so that after the LPU with the keep-alive proxy enabled modifies the keep-alive timeout time in the MLAG protocol message to the keep-alive abnormal timeout time, modifies the second sequence number in the MLAG protocol message to the local second sequence number on the local LPU, calculates the authentication data based on the authentication type, authentication key and the entire content of the modified MLAG protocol message, updates the authentication data to the MLAG authentication header of the modified MLAG protocol message, and then sends the modified MLAG protocol message to the peer MLAG device.
[0097] The present invention provides an MLAG node keep-alive device that establishes an MLAG process health check mechanism within the MLAG device. In the event of MLAG process failure or MPU master-slave switching on the local MLAG device, the keep-alive detection cycle of the remote MLAG device is adjusted to avoid the two MLAG devices from entering unnecessary dual-master failure handling processes, thereby reducing unnecessary network jitter and improving the reliability of the MLAG system.
[0098] This invention provides a service card for executing the MLAG node keep-alive method applied to the service card as described in the above embodiments.
[0099] This invention provides a master control card for executing the MLAG node keep-alive method applied to MPU as described in the above embodiments.
[0100] This invention provides an MLAG system comprising two MLAG devices connected via a Peer-Link link. Each MLAG device includes a master control card and at least one service card. The master control card is used to execute the MLAG node keep-alive method applied to the MPU as described in the above embodiments, and the service card is used to execute the MLAG node keep-alive method applied to the LPU as described in the above embodiments.
[0101] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the MLAG node keep-alive method disclosed in the above embodiments. The computer-readable storage medium can be an electronic storage device such as flash memory, EEPROM (Electric Erasable Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), RAM (Random Access Memory), ROM (Read-Only Memory), magnetic disks, or optical disks, etc., capable of storing program code. Optionally, the computer-readable storage medium includes a non-volatile computer-readable storage medium. The computer-readable storage medium has storage space for program code that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code can be compressed, for example, in a suitable form.
[0102] This invention also provides a computer program product that, when executed by a processor, implements an MLAG node keep-alive method disclosed in the above embodiments.
[0103] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for keeping MLAG nodes alive, characterized in that, The method includes a service card LPU applied to a local cross-device link aggregation group MLAG device, wherein the local MLAG device also includes a master control card MPU, and the LPU of the local MLAG device is connected to the LPU of the peer MLAG device via a Peer-Link link. Receive the Peer-Link aggregation group ID, health check timeout time, and keep-alive anomaly timeout time sent by the MPU; the health check timeout time is less than the keep-alive timeout time between the local MLAG device and the peer MLAG device. If the root port of the aggregation group corresponding to the Peer-Link aggregation group ID is determined to be on this LPU based on the Peer-Link aggregation group ID, then the keep-alive proxy is enabled. A first timer is started based on the health check timeout period. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, the first timer is reset. If the health notification message is not received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout period sent by the MPU is copied, and the keep-alive timeout period in the MLAG protocol message is modified to the keep-alive abnormal timeout period. The modified MLAG protocol message is then sent to the peer MLAG device.
2. The method according to claim 1, characterized in that, After the step of sending the modified MLAG protocol message to the peer MLAG device, the method further includes: A second timer is started based on the keep-alive message transmission cycle between the local MLAG device and the peer MLAG device issued by the MPU. If a new MLAG protocol message sent by the MPU is received before the second timer expires, the new MLAG protocol message is cached locally, a copy of the new MLAG protocol message is sent to the peer MLAG device, and the second timer is closed. If no new MLAG protocol message is received after the second timer expires, a copy of the locally cached new MLAG protocol message is copied, the keep-alive timeout time in the new MLAG protocol message is modified to the keep-alive abnormal timeout time, and the modified new MLAG protocol message is sent to the peer MLAG device.
3. The method according to claim 1 or 2, characterized in that, The method further includes: the MLAG protocol message includes a first sequence number, a second sequence number and an acknowledgment number, the first sequence number is accumulated by the MPU, the second sequence number is accumulated by the LPU of the local MLAG device, and the acknowledgment number is the first sequence number carried in the last received MLAG protocol message sent by the peer MLAG device; Receive the authentication type and authentication key issued by the MPU; After the step of modifying the keep-alive timeout in the MLAG protocol message to the keep-alive abnormal timeout, the method further includes: After modifying the second sequence number in the MLAG protocol message to the local second sequence number on this LPU, the authentication data is calculated based on the authentication type, the authentication key, and the entire content of the modified MLAG protocol message. The authentication data is then updated into the MLAG authentication header of the modified MLAG protocol message, and the modified MLAG protocol message is sent to the peer MLAG device.
4. A method for keeping MLAG nodes alive, characterized in that, The method includes: a master control unit (MPU) applied in a local cross-device link aggregation group (MLAG) device, wherein the local MLAG device also includes a service unit (LPU), and the LPU of the local MLAG device is connected to the LPU of the peer MLAG device via a Peer-Link link. The Peer-Link aggregation group ID is sent to the LPU of the local MLAG device so that the LPU of the local MLAG device can determine the root port of the aggregation group corresponding to the Peer-Link aggregation group ID on the local LPU, and then the keep-alive proxy is enabled. A health check timeout and a keep-alive anomaly timeout are sent to the LPU with the keep-alive agent enabled, so that the LPU with the keep-alive agent enabled starts a first timer based on the health check timeout. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, the first timer is reset. If the health notification message is not received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout is copied, and the keep-alive timeout in the MLAG protocol message is modified to the keep-alive anomaly timeout. The modified MLAG protocol message is then sent to the peer MLAG device. The health check timeout is less than the keep-alive timeout between the local MLAG device and the peer MLAG device. A health notification message carrying its own MLAG process status information is sent to the LPU with the keep-alive agent enabled, according to the health notification sending cycle, wherein the health notification sending cycle is less than the health check timeout time.
5. The method according to claim 4, characterized in that, The method further includes: Send an MLAG protocol message carrying the keep-alive timeout between the local MLAG device and the peer MLAG device to the LPU of the local MLAG device.
6. The method according to claim 4 or 5, characterized in that, The method includes: The MLAG protocol message includes a first sequence number, a second sequence number, and an acknowledgment number. The first sequence number is accumulated by the MPU, the second sequence number is accumulated by the LPU of the local MLAG device, and the acknowledgment number is the first sequence number carried in the last MLAG protocol message sent by the peer MLAG device. The authentication type and authentication key are issued to the LPU of the local MLAG device so that the LPU with the keep-alive proxy enabled, after modifying the keep-alive timeout time in the MLAG protocol message to the keep-alive abnormal timeout time, and after modifying the second sequence number in the MLAG protocol message to the local second sequence number on the local LPU, calculates authentication data based on the authentication type, the authentication key and the entire content of the modified MLAG protocol message, updates the authentication data in the MLAG authentication header of the modified MLAG protocol message, and then sends the modified MLAG protocol message to the peer MLAG device.
7. A MLAG node keep-alive device, characterized in that, A service card LPU is applied in a local cross-device link aggregation group MLAG device, wherein the local MLAG device also includes a master control card MPU, and the LPU of the local MLAG device is connected to the LPU of the peer MLAG device via a Peer-Link link. The device includes: The receiving module is used to receive the Peer-Link aggregation group ID, health check timeout time, and keep-alive anomaly timeout time sent by the MPU; the health check timeout time is less than the keep-alive timeout time between the local MLAG device and the peer MLAG device; The proxy module is used to determine the root port of the aggregation group corresponding to the Peer-Link aggregation group ID on this LPU based on the Peer-Link aggregation group ID, and then enable the keep-alive proxy. The proxy module is further configured to start a first timer based on the health check timeout time. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, the first timer is reset. If the health notification message is not received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout time sent by the MPU is copied, and the keep-alive timeout time in the MLAG protocol message is modified to the keep-alive abnormal timeout time. The modified MLAG protocol message is then sent to the peer MLAG device.
8. A MLAG node keep-alive device, characterized in that, A master control unit (MPU) is used in a local cross-device link aggregation (MLAG) device. The local MLAG device also includes a service unit (LPU). The LPU of the local MLAG device is connected to the LPU of the peer MLAG device via a Peer-Link link. The device includes: The configuration module is used to issue the Peer-Link aggregation group ID to the LPU of the local MLAG device, so that the LPU of the local MLAG device can determine the root port of the aggregation group corresponding to the Peer-Link aggregation group ID on the local LPU, and then enable the keep-alive proxy. The configuration module is further configured to send a health check timeout and a keep-alive abnormal timeout to the LPU with the keep-alive agent enabled, so that the LPU with the keep-alive agent enabled starts a first timer based on the health check timeout. If a health notification message carrying its own MLAG process status information is received from the MPU before the first timer expires, the first timer is reset. If the health notification message is not received after the first timer expires, a copy of the locally cached MLAG protocol message carrying the keep-alive timeout sent by the MPU is copied, and the keep-alive timeout in the MLAG protocol message is modified to the keep-alive abnormal timeout. The modified MLAG protocol message is then sent to the peer MLAG device. The health check timeout is less than the keep-alive timeout between the local MLAG device and the peer MLAG device. The sending module is used to send a health notification message carrying its own MLAG process status information to the LPU with the keep-alive agent enabled, according to the health notification sending cycle, wherein the health notification sending cycle is less than the health check timeout time.
9. A service card, characterized in that, The service card is used to execute the MLAG node keep-alive method as described in any one of claims 1-3.
10. A master control card, characterized in that, The main control card is used to execute the MLAG node keep-alive method as described in any one of claims 4-6.
11. An MLAG system, characterized in that, The MLAG system includes two MLAG devices connected by a Peer-Link link. Each MLAG device includes a master control card and at least one service card. The master control card is used to execute the MLAG node keep-alive method as described in any one of claims 4-6, and the at least one service card is used to execute the MLAG node keep-alive method as described in any one of claims 1-3.