Spanning tree protocol convergence method and device, and medium

By virtualizing the stacking system into a virtual switch and creating a virtual port on the main device, the problem of the spanning tree protocol convergence in the stacking switch system is solved, and faster network response and more efficient topological changes are achieved.

CN119766722AActive Publication Date: 2025-04-04INSPUR NETWORK TECH (SHANDONG) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411905919.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-04
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

In stack switch systems, the convergence speed of the spanning tree protocol is too slow, resulting in poor network performance.

Method used

By virtualizing the stacking system into a virtual switch, creating a bridge ID for root bridge calculations, and creating a virtual port on the main device to distinguish device types, shorten the root bridge election time, and improve the convergence speed of the spanning tree protocol.

Benefits of technology

The convergence process of the spanning tree protocol is accelerated, redundant computing and communication is reduced, the network response speed is improved, and the network can adapt to topological changes faster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766722A_ABST
    Figure CN119766722A_ABST
Patent Text Reader

Abstract

The invention discloses a spanning tree protocol convergence method, spanning tree protocol convergence equipment and a medium, and the method comprises the steps: virtualizing a stacking system into a single virtual switch, creating virtual ports of all ports in the stacking system on main equipment, and when root bridge election is carried out, carrying out root bridge election on the virtual ports; after the standby device and the slave device respectively forward a first BPDU message of the opposite terminal external device to the master device, a root bridge device is determined according to a root bridge calculation result of the master device and a root bridge calculation result of the external device, and when the master device carries out port role election on a virtual port in a second state according to a second BPDU message, the virtual port in the second state is subjected to port role election. The port role and the port state are obtained, the port state of the single virtual port is forwarded to the corresponding standby device or slave device through the master device, and when the network topology changes, port role election is conducted on the network topology again through the master device. The stacking system is virtualized into a switch, and the BPDU messages of the slave device and the standby device are transferred to the master device to be processed, so that the convergence speed of the spanning tree protocol is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of switch network communications, and in particular to a spanning tree protocol convergence method, device and medium. Background Art

[0002] Switch stacking is to connect multiple physical switches together through dedicated stacking ports, so that they appear as a logical switch in the network, so that they can be managed and configured as a unified device, thereby simplifying the network topology, management operations and fault recovery. Stacked switches are managed and communicated through stacking links and stacking protocols, and cooperate with each other when forwarding data packets. Stacked switches share the same bridge ID, STP status, MAC address table and other information. The switches in the stacking system are divided into three roles: master switch (Active), standby switch (Standby), and slave switch (Member). Among them, the master switch is usually a switch in the stack, which is responsible for the management and configuration of the entire stack system. In the stack, the configuration of the master switch is effective for all members. When the master switch fails or restarts, the standby switch takes over all the services of the original master switch and becomes the new master switch.

[0003] However, although stacking technology can increase network redundancy, improve bandwidth and simplify network management, the stacked switches may introduce loops, causing data packets to circulate infinitely in the network. Therefore, in order to prevent this situation, it is usually necessary to use the spanning tree protocol to avoid loops.

[0004] Currently, in a stacked switch system, each switch has its own spanning tree calculation module, but the stacking protocol ensures that the calculation and link status between switches are consistent, thereby avoiding loops. However, changes in network topology (such as device failures, link interruptions) will trigger the convergence process of the spanning tree protocol, and a long convergence time may cause data loss, loops, or temporary network interruptions. Although the spanning tree protocol can provide fault recovery capabilities, in some large-scale stacking systems, the convergence time is still long, resulting in poor network performance. Summary of the invention

[0005] The embodiments of the present application provide a spanning tree protocol convergence method, device and medium, which are used to solve the problem that the spanning tree protocol convergence speed is too slow in a stacking scenario, resulting in poor network performance.

[0006] The present application embodiment adopts the following technical solutions:

