Communication loop elimination method, system, device and storage medium

By receiving BPDU packets and determining port roles through the cross-device link aggregation group (MLAG), the problem of loop calculation failure in the MLAG environment is solved, and normal STP protocol operation of the switch is achieved, saving network resources.

CN119544595BActive Publication Date: 2025-09-16SHEN ZHOU SHU MA WANG LUO BEI JING YOU XIAN GONG SI +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411733979.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-09-16
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

In an MLAG environment, the switches cannot calculate the ports involved in a loop formed by links on the slave switch and links in the MLAG. This results in broadcast storms and waste of network resources.

Method used

The cross-device link aggregation group MLAG receives BPDU messages sent by the third switch, determines the port role, and feeds back BPDU messages to block non-root ports and non-designated ports, ensuring that all switches participate in STP protocol operations and eliminating loop risks.

Benefits of technology

It effectively eliminates loop risks between switches, avoids broadcast storms, saves network resources, and ensures network stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544595B_ABST
    Figure CN119544595B_ABST
Patent Text Reader

Abstract

The present application discloses a communication loop elimination method, system, device, and storage medium, relating to the technical field of communication loop elimination. The method includes: if an MLAG is a non-root bridge, a first port is connected to a third port of a third switch, and a second port is connected to a fourth port of the third switch, determining that the port role of the first aggregation group where the first and second ports are located is a root port based on a third BPDU message; feeding back the first BPDU message and the second BPDU message to the third switch; the third switch determining that the port role of the second aggregation group where the third and fourth ports of the third switch are located is a designated port based on the first BPDU message and the second BPDU message; and the MLAG blocking the non-root port and the non-designated port. This method enables all devices in the network scenario applied to the MLAG to operate the STP protocol normally, thereby avoiding the generation of broadcast storms and saving network resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of communication loop elimination, and in particular to a communication loop elimination method, system, device and storage medium. Background Art

[0002] Spanning Tree Protocol (STP) is a Layer 2 (data link layer) communications protocol in the OSI (Open Systems Interconnection) model. It eliminates loops in networks and ensures a loop-free logical topology, thereby preventing broadcast storms that can lead to excessive network resource and bandwidth consumption. It can also be used for link redundancy. This protocol has also spawned Rapid Spanning Tree Protocol (RSTP) and Multiple Spanning Tree Protocol (MSTP). Both RSTP and MSTP belong to the STP protocol suite, which has become a widely used and important network protocol. Even in Multi-Chassis Link Aggregation (MLAG) environments, the STP protocol suite is still required.

[0003] In existing technologies, MLAG only implements the aggregation of two switches (master and slave) into a single virtual switch at the link aggregation control protocol level of the aggregation group. However, during the operation of the STP protocol cluster, the two switches (master and slave) of MLAG run the STP protocol cluster separately and use their own MAC addresses as device identifiers for calculations and protocol interactions in the network. Figure 1 As shown, Figure 1This is a schematic diagram of an MLAG connection method in the prior art, provided in an embodiment of the present application. Switches 1 and 2 form an MLAG. Switches 1, 2, and 3 each use their own MAC addresses as device identifiers (MAC addresses) for operations and protocol interaction. The two ports on switch 3 connecting to switches 1 and 2 are both aggregation group ports. Switch 3's aggregation group ports need to receive different MAC addresses from switches 1 and 2, respectively. Because switch 3 identifies the MLAG composed of switches 1 and 2 as a single device, its aggregation group ports will receive two different MAC addresses, preventing switch 3 from properly operating the STP protocol cluster. Therefore, in the prior art, to ensure the proper operation of the STP protocol cluster on switch 3, only the master switch (switch 1) in the MLAG participates in STP protocol cluster operations, while the slave switch (switch 2) does not. However, if a link on the slave switch (Switch 2) forms a loop with the link in the MLAG (the link between Switch 1 and Switch 2), the ports involved in the loop cannot be calculated on the slave switch (Switch 2). As a result, a broadcast storm on the loop cannot be avoided, which can cause significant damage to the network.

[0004] Therefore, there is an existing problem that the ports involved in the loop formed by the links on the switch and the links in the MLAG cannot be calculated from the switch. Summary of the Invention

[0005] The present application provides a communication loop elimination method, system, device, and storage medium, which can enable the ports involved in the loop formed by the links on the slave switch and the links in the MLAG to be calculated by the slave switch.

