Communication method, system and apparatus, network device, and target device

By using Spanning Tree Protocol (STP) messages carrying path cost values ​​in the MLAG system to determine changes in network device interface status, the problem of MLAG interface oscillation caused by peer-link and keepalive link failures is resolved, ensuring stable forwarding of network traffic.

WO2025241105A1PCT designated stage Publication Date: 2025-11-27NEW H3C TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/094652
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2025-11-27

AI Technical Summary

Technical Problem

In an MLAG system, when the peer-link or keepalive link fails, network devices may mistakenly enter independent mode, causing MLAG interface oscillations and affecting network traffic forwarding.

Method used

By receiving and sending Spanning Tree Protocol (STP) messages carrying path cost values, the MLAG system is maintained using hash principles to determine interface state changes and avoid directly entering a split state.

Benefits of technology

It effectively avoids MLAG interface oscillations, ensures normal network traffic forwarding, and prevents unnecessary changes in MAC addresses and LACP system priorities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024094652_27112025_PF_FP_ABST
    Figure CN2024094652_27112025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of communications, and provide a communication method, system and apparatus, a network device, and a target device, the communication method being applied to any network device among a plurality of network devices forming an MLAG system. The method comprises: receiving an STP packet carrying a path overhead value and sent by a target device, wherein the path overhead value is used for indicating the number of interfaces in a normal state among a plurality of interfaces; and if a keepalive link and a peer-link that have been established among a plurality of network devices are both disconnected and it is determined that a first path overhead value is different from a second path overhead value, maintaining an MLAG system. Use of the embodiments of the present application can ensure normal forwarding of network traffic.
Need to check novelty before this filing date? Find Prior Art

Description

A communication method, system, apparatus, network device, and target device TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, and particularly relates to a communication method, system, apparatus, network device, and target device. BACKGROUND

[0002] MLAG (Multichassis Link Aggregation Group) is a mechanism for realizing cross-device link aggregation, which can logically virtualize multiple network devices into one network device to form a unified Layer 2 logical node. It is equivalent to forwarding traffic as one network device, thereby improving link reliability from a single board level to a device level.

[0003] Referring to FIG. 1, it is a MLAG scenario diagram provided in the related art. As shown in the following figure, network device A and network device B are neighbors, forming a MLAG system, and the network devices in the MLAG system can also be referred to as MLAG devices. Network device A is a master device, and network device B is a slave device. The MAC (Media Access Control Address) addresses of network device A and network device B are configured as the same MAC address, and the LACP (Link Aggregation Control Protocol) priority is configured as the same LACP system priority, thereby being virtually formed as one network device to form load sharing and jointly forward traffic. The MLAG system shown in the figure contains only two network devices, which is only an example, and the number of network devices in the MLAG system is not limited.

[0004] Network device C is connected to network device A and network device B respectively. Network device C is connected to a user device, and network device A and network device B are connected to an IP (Internet Protocol) network respectively.

[0005] The interface roles defined by the MLAG for each network device (i.e., network device A and network device B) include: an MLAG interface, a peer-link (Intra-Portal, internal control link) interface, and a keepalive interface. The MLAG interface is a layer 2 aggregation interface of the network device connected to an external device. In FIG. 1, the interfaces of network device A and network device B connected to network device C and an IP network are MLAG interfaces. The MLAG interfaces connected to the same aggregation group on an external device belong to the same MLAG group. In FIG. 1, the MLAG interface 1 on network device A and the MLAG interface 2 on network device B belong to the same MLAG group.

[0006] In addition, the peer-link interface is used to connect a peer network device to implement internal control. Each network device in the MLAG system has only one peer-link interface. The link between the peer-link interfaces of the network devices is a peer-link link, and the network devices exchange protocol packets and transmit data traffic through the peer-link link. There is only one peer-link link in each MLAG system.

[0007] The network devices exchange keepalive packets through the keepalive link to detect the state of the neighbor, that is, the double master detection in the case of peer-link link failure is performed by exchanging keepalive packets.

[0008] When the MLAG system is normally running, network device C can forward traffic to network device A or network device B to achieve network communication. When a network device in the MLAG system fails, the traffic can be quickly switched to another network device to ensure normal operation of the service, that is, the link reliability is improved to the device level.

[0009] In the related art, if the peer-link link and the keepalive link between the network devices fail, the MLAG system is split. In order to avoid the network devices acting as master devices to forward traffic after the MLAG system is classified, it is necessary to configure each network device to enter an independent mode and start independent work. When the independent mode is configured, the MAC address of each network device will change. During the configuration of the MAC address change, the network device cannot forward traffic during the process of relearning the table item, resulting in oscillation of the MLAG interface.

[0010] Especially in the case that a network device enters a shutdown state due to a fault or a restart, the peer-link link and the keepalive link between network devices are disconnected due to the overall shutdown of the network device, and other network devices are misjudged to enter the independent mode. In this process, all network devices cannot perform traffic forwarding, which causes unnecessary oscillation of the MLAG interface and affects network traffic forwarding.

[0011] SUMMARY

[0012] Embodiments of the present application aim to provide a communication method, system, device, network device and target device, which ensure that part of network devices in an MLAG system enter a shutdown state without affecting network traffic forwarding. The specific technical solutions are as follows:

[0013] In a first aspect, embodiments of the present application provide a communication method applied to any network device in a multi-chassis link aggregation group (MLAG) system, and the method comprises the following steps.

[0014] receiving a spanning tree protocol (STP) packet carrying a path cost value sent by a target device, wherein the target device comprises a plurality of interfaces, each interface is used to access a network device in the MLAG system, and the path cost value is used to indicate the number of interfaces in a normal state in the plurality of interfaces.

[0015] If the keepalive link and the internal control peer-link link established between the plurality of network devices are disconnected, and it is determined that the first path cost value is different from the second path cost value, maintaining the MLAG system, wherein the first path cost value is a path cost value carried in an STP packet received before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in an STP packet received after the keepalive link and the peer-link link are disconnected.

[0016] In a second aspect, embodiments of the present application provide a communication method applied to a target device accessing a multi-chassis link aggregation group (MLAG) system, wherein the MLAG system is composed of a plurality of network devices, the target device comprises a plurality of interfaces, each interface is used to access a network device in the MLAG system, and the method comprises the following steps.

[0017] sending a first spanning tree protocol (STP) packet to the network devices in the MLAG system based on a hash principle, wherein the first STP packet comprises a first path cost value.

[0018] sending a second STP message to a network device in the MLAG system based on the hash principle, the second STP message comprising a second path cost value, so that any network device in the MLAG system maintains the MLAG system in a case that the keepalive link and the peer-link link established between the plurality of network devices are both disconnected, and the first path cost value is different from the second path cost value.

[0019] The first path cost value is a path cost value carried in a STP message received by the network device before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in a STP message received by the network device after the keepalive link and the peer-link link are disconnected.

[0020] In a third aspect, an embodiment of the present application provides a communication system, the system comprising a plurality of network devices constituting a Multi-Chassis Aggregation Group (MLAG) system, and a target device accessing the MLAG system, the target device comprising a plurality of interfaces, each interface being configured to access one network device in the MLAG system.

[0021] Any network device in the plurality of network devices is configured to implement the method steps in any of the first aspect.

[0022] The target device is configured to implement the method steps in any of the second aspect.

[0023] In a fourth aspect, an embodiment of the present application provides a network device, the network device being any network device in a plurality of network devices constituting a Multi-Chassis Aggregation Group (MLAG) system, the network device comprising:

[0024] a processor;

[0025] a transceiver;

[0026] a machine readable storage medium storing machine executable instructions executable by the processor; the machine executable instructions causing the processor to perform the following steps:

[0027] receiving a Spanning Tree Protocol (STP) message carrying a path cost value sent by a target device, wherein the target device comprises a plurality of interfaces, each interface being configured to access one network device in the MLAG system, and the path cost value is used to indicate a number of interfaces in a normal state in the plurality of interfaces.

[0028] If the keepalive link and the peer-link link between the network devices are disconnected, and it is determined that the first path cost value and the second path cost value are different, the MLAG system is maintained, wherein the first path cost value is a path cost value carried in a STP message received before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in a STP message received after the keepalive link and the peer-link link are disconnected.

[0029] In a fifth aspect, an embodiment of the present application provides a target device, which accesses a multi-chassis aggregation group (MLAG) system, the MLAG system being composed of a plurality of network devices, the target device comprising a plurality of interfaces, each interface being configured to access one network device in the MLAG system, and the target device comprising:

