Communication method and device

By using protocol packet voting and selection methods in M-LAG networking, misjudgment and network flow outage problems caused by network device restart are solved, ensuring network stability and traffic continuity.

CN118945104AActive Publication Date: 2024-11-12NEW H3C TECH CO LTD

Patent Information

Application Number
CN202411088823.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-12
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

In M-LAG networking, restarting the network device causes another device to misjudgment and split and switch to independent operation mode, resulting in problems such as aggregation interface oscillation and network outage.

Method used

By sending protocol messages to multiple network devices on the M-LAG interface for voting and selection, if the number of response messages received is the same as the number of sent messages, the current working mode will be maintained to avoid unnecessary independent operation mode switching, and reduce Network oscillation and disconnection.

Benefits of technology

It effectively avoids misjudgment and network flow outage problems caused by device restart in M-LAG network, ensuring network stability and traffic continuity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945104A_ABST
    Figure CN118945104A_ABST
Patent Text Reader

Abstract

The invention provides a communication method and device, the method is applied to a first network device, the first network device is located in an M-LAG network, the M-LAG network further comprises a second network device, the first network device comprises a first MLAG interface, and the method comprises the following steps: if the first network device perceives that the M-LAG network is split, the second network device sends the first MLAG interface to the M-LAG network; if so, respectively sending a first protocol message to a plurality of third network devices accessing the M-LAG network through the first MLAG interface; and if second protocol messages sent by the third network equipment are received through the first MLAG interface and the number of the second protocol messages is the same as the number of the first protocol messages, maintaining the current working mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a communication method and device. Background Art

[0002] Multichassis Link Aggregation Group (M-LAG) is a mechanism for implementing cross-device link aggregation, that is, two network devices perform cross-device link aggregation, thereby improving link reliability from the single-board level to the device level.

[0003] For Layer 2 forwarding, M-LAG can be understood as a horizontal virtualization technology that logically virtualizes the two network devices that constitute M-LAG into one network device to form a unified Layer 2 logical node. Figure 1 As shown, Figure 1 The following is a schematic diagram of the existing M-LAG network. Figure 1 In the example, network device A and network device B form an M-LAG network and form load sharing to forward traffic together. When one of the network devices fails, the traffic can be quickly switched to the other network device to ensure the normal operation of the service.

[0004] In an M-LAG network, if both the peer-link and the keepalive link fail, the M-LAG network enters a split state. In order to prevent both network devices in the M-LAG network from forwarding traffic as master devices, the slave devices in the M-LAG network need to work independently, that is, the slave devices switch to independent operation mode immediately or after a period of time.

[0005] However, the above switching from the device to the independent operation mode will also expose the following defects: 1) If any network device in the M-LAG network is restarted, the other network device will misjudge that the M-LAG network is split and switch to the independent operation mode; 2) After the network device enters the independent mode, the MAC address of its M-LAG network changes, causing the aggregation interface of the network device to vibrate, and the table entries (MAC address table entries, ARP table entries) on the aggregation interface are deleted and re-learned, resulting in network interruption for several seconds. Summary of the invention

[0006] In view of this, the present application provides a communication method and apparatus to solve the problem that a network device in the existing M-LAG network is restarted, causing another network to misjudge that the M-LAG network is split and switch to an independent operation mode, and the problem that after the network device enters the independent mode, the aggregation interface oscillates, causing the network to be disconnected.

[0007] In a first aspect, the present application provides a communication method, the method being applied to a first network device, the first network device being in an M-LAG network, the M-LAG network further comprising a second network device, the first network device comprising a first MLAG interface, the method comprising:

[0008] If the first network device senses that the M-LAG network is split, the first protocol message is sent to each of the plurality of third network devices connected to the M-LAG network through the first MLAG interface;

[0009] If the second protocol packets sent by the third network device are received through the first MLAG interface, and the number of the second protocol packets is the same as the number of the first protocol packets, the current working mode is maintained.

[0010] In a second aspect, the present application provides a communication device, the device being applied to a first network device, the first network device being in an M-LAG network, the M-LAG network further comprising a second network device, the first network device comprising a first MLAG interface, the device comprising:

[0011] a sending unit, configured to send a first protocol message to each of a plurality of third network devices connected to the M-LAG network through the first MLAG interface if the first network device senses that the M-LAG network is split;

[0012] A maintaining unit, configured to maintain a current working mode if a second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages is the same as the number of the first protocol messages.

[0013] In a third aspect, the present application provides a network device, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the first aspect of the present application.

[0014] Therefore, by applying the communication method and device provided in the present application, if the first network device senses that the M-LAG network is split, the first network device sends a first protocol message to multiple third network devices connected to the M-LAG network through the first MLAG interface; if the second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages is the same as the number of the first protocol messages, the first network device maintains the current working mode.