[0006] To achieve the above objectives, this application adopts the following technical solutions:

[0007] In a first aspect, the present application provides a communication loop elimination method, wherein a cross-device link aggregation group (MLAG) includes a first switch and a second switch; the first switch is provided with a first port and a first data link port; the second switch is provided with a second port and a second data link port; the first port and the second port belong to a first aggregation group; the method includes:

[0008] The MLAG receives a third bridge protocol data unit (BPDU) message sent by the third switch;

[0009] If the MLAG is a non-root bridge, the first port is connected to the third port of the third switch, and the second port is connected to the fourth port of the third switch, the MLAG determines, according to the third BPDU message, that the port role of the first aggregation group where the first port and the second port are located is a root port;

[0010] The MLAG feeds back a first BPDU message and a second BPDU message to the third switch; wherein the first BPDU message includes that the port role of the first aggregation group where the first port of the first switch is located is a root port, and the second BPDU message includes that the port role of the first aggregation group where the second port of the second switch is located is a root port;

[0011] The third switch determines, based on the first BPDU message and the second BPDU message, that the port role of the second aggregation group to which the third port and the fourth port of the third switch belong is a designated port; wherein the MAC address of the first switch and the MAC address of the second switch are configured to be the same, and the third port and the fourth port belong to the second aggregation group;

[0012] The MLAG blocks non-root ports and non-designated ports.

[0013] Preferably, the method further comprises:

[0014] If the MLAG is a non-root bridge and the first port is connected to the third port of the third switch, the first switch determines, according to the third BPDU message, that the port role of the first port is a root port;

[0015] The first switch forwards the third BPDU message to the second switch;

[0016] The second switch determines, according to the third BPDU message, that the port role of the second data link port is a root port.

[0017] Preferably, the method further comprises:

[0018] The second switch writes the port role of the second data link port as a root port into a fourth BPDU message;

[0019] The second switch forwards the fourth BPDU message to the first switch;

[0020] The first switch determines, according to the fourth BPDU message, that the port role of the first data link port is a designated port.

[0021] Preferably, the method further comprises:

[0022] If the MLAG is a root bridge, the first switch determines, according to the third BPDU message, that the port role of the first data link port is a designated port;

[0023] The first switch generates a fifth BPDU message, replaces the port role of the first data link port with the root port, and writes the MAC address of the central processing unit (CPU) of the first switch into the fifth BPDU message;

[0024] The first switch forwards the fifth BPDU message to the second switch;

[0025] The second switch determines, according to the fifth BPDU message, that the port role of the second data link port is a designated port.

[0026] Preferably, the method further comprises:

[0027] The third switch blocks the non-root port and the non-designated port.

[0028] Preferably, the method further comprises:

[0029] The sending time of the fifth BPDU message is set to half of the preset time.

[0030] In a second aspect, the present application provides a communication loop elimination system, the system comprising: a first switch and a second switch; the first switch is provided with a first port and a first data link port; the second switch is provided with a second port and a second data link port; the first port and the second port belong to a first aggregation group;

[0031] MLAG, configured to receive a third bridge protocol data unit BPDU message sent by the third switch;

[0032] The MLAG is further configured to, if the MLAG is a non-root bridge, the first port is connected to the third port of the third switch, and the second port is connected to the fourth port of the third switch, determine, based on the third BPDU message, that the port role of the first aggregation group in which the first port and the second port are located is a root port; and feed back a first BPDU message and a second BPDU message to the third switch; wherein the first BPDU message includes that the port role of the first aggregation group in which the first port of the first switch is located is a root port, and the second BPDU message includes that the port role of the first aggregation group in which the second port of the second switch is located is a root port;

[0033] a third switch, configured to determine, based on the first BPDU message and the second BPDU message, that the port role of the second aggregation group to which the third port and the fourth port of the third switch belong is a designated port; wherein the MAC address of the first switch and the MAC address of the second switch are configured to be the same, and the third port and the fourth port belong to the second aggregation group;

[0034] The MLAG is used to block non-root ports and non-designated ports.

[0035] In a third aspect, the present application provides a computing device, including a memory and a processor;

[0036] One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as described in any one of the first aspects.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program for executing the method as described in any one of the first aspects.

[0038] In a fifth aspect, the present application provides a computer program product, which includes one or more computer instructions. When the computer instructions are executed by a computer, the computer executes the method as described in any one of the first aspects.