[0007] On the one hand, an embodiment of the present application provides a spanning tree protocol convergence method, the method comprising: virtualizing a stacking system of a network topology into a single virtual switch to create a unique bridge ID for the stacking system; the bridge ID is used to perform root bridge calculation with external devices of the stacking system; creating virtual ports of all physical ports in the stacking system on a master device; the stacking system comprises a master device, a backup device and a slave device; the virtual ports can distinguish different device types; setting the corresponding virtual port of the stacking port to a first state, and setting other virtual ports except the corresponding virtual port to a second state; when the network topology performs root bridge election, the backup device and the slave device respectively set the virtual port of the external device at the opposite end to the first state; After the first BPDU message is forwarded to the master device, the root bridge device of the network topology is determined according to the root bridge calculation result of the master device and the root bridge calculation result of each external device of the stacking system; if the root bridge device is an external device of the stacking system, when the master device performs port role election for the virtual port in the second state according to the second BPDU message, the port role and port status are obtained, and when a single virtual port is a remote port, the port status of the single virtual port is forwarded to the corresponding backup device or slave device through the master device; the second BPDU message comes from the root bridge device; when the network topology changes, the port role election is re-performed for the network topology through the master device.

[0008] In one example, when the network topology changes, the network topology is re-elected through the master device for port roles, specifically including: when the root bridge device of the network topology is offline, the root bridge device of the network topology is re-determined, and the port role election of the network topology is re-performed through the master device; when a new device with a smaller bridge ID is online in the network topology, the root bridge device of the network topology is re-determined, and the port role election of the network topology is re-performed through the master device.

[0009] In one example, the method of creating a unique bridge ID for the stacking system specifically includes: in the network topology, determining the MAC addresses of all devices in the stacking system; comparing multiple MAC addresses to obtain the smallest MAC address, and performing addition or subtraction operations on the smallest MAC address value to obtain the MAC address of the virtual switch, and using the MAC address of the virtual switch as the bridge MAC address of the stacking system; using the bridge priority of the master device in the stacking system as the bridge priority of the stacking system; combining the bridge MAC address with the bridge priority of the stacking system to obtain a unique bridge ID for the stacking system.

[0010] In one example, the virtual ports of all ports in the stacking system are created on the master device, specifically including: setting the port IDs of all ports in the stacking system according to the pre-built device types; the port IDs are used to distinguish different device types; according to the port IDs, the virtual ports of all ports are created on the master device; the master device virtual port is a local port, and the standby device virtual port and the slave device virtual port are both remote ports.

[0011] In one example, the root bridge device of the network topology is determined based on the root bridge calculation result of the master device and the root bridge calculation result of each external device of the stacking system, specifically including: performing root bridge calculation on the first BPDU message from the backup device and the slave device by the master device to obtain the minimum bridge ID; comparing the minimum bridge ID with the root bridge calculation result of the external device, and determining the device with a lower bridge priority value as the root bridge device of the network topology.

[0012] In one example, the method further includes: if the root bridge device is the virtual switch, sending a third BPDU message to an external device of the stacking system through the master device.

[0013] In one example, when a single virtual port is a remote port, the port state of the single virtual port is forwarded to a corresponding backup device or slave device through the master device, specifically including: determining whether each virtual port in the second state is an aggregate port of the stacking system; if the aggregate port has multiple physical ports, traversing multiple physical ports corresponding to the aggregate port, and if the physical port is a remote port, forwarding the port state of the physical port to a corresponding backup device or slave device through the master device; when a single non-aggregate port is a remote port, forwarding the port state of the single non-aggregate port to a corresponding physical port of a corresponding backup device or slave device through the master device.

[0014] In one example, after the port status of the single virtual port is forwarded to the corresponding backup device or slave device by the master device, the method further includes: exporting the port status after forwarding and sending it to the corresponding backup device or slave device chip, aggregating it into a status information chart, and sending it to the client; if the network topology changes, the updated port status is compared with the port status before the update to obtain a difference status information chart, and send it to the client.

[0015] On the other hand, an embodiment of the present application provides a spanning tree protocol convergence device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a spanning tree protocol convergence method described in any one of the above items.

[0016] On the other hand, an embodiment of the present application provides a spanning tree protocol convergence non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions can execute any one of the spanning tree protocol convergence methods described above.

