Spanning tree protocol convergence method, device and medium
By virtualizing the stack system into a single virtual switch and performing bridge ID and port role election, the problem of slow spanning tree protocol convergence is solved, the adaptability and stability of the network are accelerated, and the calculation and management of the spanning tree protocol are simplified.
Patent Information
- Application Number
- CN202411905919.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-12-23
AI Technical Summary
In a stacked switch system, the slow convergence of the spanning tree protocol leads to poor network performance. Especially in large-scale stacking systems, the long convergence time when the network topology changes may cause data loss and temporary network interruption.
The stack system is virtualized into a single virtual switch, a unique bridge ID is created, and virtual ports are created on the master device. The master device processes BPDUs to perform root bridge calculation and port role election, shortening the root bridge election time and avoiding chaotic calculations between devices.
It accelerates the convergence process of the spanning tree protocol, improves the adaptability and stability of the network, simplifies the spanning tree protocol calculation and management in the stack system, and reduces redundant calculation and communication.
Smart Images

Figure CN119766722B_ABST
Abstract
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 connects multiple physical switches via dedicated stacking ports, making them appear as a single logical switch on the network. This allows for management and configuration as a unified device, simplifying network topology, management operations, and fault recovery. Stacked switches manage and communicate using stacking links and stacking protocols, collaborating on packet forwarding and sharing information such as the bridge ID, STP status, and MAC address table. Switches in a stack system can be divided into three roles: master (Active), standby (Standby), and member (Member). The master switch is typically a switch in the stack and is responsible for managing and configuring the entire stack. Configurations made by the master switch apply to all members of the stack. The standby switch becomes the new master switch if the master switch fails or restarts, taking over all services from the original master switch.
[0003] While stacking can increase network redundancy, bandwidth, and simplify network management, it can also introduce loops, causing packets to circulate endlessly within the network. To prevent this, the spanning tree protocol is often used.
[0004] Currently, in stacked switch systems, each switch has its own spanning tree calculation module, but the stacking protocol ensures that the calculations and link states are consistent across switches, thus preventing loops. However, network topology changes (such as device failures and link interruptions) trigger the spanning tree protocol's convergence process. Long convergence times can lead to data loss, loops, or temporary network outages. While the spanning tree protocol provides fault resilience, in some large-scale stacking systems, long convergence times can still degrade 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 of slow spanning tree protocol convergence causing poor network performance in a stacking scenario.
[0006] The embodiments of this application adopt the following technical solutions:
[0007] On the one hand, an embodiment of the present application provides a spanning tree protocol convergence method, which includes: 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 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 stacking port to a first state, and setting the 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 ports of the opposite external device 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 for the network topology is re-performed through the master device.
[0008] In one example, when the network topology changes, the network topology is re-elected through the master device for the port role, 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 of the network topology is re-elected 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 of the network topology is re-elected through the master device.
[0009] In one example, creating a unique bridge ID for the stacking system specifically includes: determining the MAC addresses of all devices in the stacking system in the network topology; comparing multiple MAC addresses to obtain the smallest MAC address, and performing addition or subtraction operations on the minimum 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; and 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 backup 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 through 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 the corresponding backup device or slave device through the master device, specifically including: judging whether each virtual port in the second state is an aggregation port of the stacking system; if there are multiple physical ports of the aggregation port, traversing the multiple physical ports corresponding to the aggregation port, and if the physical port is a remote port, forwarding the port state of the physical port to the 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 the corresponding physical port of the 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 through the master device, the method further includes: exporting the port status that is forwarded and sent down to the corresponding backup device or slave device chip, summarizing 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 sending 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-mentioned technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: by virtualizing the stacking system into a virtual switch and creating a bridge ID to conduct root bridge election with other devices outside the stacking system, the process of each switch in the stacking system performing an election is transformed into a process of a virtual switch performing a root bridge election, thereby shortening the root bridge election time in the spanning tree protocol and accelerating the convergence process of the spanning tree protocol. By forwarding BPDU messages received from the peer end by the backup and slave devices in the stacking system to the master device for spanning tree module calculation, the confusion and inconsistency caused by multiple devices processing messages simultaneously is 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 is made 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 with reference to 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 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] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0024] Some embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0025] Figure 1 This is a flow chart of a spanning tree protocol convergence method provided in an embodiment of the present application. This method can be applied to different business areas. Certain input parameters or intermediate results in this process allow for manual intervention and adjustment to help improve accuracy.
[0026] The analysis method involved in the embodiments 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 ease of understanding and description, the following embodiments are described in detail using the control host as an example.
[0027] Figure 1 The process in may include the following steps:
[0028] S101: Virtualizing a stacking system in 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's important to note that the stack system's MAC address and bridge priority are important parameters used in the spanning tree protocol. The stack system's MAC address is a virtual MAC address created by the stack protocol and used as the stack system's bridge MAC address. In the spanning tree protocol, the bridge MAC address is used to identify bridge devices (i.e., switches) 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 likelihood that the switch will become the root bridge. By default, the bridge priority of a switch is fixed, but it can be adjusted through configuration. In a stack system, the bridge priority, together with the stack system's MAC address, forms the stack system's bridge ID.
[0030] In some embodiments of the present application, the switch device within the stacking system is logically virtualized into a switch, and a system MAC is created according to the stacking protocol based on the switch within 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. 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. 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. The bridge MAC address is combined with the bridge priority of the stacking system to obtain a unique bridge ID for the stacking system, and the bridge ID is used to perform root bridge election with other devices outside the system.
[0031] By specifying a stack system bridge ID, you can reduce the spanning tree root bridge election process among switches within the stack system, 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 stack system, devices can be divided into three roles: master device, backup device, and slave device.
[0034] The master device is the primary control and management device in a stack system. It is responsible for managing and configuring the entire stack. Configurations on the master device are effective for all member devices. The master switch plays a key role in spanning tree protocol calculation and execution, responsible for spanning tree calculation and state synchronization. The backup device serves as a backup for the master. If the master device fails or restarts, it takes over all services from the master and becomes the new master. Normally, the backup device does not participate in spanning tree calculation, but it will take over its responsibilities if the master fails. Slave devices are ordinary member devices in the stack system. They follow the management and configuration instructions of the master device. Slave devices do not independently calculate spanning trees, but rely on the master device for spanning tree state synchronization and decision-making. The primary function of a slave device is to provide additional ports and bandwidth, enhancing network redundancy and performance. Through the collaboration of these three roles, a stack system can achieve unified management and configuration, simplify network topology, and improve network reliability and performance.
[0035] In some embodiments of the present application, the port IDs of all ports in the stacking system are set according to the pre-built device types, and the port IDs are 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 stack ports only perform stacking protocol elections and synchronize information between devices, when a port within the stacking 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. 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 other virtual port states 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 is the process of selecting a root bridge in a spanning tree protocol network by comparing the bridge IDs of various devices. A bridge ID consists of two parts: priority and MAC address. The device with the lowest priority is elected as the root bridge. If priorities are the same, the MAC addresses are compared, and the device with the lowest MAC address is elected as the root bridge.
[0041] The root bridge election determines the optimal path within the network. The root bridge is responsible for sending BPDUs to other devices, informing them how to build a loop-free topology. By selecting a root bridge, the network ensures that data packets are transmitted along the optimal path, improving network efficiency and performance.
[0042] It's also important to note that during the initial root bridge election phase, each device assumes its own identity as the root bridge upon startup and begins sending BPDUs. Devices compare their bridge IDs by exchanging BPDUs, and the device with the smallest bridge ID is elected as the root bridge. Once the root bridge is elected, other devices update their topology information, including the root path cost, designated ports, and root ports, based on the BPDUs sent by the root bridge. After a period of convergence, all devices on the network will know the location of the root bridge, and a loop-free spanning tree topology will be established.
[0043] In some embodiments of the present application, within the stacking system, after receiving the first BPDU message, other devices other than the master device send it to the master device through the stack port for processing. The master device then 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, and the device with the 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 the smaller MAC address is the root bridge device. The first BPDU message here is the BPDU message sent by each device to the stacking system when it acts as a root bridge.
[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 assignment of a specific role to each switch port based on specific rules and algorithms in the spanning tree protocol. These include:
[0047] The root port is the optimal port on each non-root device that connects to the root bridge. The root port is selected to minimize the path cost from this port to the root bridge. A designated port is the optimal port on each network segment that connects to the root bridge. The designated port is selected to minimize the path cost from this port to the root bridge and is activated for data forwarding. An alternate port is the suboptimal port on each non-root switch that connects to the root bridge. Alternate ports are blocked and not used for data forwarding, but serve as backup paths.
[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 received BPDU message. The total path costs of all non-disabled ports to the root bridge are compared, and the port with the smallest total path cost is selected as the root port. The sender bridge ID and sender port ID in the second received BPDU message are then compared. If the sender bridge ID in the second received BPDU message is smaller, the port is selected as the designated port. If the sender bridge IDs are the same, the sender port IDs are compared. If the sender port ID is smaller, 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 uses a spanning tree protocol calculation module to assign different roles to ports participating in spanning tree elections within the system and transmits status information to the chip. If the port is a backup or slave port in a stack system, the port status information is synchronized to the backup or slave port via the stack port and transmitted 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 there are multiple physical ports for the aggregate port, 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 information is forwarded and 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 and send it to the client. This allows users to observe the port changes between the two changes, helping users better understand the entire convergence process.
[0052] S106: When the network topology changes, re-elect port roles for 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 of 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 of the network topology is re-performed through the master device.
[0054] It should be noted that although the embodiments of this 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 FIG1 is to introduce and explain steps S101 to S106 in order to facilitate those skilled in the art to understand the technical solutions of the embodiments of the present application. In other words, in the embodiments of the present application, the order of steps S101 to S106 can be adjusted appropriately 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, enabling the Spanning Tree Protocol to perform optimized calculations of the virtual switch view between stacked devices. That is, each device in the stack no longer calculates the spanning tree path independently. Instead, a collaborative algorithm is used to form a unified path calculation view within the stack cluster, thereby reducing redundant path calculations. In addition, the stacked devices 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 master device, other devices synchronously issue 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 a stacked device environment, providing network designers with an effective solution, especially suitable for topology optimization of large enterprise and data center networks.
[0056] Figure 2 A virtual port 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 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 are generated on the backup device, and ports-3-1 to port-3-30 are generated on the slave device, for a total of 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 performs root bridge election. Switches A, B, C, D, E, and the stack system use themselves as the root bridge to send BPDUs to the peer devices 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 device is the smallest and is determined to be the root bridge of the network topology. Then, according to the port role election, the following is determined: Figure 3 The roles and status of each port are shown. The master device calculates that port-1-1 is the root port and its status is forward. Based on the port ID, it determines that the port is a local port 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 structural diagram 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. The instructions are executed by the at least one processor to enable the at least one processor to perform any one of the above-mentioned spanning tree protocol convergence methods.
[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 above-mentioned spanning tree protocol convergence methods.
[0068] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the device and medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For relevant portions, refer to the descriptions 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 to their 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] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, 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 magnetic 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 flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, 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 flowcharts and / or block diagrams. 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 that can direct a computer or other programmable data processing device to work 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 The 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 operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0074] In a typical configuration, a computing device includes one or more processors (CPUs), 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 such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0076] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The 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 disc read-only memory (CD-ROM), digital versatile disc (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 transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0077] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0078] The foregoing is merely 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 modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the technical principles of the present application should fall within the scope of protection of the present application.
Claims
1. A spanning tree protocol convergence method, characterized in that: The method comprises: Virtualizing a stack system in a network topology into a single virtual switch to create a unique bridge ID for the stack system; the bridge ID is used to perform root bridge calculation with external devices of the stack system; Creating virtual ports for 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, determine 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 stack system; If the root bridge device is an external device of the stack 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 state are obtained, and when a single virtual port is a remote port, the port state 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 master device re-elects the port roles of the network topology.
2. The method according to claim 1, characterized in that When the network topology changes, re-electing port roles for the network topology by the master device specifically includes: When a root bridge device of a network topology goes offline, re-determine the root bridge device of the network topology, and re-elect port roles for 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 the MAC addresses of all devices in the stack system; Comparing multiple MAC addresses to obtain a minimum MAC address, performing an addition operation or a subtraction operation on the minimum 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; 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, wherein The step of creating virtual ports for all ports in the stack system on the master device specifically includes: Setting port IDs for all ports in the stacking system according to pre-built device types; 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 backup device virtual port and the slave device virtual port are both remote ports.
5. The method according to claim 1, wherein 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 stack system specifically includes: Performing root bridge calculation on the first BPDU messages from the backup device and the slave device by the master device to obtain a minimum bridge ID; The smallest 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 the external devices 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 backup device or slave device through the master device specifically includes: 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, 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 backup device or slave device through the master device; When a single non-aggregation port is a remote port, the port state of the single non-aggregation port is forwarded to a corresponding physical port of a corresponding backup 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 backup device or slave device through the master device, the method further includes: After forwarding, the information 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 that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for implementing rapid convergence of a spanning tree protocol according to 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 the 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