[0039] It can be seen from the above technical solution that this application has at least the following beneficial effects:

[0040] In the present application, when the data exchange network formed by the MLAG and the third switch is stable, the MLAG determines the port role of the first aggregation group as the root port based on the third BPDU message, and feeds back the first BPDU message and the second BPDU message to the third switch; the third port and the fourth port belong to the same first aggregation group; the third switch determines the port role of the second aggregation group where the third and fourth ports of the third switch are located as the designated port based on the first BPDU message and the second BPDU message; and the MLAG blocks non-root ports and non-designated ports. This method enables all devices in the network scenario applied to the MLAG to operate the STP protocol normally, more effectively eliminating the hidden dangers of loops between switches, thereby avoiding the generation of broadcast storms, saving network resources, and reducing the harm caused to the network by the existence of loops.

[0041] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution or beneficial effect is included in at least one embodiment. Therefore, the description of a technical feature, technical solution or beneficial effect in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be implemented without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in specific embodiments that do not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of the MLAG connection method in the prior art provided in the embodiments of the present application;

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

[0044] Figure 3 A schematic diagram of a device connection method in which the first port and the second port are root ports after the network is stable according to an embodiment of the present application;

[0045] Figure 4 A schematic diagram of a device connection method in which the port role of the first port is a root port after the network is stable provided in an embodiment of the present application;

[0046] Figure 5 A schematic diagram of a device connection method when MLAG is the root bridge after the network is stable according to an embodiment of the present application;

[0047] Figure 6 A schematic diagram of the structure of a communication loop elimination system provided in an embodiment of the present application;

[0048] Figure 7 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The terms "first", "second" and "third" in this application specification and the accompanying drawings are used to distinguish different objects rather than to limit a specific order.

[0050] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0051] The embodiment of the present application provides a communication loop elimination method, wherein the MLAG includes a first switch and a second switch; the first switch is provided with a first port and a first data link port; the second switch is provided with a second port and a second data link port; Figure 2 As shown, Figure 2 A flow chart of a communication loop elimination method provided in an embodiment of the present application. The method comprises the following steps:

[0052] S101: The MLAG receives a third BPDU message sent by a third switch.

[0053] Specifically, if Figure 3 As shown, Figure 3 This is a diagram illustrating a device connection method where the first and second ports are configured as root ports after the network stabilizes, as provided in an embodiment of the present application. After the network formed by MLAG 300 and the third switch 303 stabilizes, MLAG 300 will continue to receive a third BPDU (Bridge Protocol Data Unit) message from the third switch 303. Because the third and fourth ports belong to the same aggregation group, the third BPDU message includes the role (bridge information) of the third switch 303 and the aggregation group information of the third switch 303. Based on the third BPDU message, MLAG 300 can determine the port role and port status of the first aggregation group to which the first port 3011 and the second port 3021 belong.

[0054] S102: If the MLAG is a non-root bridge, the first port is connected to the third port of the third switch, and the second port is connected to the fourth port of the third switch, the MLAG determines, based on the third BPDU message, that the port role of the first aggregation group where the first port and the second port are located is the root port.

[0055] Specifically, the first switch 301 is the master switch of MLAG 300, and the second switch 302 is the slave switch of MLAG 300. In MLAG 300, only one switch (the first switch 301 or the second switch 302) can receive the third BPDU message sent by the third switch 303. If the first switch 301 receives the third BPDU message, it calculates from the third BPDU message that the path (cost) from the first aggregation group to the second aggregation group of the third switch 303 (root bridge) is the shortest. Therefore, the port role of the first aggregation group where the first port 3011 of the first switch 301 resides is the root port. Simultaneously, the first switch 301 sends the third BPDU message to the second switch 302 via a tunnel. Based on the third BPDU message, the second switch 302 calculates from the third BPDU message that the path (cost) from the first aggregation group to the second aggregation group of the third switch 303 (root bridge) is the shortest. Therefore, the port role of the first aggregation group where the second port 3021 of the second switch 302 resides is the root port.

[0056] If the second switch 302 receives the third BPDU, it calculates, based on the third BPDU, that the port role of the first aggregation group where the second port 3021 is located is the root port. Simultaneously, the second switch 302 also sends the third BPDU to the first switch 301 via the tunnel. The first switch 301 also calculates, based on the third BPDU, that the port role of the first aggregation group where the first port 3011 is located is the root port.