[0017] At least one of the above technical solutions adopted in the embodiment of the present application can achieve the following beneficial effects: by virtualizing the stacking system as a virtual switch and creating a bridge ID to perform root bridge election with other devices outside the stacking system, the process of each switch in the stacking system performing election is transformed into the process of a virtual switch performing root bridge election, thus shortening the root bridge election time in the spanning tree protocol and accelerating the convergence process of the spanning tree protocol. By forwarding the BPDU message received from the opposite end by the backup device and the slave device in the stacking system to the master device for spanning tree module calculation, the confusion and inconsistency caused by multiple devices processing messages at the same time are avoided, redundant calculations and communications are reduced, the convergence speed of the spanning tree protocol is improved, the network can adapt to topology changes more quickly, and the spanning tree protocol calculation and management in the stacking system are simpler and more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solution of the present application, some embodiments of the present application will be described in detail below in conjunction with the accompanying drawings, in which:

[0019] Figure 1 A schematic diagram of a flow chart of a spanning tree protocol convergence method provided in an embodiment of the present application;

[0020] Figure 2 A virtual port schematic diagram of a spanning tree protocol convergence method provided in an embodiment of the present application;

[0021] Figure 3 A schematic diagram of an embodiment of a spanning tree protocol convergence method provided in an embodiment of the present application;

[0022] Figure 4 A schematic diagram of the structure of a spanning tree protocol convergence device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0024] Some embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0025] Figure 1 A flow chart of a spanning tree protocol convergence method provided in an embodiment of the present application. The method can be applied to different business fields. Certain input parameters or intermediate results in the process allow manual intervention and adjustment to help improve accuracy.

[0026] The analysis method involved in the embodiment of the present application can be implemented by a terminal device or a server, and the present application does not impose any special restrictions on this. For the convenience of understanding and description, the following embodiments are described in detail by taking the control host as an example.

[0027] Figure 1 The process in may include the following steps:

[0028] S101: Virtualizing a stacking system of a network topology into a single virtual switch to create a unique bridge ID for the stacking system; the bridge ID is used to perform root bridge calculation with external devices of the stacking system.

[0029] It should be noted that the MAC address and bridge priority of the stack system are important parameters used in the spanning tree protocol. The MAC address of the stack system is a virtual MAC address created by the stack protocol, and this virtual MAC address is used as the bridge MAC address of the stack system. In the spanning tree protocol, the bridge MAC address is used to identify the bridge device (i.e., switch) in the network and participate in the root bridge election process. The bridge priority is a numerical value used in the spanning tree protocol to determine which switch will become the root bridge during the root bridge election process. The lower the bridge priority, the greater the possibility that the switch will become the root bridge. By default, the bridge priority of the switch is a fixed value, but it can be adjusted through configuration. In the stack system, the bridge priority and the MAC address of the stack system together form the bridge ID of the stack system.

[0030] In some embodiments of the present application, the switch device in the stacking system is logically virtualized into a switch, and a system MAC is created according to the stacking protocol based on the switch inside the stacking system, that is, in the network topology, the MAC addresses of all devices in the stacking system are determined, and multiple MAC addresses are compared to obtain the smallest MAC address, and the smallest MAC address value is added or subtracted to obtain the MAC address of the virtual switch, and then the MAC address of the virtual switch is used as the bridge MAC address of the stacking system, and the bridge priority of the master device in the stacking system is determined, and the bridge priority of the master device in the stacking system is used as the bridge priority of the stacking system, and the bridge MAC address is combined with the bridge priority of the stacking system to obtain a unique bridge ID of the stacking system, and the bridge ID is used to perform root bridge election with other devices outside the system.

[0031] By specifying the stack system bridge ID, the process of selecting the root bridge in the spanning tree of switches within the stack system is reduced, effectively avoiding incorrect elections caused by asynchrony between stack switches and accelerating convergence.

[0032] S102: creating virtual ports of all physical ports in the stacking system on the master device; the stacking system includes a master device, a backup device and a slave device; the virtual ports can distinguish different device types.

[0033] It should be noted that in a stacking system, devices can be divided into three roles: master device, backup device, and slave device.

