Communication method and apparatus
Patent Information
- Application Number
- CN202411088823.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2026-08-07
- Estimated Expiration
- 2044-08-08
AI Technical Summary
[0006]有鉴于此,本申请提供了一种通信方法及装置,用以解决现有M-LAG组网中一台网络设备重启,导致另一台网络误判M-LAG组网分裂并切换为独立运行模式的问题以及网络设备进入独立模式后,聚合接口震荡,导致网络断流的问题
[0014]因此,通过应用本申请提供的通信方法及装置,若第一网络设备感知到M-LAG组网分裂,则第一网络设备通过第一MLAG接口向接入M-LAG组网的多个第三网络设备分别发送第一协议报文;若通过第一MLAG接口接收到第三网络设备发送的第二协议报文,且第二协议报文的数量与第一协议报文的数量相同,则第一网络设备维持当前的工作模式。
Smart Images

Figure CN118945104B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method and apparatus. Background Technology
[0002] Multichassis Link Aggregation Group (M-LAG) is a mechanism for achieving cross-device link aggregation. That is, two network devices perform cross-device link aggregation, thereby improving link reliability from the 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 constituting M-LAG into a single network device, forming a unified Layer 2 logical node. For example... Figure 1 As shown, Figure 1 This is a schematic diagram of an existing M-LAG network. Figure 1 In this setup, network device A and network device B form an M-LAG network, sharing the load and forwarding traffic together. When one network device fails, traffic can be quickly switched to the other, ensuring the normal operation of services.
[0004] In an M-LAG network, if both the Peer-link and Keepalive links fail, the M-LAG network enters a split state. To prevent both network devices in the M-LAG network from acting as masters and forwarding traffic, the slave devices in the M-LAG network need to operate independently; that is, the slave devices must immediately or after a period of time switch to independent operation mode.
[0005] However, the above-mentioned switching from device to stand-alone mode will also expose the following defects: 1) If any network device in the M-LAG network restarts, it will cause another network device to misjudge the M-LAG network as split and switch to stand-alone mode; 2) After the network device enters stand-alone mode, the MAC address of its M-LAG network changes, causing the aggregation interface of the network device to oscillate, and the entries (MAC address entries, ARP entries) on the aggregation interface to be deleted and relearned, resulting in network outages lasting for several seconds. Summary of the Invention
[0006] In view of this, this application provides a communication method and apparatus to solve the problem that restarting one network device in an existing M-LAG network causes another network to misjudge the M-LAG network split and switch to independent operation mode, and the problem that after a network device enters independent mode, the aggregation interface oscillates, causing network outages.
[0007] In a first aspect, this application provides a communication method applied to a first network device, the first network device being located within an M-LAG network, the M-LAG network further including a second network device, the first network device including a first MLAG interface, the method comprising:
[0008] If the first network device detects the split of the M-LAG network, it sends a first protocol message to each of the multiple third network devices connected to the M-LAG network through the first MLAG interface.
[0009] 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, then the current working mode is maintained.
[0010] Secondly, this application provides a communication device applied to a first network device located within an M-LAG network, the M-LAG network further comprising a second network device, the first network device including a first MLAG interface, and the device comprising:
[0011] The sending unit is configured to send a first protocol message to multiple third network devices connected to the M-LAG network through the first MLAG interface if the first network device detects the split of the M-LAG network.
[0012] The maintenance unit is configured to maintain the current operating mode if it receives a 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.
[0013] Thirdly, this application provides a network device including a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn cause the processor to perform the method provided in the first aspect of this application.
[0014] Therefore, by applying the communication method and apparatus provided in this application, if the first network device senses an M-LAG network split, the first network device sends a first protocol message to each of the multiple third network devices connected to the M-LAG network through the first MLAG interface; if the first network device receives a second protocol message sent by a third network device through the first MLAG interface, and the number of second protocol messages is the same as the number of first protocol messages, the first network device maintains its current working mode.
[0015] In this way, by using protocol messages sent by network devices connected to the M-LAG network for voting, after the M-LAG network splits, one network device can be controlled to enter independent mode while the other network device maintains its current operating mode, reducing network oscillations and disconnections. At the same time, it also solves the problem of one network device restarting in an M-LAG network causing another network device to mistakenly perceive an M-LAG network split and switch to independent operation mode, as well as the problem of aggregation interface oscillations after a network device enters independent mode, leading to network disconnections. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of an existing MLAG network.
[0017] Figure 2 A flowchart illustrating the communication method provided in the embodiments of this application;
[0018] Figure 3 A schematic diagram of an M-LAG network provided in this application embodiment;
[0019] Figure 4 Another M-LAG networking diagram provided for an embodiment of this application;
[0020] Figure 5 A structural diagram of a communication device provided in an embodiment of this application;
[0021] Figure 6 The network device hardware structure provided in the embodiments of this application. Detailed Implementation
[0022] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0023] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the corresponding listed items.
[0024] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0025] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 2 , Figure 2 A flowchart illustrating a communication method provided in an embodiment of this application. This method is applied to a first network device. The communication method provided in an embodiment of this application may include the following steps.
[0026] Step 210: If the first network device detects the split of the M-LAG network, it sends a first protocol message to each of the multiple third network devices connected to the M-LAG network through the first MLAG interface.
[0027] Specifically, the first and second network devices form an M-LAG network, sharing the load and jointly forwarding 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 includes a second interface. The two network devices establish a Keepalive link through their first and second interfaces, 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 is connected to 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 this embodiment of the application, the first MLAG interface and the second MLAG interface belong to the same MLAG and are member ports within the MLAG.
[0030] The following explanation uses the first network device as an example.
[0031] Optionally, the first network device periodically probes the status of its first Peer-link interface and its first interface. If the status of both the first Peer-link interface and the first interface changes from up to down, the first network device determines that the M-LAG network has split.
[0032] It should be noted that if the first Peer-link interface or any of the first interfaces changes from the up (start) state to the down (shutdown) state, the first network device determines that the M-LAG network has not split.
[0033] The specific reasons for the status changes of the first Peer-link interface and the first interface are as follows: 1) The second network device was powered off and restarted, causing the Peer-link and Keepalive links to disconnect; 2) The Peer-link and Keepalive links failed.
[0034] In this embodiment of the application, if the first network device detects the split of the M-LAG network, the first network device generates a first protocol message and sends the first protocol message to multiple third network devices accessing the M-LAG network through the first MLAG interface.
[0035] The first MLAG interface is configured and running Layer 2 protocols, such as ARP, STP, and IGMP. Taking ARP as an example, the aforementioned first protocol message can specifically be an ARP probe message.
[0036] It is understandable that the second network device can 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 has split; after the Peer-link or Keepalive link fails, the second network device determines that the M-LAG network has split.
[0037] Step 220: 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, then the current working mode is maintained.
[0038] Specifically, according to the description in 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 the second protocol message to the M-LAG network. The aforementioned second protocol message can specifically be an ARP probe response message.
[0039] In one implementation, if the second network device experiences a power outage and restarts, all second protocol messages sent by the third network device will be received by the first network device. If the first network device receives second protocol messages sent by the third network device through the first MLAG interface, and the number of second protocol messages is the same as the number of first protocol messages, then the first network device maintains its current operating mode.
[0040] In another implementation, if the Peer-link or Keepalive link fails, each third network device, when sending a second protocol message, uses a hash algorithm to determine the member port within the aggregation group used to send 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 has sent the second protocol message locally, and thus maintains its current operating mode without entering independent operating mode.
[0041] The aforementioned independent operating mode specifically refers to network devices operating independently outside the M-LAG network, forwarding service packets on their own. The aforementioned current operating mode specifically refers to the device acting as the master device within the M-LAG network, forwarding service packets.
[0042] In this embodiment, regardless of the implementation described above, 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 a second protocol message locally, and the first network device maintains its current working mode and does not enter an independent working mode.
[0043] It is understandable that the second network device can also perform this step, so it will not be repeated here.
[0044] Therefore, by applying the communication method provided in this application, if the first network device senses the split of the M-LAG network, the first network device sends a first protocol message to each of the multiple third network devices accessing the M-LAG network through the first MLAG interface; if the first network device receives a second protocol message sent by a third network device through the first MLAG interface, and the number of second protocol messages is the same as the number of first protocol messages, the first network device maintains the current working mode.
[0045] In this way, by using protocol messages sent by network devices connected to the M-LAG network for voting, after the M-LAG network splits, one network device can be controlled to enter independent mode while the other network device maintains its current operating mode, reducing network oscillations and disconnections. At the same time, it also solves the problem of one network device restarting in an M-LAG network causing another network device to mistakenly perceive an M-LAG network split and switch to independent operation mode, as well as the problem of aggregation interface oscillations after a network device enters independent mode, leading to network disconnections.
[0046] Optionally, in this embodiment of the application, the first network device further includes another process in the process of identifying the number of second protocol messages and the number of first protocol messages.
[0047] Specifically, after receiving the second protocol message, the first network device identifies the number of second protocol messages received. If the number of second protocol messages differs from the number of first protocol messages, the first network device continues to identify whether the number of second protocol messages exceeds a first threshold.
[0048] If the number of second protocol messages exceeds the first threshold, the first network device determines its role within the M-LAG network before the M-LAG network split.
[0049] If a device in an M-LAG network is designated as the primary device, then the first network device will maintain its current operating mode and will not enter an independent operating mode.
[0050] If the number of second protocol messages does not exceed the first threshold, the first network device determines its role within the M-LAG network before the M-LAG network split.
[0051] If a device in an M-LAG network is designated as the primary device, then the first network device will start operating in independent mode.
[0052] Optionally, in this embodiment of the application, the first network device further includes another process in the process of identifying the number of second protocol messages and the number of first protocol messages.
[0053] Specifically, after receiving the second protocol message, the first network device identifies the number of second protocol messages received. If the number of second protocol messages differs from the number of first protocol messages, the first network device continues to identify whether the number of second protocol messages exceeds a first threshold.
[0054] If the number of second protocol messages does not exceed the first threshold, the first network device determines its role within the M-LAG network before the M-LAG network split.
[0055] If a device in an M-LAG network is designated as a backup device, then the first network device will start in independent working mode.
[0056] If the number of second protocol messages exceeds the first threshold, the first network device determines its role within the M-LAG network before the M-LAG network split.
[0057] If a device in an M-LAG network is designated as a backup device, the first network device will maintain its current operating mode and will not enter independent operating mode.
[0058] Optionally, in this embodiment of the application, the first network device further includes another process in the process of identifying the number of second protocol messages and the number of first protocol messages.
[0059] If the number of second protocol messages equals the first threshold, the first network device determines its role within the M-LAG network before the M-LAG network split.
[0060] If a device in an M-LAG network is designated as the primary device, then the first network device will maintain its current operating mode and will not enter an independent operating mode.
[0061] If a device in an M-LAG network is designated as a backup device, then the first network device will start in independent working mode.
[0062] In this embodiment of the application, the first threshold is specifically more than half of the number of third network devices. For example, if the number of third network devices is 10, then the first threshold can be more than 5.
[0063] Optionally, in this embodiment of the application, after the first network device starts the independent working mode, it also executes the process of exchanging protocol messages with each third network device to announce its own aggregation interface information.
[0064] Specifically, after the first network device starts operating in independent mode, it generates a third protocol message. This third protocol message includes the system Link Aggregation Control Protocol (LACP) priority and the system MAC address. The system LACP priority is the priority configured for the first network device itself (the system LACP priority for non-M-LAG networks), and the system MAC address is the MAC address of the first network device itself (the system MAC address for non-M-LAG networks).
[0065] Through the first MLAG interface, the first network device sends a third protocol message to each third network device.
[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 scenarios where both the Peer-link and Keepalive links fail, the second network device also generates a third protocol message and sends it to each third network device via the second MLAG interface. This third protocol message includes the system LACP priority and system MAC address. The system LACP priority is the priority for the M-LAG network, and the system MAC address is the MAC address for the M-LAG network.
[0067] Therefore, after receiving the third protocol message from each network device, the third network device obtains the system LACP priority and system MAC address of each network device. The third network device compares the system LACP priorities and selects the highest system LACP priority value. The third network device selects the MLAG interfaces of the network device that sent the highest value as the selected interfaces, and the MLAG interfaces of other network devices as the unselected interfaces.
[0068] If all system LACP priorities are the same, the third network device selects the minimum system MAC address. The third network device will select the MLAG interfaces of the network device that sent the minimum value as the selected interfaces, and the MLAG interfaces of other network devices as the unselected 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, then the third network device selects the second MLAG interface as the selected interface and the first MLAG interface as the unselected interface.
[0070] Understandably, in the scenario where the second network device experiences a power outage and restart, it will no longer send third protocol messages to each third network device. After the second network device restarts and recovers, it will rebuild the M-LAG network with the first network device, and during the process of devices joining the M-LAG network, it will send third protocol messages to each third network device.
[0071] The aforementioned third protocol message is specifically an LACP protocol message.
[0072] Optionally, in this embodiment of the application, the process of sending a protocol message to each third network device when the first network device does not receive the second protocol message is also included.
[0073] Specifically, in scenarios where both Peer-link and Keepalive links fail, the M-LAG network splits, with the first and second network devices each sending a first protocol message to each third network device and waiting to receive a second protocol message from the third network device.
[0074] The following explanation uses the first network device as an example. 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 a preset time, it will activate an independent operating mode. The first network device also generates a fourth protocol message, which includes the system LACP priority and the system MAC address. The system LACP priority is the priority configured for the first network device itself (for non-M-LAG networking), and the system MAC address is the first network device's own MAC address (for non-M-LAG networking).
[0076] Through the first MLAG interface, the first network device sends a fourth protocol message to each of the third network devices.
[0077] After receiving the fourth protocol message, the third network device, according to the description in the foregoing embodiments, compares the system LACP priority and the system MAC address, and selects one MLAG interface as the selected interface, while the other MLAG interfaces are designated as non-selected interfaces. For example, the third network device selects the second MLAG interface and designates the first MLAG interface as a non-selected interface.
[0078] The aforementioned fourth protocol message is specifically an LACP protocol message.
[0079] It should be noted that in the above embodiments, the third network device will continue to communicate with the network device where the selected MLAG interface is located, but will no longer communicate with the network device where the non-selected MLAG interface is located.
[0080] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 3 , Figure 3 This is a schematic diagram of an M-LAG network provided in an embodiment of this application.
[0081] exist Figure 3 In this configuration, A1 and A2 form an M-LAG network, while A3 and A4 are dual-active devices, each connected to the M-LAG network. A1 includes port 1 and port 2, forming MLAG interface 1; A2 includes port 3 and port 4, forming MLAG interface 2. MLAG interface 1 and MLAG interface 2 belong to the same aggregation group. A1 and A2 are gateways with the gateway address 100.1.1.1 / 24.
[0082] A3 includes interfaces port5 and port6, forming MLAG interface 3; A4 includes interfaces port7 and port8, forming MLAG interface 4. Ports 5, 6, 7, and 8 are connected to multiple downlink ports 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. Both A1 and A2 can learn the ARP information of A3 and A4.
[0083] A1 and A2 each 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 also includes port 9, and A2 also includes port 10. A Keepalive link is established between port 9 and port 10.
[0084] A1 and A2 also include uplink ports, and each network device's uplink port connects to A5. A5 connects to A1 and A2 via ECMP. A3 and A4 are user-side access devices, and A5 is a network-side access device.
[0085] In this embodiment, ARP runs on MLAG interface 1 and MLAG interface 2. The following description uses A2 as an example.
[0086] When A1 is powered off and restarted, all interfaces included in A1 go down. A2 periodically probes the status of its Peer-link port 2 and port 10. If the status of both Peer-link port 2 and port 10 changes from up to down, A2 determines that the M-LAG network has split.
[0087] After A2 detects the M-LAG network split, it generates an ARP probe packet based on its local ARP address table entries and sends the ARP probe packet to A3 and A4 respectively through MLAG interface 2.
[0088] After receiving the ARP probe packet, A3 and A4 generate ARP response packets respectively. Since all interfaces included in A1 are down, the interfaces (port5 and port7) connected to A3 and A4 to A1 also change from up to down. The ARP response packets 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 an ARP response message, A2 checks whether the number of ARP response messages is the same as the number of ARP probe messages. In this embodiment, if the number of ARP response messages received by A2 is the same as the number of ARP probe messages sent, A2 determines that A3 and A4 have both voted for it, and A2 maintains its current working mode without entering an independent working mode.
[0090] In this embodiment, after A1 restarts and recovers, Peer-link ports 1 and 9 return from the down state to the up state. A1 and A2 rebuild the M-LAG network, and the backup device joins the M-LAG network. It is understood that the process of A1 and A2 rebuilding 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 embodiments of this application will be described in detail below. See also... Figure 4 , Figure 4 This is another M-LAG networking diagram provided for an embodiment of this application. Figure 4 The M-LAG network shown is Figure 3 The M-LAG networking shown is the same, so it will not be repeated here.
[0092] In an M-LAG network, A1 is the master device and A2 is the slave device.
[0093] In this embodiment of the application, if the Peer-link and Keepalive links fail, the state of Peer-link port 1 and port 9 included in A1 changes from the up state to the down state; the state of Peer-link port 2 and port 10 included in A2 changes from the up state to the down state.
[0094] Both A1 and A2 periodically probe the status of their own Peer-link ports and port9 / port10. If the status of both Peer-link ports and port9 / port10 changes from up to down, then A1 and A2 determine that the M-LAG network has split.
[0095] After A1 and A2 detect the M-LAG network split, they both generate ARP probe packets based on their local ARP address table entries and send these packets to A3 and A4 respectively via MLAG interface 1 and MLAG interface 2. After sending the ARP probe packets, A1 and A2 each start their local ARP probe timeout timer and configure a preset time, for example, 3 seconds.
[0096] In one implementation, after receiving the ARP probe message, A3 and A4 generate ARP response messages respectively. When sending the ARP response messages, A3 and A4 determine the member interface from their respective aggregated interfaces using a hash algorithm.
[0097] After A3 and A4 determine the member ports, they send ARP response messages to A1 or A2 through the member ports. If A3 selects port5 and A4 selects port7, then A1 will receive two ARP response messages.
[0098] Within a preset time, after A1 receives an ARP response message, it checks whether the number of ARP response messages is the same as the number of ARP probe messages. In this embodiment, if the number of ARP response messages received by A1 is the same as the number of ARP probe messages sent, A1 determines that A3 and A4 have both voted for it, and A1 maintains its current working mode without entering an independent working mode.
[0099] If A2 does not receive any ARP response packets within the preset time, A2 will start operating in independent mode. A2 also generates LACP protocol packet 1, which includes the system LACP priority and the system MAC address. The system LACP priority is the priority configured for A2 itself (the system LACP priority for non-M-LAG networks), and the system MAC address is A2's own MAC address (the system MAC address for non-M-LAG networks).
[0100] Through MLAG interface 2, A2 sends LACP protocol message 1 to A3 and A4. Simultaneously, A1 also periodically generates LACP protocol message 2 and sends it to A3 and A4. This LACP protocol message 2 includes the system LACP priority and the system MAC address. The system LACP priority is the priority for the M-LAG network, and the system MAC address is the MAC address for the M-LAG network.
[0101] After receiving multiple LACP protocol messages, A3 and A4 compare the system LACP priority and the system MAC address according to the LACP calculation principle, and select port5 and port7 as the selected interfaces, while the other interfaces are not selected interfaces.
[0102] In another implementation, after receiving the ARP probe message, A3 and A4 generate ARP response messages respectively. When sending the ARP response messages, A3 and A4 determine the member interface from their respective aggregated interfaces using 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 A3 selects port5 and A4 selects port8, then A1 and A2 will each receive one ARP response message.
[0104] Within a preset time period, after A1 and A2 receive ARP response packets, they identify whether the number of ARP response packets is the same as the number of ARP probe packets. In this embodiment, if the number of ARP response packets received by A1 and A2 is different from the number of ARP probe packets sent, A1 and A2 continue to identify whether the number of ARP response packets exceeds a first threshold (for example, the first threshold is more than one).
[0105] In this embodiment of the application, if the number of ARP response messages received by A1 and A2 is equal to the first threshold, then A1 and A2 determine their device roles in the M-LAG network before the M-LAG network split.
[0106] Before the M-LAG network splits, A1's role within the M-LAG network is that of the primary device, and A1 maintains its current operating mode without entering independent operating mode. Before the M-LAG network splits, A2's role within the M-LAG network is that of the backup device, and A2 starts operating in independent mode.
[0107] A2 also generates LACP protocol message 3, which includes the system LACP priority and the system MAC address. The system LACP priority is the priority configured for A2 itself (the system LACP priority for non-M-LAG networks), and the system MAC address is A2's own MAC address (the system MAC address for non-M-LAG networks).
[0108] Through MLAG interface 2, A2 sends LACP protocol message 3 to A3 and A4. Simultaneously, A1 also generates LACP protocol message 4 and sends it to A3 and A4. This LACP protocol message 4 includes the system LACP priority and the system MAC address. The system LACP priority is the priority for the M-LAG network, and the system MAC address is the MAC address for the M-LAG network.
[0109] After receiving multiple LACP protocol messages, A3 and A4 compare the system LACP priority and the system MAC address according to the LACP calculation principle, and select port5 and port7 as the selected interfaces, while the other interfaces are not selected interfaces.
[0110] In another implementation, after receiving the ARP probe message, A3 and A4 generate ARP response messages respectively. When sending the ARP response messages, A3 and A4 determine the member interface from their respective aggregated interfaces using a hash algorithm.
[0111] After A3 and A4 determine the member ports, they send ARP response messages to A1 or A2 through the member ports. If A3 selects port6 and A4 selects port8, then A2 will receive two ARP response messages.
[0112] Within a preset time, after A2 receives an ARP response message, it checks whether the number of ARP response messages is the same as the number of ARP probe messages. In this embodiment, if the number of ARP response messages received by A2 is the same as the number of ARP probe messages sent, A2 determines that A3 and A4 have both voted for it, and A2 maintains its current working mode without entering an independent working mode.
[0113] If A1 does not receive any ARP response packets within the preset time, A1 will start operating in independent mode. A1 also generates LACP protocol packet 5, which includes the system LACP priority and the system MAC address. The system LACP priority is the priority configured for A1 itself (the system LACP priority for non-M-LAG networks), and the system MAC address is A1's own MAC address (the system MAC address for non-M-LAG networks).
[0114] Through MLAG interface 1, A1 sends LACP protocol message 5 to A3 and A4. Simultaneously, A2 also periodically generates LACP protocol message 6 and sends it to A3 and A4. This 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 messages, A3 and A4 compare the system LACP priority and the system MAC address according to the LACP calculation principle, and select port6 and port8 as the selected interfaces, while the other interfaces are not selected interfaces.
[0116] Based on the same inventive concept, embodiments of this application also provide a communication device corresponding to the communication method. See also Figure 5 , Figure 5 The communication apparatus provided in this application embodiment is applied to a first network device, the first network device being located within an M-LAG network, the M-LAG network further including a second network device, the first network device including a first MLAG interface, and the apparatus comprising:
[0117] The sending unit 510 is configured to send a first protocol message to multiple third network devices connected to the M-LAG network through the first MLAG interface if the first network device detects the split of the M-LAG network.
[0118] The maintenance unit 520 is configured to maintain the current operating mode if it receives a 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.
[0119] Optionally, the maintenance unit 520 is further configured to maintain the current working mode when the first network device is the master device in the M-LAG network if it receives a second protocol message sent by the third network device through the first MLAG interface and the number of the second protocol messages exceeds a first threshold.
[0120] or,
[0121] The device further includes a startup unit (not shown in the figure), configured to start an independent working mode if the first network device receives a second protocol message sent by the third network device through the first MLAG interface and the number of the second protocol messages does not exceed the first threshold, when the first network device plays the role of a master device in the M-LAG network.
[0122] Optionally, the startup unit (not shown in the figure) 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, then when the first network device is a backup device in the M-LAG network, start the independent working mode.
[0123] or,
[0124] The maintenance unit 520 is further configured to maintain the current working mode if, through the first MLAG interface, it receives a second protocol message sent by the third network device and the number of the second protocol messages exceeds the first threshold, when the first network device is a backup device in the M-LAG network.
[0125] Optionally, the maintenance unit 520 is further configured to maintain the current working mode when the first network device is the master device in the M-LAG if it receives a second protocol message sent by the third network device through the first MLAG interface and the number of the second protocol messages is equal to the first threshold.
[0126] or;
[0127] The startup unit (not shown in the figure) is further configured to, if it receives a second protocol message sent by the third network device through the first MLAG interface, and the number of the second protocol messages is equal to the first threshold, then when the first network device is a backup device in the M-LAG network, it starts an independent working mode.
[0128] Optionally, the sending unit 510 is further configured to send a third protocol message to each of the third network devices through the first MLAG interface. The third protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices selects the second MLAG interface included in the second network device as the selected interface and the first MLAG interface as the unselected interface according to the system LACP priority and the system MAC address.
[0129] Optionally, the startup unit (not shown in the figure) is further configured to, if the first network device is in the working mode and does not receive the second protocol message within a preset time, start the independent working mode;
[0130] The sending unit 510 is further configured to send a fourth protocol message to each of the third network devices through the first MLAG interface. The fourth protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices selects the second MLAG interface included in the second network device as the selected interface and the first MLAG interface as the unselected interface according to the system LACP priority and the system MAC address.
[0131] Optionally, a Peer-link and Keepalive link have been established between the first network device and the second network device;
[0132] The device further includes a determining unit (not shown in the figure), used to determine the M-LAG network split when both the Peer-link interface used to establish the Peer-link and the interface used to establish the Keepalive link change from the up state to the down state.
[0133] Therefore, by applying the communication device provided in this application, if the first network device senses the split of the M-LAG network, the first network device sends a first protocol message to each of the multiple third network devices connected to the M-LAG network through the first MLAG interface; if the first network device receives a second protocol message sent by a third network device through the first MLAG interface, and the number of second protocol messages is the same as the number of first protocol messages, the first network device maintains the current working mode.
[0134] In this way, by using protocol messages sent by network devices connected to the M-LAG network for voting, after the M-LAG network splits, one network device can be controlled to enter independent mode while the other network device maintains its current operating mode, reducing network oscillations and disconnections. At the same time, it also solves the problem of one network device restarting in an M-LAG network causing another network device to mistakenly perceive an M-LAG network split and switch to independent operation mode, as well as the problem of aggregation interface oscillations after a network device enters independent mode, leading to network disconnections.
[0135] Based on the same inventive concept, embodiments of this application also provide a network device, such as... Figure 6 As shown, the system 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. The processor 610 is prompted by the machine-executable instructions to execute the communication method provided in the embodiments of this application. (The foregoing...) Figure 5 The communication device shown can be used as follows: Figure 6 The hardware structure of the network device shown is implemented.
[0136] The aforementioned computer-readable storage medium 630 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the computer-readable storage medium 630 may also be at least one storage device located remotely from the aforementioned processor 610.
[0137] The processor 610 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0138] In this embodiment of the application, the processor 610 reads the machine-executable instructions stored in the machine-readable storage medium 630, and is prompted by the machine-executable instructions to enable the processor 610 itself and the transceiver 620 to execute the communication method described in the foregoing embodiment of the application.
[0139] In addition, this application provides a machine-readable storage medium 630 that stores machine-executable instructions. When called and executed by the processor 610, the machine-executable instructions cause the processor 610 itself and the transceiver 620 to execute the communication method described in the aforementioned application.
[0140] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0141] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0142] For the embodiments of communication devices and machine-readable storage media, since the methods involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple, and relevant details can be found in the descriptions of the method embodiments.
[0143] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A communication method, characterized in that, The method is applied to a first network device, which is located within an M-LAG network. The M-LAG network further includes a second network device, and the first network device includes a first MLAG interface. The method includes: If the first network device detects the split of the M-LAG network, it sends a first protocol message to each of the multiple third network devices connected to the M-LAG network through the first MLAG interface. 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, then the current working mode is maintained. 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 first network device plays the role of a master device in the M-LAG network, it starts the independent working mode. The M-LAG network split refers to a failure of the Peer-link and Keepalive links between the first network device and the second network device; the current working mode specifically refers to acting as the master device within the M-LAG network and forwarding service packets; the independent working mode specifically refers to the network device operating independently outside the M-LAG network and forwarding service packets on its own.
2. The method according to claim 1, characterized in that, The method further includes: 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, then when the first network device plays the role of a master device in the M-LAG network, it maintains the current working mode.
3. The method according to claim 2, characterized in that, The method further includes: 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 first network device is a backup device in the M-LAG network, it starts the independent working mode. 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, then when the first network device is a backup device in the M-LAG network, it shall maintain the current working mode.
4. The method according to claim 2, characterized in that, The method further includes: 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 first network device is the master device in the M-LAG, 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 first network device is a backup device in the M-LAG network, it starts the independent working mode.
5. The method according to any one of claims 2-4, characterized in that, After initiating the independent working mode, the method further includes: Through the first MLAG interface, a third protocol message is sent to each of the third network devices. The third protocol message includes the system LACP priority and the system MAC address, so that each of the third network devices selects the second MLAG interface included in the second network device as the selected interface and the first MLAG interface as the unselected 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 includes: If the first network device is in the operating mode and does not receive the second protocol message within a preset time, then the independent operating mode is activated; A fourth protocol message is sent to each of the third network devices through the first MLAG interface. The fourth protocol message includes the system LACP priority and the system MAC address, so that each of the third network devices selects the second MLAG interface of the second network device as the selected interface and the first MLAG interface as the unselected interface according to the system LACP priority and the system MAC address.
7. The method according to claim 1, characterized in that, Peer-link and Keepalive links have been established between the first network device and the second network device; Before the first network device detects the M-LAG network split and sends the first protocol message to the multiple third network devices accessing the M-LAG network through the first MLAG interface, the method further includes: When both the Peer-link interface used to establish the Peer-link and the interface used to establish the Keepalive link change from the up state to the down state, the M-LAG network is determined to be split.
8. A communication device, characterized in that, The device is applied to a first network device, which is located within an M-LAG network. The M-LAG network further includes a second network device. The first network device includes a first MLAG interface. The device comprises: The sending unit is configured to send a first protocol message to multiple third network devices connected to the M-LAG network through the first MLAG interface if the first network device detects the split of the M-LAG network. The maintenance unit is configured to maintain the 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. The device further includes: a startup unit, 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 a first threshold, then when the first network device plays the role of a master device in the M-LAG network, start an independent working mode; The M-LAG network split refers to a failure of the Peer-link and Keepalive links between the first network device and the second network device; the current working mode specifically refers to acting as the master device within the M-LAG network and forwarding service packets; the independent working mode specifically refers to the network device operating independently outside the M-LAG network and forwarding service packets on its own.
9. The apparatus according to claim 8, characterized in that, The maintenance unit is further configured to maintain the current working mode if, through the first MLAG interface, it receives a second protocol message sent by the third network device and the number of the second protocol messages exceeds a first threshold, when the first network device is the master device in the M-LAG network.
10. The apparatus according to claim 9, characterized in that, The startup unit is further configured to, if it receives a second protocol message sent by the third network device through the first MLAG interface and the number of the second protocol messages does not exceed the first threshold, then when the first network device is a backup device in the M-LAG network, it will start an independent working mode. or, The maintenance unit is further configured to maintain the current working mode if, through the first MLAG interface, it receives a second protocol message sent by the third network device and the number of the second protocol messages exceeds the first threshold, when the first network device is a backup device in the M-LAG network.
11. The apparatus according to claim 9, characterized in that, The maintenance unit is further configured to maintain the current working mode if, through the first MLAG interface, it receives a second protocol message sent by the third network device, and the number of the second protocol messages is equal to the first threshold; or; The startup unit is further configured to, if it receives a second protocol message sent by the third network device through the first MLAG interface, and the number of the second protocol messages is equal to the first threshold, then when the first network device is a backup device in the M-LAG network, it shall start an independent working mode.
12. The apparatus according to any one of claims 9-11, characterized in that, The sending unit is further configured to send a third protocol message to each of the third network devices through the first MLAG interface. The third protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices selects the second MLAG interface included in the second network device as the selected interface and the first MLAG interface as the unselected interface according to the system LACP priority and the system MAC address.
13. The apparatus according to claim 9, characterized in that, The startup unit is further configured to, if the first network device is in the working mode and does not receive the second protocol message within a preset time, start an independent working mode; The sending unit is further configured to send a fourth protocol message to each of the third network devices through the first MLAG interface. The fourth protocol message includes a system LACP priority and a system MAC address, so that each of the third network devices selects the second MLAG interface included in the second network device as the selected interface and the first MLAG interface as the unselected interface according to the system LACP priority and the system MAC address.
14. The apparatus according to claim 8, characterized in that, Peer-link and Keepalive links have been established between the first network device and the second network device; The device further includes a determining unit, configured to determine the M-LAG network split when both the Peer-link interface used to establish the Peer-link and the interface used to establish the Keepalive link change from an up state to a down state.
Citation Information
Patent Citations
Cluster management method and device
CN106657355A
Method and device for early alarm for networking equipment
JP2009017562A