[0015] In this way, the protocol packets sent by the network devices connected to the M-LAG network are used for voting, so that after the M-LAG network is split, one network device is controlled to enter the independent mode, and the other network device maintains the current working mode, reducing network oscillation and interruption. At the same time, it also solves the problem that one network device in the M-LAG network restarts, causing the other network to misjudge the M-LAG network split and switch to the independent operation mode, and the problem that after the network device enters the independent mode, the aggregation interface oscillates, causing the network to be disconnected. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a schematic diagram of the existing MLAG network;

[0017] Figure 2 A flow chart of a communication method provided in an embodiment of the present application;

[0018] Figure 3 A schematic diagram of an M-LAG network provided in an embodiment of the present application;

[0019] Figure 4 Another M-LAG networking diagram provided in an embodiment of the present application;

[0020] Figure 5 A structural diagram of a communication device provided in an embodiment of the present application;

[0021] Figure 6 The network device hardware structure provided in the embodiment of the present application. DETAILED DESCRIPTION

[0022] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0023] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more corresponding listed items.

[0024] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0025] The communication method provided in the embodiment of the present application is described in detail below. Figure 2 , Figure 2 A flow chart of a communication method provided in an embodiment of the present application. The method is applied to a first network device. The communication method provided in an embodiment of the present application may include the following steps.

[0026] Step 210: If the first network device senses that the M-LAG network is split, the first protocol message is sent to each of the plurality of third network devices connected to the M-LAG network through the first MLAG interface;

[0027] Specifically, the first network device and the second network device form an M-LAG network, form load sharing, and jointly forward traffic. The first network device includes a first Peer-link interface, and the second network device includes a second Peer-link interface. The two network devices establish a Peer-link through their respective Peer-link interfaces. The first network device also includes a first interface, and the second network device also includes a second interface. The two network devices establish a Keepalive link through the first interface and the second interface respectively.

[0028] The first network device also includes a first MLAG interface, and the second network device also includes a second MLAG interface. The third network device accesses the M-LAG network and is connected to the first MLAG interface of the first network device and the second MLAG interface of the second network device respectively.

[0029] In the embodiment of the present application, the first MLAG interface and the second MLAG interface belong to the same MLAG and are member interfaces within the MLAG.

[0030] The following description is given by taking the first network device as an example.

[0031] Optionally, the first network device periodically detects the status of its first peer-link interface and the first interface. If the status of the first peer-link interface and the first interface both change from an up state to a down state, the first network device determines that the M-LAG network is split.

[0032] It should be noted that if any one of the first peer-link interface and the first interface changes from an up (startup) state to a down (shutdown) state, the first network device determines that the M-LAG networking is not split.

[0033] Among them, the reasons for the status change of the first Peer-link interface and the first interface are as follows: 1) the second network device is powered off and restarted, causing the Peer-link and Keepalive links to be disconnected; 2) the Peer-link and Keepalive links are faulty.

[0034] In an embodiment of the present application, if the first network device senses that the M-LAG networking is split, the first network device generates a first protocol message and sends the first protocol message to multiple third network devices connected to the M-LAG networking through the first MLAG interface.

[0035] The first MLAG interface has been configured and running a layer 2 protocol, such as ARP, STP, IGMP, etc. Taking ARP as an example, the first protocol message may specifically be an ARP detection message.

[0036] It is understandable that the second network device may also perform this step. For example, after the first network device is powered off and restarted, the second network device determines that the M-LAG network is split; after the Peer-link and Keepalive links fail, the second network device determines that the M-LAG network is split.

[0037] Step 220: If the second protocol packets sent by the third network device are received through the first MLAG interface, and the number of the second protocol packets is the same as the number of the first protocol packets, maintain the current working mode.

[0038] Specifically, according to the description of step 220, after receiving the first protocol message, each third network device generates a response message to the first protocol message, for example, a second protocol message. Each third network device sends a second protocol message to the M-LAG network. The second protocol message may be specifically an ARP probe response message.

[0039] In one implementation, if the second network device is powered off and restarted, each second protocol message sent by the third network device is received by the first network device. If the first network device receives the second protocol message sent by the third network device through the first MLAG interface, and the number of the second protocol messages is the same as the number of the first protocol messages, the first network device maintains the current working mode.

[0040] In another implementation, if the Peer-link and Keepalive links fail, each third network device determines the member port in the aggregation group for sending the second protocol message by a hash algorithm when sending the second protocol message. After receiving the second protocol message, the first network device identifies the number of received second protocol messages. If the number of second protocol messages is the same as the number of first protocol messages, the first network device determines that each third network device sends the second protocol message to the local, and the first network device maintains the current working mode and does not enter the independent working mode.

[0041] The above-mentioned independent working mode specifically refers to that the network device works independently without the M-LAG network and forwards service messages independently. The above-mentioned current working mode specifically refers to forwarding service messages as a master device in the M-LAG network.