[0030] a processor;

[0031] a transceiver;

[0032] a machine readable storage medium storing machine executable instructions executable by the processor, the machine executable instructions causing the processor to perform the following steps:

[0033] sending a first spanning tree protocol (STP) message to the network devices in the MLAG system based on a hash principle, the first STP message comprising a first path cost value;

[0034] sending a second STP message to the network devices in the MLAG system based on the hash principle, the second STP message comprising a second path cost value, so that any network device in the MLAG system maintains the MLAG system in a case where the keepalive link and the peer-link link between the network devices are disconnected, and the first path cost value and the second path cost value are different;

[0035] wherein the first path cost value is a path cost value carried in a STP message received by the network device before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in a STP message received by the network device after the keepalive link and the peer-link link are disconnected.

[0036] In a sixth aspect, an embodiment of the present application provides a communication apparatus, which is applied to any network device in a multi-chassis aggregation group (MLAG) system, and the apparatus comprises:

[0037] The STP message receiving module is configured to receive a spanning tree protocol (STP) message carrying a path cost value sent by a target device, wherein the target device comprises a plurality of interfaces, each of which is configured to access one network device in the MLAG system, and the path cost value is used to indicate the number of interfaces in normal state in the plurality of interfaces.

[0038] The system maintaining module is configured to maintain the MLAG system if the keepalive link and the peer-link link between the plurality of network devices are disconnected and the first path cost value is different from the second path cost value, wherein the first path cost value is the path cost value carried in the STP message received before the keepalive link and the peer-link link are disconnected, and the second path cost value is the path cost value carried in the STP message received after the keepalive link and the peer-link link are disconnected.

[0039] In a seventh aspect, an embodiment of the present application provides a communication device applied to a target device accessing a multi-chassis link aggregation group (MLAG) system, wherein the MLAG system is composed of a plurality of network devices, the target device comprises a plurality of interfaces, each of which is configured to access one network device in the MLAG system, and the device comprises:

[0040] The first STP message sending module is configured to send a first spanning tree protocol (STP) message to the network devices in the MLAG system based on a hash principle, wherein the first STP message comprises a first path cost value.

[0041] The second STP message sending module is configured to send a second STP message carrying a path cost value to the network devices in the MLAG system based on the hash principle, wherein the second STP message comprises a second path cost value, so that any network device in the MLAG system maintains the MLAG system if the keepalive link and the peer-link link between the plurality of network devices are disconnected and the first path cost value is different from the second path cost value.

[0042] The first path cost value is the path cost value carried in the STP message received by the network device before the keepalive link and the peer-link link are disconnected, and the second path cost value is the path cost value carried in the STP message received by the network device after the keepalive link and the peer-link link are disconnected.

[0043] In an eighth aspect, the embodiments of the present application provide a machine readable storage medium storing machine executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method of any one of the first aspect or the second aspect.

[0044] In a ninth aspect, a computer program product causes a processor to implement the method of any one of the first aspect or the second aspect.

[0045] The embodiments of the present application have the following beneficial effects: In the communication method provided by the embodiments of the present application, when any one of the plurality of network devices in the MLAG system determines that both the keepalive link and the peer-link link established between the plurality of network devices are disconnected, the MLAG system does not directly enter the split state. Instead, the network device determines whether the path cost value carried in the STP packet sent by the target device changes. If other network devices other than the network device restart or malfunction, the other network devices do not work normally. In this case, all interfaces of the other network devices are in a closed state, which causes the channel between the other network devices and the target device to be disconnected, and the interface on the target device connected to the other network devices also becomes a closed state. In this case, the number of interfaces on the target device in a normal state changes, and the path cost value carried in the STP packet sent by the target device also changes. If the network device determines that the first path cost value and the second path cost value are different, it can be determined that all interfaces of the other network devices are closed, and the other network devices are not currently working normally.

[0046] In this case, the network device does not directly enter the split state of the MLAG system due to the disconnection of the links between the plurality of network devices. Instead, it further determines whether the first path cost value and the second path cost value carried in the STP packet are the same. In the case where the first path cost value and the second path cost value are different, i.e., the other network devices are not currently working normally, the MLAG system is maintained, and the current MAC address and priority of the device are continued to be maintained for traffic forwarding. Thus, the MLAG interface of the MAC address and priority changing device is prevented from oscillating, and the forwarding of network traffic is prevented from being affected. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can also obtain other embodiments according to these drawings without creative labor.

[0048] FIG. 1 is a schematic diagram of an MLAG scenario provided in the related art;

[0049] FIG. 2 is a schematic diagram of a structure of a communication system provided in an embodiment of the present application;

[0050] FIG. 3 is a schematic diagram of a first application scenario provided in an embodiment of the present application;

[0051] FIG. 4 is a schematic diagram of a second application scenario provided in an embodiment of the present application;

[0052] FIG. 5 is a schematic diagram of a flow of a first communication method provided in an embodiment of the present application;

[0053] FIG. 6 is a schematic diagram of a third application scenario provided in an embodiment of the present application;

[0054] FIG. 7 is a schematic diagram of a flow of a second communication method provided in an embodiment of the present application;

[0055] FIG. 8 is a schematic diagram of a structure of a network device provided in an embodiment of the present application;

[0056] FIG. 9 is a schematic diagram of a structure of a target device provided in an embodiment of the present application;

[0057] FIG. 10 is a schematic diagram of a structure of a first communication apparatus provided in an embodiment of the present application;

[0058] FIG. 11 is a schematic diagram of a structure of a second communication apparatus provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0060] In the related art, for Layer 2, the MLAG technology can be understood as a horizontal virtualization technology, which logically virtualizes multiple network devices into one device to form a unified Layer 2 logical node. The MLAG technology provides a loop-free Layer 2 topology and simultaneously implements redundant backup, and no longer needs complicated Spanning Tree Protocol configuration, greatly simplifying networking and configuration.

[0061] When the peer-link link and the keepalive link between the network devices are both in a DOWN (off) state, the MLAG system enters a split state, and the following ways (one)-(two) are currently used to manage the split of the MLAG system.

[0062] Method (one) MAD (Multi-Active Detection) DOWN holding function.

[0063] In the case of peer-link link failure and keepalive link normal working, the master device works normally, and the slave device will automatically close other interfaces on the slave device except for the IRF (Intelligent Resilient Framework) reserved interface and the MLAG reserved interface. The closed interfaces are configured as MLAG MAD DOWN state.

[0064] In this case, if the keepalive link also fails, the interfaces on the slave device configured as MLAG MAD DOWN state will be upgraded to the master device. In this case, the network devices can all work as master devices to forward traffic, causing network failure. In order to avoid the above situation, the MLAG MAD DOWN holding function can be started, that is, the interfaces on the slave device are continuously in the MLAG MAD DOWN state and do not participate in traffic forwarding.

[0065] But method (one) is only applicable to the scenario of peer-link link failure first and keepalive link failure later. If the keepalive link fails first and the peer-link link fails later, this mechanism cannot work.

[0066] Method (two) network device independent mode.

[0067] When the MLAG system is split, in order to avoid the network devices in the MLAG system all forwarding traffic as master devices, the network devices need to be configured to work independently. When the peer-link link and the keepalive link are both in the DOWN state, the slave device will immediately or after a period of time start switching to the independent mode.

[0068] After the slave device switches to the independent mode, the MLAG system parameters carried in the LACP packet sent by the aggregation interface are restored to the original MAC address and LACP system priority of the interface, that is, the interface is restored to the state before being configured as an interface in the MLAG system. Thus, the MAC addresses and LACP system priorities of the aggregation interfaces in the same MLAG system are inconsistent. In this way, the two network devices start to work independently, and only the member port of one aggregation interface can be selected when forwarding traffic. By forwarding service traffic through the selected device, traffic forwarding abnormalities can be avoided.

[0069] But although mode (two) is suitable for the scene that mode (one) is not suitable for, when adopting mode (two) to carry out MLAG system split management, if one network device enters the closed state due to failure or restart, other network devices will misjudge to enter the independent mode, so that the MLAG system splits. During the MLAG system enters the split configuration, all network devices cannot carry out traffic forwarding, which will cause unnecessary oscillation of the MLAG interface, and affect network traffic forwarding.

[0070] In order to solve the above problems, the embodiment of the application provides a communication method, system, device, network device and target device.