[0034] The master device is the main control and management device in the stack system. It is responsible for the management and configuration of the entire stack system. The configuration of the master device is effective for all member devices. In the calculation and execution of the spanning tree protocol, the master switch plays a key role and is responsible for the calculation and state synchronization of the spanning tree. The standby device is the backup device of the master device. When the master device fails or restarts, the standby device will take over all the services of the master device and become the new master device. The standby device does not participate in the calculation of the spanning tree under normal circumstances, but will take over its responsibilities when the master device fails. The slave device is an ordinary member device in the stack system. They follow the management and configuration instructions of the master device. The slave device does not calculate the spanning tree independently, but relies on the master device for spanning tree state synchronization and decision-making. The main function of the slave device is to provide additional ports and bandwidth to enhance the redundancy and performance of the network. Through the division of labor and cooperation of these three roles, the stack system can achieve unified management and configuration, simplify the network topology, and improve the reliability and performance of the network.

[0035] In some embodiments of the present application, the port ID of all ports in the stacking system is set according to the pre-built device type, and the port ID is used to distinguish different device types; that is, logical ports are created on the master device to correspond one-to-one with the ports of other devices in the system, so that the master device logically owns all the ports in the system, and the ports are distinguished by the device ID. According to the port ID, the port type and device type are distinguished, that is, the master device virtual port is a local port, and the backup device virtual port and the slave device virtual port are both remote ports.

[0036] S103: Setting the corresponding virtual port of the stack port to a first state, and setting other virtual ports except the corresponding virtual port to a second state.

[0037] It should be noted that since the stack port only performs stacking protocol election and information synchronization exchange between devices, when a port inside the stack system is configured as a stack port, the port does not participate in the port role election of the spanning tree, that is, the first state, and the port state that participates in the port role election of the spanning tree is the second state.

[0038] In some embodiments of the present application, if the stack port participates in the port role election of the spanning tree, it may cause the stack port to be blocked and the BPDU message cannot be forwarded. Therefore, the stack port is set to the disable state and does not participate in the port role election of the spanning tree. The states of other virtual ports are set to the forward state by default and participate in the port role election of the spanning tree.

[0039] S104: When the network topology performs root bridge election, after the backup device and the slave device respectively forward the first BPDU message of the opposite external device to the master device, the root bridge device of the network topology is determined according to the root bridge calculation result of the master device and the root bridge calculation result of each external device of the stacking system.

[0040] It should be noted that root bridge election refers to selecting a device as the root bridge by comparing the bridge IDs of various devices in the spanning tree protocol network. The bridge ID consists of two parts: priority and MAC address. The device with the lower priority value is selected as the root bridge. If the priority values ​​are the same, the MAC addresses are compared, and the device with the smallest MAC address is selected as the root bridge.

[0041] The result of the root bridge election determines the optimal path in the network. The root bridge is responsible for sending BPDU messages to other devices to inform them how to build a loop-free topology. By selecting the root bridge, the network can ensure that data packets are transmitted along the optimal path, improving network efficiency and performance.

[0042] It should also be noted that in the initial root bridge election phase, each device will assume that it is the root bridge when it starts up and start sending BPDU messages. Devices compare their bridge IDs by exchanging BPDU messages, and the device with the smallest bridge ID is selected as the root bridge. Once the root bridge is selected, other devices will update their topology information according to the BPDU messages sent by the root bridge, including the root path cost, designated port, and root port. After a period of convergence, all devices in the network will know the location of the root bridge and build a loop-free spanning tree topology.

[0043] In some embodiments of the present application, after receiving the first BPDU message, other devices except the master device in the stacking system send it to the master device through the stacking port for processing. The master device performs root bridge calculation on the first BPDU messages from the backup device and the slave device to obtain the smallest bridge ID. The smallest bridge ID is compared with the root bridge calculation result of the external device. The device with a lower bridge priority value is determined as the root bridge device of the network topology. If the bridge priority values ​​are the same, the device with a smaller MAC address is the root bridge device. The first BPDU message here is the BPDU message sent by each device as a root bridge to the stacking system.

