Communication loop elimination method, system and device and storage medium
By receiving and processing BPDU messages in the MLAG environment, determining the port role and blocking non-root ports, the problem that Switch 3 cannot run the STP protocol normally is solved, and the effect of effectively eliminating loops and avoiding broadcast storms is achieved.
Patent Information
- Application Number
- CN202411733979.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-29
AI Technical Summary
In the MLAG environment, switch 3 cannot run the STP protocol normally because it receives different MAC addresses from switch 1 and switch 2, resulting in the inability to identify the loop in the MLAG, thus unable to avoid the generation of broadcast storms.
By receiving the BPDU message sent by the third switch, the MLAG determines the port role of the first aggregate group and feedbacks the BPDU message to the third switch. The third switch determines its port role based on this information and blocks the non-root port and the non-specified port.
Ensure that all devices operate STP protocol normally in the MLAG network, effectively eliminate loop hazards, avoid broadcast storms, save network resources, and reduce the harm of loops to the network.
Smart Images

Figure CN119544595A_ABST
Abstract
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] STP (Spanning Tree Protocol) is a communication protocol that works in the second layer (data link layer) of the OSI (Open Systems Interconnection) model. Its function is to eliminate loops in the network and ensure a loop-free logical topology in the network, thereby avoiding broadcast storms in the network, which causes a large amount of network resources and bandwidth to be occupied. It can also be used for link redundancy backup. This protocol also derives RSTP (Rapid Spanning Tree Protocol) and MSTP (Multiple Spanning Tree Protocol). Both RSTP and MSTP belong to the STP protocol cluster, which has become one of the important protocols in the network and is widely used. In the use environment of MLAG (Multi-Chassis Link Aggregation), there are still situations where the STP protocol cluster needs to run.
[0003] In the existing technology, MLAG only realizes the aggregation of two switches (master switch and slave switch) into one 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 switch and slave switch) of MLAG run the STP protocol cluster separately, and use their own MAC addresses as device identifiers for calculation and protocol interaction in the network. Figure 1 As shown, Figure 1A schematic diagram of the MLAG connection method in the prior art provided for an embodiment of the present application. Switch 1 and switch 2 form an MLAG. Switch 1, switch 2, and switch 3 use their respective MAC addresses as device identifiers (MAC addresses) for operations and protocol interactions. The two ports of switch 3 connected to switch 1 and switch 2 are both aggregation group ports. The aggregation group port of switch 3 needs to receive different MAC addresses from switch 1 and switch 2, respectively. Since switch 3 will identify the MLAG composed of switch 1 and switch 2 as one device, the aggregation group port of switch 3 will receive two different MAC addresses, causing switch 3 to be unable to operate the STP protocol cluster normally. Therefore, in the prior art, in order for switch 3 to operate the STP protocol cluster normally, only the master switch (switch 1) in the MLAG participates in the operation of the STP protocol cluster, and the slave switch (switch 2) does not participate in the operation of the STP protocol cluster. However, if a link on the slave switch (switch 2) forms a loop with the link in MLAG (the link between switch 1 and switch 2), the ports involved in the loop cannot be calculated from the slave switch (switch 2), and broadcast storms on the loop cannot be avoided, which in turn causes great harm 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] In order to achieve the above objectives, this application adopts the following technical solutions: 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: 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, according to 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; wherein 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; The MLAG blocks non-root ports and non-designated ports.
[0007] Preferably, 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.
[0008] Preferably, 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.
[0009] Preferably, 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, and replaces the port role of the first data link port with a 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.
[0010] Preferably, the method further comprises: The third switch blocks the non-root port and the non-designated port.
[0011] Preferably, the method further comprises: The sending time of the fifth BPDU message is set to half of the preset time.
[0012] 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; MLAG, used to receive a third bridge protocol data unit BPDU message sent by the third switch; The MLAG is further used to determine, 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 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; and to 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 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; a third switch, configured to determine, according to 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 are located is a designated port; wherein 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; The MLAG is used to block non-root ports and non-designated ports.
[0013] In a third aspect, the present application provides a computing device, including a memory and a 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 as described in any one of the first aspects.
[0014] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method as described in any one of the first aspects.
[0015] In a fifth aspect, the present application provides a computer program product, wherein the computer program product comprises one or more computer instructions, and when the computer instructions are executed by a computer, the computer executes the method as described in any one of the first aspects.
[0016] It can be seen from the above technical solution that the present application has at least the following beneficial effects: In the present application, when the data exchange network composed of MLAG and the third switch is stable, MLAG determines the port role of the first aggregation group as the root port according to 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 first aggregation group; the third switch determines the port role of the second aggregation group where the third port and the fourth port of the third switch are located as the designated port according to the first BPDU message and the second BPDU message; MLAG blocks the non-root port and the non-designated port. This method enables all devices in the network scenario applied to MLAG to run the STP protocol normally, more 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 the existence of loops to the network.
[0017] 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 features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects 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 realized 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 a specific embodiment that does not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A schematic diagram of the MLAG connection method in the prior art provided in the embodiment of the present application; Figure 2 A flow chart of a communication loop elimination method provided in an embodiment of the present application; Figure 3A schematic diagram of a device connection method in which the port roles of the first port and the second port are root ports after the network is stable provided in an embodiment of the present application; 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; 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; Figure 6 A schematic diagram of the structure of a communication loop elimination system provided in an embodiment of the present application; Figure 7 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The terms "first", "second", "third", etc. in the specification of this application and the accompanying drawings are used to distinguish different objects rather than to limit a specific order.
[0020] In the embodiments of the present 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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0021] 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: S101: MLAG receives a third BPDU message sent by a third switch.
[0022] Specifically, Figure 3 As shown, Figure 3A schematic diagram of a device connection method in which the port roles of the first port and the second port are root ports after the network is stable provided in an embodiment of the present application. When the network composed of MLAG300 and the third switch 303 is stable, MLAG300 will still receive the third BPDU (Bridge Protocol Data Unit) message sent by the third switch 303. Since the third port and the fourth port 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. MLAG300 can determine the port role and port status of the first aggregation group where the first port 3011 and the second port 3021 are located based on the third BPDU message.
[0023] 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, 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.
[0024] Specifically, the first switch 301 is the master switch of the MLAG 300, and the second switch 302 is the slave switch of the MLAG 300. In the 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 that the path (cost value) from the first aggregation group to the second aggregation group of the third switch 303 (root bridge) is the shortest according to the third BPDU message, that is, the port role of the first aggregation group where the first port 3011 of the first switch 301 is located is the root port. At the same time, the first switch 301 will also send the third BPDU message to the second switch 302 through the tunnel, and the second switch 302 can also calculate that the path (cost value) from the first aggregation group to the second aggregation group of the third switch 303 (root bridge) is the shortest according to the third BPDU message, that is, the port role of the first aggregation group where the second port 3021 of the second switch 302 is located is the root port.
[0025] If the second switch 302 receives the third BPDU message, it calculates that the port role of the first aggregation group where the second port 3021 is located is the root port according to the third BPDU message. At the same time, the second switch 302 will also send the third BPDU message to the first switch 301 through the tunnel, and the first switch 301 can also calculate that the port role of the first aggregation group where the first port 3011 is located is the root port according to the third BPDU message.
[0026] S103: The MLAG feeds back the first BPDU message and the second BPDU message to the third switch.
[0027] 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.
[0028] 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 aggregation group of MLAG, so as to subsequently calculate the information of the second aggregation group.
[0029] S104: The third switch determines, according to 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.
[0030] 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.
[0031] 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 where the third port 3031 and the fourth port 3032 are located.
[0032] S105: MLAG blocks non-root ports and non-designated ports.
[0033] Specifically, the non-root ports and non-designated ports are ports other than the root ports and designated ports, i.e., backup ports. Since the communication line where the backup port is located may form a loop with the ports of other devices. Since the existence of the loop may cause broadcast storms and cause great harm to the network, it is necessary to block the backup ports (non-root ports and non-designated ports) to eliminate the loop. The method of blocking the backup ports (non-root ports and non-designated ports) is to set the status of the backup ports (non-root ports and non-designated ports) to the block state, that is, MLAG300 prohibits sending any service data other than BPDU messages to the backup ports (non-root ports and non-designated ports).
[0034] The embodiment of the present application provides a communication loop elimination method, in which, when the data exchange network formed by MLAG300 and the third switch 303 is stable, MLAG300 determines that the port role of the first aggregation group where the first port 3011 of the first switch 301 is located is the root port, and the port role of the first aggregation group where the second port 3021 of the second switch 302 is located is the root port according to the third BPDU message, and feeds back the first BPDU message and the second BPDU message to the third switch 303; the third switch 303 determines that the port role of the second aggregation group where the third port 3031 and the fourth port 3032 are located is the designated port according to the first BPDU message and the second BPDU message; MLAG300 blocks the non-root port and the non-designated port. In the 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 such a configuration, the third switch 303 can normally calculate 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 where the third port 3031 and the fourth port 3032 are located. In the prior art, only the master switch (the first switch 301) in MLAG300 participates in the operation of the STP protocol, and the slave switch (the second switch 302) does not participate in the operation of the STP protocol. Compared with the prior art, the slave switch (the second switch 302) of this method can also participate in the operation of the STP protocol. It avoids the situation that the third switch 303 identifies the MLAG300 composed of the first switch 301 and the second switch 302 as a device, but receives two different MAC addresses, resulting in the third switch 303 being unable to run the STP protocol normally. This method enables all devices in the network scenario applied to MLAG300 to run the STP protocol normally, more 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 the existence of loops to the network.
[0035] In some possible implementations, such as Figure 4 As shown, Figure 4A 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. If MLAG 300 is a non-root bridge and the first port 3011 is connected to the third port 3031 of the third switch 301, the first switch 301 determines that the port role of the first port 3011 is a root port according to the third BPDU message, and forwards the third BPDU message to the second switch 302; the second switch 302 determines that the port role of the second data link port 3022 is a root port according to the third BPDU message.
[0036] Specifically, since 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 thus cannot calculate the port role of the second port 3021 according to the third BPDU message. Therefore, after the network is stable, the first switch 301 processes the third BPDU message and also forwards the third BPDU message to the second switch 302. The second switch 302 calculates that the path (cost value) from the second port 3021 of the second switch 302 to the second aggregation group of the third switch 303 (root bridge) is the shortest according to the third BPDU message, that is, the port role of the second port 3021 of the second switch 302 is determined to be the root port.
[0037] In this manner, the first switch 301 forwards the third BPDU message to the second switch 302 for processing while processing the third BPDU message, so that the second switch 302 quickly determines the port role of the second data link port 3022. The first switch 301 and the second switch 302 exchange information through the third BPDU message to determine the port role, which helps to quickly eliminate loops in the network.
[0038] 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 stable provided in 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 the fourth BPDU message, and forwards the fourth BPDU message to the first switch 301; the first switch 301 determines that the port role of the first data link port 3012 is a designated port according to the fourth BPDU message.
[0039] Specifically, after the network is stable, after the second switch 302 determines that the port role of its own second data link port 3022 is the root port, it generates a fourth BPDU message, writes the port role of its own second data link port 3022 into the fourth BPDU message, and forwards the fourth BPDU message to the first switch 301. The first switch 301 calculates that the path (cost value) from its own first port 3011 to the second aggregation group of the third switch 303 (root bridge) is the shortest according to the fourth BPDU message, that is, it determines that the port role of the first port 3011 of the first switch 301 is the designated port.
[0040] 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.
[0041] In some possible implementations, such as Figure 5 As shown, Figure 5 A schematic diagram of the device connection method when MLAG is the root bridge after the network is stable provided in the embodiment of the present application. If MLAG300 is the root bridge, the first switch 301 determines that the port role of the first data link port 3012 is a designated port according to 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, and forwards the fifth BPDU message to the second switch 302; the second switch 302 determines that the port role of the second data link port 3022 is a designated port according to the fifth BPDU message.
[0042] Specifically, if MLAG300 is the root bridge, the port roles of the first data link port 3012 of the first switch 301 and the second data link port 3022 of the second switch 302 in MLAG300 are both designated ports. However, after the network is stable, the second switch 302 needs to understand (recognize) that the port role of the first data link port 3012 of the first switch 301 connected to the second data link port 3022 of itself (the second switch 302) is the root port, and the priority of the first switch 301 is not as high as that of itself (the second switch 302). Therefore, the first switch 301 needs to generate a fifth BPDU message, replace the port role of the first data link port 3012 with the root port, write the MAC address of the CPU of the first switch 301 into the fifth BPDU message, and send the fifth BPDU message to the second switch 302. With such configuration, the second switch 302 can determine that the priority of the first switch 301 is not higher than that of itself (the second switch 302) based on the comparison between the MAC address of the CPU of the first switch 301 in the fifth BPDU message and the MAC address of the CPU 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, and thus the port role of the second data link port 3022 can be determined to be the designated port.
[0043] 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.
[0044] In some possible implementations, the sending time of the fifth BPDU message is set to half of the preset time.
[0045] Specifically, the preset time is 2s, and the sending time of the fifth BPDU message is 1s.
[0046] 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 second switch 302 on the fifth BPDU message, thereby improving the efficiency of eliminating loops in various communication lines.
[0047] In some possible implementations, the third switch 303 blocks non-root ports and non-designated ports.
[0048] Specifically, the third switch 303 may also block the backup port (non-root port and non-designated port) to eliminate the loop. The third switch 303 prohibits sending any service data except BPDU messages to the backup port (non-root port and non-designated port).
[0049] This method effectively eliminates the hidden danger of loops between switches, thereby avoiding the occurrence of broadcast storms, saving network resources, and reducing the harm caused by the existence of loops to the network.
[0050] Based on the above method embodiment, the present application embodiment also provides a communication loop elimination system, such as Figure 6 As shown, Figure 6 A schematic diagram of the structure of a communication loop elimination system provided in an embodiment of the present application. The system includes a first switch (not shown in the figure) and a second switch (not shown in the figure); 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; MLAG300, configured to receive a third BPDU message sent by the third switch 303; MLAG300 is further used to determine, 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 if MLAG300 is a non-root bridge, 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; and to 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 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 303 is used to determine, according to 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 303 are located is a designated port; wherein 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; MLAG300 is also used to block non-root ports and non-designated ports.
[0051] Preferably, the first switch is used to determine the port role of the first port as a root port according to the third BPDU message if the MLAG 300 is a non-root bridge and the first port is connected to the third port of the third switch 303; The first switch is further configured to forward the third BPDU message to the second switch; The second switch is used to determine, according to the third BPDU message, that the port role of the second data link port is a root port.
[0052] Preferably, the second switch is used to write the port role of the second data link port as a root port into the fourth BPDU message; The second switch is further used to forward the fourth BPDU message to the first switch; 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.
[0053] Preferably, the first switch is further configured to, if MLAG300 is a root bridge, determine the port role of the first data link port as a designated port according to the third BPDU message; generate a fifth BPDU message, and 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; 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.
[0054] Preferably, the third switch 303 is further used to block non-root ports and non-designated ports.
[0055] Preferably, the sending time of the fifth BPDU message is set to half of the preset time.
[0056] 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.
[0057] The present application also provides a computing device. Figure 7 As shown, this figure is a schematic diagram of a computing device provided in an embodiment of the present application, and 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 through the bus 401.
[0058] 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 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0059] The processor 402 may be any one or more of processors such as a CPU, a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0060] The communication interface 403 is used for communicating with the outside. The memory 404 may include a volatile memory, such as a random access memory (RAM). The memory 404 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD).
[0061] The memory 404 stores executable codes, and the processor 402 executes the executable codes to perform the aforementioned communication loop elimination method.
[0062] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned communication loop elimination method.
[0063] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.
[0064] The computer instructions may 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 may 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.
[0065] When the computer program product is executed by a computer, the computer executes 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 required, the computer program product may be downloaded and executed on a computer.
[0066] The descriptions of the processes or structures corresponding to the above-mentioned 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.
[0067] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions 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; the method comprises: 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, according to 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; wherein 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; The MLAG blocks non-root ports and non-designated ports.
2. The communication loop elimination method according to claim 1, characterized in that: 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, characterized in that: 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, characterized in that: 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, and replaces the port role of the first data link port with a 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, characterized in that: 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 comprises: 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, used to receive a third bridge protocol data unit BPDU message sent by the third switch; The MLAG is further used to determine, 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 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; and to 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 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; a third switch, configured to determine, according to 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 are located is a designated port; wherein 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; 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 as claimed in 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
Network redundancy method, device and apparatus
CN112422422A
Edge aggregation port convergence method of MLAG device group, device and medium
CN116708194A
Loop detection and avoiding function in redundancy line function
JP2007104512A