[0071] Referring to FIG. 2, it is a structural schematic diagram of a communication system provided by the embodiment of the application. The system includes a plurality of network devices 201 constituting an MLAG system 20, and a target device 202 accessing the MLAG system 20. The target device 202 includes a plurality of interfaces, each of which is used to access one network device 201 in the MLAG system 20.

[0072] Referring to FIG. 3, it is a schematic diagram of a first application scenario provided by the embodiment of the application.

[0073] This scenario includes network device A1, network device A2, network device A3, network device A4 and network device A5. The network device A1 and the network device A2 constitute an MLAG system, and correspond to the network device 201 in FIG. 2. The dashed line between the network device A1 and the network device A2 represents a keepalive link. The solid line between the network device A1 and the network device A2 represents a peer-link link. The network device A1 and the network device A2 are connected through MLAG interfaces with the network device A3 and the network device A4 respectively. The network device A3 and the network device A4 correspond to the target device 202 in FIG. 2. For example, the data transmission rate of the MLAG interface is gigabit level.

[0074] The network device A1-network device A4 starts STP (Spanning Tree Protocol).

[0075] The network device A1 and the network device A5 are connected through a three-layer port ECMP (Equal-Cost Multipath Routing).

[0076] In this scenario, each network device is in a normal state, so each interface is also in a normal state.

[0077] On the basis of the application scenario shown in FIG. 3, if the network device A1 restarts, the application scenario changes. In this case, referring to FIG. 4, a second application scenario diagram provided by the embodiment of the present application is shown.

[0078] During the process of restarting the network device A1, the network device A1 is closed, and therefore all the links connected to the network device A1 are in a closed state, which is indicated by an "X" in the figure. In addition, the other parts of the application scenario shown in FIG. 4 are the same as those in FIG. 3, and are not described herein again.

[0079] It should be noted that the number of network devices and the number of target devices in the MLAG system shown in FIG. 3 and FIG. 4 are only an example, and the number of both the embodiments of the present application is not limited to this.

[0080] Based on the application scenarios shown in FIG. 3 and FIG. 4, referring to FIG. 5, a flow diagram of a first communication method provided by the embodiment of the present application is shown, which is applied to any network device in the plurality of network devices of the MLAG system, and the method includes the following steps S501-S502.

[0081] Step S501: receiving an STP packet carrying a path cost value sent by a target device.

[0082] The target device includes a plurality of interfaces, each of which is used to access a network device in the MLAG system, and the path cost value is used to indicate the number of interfaces in a normal state in the plurality of interfaces.

[0083] Taking the scenario shown in FIG. 3 as an example, all the interfaces in the figure are in a normal state. In this case, the number of interfaces in a normal state on the network device A3 and the network device A4 is 2. Therefore, in this case, the number of interfaces in a normal state indicated by the path cost value carried in the STP packet reported by the network device A3 and the network device A4 to the network device A1 and the network device A2 is 2. The sending of the STP packet follows the hash principle, and the STP packet can be sent to the network device A1 or the network device A2. One of the network device A1 and the network device A2 will receive the STP packet.

[0084] But if the interface of the network device A1 is closed during the restart of the network device A1. Referring to FIG. 4, the number of interfaces in normal state on the network device A3 and the network device A4 is reduced to 1. Therefore, in this case, the path cost value carried in the STP message reported by the network device A3 and the network device A4 to the network device 201 is changed compared with the application scenario shown in FIG. 3, and is changed to the path cost value indicating that the number of interfaces is 1. Due to the restart of the network device A1, the interface is closed, so the STP message cannot be sent to the network device A1, and only the network device A2 can receive the STP message.

[0085] Referring to Table 1, a correspondence table between a link rate, a port type and a path cost value provided by the embodiment of the application is provided.

[0086] Table 1

[0087] In Table 1, the link rate of 1000 Mbps is only an example, and is only a possible value of the link rate for setting the path cost value by example. The application does not limit the link rate. Different interface types correspond to different numbers of interfaces in normal state connected by the device. As can be seen from the table, if the IEEE 802.1D-1998 standard is used, the path cost value is the same regardless of the number of interfaces in normal state connected by the device. Therefore, the IEEE 802.1D-1998 standard is not applicable to the present scheme. But the IEEE 802.1t standard is applicable to the present scheme. The above-mentioned other standards are self-defined standards other than the standards defined by IEEE. The value of the path cost value in the other standards is only an example. As long as the path cost value is different for different interface types, the standard is applicable to the embodiment of the application.

[0088] In addition, the above-mentioned STP message includes an MST BPDU (Multiple Spanning Tree Bridge Protocol Data Unit) field, and the MST BPDU field carries the above-mentioned path cost value.

[0089] Step S502: If the keepalive link and the peer-link link established between the plurality of network devices are disconnected, and it is determined that the first path cost value and the second path cost value are different, the MLAG system is maintained.

[0090] The first path cost value is a path cost value carried in a received STP message before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in a received STP message after the keepalive link and the peer-link link are disconnected.

[0091] Specifically, the first path cost value can be a path cost value in the application scenario shown in FIG. 3, and the second path cost value can be a path cost value in the application scenario shown in FIG. 4.

[0092] Specifically, if the network device 201 determines that the keepalive link and the peer-link link between the plurality of network devices are disconnected, but the path cost value does not change, it can be determined that not only the links between the plurality of network devices are disconnected, but also the interface on the target device is closed. In this case, other network devices in the MLAG system should be the entire device failure or closed. In this case, the network device that is not failed needs to maintain the MLAG system and continue to work to ensure normal forwarding of network traffic, and therefore needs to maintain the current MAC address and LACP system priority.

[0093] In the application scenarios shown in FIG. 3 and FIG. 4, the network device A1 restarts the device. The network device A2 can perceive that the keepalive link and the peer-link link between the network device A1 and the network device A2 are disconnected. In this case, if according to the related art, the network device A2 will enter the independent mode, causing the traffic forwarding to be affected.

[0094] But in the scheme provided in the application, in the case that the STP is based on the IEEE 802.1t standard, before the network device A1 is restarted, the aggregation interface connected by the network device A3 and the network device A4 contains two interfaces in the normal state. In this case, referring to Table 1, the first path cost value carried by the STP message is 10000. During the restart of the network device A1, the network device A3 and the network device A4 only have a single interface in the normal state. In this case, referring to Table 1, the second path cost value carried by the STP message is 20000. The network device A2 determines that the first path cost value and the second path cost value are different. Then the network device A2 can determine that not only the interface connected with the network device A2 on the network device A1 is closed, but also the interface connected with the target device on the network device A1 is closed. That is, not only the keepalive link and the peer-link link between the network device A1 and the network device A2 are disconnected, but also the link between the network device A1 and the target device is disconnected. Instead of the keepalive link and the peer-link link being faulty, the network device A1 is closed or faulty as a whole. In this case, the network device A2 needs to maintain the MLAG system and continue to perform traffic forwarding, and cannot enter the independent mode. That is, the current MAC address and LACP system priority need to be maintained. That is, the MAC address of the network device A2 remains the MAC address of the MLAG system, and the LACP system priority of the network device A1 remains the LACP system priority of the MLAG system. Since the MAC address and the LACP system priority of the network device A2 do not change, unnecessary oscillation of the MLAG interface does not occur, and traffic forwarding is not affected.

[0095] In addition, the above-mentioned STP message carries a Flags field, and the data amount of the Flags field is 1 byte. For the STP, the first Bit, that is, the high-order Bit on the left side represents TCA (Topology Change Acknowledge, topology change response). The last Bit, that is, the low-order Bit on the right side represents TC (Topology Change, topology change), and the other fields are reserved.

[0096] For the RSTP (Rapid Spanning Tree Protocol, rapid spanning tree protocol) and the MSTP (Multi-Service Transport Platform, multi-service transport platform), Bit7 is TCA, Bit6 is Agreement (agreement) identification, Bit5 is Forwarding (forwarding) identification, Bit4 is Learning (learning) identification, Bit3 and Bit2 represent interface roles, Bit1 is Proposal (request identification), and Bit0 is TC.

[0097] Bit3 and Bit2 are 00, indicating that the interface role is unknown; Bit3 and Bit2 are 01 (1 in the low bit and 0 in the high bit), indicating that the interface role is an Altemate (candidate) interface or a Backup (backup) interface; Bit3 and Bit2 are 10 (0 in the low bit and 1 in the high bit), indicating that the interface role is a root interface; and Bit3 and Bit2 are 11, indicating that the interface role is a designated port.