[0044] It should be further explained that if the root bridge device is the virtual switch, the third BPDU message is sent to the external device of the stacking system through the main device, and the main device does not need to send BPDU messages to other devices in the stacking system. The third BPDU message is the BPDU message sent when the virtual switch acts as the root bridge.

[0045] S105: If the root bridge device is an external device of the stacking system, when the master device performs port role election for the virtual port in the second state according to the second BPDU message, the port role and port status are obtained, and when a single virtual port is a remote port, the port status of the single virtual port is forwarded to the corresponding backup device or slave device through the master device; the second BPDU message comes from the root bridge device.

[0046] It should be noted that port role election refers to the allocation of a specific role to each switch port in the spanning tree protocol according to specific rules and algorithms, including:

[0047] The root port is the optimal port on each non-root device that connects to the root bridge. The purpose of selecting the root port is to ensure that the path cost from the port to the root bridge is the smallest. The designated port is the optimal port on each network segment that connects to the root bridge. The purpose of selecting the designated port is to ensure that the path cost from the port to the root bridge is the smallest, and the port is activated for forwarding data. The alternative port is the suboptimal port on each non-root switch that connects to the root bridge. The alternative port is blocked and is not used to forward data, but serves as a backup path.

[0048] It should be further explained that the non-root bridge device calculates the total path cost to the root bridge, which is the local port cost plus the root path cost in the second BPDU message received; compares the total path costs of all non-disabled ports to the root bridge, and selects the port with the smallest total path cost as the root port; then compares the sender bridge ID and the sender port ID in the second BPDU message received, if the sender bridge ID in the second BPDU message received is smaller, the port is selected as the designated port, if the sender bridge ID is the same, compare the sender port ID, the sender port ID is smaller, and the port is selected as the designated port. The sender is the peer device.

[0049] In some embodiments of the present application, the master device processes through the spanning tree protocol calculation module, assigns different roles to the ports participating in the spanning tree election in the system, and sends the status information to the chip. If the port is a port of a standby device or a slave device of the stacking system, the port status information is synchronized to the standby device or the slave device through the stacking port and sent to the chip.

[0050] It should be noted that before performing the sending action, it is necessary to determine whether each virtual port in the second state is an aggregate port of the stacking system. If there is an aggregate port and the aggregate port has multiple physical ports, the multiple physical ports corresponding to the aggregate port are traversed. If the physical port is a remote port, the port state of the physical port is forwarded to the corresponding backup device or slave device through the master device, and sent to the chip of the corresponding backup device or slave device; when a single non-aggregate port is a remote port, the port state of the single non-aggregate port is forwarded to the corresponding physical port of the corresponding backup device or slave device through the master device, and sent to the chip of the corresponding backup device or slave device.

[0051] Furthermore, the port status after forwarding is sent to the corresponding backup device or exported from the device chip, summarized into a status information chart, and sent to the client. If the network topology changes, the updated port status is compared with the port status before the update to obtain a difference status information chart, which is sent to the client. It is used for users to observe the port changes of the two changes, helping users to better understand the entire convergence process.

[0052] S106: When the network topology changes, re-elect the port roles of the network topology through the master device.

[0053] In some embodiments of the present application, when the root bridge device of the network topology goes offline, the root bridge device of the network topology is re-determined, and the port role election for the network topology is re-performed through the master device; when a new external device with a smaller bridge ID comes online in the network topology, the root bridge device of the network topology is re-determined, and the port role election for the network topology is re-performed through the master device.

[0054] It should be noted that although the embodiments of the present application are based on Figure 1 Steps S101 to S106 are described in sequence, but this does not mean that steps S101 to S106 must be performed in a strict order. Figure 1 The order shown in the figure is to introduce and explain step S101 to step S106 in sequence, in order to facilitate those skilled in the art to understand the technical solution of the embodiment of the present application. In other words, in the embodiment of the present application, the order between step S101 to step S106 can be appropriately adjusted according to actual needs.