[0057] S103: The MLAG feeds back the first BPDU message and the second BPDU message to the third switch.

[0058] The first BPDU message includes that the port role of the first aggregation group where the first port of the first switch is located is the root port, and the second BPDU message includes that the port role of the first aggregation group where the second port of the second switch is located is the root port.

[0059] Specifically, the content of the first BPDU message is the same as the content of the second BPDU message. After receiving the first BPDU message and the second BPDU message, the third switch 303 obtains the information that MLAG300 is a non-root bridge and the first MLAG aggregation group, so as to subsequently calculate the information of the second aggregation group.

[0060] S104: The third switch determines, based on the first BPDU message and the second BPDU message, that the port role of the second aggregation group where the third port and the fourth port of the third switch are located is a designated port.

[0061] The MAC address of the first switch is configured to be the same as the MAC address of the second switch, and the third port and the fourth port belong to the second aggregation group.

[0062] Specifically, since the MAC address of the first switch 301 and the MAC address of the second switch 302 are configured to be the same, the MAC address in the first BPDU message and the MAC address in the second BPDU message received by the third switch 303 are the same. The third switch 303 can process the received first BPDU message and the second BPDU message based on the STP protocol to determine the port role of the second aggregation group in which the third port 3031 and the fourth port 3032 are located.

[0063] S105: MLAG blocks non-root ports and non-designated ports.

[0064] Specifically, the non-root ports and non-designated ports mentioned above are ports other than the root port and designated ports, i.e., backup ports. Because the communication lines on which backup ports reside can potentially form loops with ports on other devices, loops can cause broadcast storms and pose significant risks to the network. Therefore, backup ports (non-root ports and non-designated ports) must be blocked to eliminate loops. Blocking backup ports (non-root ports and non-designated ports) involves setting their status to "blocked." This means that the MLAG300 prohibits the sending of any service data other than BPDUs to the backup ports (non-root ports and non-designated ports).

[0065] An embodiment of the present application provides a communication loop elimination method. In this method, after the data exchange network formed by MLAG 300 and a third switch 303 stabilizes, MLAG 300 determines, based on a third BPDU message, that the port role of the first aggregation group in which the first port 3011 of the first switch 301 resides is a root port, and that the port role of the first aggregation group in which the second port 3021 of the second switch 302 resides is a root port. MLAG 300 then feeds back a first BPDU message and a second BPDU message to the third switch 303. Based on the first BPDU message and the second BPDU message, the third switch 303 determines that the port role of the second aggregation group in which the third port 3031 and the fourth port 3032 reside is a designated port. MLAG 300 blocks non-root ports and non-designated ports. In this method, the MAC address of the first switch 301 and the MAC address of the second switch 302 are configured to be the same, so that the first BPDU message sent by the first switch 301 to the third switch 303 and the second BPDU message sent by the second switch 302 to the third switch 303 have the same MAC address. With this configuration, the third switch 303 can normally perform STP-based calculations on the received first and second BPDUs to determine the port roles of the second aggregation group to which the third port 3031 and the fourth port 3032 belong. In the prior art, only the master switch (the first switch 301) in an MLAG 300 participates in STP operations, while the slave switch (the second switch 302) does not. Compared to the prior art, this method also allows the slave switch (the second switch 302) to participate in STP operations. This prevents the third switch 303 from identifying the MLAG 300 (composed of the first and second switches 301 and 302) as a single device but receiving two different MAC addresses, causing the third switch 303 to be unable to properly run the STP protocol. This method ensures that all devices in the network scenario using the MLAG 300 can properly run the STP protocol, effectively eliminating the risk of loops between switches, thereby preventing broadcast storms, conserving network resources, and reducing the damage caused by loops to the network.

[0066] In some possible implementations, such as Figure 4 As shown, Figure 4This is a schematic diagram of a device connection method in which the first port's port role is a root port after the network stabilizes, as provided in an embodiment of the present application. If MLAG 300 is a non-root bridge and first port 3011 is connected to third port 3031 of third switch 301, first switch 301 determines the port role of first port 3011 as a root port based on the third BPDU message and forwards the third BPDU message to second switch 302. Second switch 302 determines the port role of second data link port 3022 as a root port based on the third BPDU message.