[0042] In the embodiment of the present application, no matter in which of the above implementations, after receiving the second protocol message, the first network device identifies the number of received second protocol messages. If the number of second protocol messages is the same as the number of first protocol messages, the first network device determines that each third network device sends the second protocol message to the local, and the first network device maintains the current working mode and does not enter the independent working mode.

[0043] It is understandable that the second network device may also perform this step, which will not be repeated here.

[0044] Therefore, by applying the communication method provided in the present application, if the first network device senses that the M-LAG network is split, the first network device sends a first protocol message to multiple third network devices connected to the M-LAG network through the first MLAG interface; if the second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages is the same as the number of the first protocol messages, the first network device maintains the current working mode.

[0045] In this way, the protocol packets sent by the network devices connected to the M-LAG network are used for voting, so that after the M-LAG network is split, one network device is controlled to enter the independent mode, and the other network device maintains the current working mode, reducing network oscillation and interruption. At the same time, it also solves the problem that one network device in the M-LAG network restarts, causing the other network to misjudge the M-LAG network split and switch to the independent operation mode, and the problem that after the network device enters the independent mode, the aggregation interface oscillates, causing the network to be disconnected.

[0046] Optionally, in the embodiment of the present application, the first network device further includes another process in the process of identifying the number of second protocol packets and the number of first protocol packets.

[0047] Specifically, after receiving the second protocol message, the first network device identifies the number of received second protocol messages. If the number of second protocol messages is different from the number of first protocol messages, the first network device continues to identify whether the number of second protocol messages exceeds the first threshold.

[0048] If the number of the second protocol packets exceeds the first threshold, the first network device determines its own device role in the M-LAG network before the M-LAG network is split.

[0049] If the device role in the M-LAG networking is a master device, the first network device maintains the current working mode and does not enter the independent working mode.

[0050] If the number of the second protocol packets does not exceed the first threshold, the first network device determines its own device role in the M-LAG network before the M-LAG network is split.

[0051] If the device role in the M-LAG networking is a master device, the first network device starts an independent working mode.

[0052] Optionally, in the embodiment of the present application, the first network device further includes another process in the process of identifying the number of second protocol packets and the number of first protocol packets.

[0053] Specifically, after receiving the second protocol message, the first network device identifies the number of received second protocol messages. If the number of second protocol messages is different from the number of first protocol messages, the first network device continues to identify whether the number of second protocol messages exceeds the first threshold.

[0054] If the number of the second protocol packets does not exceed the first threshold, the first network device determines its own device role in the M-LAG network before the M-LAG network is split.

[0055] If the device role in the M-LAG network is a standby device, the first network device starts an independent working mode.

[0056] If the number of the second protocol packets exceeds the first threshold, the first network device determines its own device role in the M-LAG network before the M-LAG network is split.

[0057] If the device role in the M-LAG networking is a standby device, the first network device maintains the current working mode and does not enter the independent working mode.

[0058] Optionally, in the embodiment of the present application, the first network device further includes another process in the process of identifying the number of second protocol packets and the number of first protocol packets.

[0059] If the number of the second protocol packets is equal to the first threshold, the first network device determines its own device role in the M-LAG network before the M-LAG network is split.

[0060] If the device role in the M-LAG networking is a master device, the first network device maintains the current working mode and does not enter the independent working mode.

[0061] If the device role in the M-LAG networking is a standby device, the first network device starts an independent working mode.

[0062] In the embodiment of the present application, the first threshold is specifically more than half of the number of the third network devices. For example, if the number of the third network devices is 10, the first threshold may be specifically more than 5.

[0063] Optionally, in an embodiment of the present application, after the above-mentioned first network device starts the independent working mode, it also executes a process of interacting with each third network device through protocol messages to notify its own aggregation interface information.

[0064] Specifically, after the first network device starts the independent working mode, a third protocol message is generated, and the third protocol message includes a system link aggregation control protocol (English: Link Aggregation Control Protocol, referred to as: LACP) priority and a system MAC address. Among them, the system LACP priority is the priority configured by the first network device itself (the system LACP priority of non-M-LAG networking), and the system MAC address is the MAC address of the first network device itself (the system MAC address of non-M-LAG networking).

[0065] The first network device sends a third protocol message to each third network device through the first MLAG interface.

[0066] After receiving the third protocol message, the third network device obtains the system LACP priority and system MAC address of the first network device. It is understandable that in the scenario where both the Peer-link and the Keepalive link fail, the second network device also generates a third protocol message and sends the third protocol message to each third network device through the second MLAG interface. The third protocol message includes the system LACP priority and the system MAC address. Among them, the system LAPC priority is the priority of the M-LAG network, and the system MAC address is the MAC address of the M-LAG network.