[0055] pass Figure 1 The method virtualizes the physical topology of the stacked devices and abstracts it into a virtual switch, so that the spanning tree protocol can perform optimized calculations of the virtual switch view between stacked devices. That is, each device in the stacked device no longer calculates the spanning tree path separately, but forms a unified path calculation view in the stacking cluster through a collaborative algorithm, thereby reducing redundant path calculations. In addition, the stacked devices will share the global root bridge election priority and MAC address information, effectively avoiding erroneous elections caused by asynchrony between stacked devices. By running the spanning tree protocol on the main device, other devices will synchronously send down the status, solving the problem of inconsistent election status caused by multiple devices in the stacking system running the spanning tree at the same time. It can significantly improve the convergence speed and network stability of the spanning tree protocol in the stacked device environment, providing an effective solution for network designers, especially for topology optimization of large enterprise and data center networks.

[0056] Figure 2 A virtual port schematic diagram of a spanning tree protocol convergence method provided in an embodiment of the present application.

[0057] exist Figure 2 In the example, the master device has 30 ports from port-1 to port-30, the backup device has 30 ports from port-1 to port-30, and the slave device also has 30 ports from port-1 to port-30.

[0058] After the steps of creating virtual logical ports, virtual ports port-1-1 to port-1-30 are generated on the master device, ports-2-1 to port-2-30 of the backup device, and port-3-1 to port-3-30 of the slave device, totaling 90 ports; the device ID of the backup device is 2, and the device ID of the slave device is 3.

[0059] Figure 3 A schematic diagram of an embodiment of a spanning tree protocol convergence method provided in an embodiment of the present application.

[0060] exist Figure 3 In the embodiment of the present application, the following is introduced:

[0061] First, the network topology elects a root bridge. Switches A, B, C, D, E and the stack system use themselves as the root bridge to send BPDU to the peer device for information comparison.

[0062] For example, port C2 of switch C sends a BPDU message to port-2-1 of the stack system. The port determines that the device is an inactive device and sends the message to the master device through the stack port. Similarly, switch D sends a BPDU message to port-3-1 and also forwards the message to the master device. After the master device receives the messages from switch C and switch D, it determines the root bridge device by comparing the bridge ID. Similarly, through layer-by-layer comparison, it is found that the bridge ID of switch A is the smallest and is determined to be the root bridge of the network topology. Then, according to the port role election, it is determined as follows: Figure 3 The roles and status of each port are shown. The master device calculates that port port-1-1 is the root port and its status is forward. It determines that the port is a local port based on the port ID and directly sends the status information to the chip. The role of port-2-1 is an alternate port and its status is block. It determines that the port is a remote port, so it sends the port status information to the backup device and sends the status information to the chip. The processing flow of other ports port-2-2, port-3-1, and port-3-2 is the same as that of port-2-1. For the aggregation port agg1 of the stacking system, after the master device calculates the role and status information of the port, when sending the status information to the chip, it traverses the physical ports of the aggregation port and sends the status information separately. If the physical port is a remote port, it sends the information to the remote device to send the status information.

[0063] Figure 4 A schematic diagram of the structure of a spanning tree protocol convergence device provided in an embodiment of the present application includes:

[0064] at least one processor; and,

[0065] a memory communicatively connected to the at least one processor; wherein,

[0066] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the spanning tree protocol convergence methods described above.

[0067] Some embodiments of the present application provide a spanning tree protocol convergence non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions can execute any one of the spanning tree protocol convergence methods described above.

[0068] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0069] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0070] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0071] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0072] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0073] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0074] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0075] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM), and non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0076] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0077] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0078] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the technical principle of the present application should all fall within the protection scope of the present application.

Claims

1. A spanning tree protocol convergence method, characterized in that: The method comprises: Virtualizing a stacking system of a network topology into a single virtual switch to create a unique bridge ID for the stacking system; the bridge ID is used to perform root bridge calculation with external devices of the stacking system; Creating virtual ports of all physical ports in the stacking system on the master device; the stacking system includes a master device, a backup device and a slave device; the virtual ports can distinguish different device types; Setting the corresponding virtual port of the stack port to a first state, and setting other virtual ports except the corresponding virtual port to a second state; When the network topology performs root bridge election, after the backup device and the slave device respectively forward the first BPDU message of the opposite external device to the master device, the root bridge device of the network topology is determined according to the root bridge calculation result of the master device and the root bridge calculation result of each external device of the stacking system; If the root bridge device is an external device of the stacking system, when the master device performs port role election for the virtual port in the second state according to the second BPDU message, the port role and the port state are obtained, and when the single virtual port is a remote port, the port state of the single virtual port is forwarded to the corresponding standby device or slave device through the master device; the second BPDU message comes from the root bridge device; When the network topology changes, the master device re-selects the port roles for the network topology.