[0067] Specifically, because the first port 3011 is connected to the third port 3031 of the third switch 303, but the second port 3021 is not connected to the fourth port 3032 of the third switch 303, the second switch 302 cannot receive the third BPDU message from the third switch 303 and, therefore, cannot calculate the port role of the second port 3021 based on the third BPDU message. Therefore, after the network stabilizes, the first switch 301 processes the third BPDU message and also forwards it to the second switch 302. The second switch 302 then calculates from the third BPDU message that the path (cost) from the second port 3021 of the second switch 302 to the second aggregation group of the third switch 303 (the root bridge) is the shortest. Therefore, the port role of the second port 3021 of the second switch 302 is determined to be the root port.

[0068] In this manner, while processing the third BPDU message, the first switch 301 forwards the third BPDU message to the second switch 302 for processing, allowing the second switch 302 to quickly determine the port role of the second data link port 3022. The first switch 301 and the second switch 302 exchange information via the third BPDU message to determine the port role, which helps to quickly eliminate loops in the network.

[0069] In some possible implementations, such as Figure 4 As shown, Figure 4 A schematic diagram of a device connection method in which the port role of the first port is a root port after the network is stabilized, according to an embodiment of the present application. The second switch 302 writes the port role of the second data link port 3022 as a root port into a fourth BPDU message and forwards the fourth BPDU message to the first switch 301. The first switch 301 determines the port role of the first data link port 3012 as a designated port based on the fourth BPDU message.

[0070] Specifically, after the network stabilizes, the second switch 302 determines that the port role of its second data link port 3022 is the root port. It then generates a fourth BPDU message, writes the port role of its second data link port 3022 into the fourth BPDU message, and forwards the fourth BPDU message to the first switch 301. Based on the fourth BPDU message, the first switch 301 calculates that the path (cost value) from its first port 3011 to the second aggregation group of the third switch 303 (the root bridge) is the shortest. Therefore, the first switch 301 determines that the port role of the first port 3011 of the first switch 301 is the designated port.

[0071] In this manner, the first switch 301 determines the port role of the first data link port 3012 according to the fourth BPDU message, which helps ensure that the first switch 301 and the second switch 302 maintain consistent port role configuration in the MLAG 300 environment, thereby maintaining network stability and reliability.

[0072] In some possible implementations, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the device connection method when the MLAG is the root bridge after the network stabilizes according to an embodiment of the present application. If MLAG 300 is the root bridge, the first switch 301 determines the port role of the first data link port 3012 as a designated port based on the third BPDU message, generates a fifth BPDU message, replaces the port role of the first data link port 3012 with the root port, and writes the MAC address of the CPU (central processing unit) of the first switch into the fifth BPDU message. The fifth BPDU message is then forwarded to the second switch 302. The second switch 302 determines the port role of the second data link port 3022 as a designated port based on the fifth BPDU message.

[0073] Specifically, if MLAG 300 is the root bridge, the first data link port 3012 of the first switch 301 and the second data link port 3022 of the second switch 302 in MLAG 300 are both designated ports. However, after the network stabilizes, it is necessary for the second switch 302 to understand (recognize) that the first data link port 3012 of the first switch 301, to which its second data link port 3022 is connected, is the root port, and that the priority of the first switch 301 is lower than that of itself (the second switch 302). Therefore, the first switch 301 needs to generate a fifth BPDU message, change the port role of the first data link port 3012 to the root port, and write the MAC address of the CPU of the first switch 301 into the fifth BPDU message. The fifth BPDU message is then sent to the second switch 302. With this configuration, the second switch 302 can compare the MAC address of the CPU of the first switch 301 in the fifth BPDU message with the MAC address of its own CPU (the second switch 302). This can determine that the priority of the first switch 301 is lower than that of itself (the second switch 302), and that the port role of the first data link port 3012 of the first switch 301 to which its second data link port 3022 is connected is the root port. Therefore, the port role of the second data link port 3022 can be determined as the designated port.

[0074] This approach ensures that the first data link port 3012 of the first switch 301 and the second data link port 3022 of the second switch 302 in the MLAG 300 are not blocked in all cases of STP protocol operation.

[0075] In some possible implementations, the sending time of the fifth BPDU message is set to half of the preset time.

[0076] Specifically, the preset time is 2 seconds, and the sending time of the fifth BPDU message is 1 second.

[0077] In this manner, setting the sending time of the fifth BPDU message to half of the preset time can speed up the processing speed of the fifth BPDU message by the second switch 302, thereby improving the efficiency of eliminating loops in various communication lines.

[0078] In some possible implementations, the third switch 303 blocks non-root ports and non-designated ports.