[0067] Therefore, after receiving the third protocol message sent by each network device, the third network device obtains the system LACP priority and system MAC address of the network device from it. The third network device compares the system LACP priority and selects the highest value of the system LACP priority. The third network device uses the MLAG interface included in the network device that sends the highest value as the selected interface, and the MLAG interfaces included in other network devices as non-selected interfaces.

[0068] If the system LACP priorities are all the same, the third network device selects the minimum value of the system MAC address and uses the MLAG interface included in the network device that sends the minimum value as the selected interface and the MLAG interfaces included in other network devices as the non-selected interfaces.

[0069] For example, if the system LACP priority sent by the first network device is 100 and the system LACP priority sent by the second network device is 1000, the third network device selects the second MLAG interface as the selected interface and the first MLAG interface as the unselected interface.

[0070] It is understandable that in the scenario where the second network device is powered off and restarted, the second network device no longer sends the third protocol message to each third network device. After the second network device is restarted and recovered, it re-establishes the M-LAG network with the first network device, and sends the third protocol message to each third network device during the process of the standby device joining the M-LAG network.

[0071] The third protocol message is specifically a LACP protocol message.

[0072] Optionally, in the embodiment of the present application, the process further includes sending a protocol message to each third network device when the first network device does not receive the second protocol message.

[0073] Specifically, in a scenario where both the Peer-link and the Keepalive link fail, the M-LAG network splits, and the first network device and the second network device each send a first protocol message to each third network device, and wait to receive a second protocol message sent by the third network device.

[0074] Taking the first network device as an example for description, after sending the first protocol message, the first network device starts a timeout timer and configures a preset time for the timeout timer, for example, 3 seconds.

[0075] If the first network device does not receive any second protocol message within the preset time, the first network device starts the independent working mode. The first network device also generates a fourth protocol message, which includes a system LACP priority and a system MAC address. Among them, the system LACP priority is the priority configured by the first network device itself (the system LACP priority of non-M-LAG networking), and the system MAC address is the MAC address of the first network device itself (the system MAC address of non-M-LAG networking).

[0076] The first network device sends a fourth protocol message to each third network device through the first MLAG interface.

[0077] After receiving the fourth protocol message, the third network device compares the system LACP priority and the system MAC address according to the description in the above embodiment, and selects one MLAG interface as the selected interface and other MLAG interfaces as unselected interfaces. For example, the third network device selects the second MLAG interface as the selected interface and the first MLAG interface as the unselected interface.

[0078] The fourth protocol message is specifically a LACP protocol message.

[0079] It should be noted that in the above-mentioned multiple embodiments, the third network device will continue to interact and communicate with the network device where the selected MLAG interface is located, and will no longer interact and communicate with the network device where the non-selected MLAG interface is located.

[0080] The communication method provided in the embodiment of the present application is described in detail below. Figure 3 , Figure 3 A schematic diagram of an M-LAG network provided in an embodiment of the present application.

[0081] exist Figure 3 In the example, A1 and A2 form an M-LAG network, and A3 and A4 are active-active devices connected to the M-LAG network. A1 includes ports 1 and 2, forming MLAG interface 1; A2 includes ports 3 and 4, forming MLAG interface 2. MLAG interface 1 and MLAG interface 2 belong to the same aggregation group. A1 and A2 are gateways, and the gateway address is 100.1.1.1 / 24.

[0082] A3 includes interfaces port5 and port6, which form MLAG interface 3; A4 includes interfaces port7 and port8, which form MLAG interface 4. Port5, port6, port7, and port8 are connected to multiple downstream interfaces of A1 and A2 respectively. The address of A3 is 100.1.1.2 / 24, and the address of A4 is 100.1.1.3 / 24. A1 and A2 can learn the ARP information of A3 and A4.

[0083] A1 and A2 each further include a Peer-link interface, for example, A1 includes Peer-link port 1, and A2 includes Peer-link port 2. A peer-link is established between Peer-link port 1 and Peer-link port 2. A1 further includes port 9, and A2 further includes port 10. A Keepalive link is established between port 9 and port 10.

[0084] A1 and A2 also include uplink ports, and the uplink ports of each network device are connected to A5. A5 is connected to A1 and A2 through ECMP. Among them, A3 and A4 are user-side access devices, and A5 is a network-side access device.

[0085] In the embodiment of the present application, ARP is run on MLAG interface 1 and MLAG interface 2. A2 is used as an example for description.

[0086] A1 is powered off and restarted, and all interfaces of A1 are down. A2 periodically detects the status of its own Peer-link port 2 and port 10. If the status of Peer-link port 2 and port 10 both change from up to down, A2 determines that the M-LAG network is split.

[0087] After A2 senses that the M-LAG network is split, it generates an ARP probe packet based on the local ARP address table and sends the ARP probe packet to A3 and A4 respectively through MLAG interface 2.