[0098] As can be seen from the above, in the communication method provided by the embodiments of the present application, in the case that any network device of the plurality of network devices in the MLAG system determines that the keepalive link and the peer-link link established between the plurality of network devices are both disconnected, the MLAG system will not directly enter the split state. Instead, it is determined whether the path cost value carried in the STP message sent by the target device accessed to the MLAG system changes. If other network devices other than the network device restart or fail, causing the above-mentioned other network devices to not work normally. Then all interfaces of the above-mentioned other network devices will be in a closed state, causing the channel between the other network devices and the target device to be disconnected, and the interface on the target device connected to the other network devices will also be in a closed state. In this case, the number of interfaces on the target device in a normal state will change, and then the path cost value carried in the STP message sent by the target device will change. If the network device determines that the first path cost value and the second path cost value are different, it can be determined that all interfaces of the above-mentioned other network devices are closed, and the above-mentioned other network devices are not currently working normally.

[0099] In this case, the network device will not directly enter the split state of the MLAG system due to the disconnection of the links between the plurality of network devices. Instead, it will further determine whether the first path cost value and the second path cost value carried in the STP message are the same. In the case that the first path cost value and the second path cost value are different, i.e., the above-mentioned other network devices are not currently working normally, the MLAG system is maintained, and the current MAC address and priority of the device are continued to be maintained for traffic forwarding. Thus, the oscillation of the MAC address and priority of the MLAG interface is avoided, and the influence on the forwarding of network traffic is avoided.

[0100] In another embodiment of the present application, referring to FIG. 6, it is a third application scenario provided by the embodiments of the present application. The interface on the network device A1 in FIG. 3 connected to the network device A2 fails, so the keepalive link and the peer-link link in the figure are disconnected. Among them, the keepalive link and the peer-link link in the disconnected state can be both disconnected, or the keepalive link can be disconnected first and the peer-link link can be disconnected later.

[0101] The link disconnection is indicated by "X" in the figure. In addition, other parts of the application scenario shown in FIG. 6 are the same as those of FIG. 3, and will not be described here.

[0102] It should be noted that the number of network devices and the number of target devices in the MLAG system shown in FIG. 3 and FIG. 6 are only an example, and the number of both embodiments of the present application is not limited thereto.

[0103] Referring to FIG. 7, a flowchart of a second communication method provided by an embodiment of the present application is shown. Compared with the embodiment shown in FIG. 5, the second communication method further includes the following step S503.

[0104] Step S503: If the keepalive link and the peer-link link between the plurality of network devices are disconnected, and it is determined that the first path cost value and the second path cost value are the same, the MLAG system is in a split state.

[0105] Specifically, the keepalive link and the peer-link link between the network devices are in a disconnected state, but the first path cost value and the second path cost value of the target device are the same. It can be determined that for the target device, the number of interfaces in the normal state on the target device has not changed. It indicates that the interfaces between the network device and the target device are not disconnected. In this case, the network device can determine that only the keepalive link and the peer-link link between the plurality of network devices are in a disconnected state, but the network device itself has not failed or restarted as a whole. In this case, the MLAG system enters a split state, and the network device needs to enter an independent mode. In this case, the MAC address of the network device needs to be adjusted, and the LACP system priority of the network device needs to be reduced.

[0106] In an embodiment of the present application, the network device can adjust the MAC address and the LACP system priority back to the original MAC address and the LACP system priority before the network device configures the MLAG system.

[0107] In the application scenarios shown in FIG. 3 and FIG. 6, the network device A1 can determine that the keepalive link and the peer-link link are in a disconnected state.

[0108] In the scheme provided in the present application, in the case that the STP is based on the IEEE 802.1t standard, if the network device A1 is in a normal state, the aggregation interface connected between the network device A3 and the network device A4 contains two interfaces in a normal state. In this case, referring to Table 1, the first path cost value carried in the STP message is 10000. After that, the keepalive link and the peer-link link are both in a disconnected state. However, the aggregation interface connected between the network device A3 and the network device A4 still contains two interfaces in a normal state. In this case, referring to Table 1, the second path cost value carried in the STP message is still 10000. The first path cost value and the second path cost value carried in the STP message received by the network device A2 are the same. Then the network device A2 can determine that only the keepalive link and the peer-link link between the network device A1 and the network device A2 are faulty. In this case, the MLAG system is in a split state, and the network device A2 needs to enter the independent mode. Otherwise, the network device A1 and the network device A2 will affect each other in message forwarding. Therefore, the network device needs to update the current MAC address and LACP system priority.

[0109] As can be seen from the above, in the communication method provided in the embodiments of the present application, in the case that the network device in the MLAG system determines that the keepalive link and the peer-link link are both disconnected, the MLAG system is not directly determined to be in a split state. Instead, it is determined whether the first path cost value and the second path cost value are the same. If they are the same, it means that the state of the interface between the network device and the target device has not changed. Therefore, it can be determined that only the keepalive link and the peer-link link are faulty, and the link between the network devices in the MLAG system is disconnected. The MLAG system needs to enter a split state, and the network device can normally enter the independent mode to prevent multiple network devices from acting as master devices to affect traffic forwarding.

[0110] In addition, the STP interface roles of the interfaces on different devices are different. In the case that the STP interface role of the interface of the device is the first type (i.e., the STP interface role is a designated interface) that can actively send the STP message, the device can actively send the STP message through the interface. In the case that the STP interface role of the interface of the device is the second type (i.e., the STP interface role is a root interface) that cannot actively send the STP message, the device cannot actively send the STP message through the interface. Therefore, the target device sending the STP message to the network device has the following two situations, which are situation one and situation two.

[0111] Situation one: the STP interface role of the interface of the above target device is the first type.

[0112] In one case, the STP message is a message sent by the target device through the second interface when the target device determines that the first interface among the multiple interfaces is in a down state. The first interface is different from the second interface.

[0113] In the case where the STP interface role of the interface of the target device is the first type, the target device can actively send the STP message. Therefore, in the case where the target device determines that the first interface is in a down state, the target device can directly send the STP message through the second interface. In this case, the STP message can be sent only to the network device connected to the second interface.

[0114] In another case, the STP message is a message sent by the target device to the network devices in the MLAG system according to a preset period and based on a hash principle.

[0115] In the case where the STP interface role of the interface of the target device is the first type, the target device can actively send the STP message. The target device can send the STP message to the network devices in the MLAG system according to a preset period and based on a hash principle.

[0116] The message sent based on the hash principle can be sent to any network device in the MLAG system.

[0117] This method can be applied to the case where there is no interface in a down state among the interfaces of the target device connected to the network devices in the MLAG system, including the case where no failure occurs to the interfaces on the network devices in the MLAG system. Or before the network devices in the MLAG system fail or restart, or before the keepalive link and the peer-link link between the multiple network devices in the MLAG system are disconnected, but the link between the network devices and the target device is not faulty.

[0118] Case two: In the case where the STP interface role of the interface of the network device is the first type, any network device in the MLAG system further performs the following step A.

[0119] Step A: If the keepalive link and the peer-link link established between the multiple network devices are disconnected, an STP request message is sent to the target device, so that the target device feeds back an STP message to the network devices in the MLAG system after receiving the STP request message.

[0120] Since the STP interface role of the interface of the network device is the first type and the STP interface role of the interface of the target device is the second type, the network device can actively send the STP message through the interface, and the target device cannot actively send the STP message. In this case, in order to enable the target device to send the STP message to the network device, the network device needs to send the STP request message to the target device.

[0121] The proposal flag in the Flags carried in the STP request message is set at Bit 1, that is, the value is a first preset value. For example, the proposal flag can be set to 1 or 0, indicating that the message is an STP request message.

[0122] After receiving the STP request message, the target device determines that the network device initiates a request for the STP message, and therefore the target device needs to respond to a corresponding STP message, which can be referred to as an STP agreement message. The Agreement flag in the Flags carried in the STP response message is set at Bit 6, that is, the value is a second preset value. For example, the second preset value can be set to 1 or 0, indicating that the message is an STP agreement message.

[0123] Corresponding to the foregoing communication method applied to the network device, an embodiment of the present application further provides a communication method applied to a target device.

[0124] In an embodiment of the present application, the target device applied to the MLAG system comprises the following steps B-C.

[0125] Step B: based on the hash principle, sending a first STP message to the network device in the MLAG system.

[0126] The first STP message comprises a first path cost value.

[0127] Step C: based on the hash principle, sending a second STP message to the network device in the MLAG system, wherein the second STP message comprises a second path cost value, so that any network device in the MLAG system maintains the MLAG system when it is determined that the keepalive link and the peer-link link established between the plurality of network devices are both disconnected, and the first path cost value and the second path cost value are different.