2. The method according to claim 1, characterized in that When the network topology changes, re-electing the port role of the network topology by the master device specifically includes: When the root bridge device of the network topology goes offline, re-determine the root bridge device of the network topology, and re-elect the port role of the network topology through the master device; When a new external device with a smaller bridge ID comes online in the network topology, the root bridge device of the network topology is re-determined, and the port role election for the network topology is re-performed through the master device.

3. The method according to claim 1, characterized in that The step of creating a unique bridge ID for the stacking system specifically includes: In the network topology, determining MAC addresses of all devices in the stacking system; Compare multiple MAC addresses to obtain a minimum MAC address, perform addition or subtraction on the minimum MAC address value to obtain the MAC address of the virtual switch, and use the MAC address of the virtual switch as the bridge MAC address of the stacking system; Using the bridge priority of the master device in the stacking system as the bridge priority of the stacking system; The bridge MAC address is combined with the bridge priority of the stacking system to obtain a unique bridge ID of the stacking system.

4. The method according to claim 1, characterized in that: The step of creating virtual ports of all ports in the stacking system on the master device specifically includes: According to the pre-built device type, the port IDs of all ports in the stacking system are set; the port IDs are used to distinguish different device types; According to the port ID, virtual ports of all the ports are created on the master device; the master device virtual port is a local port, and the standby device virtual port and the slave device virtual port are both remote ports.

5. The method according to claim 1, characterized in that: The determining the root bridge device of the network topology according to the root bridge calculation result of the master device and the root bridge calculation result of each external device of the stacking system specifically includes: Performing root bridge calculation on the first BPDU messages from the standby device and the slave device through the master device to obtain a minimum bridge ID; The minimum bridge ID is compared with the root bridge calculation result of the external device, and the device with a lower bridge priority value is determined as the root bridge device of the network topology.

6. The method according to claim 5, characterized in that The method further comprises: If the root bridge device is the virtual switch, a third BPDU message is sent to an external device of the stacking system through the master device.

7. The method according to claim 1, characterized in that When the single virtual port is a remote port, forwarding the port state of the single virtual port to the corresponding standby device or slave device through the master device specifically includes: Determine whether each virtual port in the second state is an aggregate port of the stacking system; If the aggregate port has multiple physical ports, traverse the multiple physical ports corresponding to the aggregate port, and if the physical port is a remote port, forward the port state of the physical port to the corresponding standby device or slave device through the master device; When the single non-aggregate port is a remote port, the port state of the single non-aggregate port is forwarded to a corresponding physical port of a corresponding standby device or slave device through the master device.

8. The method according to claim 1, characterized in that After forwarding the port status of the single virtual port to the corresponding standby device or slave device through the master device, the method further includes: The forwarded data is sent to the corresponding backup device or the port status in the chip of the device is exported, summarized into a status information chart, and sent to the client; If the network topology changes, the updated port status is compared with the port status before the update to obtain a difference status information chart and send it to the client.

9. A device for implementing rapid convergence of a spanning tree protocol, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for implementing rapid convergence of a spanning tree protocol as described in any one of claims 1 to 8.

10. A non-volatile computer storage medium for implementing rapid convergence of a spanning tree protocol, storing computer executable instructions, characterized in that: The computer executable instructions can execute a method for implementing rapid convergence of a spanning tree protocol as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Network topology computing method and network topology computing device

    CN103139080A

  • Fast convergence spanning tree protocol control method and device in MLAG environment and medium

    CN116684348A

  • Method for controlling communication transmission path in stacked equipment domain

    CN1722705A

  • Processing method for applying rapid spanning tree protocol to single ring network topology

    WO2014026512A1

  • Method for processing stack split, computer device and computer readable storage medium

    WO2018205728A1