[0088] After receiving the ARP detection message, A3 and A4 generate ARP response messages respectively. Since all interfaces of A1 are down, the interfaces (port5 and port7) connected to A1 by A3 and A4 also change from up to down. The ARP response messages generated by A3 and A4 will not be sent to A1 through port5 and port7, but will only be sent to A2 through port6 ​​and port8.

[0089] After receiving the ARP response message, A2 identifies whether the number of ARP response messages is the same as the number of ARP detection messages. In the embodiment of the present application, the number of ARP response messages received by A2 is the same as the number of ARP detection messages sent, A2 determines that A3 and A4 all vote for itself, and A2 maintains the current working mode and does not enter the independent working mode.

[0090] In the embodiment of the present application, after A1 is restarted and recovered, Peer-link port 1 and port 9 are restored from down state to up state. A1 and A2 reconstruct the M-LAG network and join the M-LAG network as a standby device. It can be understood that the process of A1 and A2 reconstructing the M-LAG network and joining the M-LAG network is the same as the existing process and will not be repeated here.

[0091] The communication method provided in the embodiment of the present application is described in detail below. Figure 4 , Figure 4 A schematic diagram of another M-LAG networking provided in an embodiment of the present application. Figure 4 The M-LAG network shown is similar to Figure 3 The M-LAG networking shown is the same and will not be repeated here.

[0092] In the M-LAG network, A1 is the master device and A2 is the slave device.

[0093] In the embodiment of the present application, if the Peer-link and Keepalive links fail, the status of Peer-link port 1 and port 9 included in A1 changes from up to down; the status of Peer-link port 2 and port 10 included in A2 changes from up to down.

[0094] A1 and A2 periodically detect the status of their own peer-link ports and port9 / port10. If the status of the peer-link ports and port9 / port10 changes from up to down, A1 and A2 determine that the M-LAG network is split.

[0095] After A1 and A2 sense that the M-LAG network is split, they both generate ARP detection packets based on the local ARP address table entries and send ARP detection packets to A3 and A4 respectively through MLAG interface 1 and MLAG interface 2. After sending the ARP detection packets, A1 and A2 each start the ARP detection timeout timer locally and configure the preset time, for example, 3 seconds.

[0096] In one implementation, after receiving the ARP detection message, A3 and A4 generate ARP response messages respectively. When sending the ARP response messages, A3 and A4 determine the member ports from their respective aggregation interfaces through a hash algorithm.

[0097] After A3 and A4 determine the member port, they send ARP response messages to A1 or A2 through the member port. If the member port selected by A3 is port5 and the member port selected by A4 is port7, A1 will receive two ARP response messages.

[0098] After receiving the ARP response message within the preset time, A1 identifies whether the number of ARP response messages is the same as the number of ARP detection messages. In the embodiment of the present application, the number of ARP response messages received by A1 is the same as the number of ARP detection messages sent, A1 determines that A3 and A4 all vote for itself, and A1 maintains the current working mode and does not enter the independent working mode.

[0099] If A2 does not receive any ARP response message within the preset time, A2 starts the independent working mode. A2 also generates LACP protocol message 1, which includes the system LACP priority and the system MAC address. Among them, the system LACP priority is the priority configured by A2 itself (the system LACP priority of non-M-LAG networking), and the system MAC address is the MAC address of A2 itself (the system MAC address of non-M-LAG networking).

[0100] A2 sends LACP protocol message 1 to A3 and A4 through MLAG interface 2. At the same time, A1 also periodically generates LACP protocol message 2 and sends it to A3 and A4. The LACP protocol message 2 includes the system LACP priority and the system MAC address. The system LACP priority is the priority of the M-LAG network, and the system MAC address is the MAC address of the M-LAG network.

[0101] After receiving multiple LACP protocol packets, A3 and A4 compare the system LACP priority and system MAC address according to the LACP calculation principle, and select port5 and port7 as selected interfaces and other interfaces as non-selected interfaces.

[0102] In another implementation, after receiving the ARP detection message, A3 and A4 generate ARP response messages respectively. When sending the ARP response message, A3 and A4 determine the member interface from their respective aggregation interfaces through a hash algorithm.

[0103] After A3 and A4 determine the member port, they send an ARP response message to A1 or A2 through the member port. If the member port selected by A3 is port5 and the member port selected by A4 is port8, A1 and A2 will receive one ARP response message respectively.

[0104] After receiving the ARP response message within the preset time, A1 and A2 identify whether the number of ARP response messages is the same as the number of ARP probe messages. In the embodiment of the present application, the number of ARP response messages received by A1 and A2 is different from the number of ARP probe messages sent, and A1 and A2 continue to identify whether the number of ARP response messages exceeds a first threshold (for example, the first threshold is specifically more than 1).