[0128] The first path cost value is a path cost value carried in a STP message received by the network device before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in a STP message received by the network device after the keepalive link and the peer-link link are disconnected.

[0129] As can be seen from the above, in the communication method provided by the embodiment of the application, when any network device in the plurality of network devices in the MLAG system determines that the keepalive link and the peer-link link established between the plurality of network devices are disconnected, the network device does not directly enter the split state of the MLAG system. Instead, the network device determines whether the path cost value carried in the STP message sent by the target device in the MLAG system changes. If other network devices other than the network device restart or malfunction, the other network devices do not work normally. In this case, all interfaces of the other network devices are in a closed state, the channel between the other network devices and the target device is disconnected, and the interface of the target device connected to the other network devices also becomes a closed state. In this case, the number of interfaces in the normal state of the target device changes, and the path cost value carried in the STP message sent by the target device also changes. If the network device determines that the first path cost value and the second path cost value are different, it can be determined that all interfaces of the other network devices are closed, and the other network devices do not work normally at present.

[0130] In this case, the network device does not directly enter the split state of the MLAG system due to the disconnection of the links between the plurality of network devices. Instead, the network device further determines whether the first path cost value and the second path cost value carried in the STP message are the same. In the case where the first path cost value and the second path cost value are different, i.e., the other network devices do not work normally at present, the MLAG system is maintained, and the current MAC address and priority of the network device are continued to be maintained for traffic forwarding. In this way, the MLAG interface of the MAC address and priority changing device is prevented from being shocked, and the forwarding of network traffic is prevented from being affected.

[0131] In an embodiment of the application, in the case where the STP interface role of the plurality of interfaces of the target device is the first type, the first STP message and the second STP message are sent to the network device by the following step D.

[0132] Step D: based on the hash principle, when it is determined that the first interface in the plurality of interfaces is in a closed state, the first STP message and the second STP message are sent to the network device in the MLAG system through the second interface.

[0133] The first interface is different from the second interface.

[0134] In one embodiment of the present application, in the case where the STP interface role of the multiple interfaces of the target device is of the first type, the first STP message and the second STP message are sent to the network device through the following step E.

[0135] Step E: Based on the hash principle, the first STP message and the second STP message are sent to the network device in the MLAG system according to a preset period.

[0136] In one embodiment of the present application, in the case where the STP interface role of the interface of the network device is of the first type, the second STP message is sent to the network device through the following step F.

[0137] Step F: In the case where the STP request message sent by the network device in the MLAG system is received, the second STP message is fed back to the network device.

[0138] The STP request message is sent in the case where the network device determines that the keepalive link and the peer-link link established between the multiple network devices in the MLAG system are disconnected.

[0139] In one embodiment of the present application, the STP message includes an MST BPDU field, and the MST BPDU field carries the path cost value.

[0140] Corresponding to the foregoing communication method, an embodiment of the present application further provides a communication system.

[0141] An embodiment of the present application provides a communication system, which includes multiple network devices constituting a multi-chassis link aggregation group (MLAG) system, a target device accessing the MLAG system, and the target device including multiple interfaces, each interface being used to access one network device in the MLAG system.

[0142] Any network device in the multiple network devices is configured to implement the method steps of any one of the foregoing communication methods applied to the network device.

[0143] The target device is configured to implement the method steps of any one of the foregoing communication methods applied to the target device.

[0144] The structure of the system can be the structure shown in the foregoing FIG. 2, which will not be described here again.

[0145] Corresponding to the foregoing communication method applied to the network device, an embodiment of the present application further provides a network device.

[0146] Referring to FIG. 8, a structural schematic diagram of a network device is provided in the embodiment of the present application, the network device is any one of a plurality of network devices constituting a Multi-Chassis Link Aggregation Group (MLAG) system, and the network device comprises:

[0147] a processor 801;

[0148] a transceiver 804;

[0149] a machine readable storage medium 802, which stores machine executable instructions capable of being executed by the processor 801; the machine executable instructions cause the processor 801 to perform the following steps:

[0150] receiving a Spanning Tree Protocol (STP) packet carrying a path cost value sent by a target device, wherein the target device comprises a plurality of interfaces, each of which is used to access one network device in the MLAG system, and the path cost value is used to indicate the number of interfaces in normal state in the plurality of interfaces;

[0151] if the keepalive link and the peer-link link between the plurality of network devices are both disconnected, and it is determined that the first path cost value is different from the second path cost value, maintaining the MLAG system, wherein the first path cost value is a path cost value carried in the STP packet received before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in the STP packet received after the keepalive link and the peer-link link are disconnected.

[0152] As shown in FIG. 8, the network device can further comprise a communication bus 803. The processor 801, the machine readable storage medium 802 and the transceiver 804 complete mutual communication through the communication bus 803, and the communication bus 803 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 803 can be divided into an address bus, a data bus, a control bus, etc.

[0153] The transceiver 804 can be a wireless communication module, and the transceiver 804 is controlled by the processor 801 to interact with other devices.

[0154] The machine readable storage medium 802 can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk storage. Additionally, the machine readable storage medium 802 can be at least one storage device remotely located from the aforementioned processor(s).

[0155] The processor 801 can be a general processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic component, a discrete hardware component.

[0156] As can be seen from the above, in the communication method provided by the embodiments of the present application, when any network device of the plurality of network devices in the MLAG system determines that both the keepalive link and the peer-link link established between the plurality of network devices are disconnected, the MLAG system will not directly enter the split state. Instead, it is determined whether the path cost value carried in the STP message sent by the target device of the MLAG system changes. If other network devices other than the network device restart or fail, causing the other network devices to not work normally. Then all interfaces of the other network devices will be in a closed state, causing the channel between the other network devices and the target device to be disconnected, and the interface on the target device connected to the other network devices will also be in a closed state. In this case, the number of interfaces on the target device in a normal state will change, and the path cost value carried in the STP message sent by the target device will also change. If the network device determines that the first path cost value and the second path cost value are different, it can be determined that all interfaces of the other network devices are closed, and the other network devices are not currently working normally.

[0157] In this case, the network device does not directly enter the split state of the MLAG system due to the disconnection of the link between the plurality of network devices. Instead, whether the first path cost value and the second path cost value carried in the STP message are the same is further determined. In a case where it is determined that the first path cost value and the second path cost value are different, i.e., the other network device is currently not working normally, the MLAG system is maintained, and the current MAC address and priority of the network device are continued to be maintained for traffic forwarding. Thus, the oscillation of the MAC address and priority of the MLAG interface is avoided, and the forwarding of network traffic is not affected.

[0158] In an embodiment of the present application, the machine executable instructions further cause the processor to perform the following steps:

[0159] If the keepalive link and the peer-link link established between the plurality of network devices are disconnected, and it is determined that the first path cost value and the second path cost value are the same, the MLAG system is in a split state.

[0160] As can be seen from the above, in the communication method provided by the embodiments of the present application, in a case where the network device in the MLAG system determines that the keepalive link and the peer-link link are disconnected, the MLAG system is not directly determined to be in a split state. Instead, whether the first path cost value and the second path cost value are the same is determined. If the two values are the same, it indicates that the state of the interface between the network device and the target device has not changed. Therefore, it can be determined that only the keepalive link and the peer-link link are faulty, and the link between the network devices in the MLAG system is disconnected. The MLAG system needs to enter a split state, and the network device can normally enter an independent mode to prevent the plurality of network devices from affecting the forwarding of traffic as master devices.

[0161] In an embodiment of the present application, in a case where the STP interface role of the plurality of interfaces of the target device is the first type, the STP message is a message sent by the target device through a second interface when it is determined that a first interface in the plurality of interfaces is in a down state, the first interface and the second interface being different.

[0162] In an embodiment of the present application, in a case where the STP interface role of the plurality of interfaces of the target device is the first type, the STP message is a message sent by the target device to the network device in the MLAG system according to a preset period based on a hash principle.

[0163] In an embodiment of the present application, in a case where the STP interface role of the interface of the network device is the first type, the machine executable instructions further cause the processor to perform the following steps:

[0164] If the keepalive link and the peer-link link between the plurality of network devices are both disconnected, an STP request message is sent to the target device, so that the target device feeds back an STP message to the network devices in the MLAG system after receiving the STP request message.

[0165] In one embodiment of the present application, the STP message comprises a multiple spanning tree bridge protocol data unit (MST BPDU) field, and the MST BPDU field carries the path cost value.