[0079] Specifically, the third switch 303 may also block backup ports (non-root ports and non-designated ports) to eliminate loops. The third switch 303 prohibits sending any service data except BPDU messages to backup ports (non-root ports and non-designated ports).

[0080] This method effectively eliminates the hidden dangers of loops between switches, thereby avoiding the generation of broadcast storms, saving network resources, and reducing the harm caused by loops to the network.

[0081] Based on the above method embodiment, the embodiment of the present application also provides a communication loop elimination system, such as Figure 6 As shown, Figure 6 A schematic diagram of the communication loop elimination system provided in an embodiment of the present application. The system includes a first switch (not shown) and a second switch (not shown). The first switch and the second switch form MLAG300. The first switch is provided with a first port and a first data link port. The second switch is provided with a second port and a second data link port. The first port and the second port belong to a first aggregation group.

[0082] MLAG300, configured to receive a third BPDU message sent by the third switch 303;

[0083] MLAG300 is further configured to, if MLAG300 is a non-root bridge and the first port is connected to the third port of the third switch 303 and the second port is connected to the fourth port of the third switch 303, determine, based on the third BPDU message, that the port role of the first aggregation group in which the first port and the second port are located is the root port; and feed back the first BPDU message and the second BPDU message to the third switch 303; wherein the first BPDU message includes that the port role of the first aggregation group in which the first port of the first switch is located is the root port, and the second BPDU message includes that the port role of the first aggregation group in which the second port of the second switch is located is the root port;

[0084] The third switch 303 is configured to determine, based on the first BPDU message and the second BPDU message, that the port role of the second aggregation group in which the third port and the fourth port of the third switch 303 are located is a designated port; wherein the MAC address of the first switch and the MAC address of the second switch are configured to be the same, and the third port and the fourth port belong to the second aggregation group;

[0085] MLAG300 is also used to block non-root ports and non-designated ports.

[0086] Preferably, the first switch is configured to determine, according to the third BPDU message, that the port role of the first port is a root port if the MLAG 300 is a non-root bridge and the first port is connected to the third port of the third switch 303;

[0087] The first switch is further configured to forward the third BPDU message to the second switch;

[0088] The second switch is configured to determine, according to the third BPDU message, that the port role of the second data link port is a root port.

[0089] Preferably, the second switch is configured to write the port role of the second data link port as a root port into the fourth BPDU message;

[0090] The second switch is further configured to forward the fourth BPDU message to the first switch;

[0091] The first switch is further configured to determine, according to the fourth BPDU message, that the port role of the first data link port is a designated port.

[0092] Preferably, the first switch is further configured to, if MLAG 300 is the root bridge, determine, based on the third BPDU message, that the port role of the first data link port is a designated port; generate a fifth BPDU message, replace the port role of the first data link port with a root port, and write the MAC address of the central processing unit (CPU) of the first switch into the fifth BPDU message; and forward the fifth BPDU message to the second switch;

[0093] The second switch is further configured to determine, according to the fifth BPDU message, that the port role of the second data link port is a designated port.

[0094] Preferably, the third switch 303 is further configured to block non-root ports and non-designated ports.

[0095] Preferably, the sending time of the fifth BPDU message is set to half of the preset time.

[0096] The communication loop elimination system provided in the embodiment of the present application has the same technical features as the communication loop elimination method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.

[0097] The present application also provides a computing device. Figure 7 As shown, this figure is a schematic diagram of a computing device provided by an embodiment of the present application, wherein the computing device 400 includes a bus 401, a processor 402, a communication interface 403, and a memory 404. The processor 402, the memory 404, and the communication interface 403 communicate with each other via the bus 401.

[0098] The bus 401 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0099] The processor 402 may be any one or more of a CPU, a graphics processing unit (GPU), a microprocessor (MP), a digital signal processor (DSP), and the like.

[0100] Communication interface 403 is used for external communication. Memory 404 may include volatile memory, such as random access memory (RAM). Memory 404 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0101] The memory 404 stores executable codes, and the processor 402 executes the executable codes to perform the aforementioned communication loop elimination method.

[0102] Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, hard disk, or magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the aforementioned communication loop elimination method.

[0103] The present application also provides a computer program product comprising one or more computer instructions that, when loaded and executed on a computing device, fully or partially generate the process or function described in the present application.