[0105] In the embodiment of the present application, the number of ARP response messages received by A1 and A2 is equal to the first threshold, so A1 and A2 determine their own device roles in the M-LAG network before the M-LAG network is split.

[0106] Before the M-LAG network is split, A1 is the master device in the M-LAG network. A1 maintains the current working mode and does not enter the independent working mode. Before the M-LAG network is split, A2 is the backup device in the M-LAG network and A2 starts the independent working mode.

[0107] A2 also generates LACP protocol message 3, which includes system LACP priority and system MAC address. The system LACP priority is the priority configured by A2 itself (system LACP priority of non-M-LAG networking), and the system MAC address is the MAC address of A2 itself (system MAC address of non-M-LAG networking).

[0108] A2 sends LACP protocol message 3 to A3 and A4 through MLAG interface 2. At the same time, A1 also generates LACP protocol message 4 and sends it to A3 and A4. The LACP protocol message 2 includes the system LACP priority and the system MAC address. The system LACP priority is the priority of the M-LAG network, and the system MAC address is the MAC address of the M-LAG network.

[0109] After receiving multiple LACP protocol packets, A3 and A4 compare the system LACP priority and system MAC address according to the LACP calculation principle, and select port5 and port7 as selected interfaces and other interfaces as non-selected interfaces.

[0110] In another implementation, after receiving the ARP detection message, A3 and A4 generate ARP response messages respectively. When sending the ARP response message, A3 and A4 determine the member interface from their respective aggregation interfaces through a hash algorithm.

[0111] After A3 and A4 determine the member port, they send ARP response messages to A1 or A2 through the member port. If the member port selected by A3 is port6 ​​and the member port selected by A4 is port8, A2 will receive two ARP response messages.

[0112] After receiving the ARP response message within the preset time, A2 identifies whether the number of ARP response messages is the same as the number of ARP detection messages. In the embodiment of the present application, the number of ARP response messages received by A2 is the same as the number of ARP detection messages sent, A2 determines that A3 and A4 all vote for itself, and A2 maintains the current working mode and does not enter the independent working mode.

[0113] If A1 does not receive any ARP response message within the preset time, A1 starts the independent working mode. A1 also generates LACP protocol message 5, which includes the system LACP priority and the system MAC address. Among them, the system LACP priority is the priority configured by A1 itself (the system LACP priority of non-M-LAG networking), and the system MAC address is the MAC address of A1 itself (the system MAC address of non-M-LAG networking).

[0114] A1 sends LACP protocol message 5 to A3 and A4 through MLAG interface 1. At the same time, A2 also periodically generates LACP protocol message 6 and sends it to A3 and A4. The LACP protocol message 6 includes the system LACP priority and the system MAC address. The system LACP priority is the priority of the M-LAG network, and the system MAC address is the MAC address of the M-LAG network.

[0115] After receiving multiple LACP protocol packets, A3 and A4 compare the system LACP priority and system MAC address according to the LACP calculation principle, and select port6 ​​and port8 as selected interfaces and other interfaces as non-selected interfaces.

[0116] Based on the same inventive concept, the present application embodiment also provides a communication device corresponding to the communication method. Figure 5 , Figure 5 A communication device provided in an embodiment of the present application is applied to a first network device, the first network device is in an M-LAG network, the M-LAG network further includes a second network device, the first network device includes a first MLAG interface, and the device includes:

[0117] The sending unit 510 is configured to send a first protocol message to each of the plurality of third network devices connected to the M-LAG network through the first MLAG interface if the first network device senses that the M-LAG network is split;

[0118] The maintaining unit 520 is configured to maintain the current working mode if the second protocol packets sent by the third network device are received through the first MLAG interface, and the number of the second protocol packets is the same as the number of the first protocol packets.

[0119] Optionally, the maintaining unit 520 is further configured to, if a second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages exceeds a first threshold, maintain the current working mode when the device role of the first network device in the M-LAG networking is a master device;

[0120] or,

[0121] The device also includes: a starting unit (not shown in the figure), which is used to start the independent working mode if the second protocol message sent by the third network device is received through the first MLAG interface and the number of the second protocol messages does not exceed the first threshold, when the device role of the first network device in the M-LAG networking is a master device.

[0122] Optionally, the starting unit (not shown in the figure) is further used to, if a second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages does not exceed the first threshold, when the device role of the first network device in the M-LAG networking is a standby device, start the independent working mode;

[0123] or,

[0124] The maintaining unit 520 is also used to maintain the current working mode when the device role of the first network device in the M-LAG networking is a backup device if a second protocol message sent by the third network device is received through the first MLAG interface and the number of the second protocol messages exceeds the first threshold.

[0125] Optionally, the maintaining unit 520 is further configured to, if a second protocol packet sent by the third network device is received through the first MLAG interface, and the number of the second protocol packets is equal to the first threshold, maintain the current working mode when the device role of the first network device in the M-LAG is a master device;