[0166] Corresponding to the above-mentioned communication method applied to the target device, an embodiment of the present application further provides a target device.

[0167] Referring to FIG. 9, a structural schematic diagram of a target device provided by an embodiment of the present application is shown, the target device accesses a multi-chassis aggregation group (MLAG) system, the MLAG system is composed of a plurality of network devices, the target device comprises a plurality of interfaces, each interface is used to access one network device in the MLAG system, and the target device comprises:

[0168] a processor 901;

[0169] a transceiver 904;

[0170] a machine readable storage medium 902, which stores machine executable instructions capable of being executed by the processor; the machine executable instructions cause the processor to execute the following steps:

[0171] based on a hash principle, a first spanning tree protocol (STP) message is sent to the network devices in the MLAG system, the first STP message comprises a first path cost value;

[0172] based on the hash principle, a second STP message is sent to the network devices in the MLAG system, the second STP message comprises a second path cost value, so that any network device in the MLAG system maintains the MLAG system in the case that the keepalive link and the peer-link link between the plurality of network devices are both disconnected and the first path cost value is different from the second path cost value.

[0173] wherein the first path cost value is a path cost value carried in an STP message received by the network device before the keepalive link and the peer-link link are both disconnected, and the second path cost value is a path cost value carried in an STP message received by the network device after the keepalive link and the peer-link link are both disconnected.

[0174] As shown in FIG. 9, the network device can further include a communication bus 903. The processor 901, the machine readable storage medium 902, and the transceiver 904 can communicate with each other through the communication bus 903. The communication bus 903 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 903 can be divided into an address bus, a data bus, a control bus, etc.

[0175] The transceiver 904 can be a wireless communication module. The transceiver 904 can interact with other devices to exchange data under the control of the processor 901.

[0176] The machine readable storage medium 902 can include a Random Access Memory (RAM) and can further include a Non-Volatile Memory (NVM), such as at least one disk memory. In addition, the machine readable storage medium 902 can be at least one storage device located away from the aforementioned processor.

[0177] The processor 901 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc. The processor 901 can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic component, a discrete hardware component.

[0178] As can be seen from the above, in the communication method provided by the embodiment of the application, in a case where any network device of the plurality of network devices in the MLAG system determines that the keepalive link and the peer-link link established between the plurality of network devices are both disconnected, the MLAG system will not directly enter the split state. Instead, it is determined whether the path cost value carried in the STP message sent by the target device of the MLAG system changes. If other network devices other than the network device restart or malfunction, the other network devices will not work normally. In this case, all interfaces of the other network devices will be in a closed state, causing the channel between the other network devices and the target device to be disconnected, and the interface of the target device connected to the other network devices will also be in a closed state. In this case, the number of interfaces of the target device in a normal state will change, and the path cost value carried in the STP message sent by the target device will also change. If the network device determines that the first path cost value and the second path cost value are different, it can be determined that all interfaces of the other network devices are closed, and the other network devices are not currently working normally.

[0179] In this case, the network device will not directly enter the split state of the MLAG system due to the disconnection of the links between the plurality of network devices. Instead, it will further determine whether the first path cost value and the second path cost value carried in the STP message are the same. In a case where it is determined that the first path cost value and the second path cost value are different, i.e., the other network devices are not currently working normally, the MLAG system is maintained, and the current MAC address and priority of the network device are continued to be maintained for traffic forwarding. Thus, the oscillation of the MLAG interface of the MAC address and priority changing device is avoided, and the forwarding of network traffic is not affected.

[0180] In an embodiment of the application, in a case where the STP interface role of the plurality of interfaces of the target device is of a first type, the first STP message and the second STP message are sent to the network devices in the MLAG system based on the hash principle, and the first STP message and the second STP message are sent to the network devices in the MLAG system based on the hash principle, comprising:

[0181] Based on the hash principle, in a case where it is determined that the first interface of the plurality of interfaces is in a closed state, the first STP message and the second STP message are sent to the network devices in the MLAG system through the second interface, the first interface and the second interface being different.

[0182] In one embodiment of the present application, in the case that the STP interface role of the interfaces of the target device is of the first type, the first STP message is sent to the network devices in the MLAG system based on the hash principle, and the second STP message is sent to the network devices in the MLAG system based on the hash principle, including:

[0183] The first STP message and the second STP message are sent to the network devices in the MLAG system based on the hash principle and according to a preset period.

[0184] In one embodiment of the present application, in the case that the STP interface role of the interfaces of the network device is of the first type, the second STP message is sent to the network devices in the MLAG system based on the hash principle, including:

[0185] In the case that the STP request message sent by the network device in the MLAG system is received, the second STP message is fed back to the network device, wherein the STP request message is sent by the network device in the case that the network device determines that the keepalive link and the peer-link link established between the network devices in the MLAG system are disconnected.

[0186] In one embodiment of the present application, the STP message includes a multiple spanning tree bridge protocol data unit (MST BPDU) field, and the MST BPDU field carries the path cost value.

[0187] Corresponding to the aforementioned communication method applied to a network device, an embodiment of the present application further provides a communication device applied to a network device.

[0188] Referring to FIG. 10, a structure schematic diagram of a first communication device provided by an embodiment of the present application is shown, which is applied to any network device in the multiple network devices constituting the MLAG system, and the device includes:

[0189] The STP message receiving module 1001 is configured to receive the spanning tree protocol (STP) message carrying the path cost value sent by a target device, wherein the target device includes multiple interfaces, each interface is configured to access one network device in the MLAG system, and the path cost value is configured to indicate the number of interfaces in a normal state in the multiple interfaces.

[0190] The system maintaining module 1002 is used for maintaining the MLAG system if the keepalive link and the peer-link link between the plurality of network devices are disconnected and the first path cost value and the second path cost value are different, wherein the first path cost value is the path cost value carried in the STP message received before the keepalive link and the peer-link link are disconnected, and the second path cost value is the path cost value carried in the STP message received after the keepalive link and the peer-link link are disconnected.

[0191] As can be seen from the above, in the communication method provided by the embodiment of the application, any network device in the plurality of network devices in the MLAG system determines that the keepalive link and the peer-link link between the plurality of network devices are disconnected, and does not directly enter the split state of the MLAG system. Instead, it is determined whether the path cost value carried in the STP message sent by the target device of the MLAG system changes. If other network devices other than the network device restart or malfunction, the other network devices do not work normally. All interfaces of the other network devices are in a closed state, the channel between the other network devices and the target device is disconnected, and the interface of the target device connected to the other network devices also changes to a closed state. In this case, the number of interfaces of the target device in a normal state changes, and the path cost value carried in the STP message sent by the target device changes. If the network device determines that the first path cost value and the second path cost value are different, it can be determined that all interfaces of the other network devices are closed, and the other network devices do not work normally at present.

[0192] In this case, the network device does not directly enter the split state of the MLAG system due to the disconnection of the link between the plurality of network devices. Instead, it further determines whether the first path cost value and the second path cost value carried in the STP message are the same. In the case where the first path cost value and the second path cost value are different, i.e., the other network devices do not work normally at present, the MLAG system is maintained, and the current MAC address and priority of the network device are continued to be used for traffic forwarding. Thus, the MLAG interface of the MAC address and priority changing device is prevented from oscillating, and the forwarding of network traffic is prevented from being affected.

[0193] In one embodiment of the application, the apparatus further comprises:

[0194] a system split module, configured to determine that the MLAG system is in a split state if the keepalive link and the peer-link link between the plurality of network devices are both disconnected, and the first path cost value and the second path cost value are determined to be the same.

[0195] As can be seen from the above, in the communication method provided by the embodiments of the present application, in the case where the network device in the MLAG system determines that the keepalive link and the peer-link link are both disconnected, the MLAG system is not directly determined to be in a split state. Instead, it is determined whether the first path cost value and the second path cost value are the same. If they are the same, it indicates that the state of the interface between the network device and the target device has not changed. Therefore, it can be determined that only the keepalive link and the peer-link link are faulty, and the links between the network devices in the MLAG system are disconnected. The MLAG system needs to enter a split state, and the network device can normally enter an independent mode to prevent multiple network devices from affecting traffic forwarding as master devices.

[0196] In an embodiment of the present application, in the case where the STP interface role of the plurality of interfaces of the target device is the first type, the STP message is a message sent by the target device through a second interface when the target device determines that a first interface in the plurality of interfaces is in a down state, the first interface and the second interface being different.