[0104] The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0105] When the computer program product is executed by a computer, the computer performs any of the aforementioned communication loop elimination methods. The computer program product may be a software installation package, and when any of the aforementioned communication loop elimination methods is needed, the computer program product may be downloaded and executed on the computer.

[0106] The descriptions of the processes or structures corresponding to the above figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0107] The above description is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A communication loop elimination method, characterized in that: The cross-device link aggregation group MLAG includes a first switch and a second switch; the first switch is provided with a first port and a first data link port; the second switch is provided with a second port and a second data link port; The first port and the second port belong to a first aggregation group; and the method includes: The MLAG receives a third bridge protocol data unit (BPDU) message sent by the third switch; If the MLAG is a non-root bridge, the first port is connected to the third port of the third switch, and the second port is connected to the fourth port of the third switch, the MLAG determines, according to the third BPDU message, that the port role of the first aggregation group where the first port and the second port are located is a root port; The MLAG feeds back a first BPDU message and a second BPDU message to the third switch; wherein the first BPDU message includes that the port role of the first aggregation group where the first port of the first switch is located is a root port, and the second BPDU message includes that the port role of the first aggregation group where the second port of the second switch is located is a root port; The third switch determines, based on the first BPDU message and the second BPDU message, that the port role of the second aggregation group to which the third port and the fourth port of the third switch belong is a designated port; wherein the MAC address of the first switch and the MAC address of the second switch are configured to be the same, and the third port and the fourth port belong to the second aggregation group; The MLAG blocks non-root ports and non-designated ports.

2. The communication loop elimination method according to claim 1, wherein: The method further comprises: If the MLAG is a non-root bridge and the first port is connected to the third port of the third switch, the first switch determines, according to the third BPDU message, that the port role of the first port is a root port; The first switch forwards the third BPDU message to the second switch; The second switch determines, according to the third BPDU message, that the port role of the second data link port is a root port.

3. The communication loop elimination method according to claim 2, wherein: The method further comprises: The second switch writes the port role of the second data link port as a root port into a fourth BPDU message; The second switch forwards the fourth BPDU message to the first switch; The first switch determines, according to the fourth BPDU message, that the port role of the first data link port is a designated port.

4. The communication loop elimination method according to claim 1, wherein: The method further comprises: If the MLAG is a root bridge, the first switch determines, according to the third BPDU message, that the port role of the first data link port is a designated port; The first switch generates a fifth BPDU message, replaces the port role of the first data link port with the root port, and writes the MAC address of the central processing unit (CPU) of the first switch into the fifth BPDU message; The first switch forwards the fifth BPDU message to the second switch; The second switch determines, according to the fifth BPDU message, that the port role of the second data link port is a designated port.

5. The communication loop elimination method according to claim 1, wherein: The method further comprises: The third switch blocks the non-root port and the non-designated port.

6. The communication loop elimination method according to claim 4, characterized in that: The method further comprises: The sending time of the fifth BPDU message is set to half of the preset time.

7. A communication loop elimination system, characterized in that: The system includes: a first switch and a second switch; the first switch is provided with a first port and a first data link port; the second switch is provided with a second port and a second data link port; the first port and the second port belong to a first aggregation group; MLAG, configured to receive a third bridge protocol data unit BPDU message sent by the third switch; The MLAG is further configured to, if the MLAG is a non-root bridge, the first port is connected to the third port of the third switch, and the second port is connected to the fourth port of the third switch, determine, based on the third BPDU message, that the port role of the first aggregation group in which the first port and the second port are located is a root port; and feed back a first BPDU message and a second BPDU message to the third switch; wherein the first BPDU message includes that the port role of the first aggregation group in which the first port of the first switch is located is a root port, and the second BPDU message includes that the port role of the first aggregation group in which the second port of the second switch is located is a root port; a third switch, configured to determine, based on the first BPDU message and the second BPDU message, that the port role of the second aggregation group to which the third port and the fourth port of the third switch belong is a designated port; wherein the MAC address of the first switch and the MAC address of the second switch are configured to be the same, and the third port and the fourth port belong to the second aggregation group; The MLAG is used to block non-root ports and non-designated ports.

8. A computing device, characterized in that including memory and processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program product comprises one or more computer instructions. When the computer instructions are executed by a computer, the computer performs the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and network equipment for preventing network loop and spanning tree protocol network system

    CN101699799A

  • Edge aggregation port convergence method of MLAG device group, device and medium

    CN116708194A