[0126] or;

[0127] The starting unit (not shown in the figure) is also used to start the independent working mode when the device role of the first network device in the M-LAG networking is a backup device if a second protocol message sent by the third network device is received through the first MLAG interface and the number of the second protocol messages is equal to the first threshold.

[0128] Optionally, the sending unit 510 is also used to send a third protocol message to each of the third network devices through the first MLAG interface, and the third protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices uses the second MLAG interface included in the second network device as a selected interface and the first MLAG interface as a non-selected interface according to the system LACP priority and the system MAC address.

[0129] Optionally, the starting unit (not shown in the figure) is further used to start the independent working mode if the first network device is in the working mode and does not receive the second protocol message within a preset time;

[0130] The sending unit 510 is also used to send a fourth protocol message to each of the third network devices through the first MLAG interface, where the fourth protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices uses the second MLAG interface included in the second network device as a selected interface and the first MLAG interface as a non-selected interface according to the system LACP priority and the system MAC address.

[0131] Optionally, a Peer-link and a Keepalive link have been established between the first network device and the second network device;

[0132] The device also includes: a determining unit (not shown in the figure), which is used to determine that the M-LAG networking is split when the Peer-link interface used to establish the Peer-link and the interface used to establish the Keepalive link both change from an up state to a down state.

[0133] Therefore, by applying the communication device provided in the present application, if the first network device senses that the M-LAG network is split, the first network device sends a first protocol message to multiple third network devices connected to the M-LAG network through the first MLAG interface; if the second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages is the same as the number of the first protocol messages, the first network device maintains the current working mode.

[0134] In this way, the protocol packets sent by the network devices connected to the M-LAG network are used for voting, so that after the M-LAG network is split, one network device is controlled to enter the independent mode, and the other network device maintains the current working mode, reducing network oscillation and interruption. At the same time, it also solves the problem that one network device in the M-LAG network restarts, causing the other network to misjudge the M-LAG network split and switch to the independent operation mode, and the problem that after the network device enters the independent mode, the aggregation interface oscillates, causing the network to be disconnected.

[0135] Based on the same inventive concept, the embodiment of the present application also provides a network device, such as Figure 6 As shown, it includes a processor 610, a transceiver 620 and a machine-readable storage medium 630, the machine-readable storage medium 630 stores machine-executable instructions that can be executed by the processor 610, and the processor 610 is prompted by the machine-executable instructions to execute the communication method provided in the embodiment of the present application. Figure 5 The communication device shown can be used as Figure 6 The network device hardware structure shown is implemented.

[0136] The computer-readable storage medium 630 may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the computer-readable storage medium 630 may also be at least one storage device located away from the processor 610.

[0137] The processor 610 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components.

[0138] In the embodiment of the present application, the processor 610 reads the machine executable instructions stored in the machine readable storage medium 630, and the machine executable instructions enable the processor 610 itself and call the transceiver 620 to execute the communication method described in the aforementioned embodiment of the present application.

[0139] In addition, an embodiment of the present application provides a machine-readable storage medium 630, which stores machine-executable instructions. When called and executed by the processor 610, the machine-executable instructions prompt the processor 610 itself and the calling transceiver 620 to execute the communication method described in the aforementioned embodiment of the present application.

[0140] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0141] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0142] As for the communication device and machine-readable storage medium embodiments, since the method contents involved are basically similar to the aforementioned method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0143] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A communication method, characterized in that: The method is applied to a first network device, the first network device is in an M-LAG network, the M-LAG network further includes a second network device, the first network device includes a first MLAG interface, and the method includes: If the first network device senses that the M-LAG network is split, the first protocol message is sent to each of the plurality of third network devices connected to the M-LAG network through the first MLAG interface; If the second protocol packets sent by the third network device are received through the first MLAG interface, and the number of the second protocol packets is the same as the number of the first protocol packets, the current working mode is maintained.

2. The method according to claim 1, characterized in that The method further comprises: If a second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages exceeds a first threshold, when the device role of the first network device in the M-LAG network is a master device, the current working mode is maintained; or, If a second protocol message sent by the third network device is received through the first MLAG interface and the number of the second protocol messages does not exceed the first threshold, then when the device role of the first network device in the M-LAG networking is a master device, an independent working mode is started.

3. The method according to claim 2, characterized in that The method further comprises: If a second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages does not exceed the first threshold, when the device role of the first network device in the M-LAG networking is a standby device, an independent working mode is started; or, If a second protocol message sent by the third network device is received through the first MLAG interface and the number of the second protocol messages exceeds the first threshold, when the device role of the first network device in the M-LAG networking is a backup device, the current working mode is maintained.