[0197] In an embodiment of the present application, in the case where the STP interface role of the plurality of interfaces of the target device is the first type, the STP message is a message sent by the target device to the network device in the MLAG system according to a preset period based on a hash principle.

[0198] In an embodiment of the present application, in the case where the STP interface role of the interface of the network device is the first type, the apparatus further comprises:

[0199] a request message sending module, configured to send an STP request message to the target device if the keepalive link and the peer-link link established between the plurality of network devices are both disconnected, so that the target device feeds back an STP message to the network device in the MLAG system after receiving the STP request message.

[0200] In an embodiment of the present application, the STP message comprises a multiple spanning tree bridge protocol data unit (MST BPDU) field, and the MST BPDU field carries the path cost value.

[0201] Corresponding to the foregoing communication method applied to the target device, an embodiment of the present application provides a communication device applied to a target device of an MLAG system. Referring to FIG. 11, it is a structural schematic diagram of a second communication device provided by an embodiment of the present application. The MLAG system is composed of a plurality of network devices. The target device includes a plurality of interfaces, each of which is used to access a network device in the MLAG system. The device includes:

[0202] A first STP message sending module 1101 is configured to send a first spanning tree protocol (STP) message to a network device in the MLAG system based on a hash principle. The first STP message includes a first path cost value.

[0203] A second STP message sending module 1102 is configured to send a second STP message to a network device in the MLAG system based on the hash principle. The second STP message includes a second path cost value. In the case that any network device in the MLAG system determines that both a keepalive link and a peer-link link established between the plurality of network devices are disconnected, and the first path cost value is different from the second path cost value, the MLAG system is maintained.

[0204] The first path cost value is a path cost value carried in an STP message received by the network device before the keepalive link and the peer-link link are disconnected. The second path cost value is a path cost value carried in an STP message received by the network device after the keepalive link and the peer-link link are disconnected.

[0205] As can be seen from the above, in the communication method provided by the embodiment of the application, in the case that any network device of the plurality of network devices in the MLAG system determines that the keepalive link and the peer-link link established between the plurality of network devices are both disconnected, the MLAG system will not directly enter the split state. Instead, it is determined whether the path cost value carried in the STP message sent by the target device of the MLAG system changes. If other network devices other than the network device restart or malfunction, the above-mentioned other network devices will not work normally. Then all interfaces of the above-mentioned other network devices will be in a closed state, resulting in the disconnection of the channel between the above-mentioned other network devices and the target device, and the interface of the target device connected to the above-mentioned other network devices will also be in a closed state. In this case, the number of interfaces of the target device in a normal state will change, and then the path cost value carried in the STP message sent by the target device will change. If the network device determines that the first path cost value and the second path cost value are different, it can be determined that all interfaces of the above-mentioned other network devices are closed, and the above-mentioned other network devices are not currently working normally.

[0206] In this case, the network device will not directly enter the split state of the MLAG system due to the disconnection of the link between the plurality of network devices. Instead, it will further determine whether the first path cost value and the second path cost value carried in the STP message are the same. In the case that the first path cost value and the second path cost value are different, i.e., the above-mentioned other network devices are not currently working normally, the MLAG system is maintained, and the current MAC address and priority of the device are continued to be maintained for traffic forwarding. Thus, the oscillation of the MLAG interface of the MAC address and priority changing device is avoided, and the forwarding of network traffic is avoided.

[0207] In an embodiment of the application, in the case that the STP interface role of the plurality of interfaces of the target device is of the first type, the sending of the first spanning tree protocol (STP) message to the network device in the MLAG system based on the hash principle and the sending of the second STP message to the network device in the MLAG system based on the hash principle include:

[0208] Based on the hash principle, in the case that the first interface of the plurality of interfaces is in a closed state, the first STP message and the second STP message are sent to the network device in the MLAG system through the second interface, and the first interface and the second interface are different.

[0209] In one embodiment of the present application, in the case that the STP interface role of the interfaces of the target device is of the first type, the first spanning tree protocol (STP) message is sent to the network device in the MLAG system based on a hash principle, and the second STP message is sent to the network device in the MLAG system based on the hash principle, including:

[0210] The first STP message and the second STP message are sent to the network device in the MLAG system based on the hash principle and according to a preset period.

[0211] In one embodiment of the present application, in the case that the STP interface role of the interfaces of the network device is of the first type, the second STP message is sent to the network device in the MLAG system based on the hash principle, including:

[0212] In the case that the STP request message sent by the network device in the MLAG system is received, the second STP message is fed back to the network device, wherein the STP request message is sent by the network device in the case that the network device determines that the keepalive link and the peer-link link established between the network devices in the MLAG system are disconnected.

[0213] In one embodiment of the present application, the STP message includes a multiple spanning tree bridge protocol data unit (MST BPDU) field, and the MST BPDU field carries the path cost value.

[0214] According to the same inventive concept, the communication method provided in the above embodiments of the present application is a machine readable storage medium storing machine executable instructions, when the machine executable instructions are called and executed by a processor, the machine executable instructions cause the processor to implement the steps of any of the communication methods applied to the network device or the target device.

[0215] In another embodiment of the present application, a computer program product containing instructions is also provided, when the computer program product is run on a computer, the computer is caused to execute the steps of any of the communication methods applied to the network device or the target device in the above embodiments.

[0216] In the embodiments described above, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD), or semiconductor media (for example, solid state disk (SSD)) and the like.

[0217] It should be noted that, in this paper, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitation, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0218] Each of the embodiments in the specification is described in a related manner, and the same and similar parts between each embodiment can be referred to each other, and each embodiment focuses on the difference from other embodiments. Especially, for the communication method, system, network device, target device, apparatus, computer readable storage medium and computer program product embodiments applied to the target device, since they are basically similar to the method embodiments, the description is relatively simple, and the related parts can be referred to the part of the method embodiment.

[0219] The above merely provides the preferred embodiment of the present application, and not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A communication method characterized by comprising: The method is applied to any network device in a plurality of network devices constituting a multi-chassis link aggregation group (MLAG) system, and comprises the following steps: receiving a spanning tree protocol (STP) packet carrying a path cost value sent by a target device, wherein the target device comprises a plurality of interfaces, each of which is used to access a network device in the MLAG system, and the path cost value is used to indicate the number of interfaces in normal state in the plurality of interfaces; if the keepalive link and the peer-link link between the plurality of network devices are disconnected, and it is determined that the first path cost value is different from the second path cost value, maintaining the MLAG system, wherein the first path cost value is a path cost value carried in an STP packet received before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in an STP packet received after the keepalive link and the peer-link link are disconnected.

2. The method of claim 1, wherein, The method further comprises the following steps: if the keepalive link and the peer-link link between the plurality of network devices are disconnected, and it is determined that the first path cost value is the same as the second path cost value, the MLAG system is in a split state.

3. The method according to claim 1 or 2, characterized in that, In a case where the STP interface role of the plurality of interfaces of the target device is the first type, the STP packet is a packet sent by the target device through a second interface when it is determined that a first interface in the plurality of interfaces is in a closed state, and the first interface is different from the second interface.

4. The method according to claim 1 or 2, characterized in that, In a case where the STP interface role of the plurality of interfaces of the target device is the first type, the STP packet is a packet sent by the target device to the network devices in the MLAG system according to a preset period and based on a hash principle.

5. The method according to claim 1 or 2, characterized in that, In a case where the STP interface role of the interface of the network device is the first type, the method further comprises the following steps: if the keepalive link and the peer-link link between the plurality of network devices are disconnected, sending an STP request packet to the target device, so that the target device feeds back an STP packet to the network devices in the MLAG system after receiving the STP request packet.

6. The method of claim 1 or 2, wherein, The STP packet comprises a multiple spanning tree bridge protocol data unit (MST BPDU) field, and the MST BPDU field carries the path cost value.

7. A communication method characterized by comprising: The method is applied to a target device accessing a multi-chassis link aggregation group (MLAG) system, the MLAG system is composed of a plurality of network devices, and the target device comprises a plurality of interfaces, each of which is used to access a network device in the MLAG system, and the method comprises the following steps: sending a first spanning tree protocol (STP) packet to the network devices in the MLAG system based on a hash principle, wherein the first STP packet comprises a first path cost value; The first STP message and the second STP message are sent to network devices in the MLAG system based on a hash principle, and the second STP message includes a second path cost value, so that any network device in the MLAG system maintains the MLAG system when it is determined that the keepalive link and the peer-link link established between the network devices are disconnected, and the first path cost value is different from the second path cost value. The first path cost value is a path cost value carried in a STP message received by the network device before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in a STP message received by the network device after the keepalive link and the peer-link link are disconnected.

8. The method of claim 7, wherein, In a case where the STP interface role of the multiple interfaces of the target device is of a first type, the first STP message and the second STP message are sent to network devices in the MLAG system based on a hash principle, and the first STP message and the second STP message are sent to network devices in the MLAG system based on a hash principle, including: In a case where it is determined that a first interface in the multiple interfaces is in a closed state, the first STP message and the second STP message are sent to network devices in the MLAG system through a second interface based on a hash principle, and the first interface is different from the second interface. In a case where the STP interface role of the multiple interfaces of the target device is of a first type, the first STP message and the second STP message are sent to network devices in the MLAG system based on a hash principle, and the first STP message and the second STP message are sent to network devices in the MLAG system based on a hash principle, including:

9. The method of claim 7, wherein, The first STP message and the second STP message are sent to network devices in the MLAG system based on a hash principle at a preset period. In a case where the STP interface role of the interface of the network device is of a first type, the second STP message is sent to network devices in the MLAG system based on a hash principle, including:

10. The method of claim 7, wherein, In a case where the STP request message sent by the network device in the MLAG system is received, the second STP message is fed back to the network device, and the STP request message is sent by the network device in a case where it is determined that the keepalive link and the peer-link link established between the multiple network devices in the MLAG system are disconnected. The STP message includes a multiple spanning tree bridge protocol data unit (MST BPDU) field, and the MST BPDU field carries the path cost value.

11. The method according to any one of claims 7-10, characterized in that, The system includes multiple network devices constituting a multi-chassis aggregation group (MLAG) system, a target device accessing the MLAG system, and the target device including multiple interfaces, each interface being used to access a network device in the MLAG system.

12. A communication system, characterized by ​ Any of the plurality of network devices, configured to implement the method steps of any of preceding claims 1-6; The target device, configured to implement the method steps of any of preceding claims 7-11.

13. A network device, comprising: The network device is any of the plurality of network devices constituting a Multi-Chassis Aggregation Group (MLAG) system, the network device comprising: a processor; a transceiver; a machine readable storage medium storing machine executable instructions executable by the processor; the machine executable instructions causing the processor to perform the following steps: receiving a Spanning Tree Protocol (STP) packet carrying a path cost value sent by a target device, wherein the target device comprises a plurality of interfaces, each of which is configured to access one of the network devices in the MLAG system, and the path cost value is used to indicate a number of interfaces in the plurality of interfaces that are in a normal state; if both a keepalive link and a peer-link link established between the plurality of network devices are disconnected, and it is determined that a first path cost value is different from a second path cost value, maintaining the MLAG system, wherein the first path cost value is a path cost value carried in an STP packet received before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in an STP packet received after the keepalive link and the peer-link link are disconnected.

14. The network device of claim 13, wherein, The machine executable instructions further cause the processor to perform the following steps: if both the keepalive link and the peer-link link established between the plurality of network devices are disconnected, and it is determined that the first path cost value is the same as the second path cost value, the MLAG system is in a split state.

15. The network device of claim 13 or 14, wherein, In a case where an STP interface role of the plurality of interfaces of the target device is a first type, the STP packet is a packet sent by the target device through a second interface when it is determined that a first interface of the plurality of interfaces is in a closed state, the first interface being different from the second interface.

16. The network device of claim 13 or 14, wherein, In a case where an STP interface role of the plurality of interfaces of the target device is the first type, the STP packet is a packet sent by the target device to the network devices in the MLAG system according to a preset period and based on a hash principle.

17. The network device of claim 13 or 14, wherein, In a case where an STP interface role of an interface of the network device is the first type, the machine executable instructions further cause the processor to perform the following steps: if both the keepalive link and the peer-link link established between the plurality of network devices are disconnected, sending an STP request packet to the target device, so that after the target device receives the STP request packet, the target device feeds back an STP packet to the network devices in the MLAG system.

18. The network device of claim 13 or 14, wherein, The STP packet comprises a Multiple Spanning Tree Bridge Protocol Data Unit (MST BPDU) field, and the MST BPDU field carries the path cost value.

19. A target device, comprising: The target device accesses a multi-device aggregation group (MLAG) system, the MLAG system is composed of a plurality of network devices, the target device comprises a plurality of interfaces, each interface is used to access a network device in the MLAG system, and the target device comprises: a processor; a transceiver; a machine readable storage medium, the machine readable storage medium stores machine executable instructions which can be executed by the processor; the machine executable instructions cause the processor to execute the following steps: sending a first spanning tree protocol (STP) message to a network device in the MLAG system based on a hash principle, the first STP message comprising a first path cost value; sending a second STP message to the network device in the MLAG system based on the hash principle, the second STP message comprising a second path cost value, so that any network device in the MLAG system maintains the MLAG system in a case where the keepalive link and the peer-link link between the plurality of network devices are both disconnected, and the first path cost value and the second path cost value are different. The first path cost value is a path cost value carried in an STP message received by the network device before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in an STP message received by the network device after the keepalive link and the peer-link link are disconnected.

20. The target device of claim 19, wherein, In a case where an STP interface role of the plurality of interfaces of the target device is a first type, the sending of the first STP message and the second STP message to the network device in the MLAG system based on the hash principle comprises: sending the first STP message and the second STP message to the network device in the MLAG system through a second interface based on the hash principle in a case where a first interface in the plurality of interfaces is in a closed state, the first interface being different from the second interface.

21. The destination device of claim 19, wherein, In a case where an STP interface role of the plurality of interfaces of the target device is a first type, the sending of the first STP message and the second STP message to the network device in the MLAG system based on the hash principle comprises: sending the first STP message and the second STP message to the network device in the MLAG system based on the hash principle according to a preset period.

22. The destination device of claim 19, wherein, In a case where an STP interface role of an interface of the network device is a first type, the sending of the second STP message to the network device in the MLAG system based on the hash principle comprises: In a case where the STP request message sent by the network device in the MLAG system is received, a second STP message is fed back to the network device, wherein the STP request message is sent in a case where the network device determines that both the keepalive link and the peer-link link established between the plurality of network devices in the MLAG system are disconnected.

23. The target device of any of claims 19-22, wherein, The STP message includes a multiple spanning tree bridge protocol data unit (MST BPDU) field, and the MST BPDU field carries the path cost value.

24. A communications device, characterized by The device is applied to any network device in a multi-link aggregation group (MLAG) system, and the device comprises: An STP message receiving module is configured to receive a spanning tree protocol (STP) message carrying a path cost value sent by a target device, wherein the target device includes a plurality of interfaces, each of which is configured to access a network device in the MLAG system, and the path cost value is used to indicate the number of interfaces in a normal state in the plurality of interfaces. A system maintaining module is configured to maintain the MLAG system if both a keepalive link and an internal control peer-link link established between the plurality of network devices are disconnected and it is determined that a first path cost value and a second path cost value are different, wherein the first path cost value is a path cost value carried in an STP message received before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in an STP message received after the keepalive link and the peer-link link are disconnected.

25. A communications device, characterized by The device is applied to a target device accessing an MLAG system, and the MLAG system is composed of a plurality of network devices, the target device includes a plurality of interfaces, each of which is configured to access a network device in the MLAG system, and the device comprises: A first STP message sending module is configured to send a first STP message to a network device in the MLAG system based on a hash principle, and the first STP message includes a first path cost value. A second STP message sending module is configured to send a second STP message carrying a path cost value to a network device in the MLAG system based on a hash principle, the second STP message includes a second path cost value, so that any network device in the MLAG system maintains the MLAG system in a case where both a keepalive link and an internal control peer-link link established between the plurality of network devices are disconnected and the first path cost value and the second path cost value are different. The first path cost value is a path cost value carried in an STP message received by the network device before the keepalive link and the peer-link link are disconnected, and the second path cost value is a path cost value carried in an STP message received by the network device after the keepalive link and the peer-link link are disconnected.

26. A machine-readable storage medium, characterized in that, Machine executable instructions are stored, which when invoked and executed by a processor, cause the processor to implement the method of any of claims 1-6 or 7-11.

27. A computer program product, characterised in that, The computer program product causes the processor to implement the method of any of claims 1-6 or 7-11.

Citation Information

Patent Citations

  • Data processing method and device based on MLAG and medium

    CN115766579A

  • Network equipment fault processing method and device, electronic equipment and storage medium

    CN117221216A

  • Method, system and apparatus for sending link aggregation control protocol message

    WO2020047842A1