4. The method according to claim 2, characterized in that: The method further comprises: If a second protocol packet sent by the third network device is received through the first MLAG interface, and the number of the second protocol packets is equal to the first threshold, when the device role of the first network device in the M-LAG is a master device, the current working mode is maintained; or; If a second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages is equal to the first threshold, then when the device role of the first network device in the M-LAG networking is a backup device, an independent working mode is started.

5. The method according to any one of claims 2 to 4, characterized in that: After starting the independent working mode, the method further includes: A third protocol message is sent to each of the third network devices through the first MLAG interface, wherein the third protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices uses the second MLAG interface included in the second network device as a selected interface and the first MLAG interface as a non-selected interface according to the system LACP priority and the system MAC address.

6. The method according to claim 1, characterized in that The method further comprises: If the first network device is in the working mode and does not receive the second protocol message within a preset time, starting the independent working mode; A fourth protocol message is sent to each of the third network devices through the first MLAG interface, wherein the fourth protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices uses the second MLAG interface included in the second network device as a selected interface and the first MLAG interface as a non-selected interface according to the system LACP priority and the system MAC address.

7. The method according to claim 1, characterized in that A Peer-link and a Keepalive link have been established between the first network device and the second network device; If the first network device senses that the M-LAG networking is split, before sending the first protocol message to a plurality of third network devices connected to the M-LAG networking through the first MLAG interface, the method further includes: When the Peer-link interface used to establish the Peer-link and the interface used to establish the Keepalive link both change from an up state to a down state, it is determined that the M-LAG networking is split.

8. A communication device, characterized in that: The apparatus is applied to a first network device, the first network device is in an M-LAG network, the M-LAG network further includes a second network device, the first network device includes a first MLAG interface, and the apparatus includes: a sending unit, configured to send a first protocol message to each of a plurality of third network devices connected to the M-LAG network through the first MLAG interface if the first network device senses that the M-LAG network is split; A maintaining unit, configured to maintain a current working mode if a second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages is the same as the number of the first protocol messages.

9. The device according to claim 8, characterized in that The maintaining unit is further configured to, if a second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages exceeds a first threshold, maintain the current working mode when the device role of the first network device in the M-LAG networking is a master device; or, The device also includes: a starting unit, which is used to start the independent working mode if the second protocol message sent by the third network device is received through the first MLAG interface and the number of the second protocol messages does not exceed the first threshold, when the device role of the first network device in the M-LAG networking is a master device.

10. The device according to claim 9, characterized in that The starting unit is further configured to, if a second protocol message sent by the third network device is received through the first MLAG interface, and the number of the second protocol messages does not exceed the first threshold, start the independent working mode when the device role of the first network device in the M-LAG networking is a standby device; or, The maintaining unit is also used to maintain the current working mode when the device role of the first network device in the M-LAG networking is a backup device if a second protocol message sent by the third network device is received through the first MLAG interface and the number of the second protocol messages exceeds the first threshold.

11. The device according to claim 9, characterized in that The maintaining unit is further configured to, if a second protocol packet sent by the third network device is received through the first MLAG interface, and the number of the second protocol packets is equal to the first threshold, maintain the current working mode when the device role of the first network device in the M-LAG is a master device; or; The starting unit is also used to start the independent working mode when the device role of the first network device in the M-LAG networking is a backup device if a second protocol message sent by the third network device is received through the first MLAG interface and the number of the second protocol messages is equal to the first threshold.

12. The device according to any one of claims 9 to 11, characterized in that: The sending unit is also used to send a third protocol message to each of the third network devices through the first MLAG interface, where the third protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices uses the second MLAG interface included in the second network device as a selected interface and the first MLAG interface as a non-selected interface according to the system LACP priority and the system MAC address.

13. The device according to claim 9, characterized in that The starting unit is further configured to start the independent working mode if the first network device is in the working mode and does not receive the second protocol message within a preset time; The sending unit is also used to send a fourth protocol message to each of the third network devices through the first MLAG interface, where the fourth protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices uses the second MLAG interface included in the second network device as a selected interface and the first MLAG interface as a non-selected interface according to the system LACP priority and the system MAC address.

14. The device according to claim 8, characterized in that A Peer-link and a Keepalive link have been established between the first network device and the second network device; The device further includes: a determining unit, configured to determine that the M-LAG networking is split when the Peer-link interface used to establish the Peer-link and the interface used to establish the Keepalive link both change from an up state to a down state.

Citation Information

Patent Citations

  • Cluster management method and device

    CN106657355A

  • Message synchronization method, device, equipment and medium based on MLAG environment

    CN111682927A

  • Fault processing method and device

    CN111953591A

  • Method and device for supporting MLAG active-active access in VXLAN network

    CN113381931A

  • MLAG link fault switching method and device

    CN114338512A

Cited By

  • Fault processing method and device, network equipment and program product

    CN121418343A