CN114039909A - Method for realizing rapid real-time spanning tree protocol - Google Patents

Method for realizing rapid real-time spanning tree protocol Download PDF

Info

Publication number
CN114039909A
CN114039909A CN202111300380.7A CN202111300380A CN114039909A CN 114039909 A CN114039909 A CN 114039909A CN 202111300380 A CN202111300380 A CN 202111300380A CN 114039909 A CN114039909 A CN 114039909A
Authority
CN
China
Prior art keywords
switch
root
network topology
arbitration
mac address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111300380.7A
Other languages
Chinese (zh)
Other versions
CN114039909B (en
Inventor
刘文龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Sidao Aviation Technology Co ltd
Original Assignee
Xi'an Sidao Aviation Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Sidao Aviation Technology Co ltd filed Critical Xi'an Sidao Aviation Technology Co ltd
Priority to CN202111300380.7A priority Critical patent/CN114039909B/en
Publication of CN114039909A publication Critical patent/CN114039909A/en
Application granted granted Critical
Publication of CN114039909B publication Critical patent/CN114039909B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/48Routing tree calculation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/55Prevention, detection or correction of errors
    • H04L49/557Error correction, e.g. fault recovery or fault tolerance
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/60Software-defined switches
    • H04L49/602Multilayer or multiprotocol switching, e.g. IP switching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides a method for realizing a rapid real-time spanning tree protocol, each exchanger arbitrates a root exchanger by circularly executing and comparing the MAC address of the exchanger with the MAC address of a new message formed by the received last arbitration result so as to obtain the arbitration result of the root exchanger; determining a target switch for sending the MAC address of the root switch according to the arbitration result; dividing the hierarchy of the target switch in the arbitrary network topology according to the hierarchy of the target switch in the arbitrary network topology; and sending the arbitration result, the level of the root switch in any network topology and the MAC address of the root switch to the connected switches in a new message form until the preset root arbitration time length is reached, and then the arbitration result of the root switch in the message of the root switch reaches the global unification or the preset total root arbitration time length to obtain the globally unified arbitration result of the root switch in any network topology and the level of the root switch in any network topology. The invention realizes fast real-time root arbitration and reconstruction of network link after the failure of the root switch and the failure of the interface in any network topology.

Description

Method for realizing rapid real-time spanning tree protocol
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a method for realizing a rapid real-time spanning tree protocol.
Background
In modern networks, a common redundant link design adopts an international standard Rapid Spanning Tree Protocol (RSTP), and then a technician proposes a multi-instance Multiple Spanning Tree Protocol (MSTP) on the basis of the RSTP to support Multiple Vlan connections.
The switches that make up the loop run the MSTP protocol to generate a tree structure, by electing the root switch (root node), the port role and port state on each switch. The MSTP spanning tree protocol divides switch port roles into root port, designated port, and alternate port.
When the system is powered on, the switch arbitrates the root switch and the root port of each switch by using the MSTP spanning tree protocol, and generally, 30 seconds are needed for reconstructing the grid. The process of arbitrating the root switch is 15 seconds, the root switch waits for 15 seconds again to determine that no other switch applies for arbitration, and the system is stable at the moment, which is also the reason that the existing switch product generally sets 30 seconds waiting time for restarting.
In TSN (Time-Sensitive Networking), whether the RSTP protocol or the MSTP protocol reconstructs links with an arbitration duration of more than ten seconds. These protocols are only suitable for slow systems, and for fast systems with fast cycle times (milliseconds), the existing spanning tree protocols cannot meet the requirements.
Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a method for implementing a fast real-time spanning tree protocol. The technical problem to be solved by the invention is realized by the following technical scheme:
the invention provides a method for realizing a rapid real-time spanning tree protocol, which comprises the following steps:
when a system of any topology network is powered on, each switch sends an initial message to the connected switches and receives initial messages sent by other switches;
the initial message carries the MAC address of the switch, the information of the switch as a root switch and the distance between the switch and the root switch;
each switch compares the MAC address of the switch with the MAC address in the received initial message to arbitrate the root switch, obtains the arbitration result of the root switch, and divides the hierarchy of the switch in any network topology according to the arbitration result; sending the arbitration result, the level of the arbitration result in any network topology and the MAC address of the root switch to the connected switches in a new message form;
each exchanger circularly compares the MAC address of the exchanger with the MAC address in the received new message to arbitrate the root exchanger and obtain the arbitration result of the root exchanger; determining a target switch for sending the MAC address of the root switch according to the arbitration result; dividing the hierarchy of the target switch in any network topology according to the hierarchy of the target switch in any network topology; sending the arbitration result, the level of the root switch in any network topology and the MAC address of the root switch to the connected switches in a new message form until the arbitration result of the root switch in the message of the root switch reaches global unification or the preset total root arbitration time length after the preset root arbitration time length is reached;
each exchanger obtains the arbitration result of the root exchanger in global unification in any network topology and the hierarchy of the root exchanger in any network topology;
the preset arbitration time length is positively correlated with the maximum possible layer number of any network topology, and the root arbitration total time length is set according to the maximum network layer number of any topology network.
Optionally, each switch, comparing its MAC address with the MAC address in the received initial packet to arbitrate the root switch, obtaining an arbitration result of the root switch, and dividing its hierarchy in any network topology according to the arbitration result includes:
each of the switches is connected to a respective one of the switches,
comparing the MAC address of the user with the MAC address in the initial message to determine whether the MAC address of the user is the minimum;
if the MAC address of the self is minimum, determining that the self is a root switch, and continuously transmitting the initial message to the connected switches;
if the MAC address of the terminal is not the minimum, stopping sending the initial message; arbitrating the switch with the minimum MAC address as a root switch to obtain an arbitration result of the root switch;
and determining the distance between the self and the root switch in physical connection as the self hierarchy in any network topology.
Optionally, dividing the hierarchy of the target switch in any network topology according to the hierarchy of the target switch in any network topology includes:
determining the physical connection distance between the target switch and the self;
and determining the distance of the physical connection between the target switch and the sum of the levels of the target switch in any network topology as the level of the target switch in any network topology.
Optionally, each switch includes a plurality of ports, and the plurality of ports are divided into an uplink port, a downlink port, a same-level port, and a user port;
the uplink port is connected with a port of a switch at a previous layer, the downlink port is connected with a port of a switch at a next layer, the port at the same layer is connected with the switch at the same layer, and the user port is connected with user equipment;
each switch sends data to the next-level switch in parallel through each downlink port of the switch, and sends data to the previous-level switch in series through one uplink port.
Optionally, after obtaining a global unified arbitration result of the root switch in any network topology and a level of the root switch in any network topology, the method for implementing a fast real-time spanning tree protocol further includes:
each switch, when there is a switch connected with a plurality of upper level switches, determining the switch with the minimum MAC address in the MAC addresses of the plurality of upper level switches; disabling the uplink ports except the switch connected with the minimum MAC address, and disabling the ports of the same layer, so that the root switch to the last layer switch are converted into a tree network topology from any network topology;
the tree network topology comprises a root node and a plurality of branch nodes in a tree structure, the root switch is the root node of the tree network topology, each branch node forms the tree structure according to the hierarchy of the branch node, each branch node only has one father node, and each father node comprises at least one child node.
Optionally, after each switch obtains a global unified arbitration result of the root switch in any network topology and a hierarchy of the root switch in any network topology, the method for implementing the fast real-time spanning tree protocol further includes:
the root node issues a clock synchronization signal;
and the branch nodes of each level execute global high-precision unified clock alignment so as to keep the data generation time nodes of the branch nodes consistent with the data generation time nodes of the root nodes.
Optionally, the performing global unified clock alignment on the branch nodes of each level to keep the data time nodes of the branch nodes consistent with the data time nodes of the root node includes:
when receiving a clock synchronization signal sent by a directly connected father node, the branch node of each level forwards the clock synchronization signal to a directly connected child node, and simultaneously starts timing and timing, and feeds back a response signal to the father node when timing is finished;
when a child node receives a response signal fed back by any directly connected child node, calculating and recording actual measurement link delay between the child node and the child node according to the time of receiving the response signal, the time of sending a clock synchronization signal to the child node and the timing duration;
wherein any child node is a branch node or a root node;
when the branch node of each level receives a data packet sent by a directly connected father node, the branch node analyzes the data packet to determine the delay of the father node and the actual measurement link of the branch node, and a data generation time node of data carried by the data packet is determined according to the receiving time and the actual measurement link delay.
Optionally, the length of time that each switch performs root switch arbitration once and the length of time that each switch performs timing are determined according to the shortest frame length of data.
Optionally, the preset arbitration duration is a product of a duration for performing root switch arbitration once and a maximum possible number of layers of any network topology, the timing duration is greater than or equal to 2 microseconds, and the preset arbitration total duration is 40 microseconds.
Optionally, after obtaining a global unified arbitration result of the root switch in any network topology and a level of the root switch in any network topology, the method for implementing a fast real-time spanning tree protocol further includes:
each switch, when detecting that a new switch is accessed, sends a message carrying the hierarchy of the switch, the arbitration result of the root switch and the MAC address of the root switch in any network topology to the accessed new switch;
and the accessed new switch divides the hierarchy of the new switch in any network topology according to the hierarchy carried by the received message.
The invention provides a method for realizing a rapid real-time spanning tree protocol, each exchanger arbitrates a root exchanger by circularly executing and comparing the MAC address of the exchanger with the MAC address of a new message formed by the received last arbitration result so as to obtain the arbitration result of the root exchanger; determining a target switch for sending the MAC address of the root switch according to the arbitration result; dividing the hierarchy of the target switch in the arbitrary network topology according to the hierarchy of the target switch in the arbitrary network topology; and sending the arbitration result, the level of the root switch in any network topology and the MAC address of the root switch to the connected switches in a new message form until the preset root arbitration time length is reached, and then the arbitration result of the root switch in the message of the root switch reaches the global unification or the preset total root arbitration time length to obtain the globally unified arbitration result of the root switch in any network topology and the level of the root switch in any network topology. The invention realizes fast real-time root arbitration and reconstruction of network link after the failure of the root switch and the failure of the interface in any network topology.
The present invention will be described in further detail with reference to the accompanying drawings and examples.
Drawings
Fig. 1 is a schematic flowchart of a method for implementing a fast real-time spanning tree protocol according to an embodiment of the present invention;
FIG. 2 is an arbitrary network topology provided by embodiments of the present invention;
FIG. 3 is a tree network topology formed after root arbitration according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a switch synchronization concurrency mode provided by an embodiment of the present invention.
Fig. 5 is a schematic diagram of switch synchronization concurrency and clock synchronization provided by an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to specific examples, but the embodiments of the present invention are not limited thereto.
Before describing the method provided by the present invention, the arbitration principle of RSTP and the concept of the present invention will be described first.
In the process of arbitrating a root node (root bridge) by the RSTP protocol, a switch receives a BPDU message and compares the BPDU message with the own bridge ID, the bridge ID consists of a priority and a mac address, the priority is compared firstly, the priority is the same, and then the mac address is compared, and the smaller the value is, the better the value is. If the BPDU is not considered as the root bridge, the BPDU which is considered as the root bridge is not sent, and the self configuration BPDU is updated through the received BPDU message. Until all the switches in the network reach the same, a certain switch is considered as a root bridge, and election of the root bridge is finished, so that the only root bridge is confirmed. When multiple interfaces of a switch receive configuration BPDU messages sent by a Root bridge at the same time, Root Path Cost, namely Root Path Cost, is obtained and added with the link Cost of a receiving port to obtain the Root Path Cost from the port to the Root bridge, and the Root Path Cost with the minimum value is used as a Root port in comparison. If the root path cost is the same, comparing the Bridge Identifier in the BPDU message, namely sending the ID of the specified Bridge in the BPDU message, and using the ID as the root port with a smaller ID. If the designated bridge ID is the same, the Port ID of the Port is sent to the Port Identifier, and the Port ID is smaller than the Port Identifier, and the Port ID is used as the root Port. After the root port is determined, comparing the configuration BPDU message generated by calculating the BPDU message received from the root port by the self with the configuration BPDU received by a non-root port, comparing the root path overhead, the designated bridge and the port id in sequence, and setting the received port as the designated port if the BPDU generated by the self calculation is better than the received port, otherwise, setting the port as the Alternate port (namely, blocking). In the process, each node polls and determines the root node all the time, each switch determines a port with the minimum cost from the root node as a root port, data of the switch can be sent to the root switch only through the root port, and the data is dispatched inside the switch, so that some data are received firstly and then sent, because the internal mechanism and the clock of the switch are different.
The invention aims to innovatively provide a new spanning tree protocol, so that the arbitration time of a root node is greatly shortened, and the root arbitration is converged at a subtle level. And the protocol can enable the switch to autonomously select a link for switching data and to reestablish a new switching link at high speed in case of port or switch failure.
As shown in fig. 1, the method for implementing a fast real-Time Spanning Tree Protocol (RT-STP) provided by the present invention includes:
s101, after a system of any topology network is powered on, each switch sends an initial message to a connected switch and receives initial messages sent by other switches;
the initial message carries the MAC address of the switch, the information of the switch as a root switch and the distance between the switch and the root switch;
with reference to fig. 2, fig. 2 is an arbitrary network topology. Any network topology is managed hierarchically, each switch has 16 ports in a 10-layer network, and the number of the ports of the bottom layer network can reach 65536. In fig. 2, the switch numbers are from 0 to 15, respectively. After the system is powered on, each switch sends an initial message to the switch directly connected with the switch for the first time, and informs the opposite side that the switch is the root switch.
S102, comparing the MAC address of the root switch with the MAC address in the received initial message to arbitrate the root switch, obtaining the arbitration result of the root switch, and dividing the hierarchy of the root switch in any network topology according to the arbitration result; sending the arbitration result, the level of the arbitration result in any network topology and the MAC address of the root switch to the connected switches in a new message form;
refer to fig. 3 in conjunction with fig. 2. FIG. 3 is a tree topology diagram formed after root arbitration according to the present invention. In fig. 2, after receiving the message of the other party, each switch is configured to arbitrate whether itself is the root switch, and if not, switch its role, and send the message of the other party as the root switch next time. In any network topology, after the physical connections of the switches are fixed, the maximum level of connections between the switches is known. In the case of maximum hierarchy determination, the maximum time for the arbitration process of the root switch can be determined.
S103, each switch circularly compares the MAC address of each switch with the MAC address in the received new message to arbitrate the root switch, and an arbitration result of the root switch is obtained; determining a target switch for sending the MAC address of the root switch according to the arbitration result; dividing the hierarchy of the target switch in the arbitrary network topology according to the hierarchy of the target switch in the arbitrary network topology; and sending the arbitration result, the level of the root switch in the random network topology and the MAC address of the root switch to the connected switches in a new message form until the arbitration result of the root switch in the message of the root switch reaches global unification or the preset total root arbitration time length after the preset root arbitration time length is reached.
Illustratively, referring to fig. 2, the maximum physical connection distance in fig. 2 is 4. Supposing that the switch 0 is a root switch, for the first time, the switch 0 sends information of the switch 0 which is the root switch to the switches 2, 8, 10, 12 and 14 which are directly connected with the switch 0, and meanwhile, the switch 0 also receives messages sent by the switches 2, 8, 10, 12 and 14, wherein each switch in the messages represents that the switch is the root switch; the switch 0 compares the MAC addresses of the switch and each switch and determines that the switch is a root switch; for the first time, switch 2, switch 8, switch 10, switch 12, and switch 14 also compare their respective MAC addresses to the received MAC addresses, taking switch 2 as an example. The switch 2 receives the messages of the switch 14, the switch 0, the switch 1, the switch 8 and the switch 9 for the first time, the switch 2 compares the MAC address of the switch 2 with the MAC address in the message, finds that the switch 0 is not the root switch but the switch 0 is the root switch, and sends the message of which the switch 0 is the root switch to the switch 14, the switch 0, the switch 1, the switch 8 and the switch 9 which are connected with the switch for the second time; taking switch 1 as an example for the second time, switch 1 arbitrates itself as the root switch and sends out for the first time, receives switch 0 as the root switch for the second time, discovers switch 0 as the root switch after arbitrating by itself, and sends to switch 9, switch 5, switch 13, switch 2 and switch 8 that are connected to itself for the third time. And thirdly, after the switch 5 receives the message, the switch 0 is found to be the root switch through arbitration, and the message is sent out for the fourth time. Taking the switch 15 as an example, the switch 15 determines the switch 4 as a root switch through the first three times, arbitrates the root switch as 0 for the fourth time, and arbitrates the root switch 0 as the root switch for the fourth time, so that the root arbitration can be realized through four times.
The preset arbitration time length is positively correlated with the possible maximum layer number of the random network topology, and the root arbitration total time length is set according to the maximum network layer number of the Ethernet. The preset arbitration duration is the product of the duration for executing root switch arbitration once and the possible maximum layer number of any network topology, the timing duration is greater than or equal to 2 microseconds, and the preset arbitration total duration is 40 microseconds.
It will be appreciated that data transmitted at the switch meets the constraint of a shortest communication frame length, which is at least 64 bytes in length, and that the ethernet protocol specifies that the shortest communication frame length also has a delay of 64 bytes. Under the background that the transmission of a single byte needs to consume 8 nanoseconds, the time for arbitrating the root switch once is not less than (64+64) multiplied by 8-1024 nanoseconds, so that the result arbitrated by the root switch can be ensured. Of course, since the shortest communication frame length is only the specification of the existing ethernet protocol, the 1024 ns limitation is also only to enable the fast real-time spanning tree protocol provided by the embodiment of the present invention to better adapt and match the existing ethernet.
The preset arbitration duration is the product of the time for performing root switch arbitration once and the possible maximum layer number of any network topology.
It is understood that in the context of existing ethernet, the duration of a single root arbitration performed by each switch of the present invention is about 2 μ s, and the final time of the root arbitration of the present invention is the product of the duration of the single root switch arbitration and the maximum number of layers possible for any network topology, as determined by the maximum number of layers possible for any network topology. In the existing network architecture, the maximum possible number of layers is 10. The present invention therefore selects a predetermined arbitration total duration of 40 microseconds.
The invention can set the preset arbitration total time length to be 40 microseconds, so that the switch can obtain a globally unified root arbitration result within 40 microseconds, and certainly, the maximum possible level is determined in any network topology, so that the switch can be determined to arbitrate the globally unified root arbitration result after the corresponding time length.
In this context, the present invention preferably selects a duration of 2 microseconds. The time for each switch to circularly execute the root arbitration is not less than 2 microseconds.
S104, each exchanger obtains the arbitration result that the root exchanger achieves global unification in any network topology and the hierarchy of the root exchanger in any network topology;
and the preset arbitration duration is positively correlated with the possible maximum layer number of the any network topology.
Referring to fig. 3, in fig. 3, after the initial message is sent, it is assumed that switch 0 is the root switch. The physical connection distance between the switch 2, the switch 8, the switch 10, the switch 12, and the switch 14 and the root switch is 1, the hierarchy of the switches directly connected to the root switch is 1, and then each switch only needs to determine a target switch in an arbitration result, and the hierarchy of the switch can be obtained according to the hierarchy of the target switch. Thus, after the root switch arbitrates, the hierarchy of any network topology is converted into a tree structure, and the root switch is a root node of the tree network topology. The physical connection distance between the root switch and the root switch is 0, the hierarchy of the root switch in the network topology is 0, the hierarchy of the switches in any network topology is determined in sequence, and therefore the root switch is arbitrated by the root switch, the role of the root switch is converted according to the arbitration result, and other switches are informed to achieve microsecond-level root arbitration decision.
The invention provides a method for realizing a rapid real-time spanning tree protocol, each exchanger arbitrates a root exchanger by circularly executing and comparing the MAC address of the exchanger with the MAC address of a new message formed by the received last arbitration result so as to obtain the arbitration result of the root exchanger; determining a target switch for sending the MAC address of the root switch according to the arbitration result; dividing the hierarchy of the target switch in the arbitrary network topology according to the hierarchy of the target switch in the arbitrary network topology; and sending the arbitration result, the level of the root switch in any network topology and the MAC address of the root switch to the connected switches in a new message form until the preset root arbitration time length is reached, and then the arbitration result of the root switch in the message of the root switch reaches the global unification or the preset total root arbitration time length to obtain the globally unified arbitration result of the root switch in any network topology and the level of the root switch in any network topology. The invention realizes fast real-time root arbitration and reconstruction of network link after the failure of the root switch and the failure of the interface in any network topology.
In an embodiment, after step S103, the method for implementing RT-STP provided in the present invention further includes:
each switch, when detecting that a new switch is accessed, sends a message carrying the hierarchy of the switch, the arbitration result of the root switch and the MAC address of the root switch in any network topology to the accessed new switch;
and the accessed new switch divides the hierarchy of the switch in the random network topology according to the hierarchy carried by the received message.
It is worth mentioning that: after the arbitration is finished, if a redundant link needs to be added, the topological network is expanded. RSTP requires re-execution of the root arbitration, root port traversal process. After the hierarchy of each switch is divided, when the invention detects that a new switch is accessed, the invention sends a message to the new switch, so that the new switch can know the hierarchy of itself only according to the hierarchy carried by the message, thereby confirming the hierarchy of itself in the network topology. Therefore, when a new node is accessed, the decision of the root node does not need to be made again. Therefore, the invention can realize rapid real-time free expansion networking.
In one embodiment, each switch circularly performs arbitration of the root switch by comparing its own MAC address with the MAC address size in the received message, and obtaining the arbitration result of the root switch includes:
each of the switches is connected to a respective one of the switches,
comparing the MAC address of the user with the MAC address in the initial message to determine whether the MAC address of the user is the minimum;
if the MAC address of the self is minimum, determining that the self is a root switch, and continuously transmitting the initial message to the connected switches;
if the MAC address of the terminal is not the minimum, stopping sending the initial message; the switch with the minimum arbitration MAC address is the root switch, and the arbitration result of the root switch is obtained;
and determining the distance between the self and the root switch in physical connection as the self hierarchy in the arbitrary network topology.
It is worth mentioning that: each root switch has two roles, namely, spontaneous and forwarding, in the process of root arbitration. If the self is the arbitration self as the root node, the message of sending the self as the root node information, namely the initial message sent when the system is just powered on, is continuously executed. If the forwarding is arbitration, the self is not the root node, the message of the self as the root node information is abandoned, and the message of the root node information is forwarded, so that the role conversion is realized.
In one embodiment, dividing the hierarchy of the target switch in the arbitrary network topology according to the hierarchy of the target switch in the arbitrary network topology includes:
the method comprises the following steps: determining the physical connection distance between the target switch and the self;
step two: and determining the distance between the target switch and the physical connection of the target switch and the sum of the levels of the target switch in the arbitrary network topology as the level of the target switch in the arbitrary network topology.
It is worth mentioning that: the physical connection distance between the switches reflects the physical connection relationship between the switches. And each switch adds one or subtracts one to determine the hierarchy of the switch according to the hierarchy of the target switch directly connected with the switch. The larger the physical connection distance from the root switch is, the lower the level of the tree network topology in which the root switch is located is.
In one embodiment, each switch includes a plurality of ports, the plurality of ports are divided into an upstream port, a downstream port, a same-level port and a user port;
the uplink port is connected with a port of an upper-level switch, the downlink port is connected with a port of a lower-level switch, the same-level port is connected with the same-level switch, and the user port is connected with user equipment.
Each switch sends data to the next-level switch in parallel through each downlink port of the switch, and sends data to the previous-level switch in series through one uplink port.
Referring to fig. 4, the switch ports in the present invention are divided into a downlink port, an uplink port, and a port in the same hierarchy, and for the I-th switch, when sending data to the I + 1-th switch, the I + 1-th switch sends the data in parallel through each downlink port, so that each switch in the I + 1-th layer receives the same data at the same time, and the downlink channel and the parallel concurrency are realized. The I +1 th layer of switch simultaneously sends data to the I layer of switch through the uplink port of the switch, and the I +1 th layer of switch sequences the data received in parallel, then sends out through the downlink port, and realizes uplink channel and serial concurrence.
In one embodiment, after obtaining the global unified arbitration result of the root switch in the arbitrary network topology and the hierarchy of the root switch in the arbitrary network topology, each switch further includes:
each switch, when there is a switch connected with a plurality of upper level switches, determining the switch with the minimum MAC address in the MAC addresses of the plurality of upper level switches; disabling the uplink ports except the switch connected with the minimum MAC address, and disabling the ports of the same layer, so that the root switch to the last layer switch are converted into a tree network topology from any network topology;
the tree network topology comprises a root node and a plurality of branch nodes in a tree structure, the root switch is the root node of the tree network topology, each branch node forms the tree structure according to the hierarchy of the branch node, each branch node only has one father node, and each father node comprises at least one child node.
With reference to fig. 2 and 3, in the process from fig. 2 to fig. 3, after each switch hierarchy is divided, since the connection mode is a full connection mode, after the switches in the same hierarchy are determined at the root node, in order to improve transmission efficiency and avoid broadcast storm during data transmission, the ports in the same hierarchy of switches are disabled, and only one switch can have one directly connected upper layer switch. Since there may be a case where more than one upper-level switch, i.e., one child node, has a plurality of parent nodes. In order to avoid the situation, the switch in the same layer detects whether a plurality of father nodes exist in the switch, if so, the uplink ports of other father nodes except the father node with the minimum MAC address are forbidden, and thus, only one father node exists in one child node.
In an embodiment, after step S103, the method for implementing a fast real-time spanning tree protocol provided by the present invention further includes:
the root node issues a clock synchronization signal;
the branch nodes of each level perform global high precision unified clock alignment to keep themselves consistent with the data time nodes of the root node.
In practical application, the clock synchronization signal is a frame of data; for example, the clock synchronization signal may be the shortest communication frame that is allowed to flow over the network.
It is worth mentioning that: the clocks of each node device are different, so that data timing errors can occur in the data transmission process. Or the data determined by each device is different according to the time node. Therefore, the clock synchronization signal issued by the root node can be unified by the time nodes of the whole network topology. That is, the data received at the same time, no matter which node device in the network topology is, the node device can know what time the data is generated, and the generation time of the data is that the root node is used as a reference to issue the clock synchronization signal uniformly.
In one embodiment, the branch nodes of each level performing global unified clock alignment to keep themselves consistent with the data time node of the root node comprises:
the method comprises the following steps: when receiving a clock synchronization signal sent by a directly connected father node, the branch node of each level forwards the clock synchronization signal to a directly connected child node, and simultaneously starts timing and timing, and feeds back a response signal to the father node when timing is finished;
step two: when a child node receives a response signal fed back by any directly connected child node, calculating and recording actual measurement link delay between the child node and the child node according to the time of receiving the response signal, the time of sending a clock synchronization signal to the child node and the timing duration;
wherein any child node is a branch node or the root node;
step three: when a data packet sent by a directly connected father node is received by the branch node of each level, the data packet is analyzed to determine the actually measured link delay between the father node and the branch node, and a data time node of data carried by the data packet is determined according to the receiving time and the actually measured link delay.
In practical applications, the manner of performing data transceiving between nodes based on measured link delay may include: when the father node sends data to the child node, the father node sends the actually measured link delay and the data to be sent to the child node, so that the child node can acquire the real generation time or the real updating time of the data at the father node according to the carried actually measured link delay after receiving the data. When the child node sends data to the parent node, the parent node can directly determine the real generation time or update time of the data at the child node according to the time of receiving the data and the recorded measured link delay. It should be noted that the manner of performing data transceiving based on the measured link delay shown here is merely an example, and does not limit the embodiment of the present invention; any mode of acquiring the actually measured link delay based on the hardware actually measured mode and transmitting data between nodes based on the actually measured link delay provided by the embodiment of the invention belongs to the protection scope of the embodiment of the invention.
It is worth mentioning that: the root node issues clock synchronization signals to trigger branch nodes of each layer to sequentially forward the clock synchronization signals, timing is started while forwarding, and response signals are fed back to respective father nodes when timing is finished. In the process, for a child node (root node or branch node), the time when the child node sends a clock synchronization signal downwards and the time when a response signal fed back by the child node is received are known, and the time length of timing is also known, so that the actually measured link delay between the child node and the child node directly connected with the child node can be calculated according to the two times and the time length; therefore, the actually measured link delay can be taken into account when data is transmitted and received between the father node and the child node, and therefore the global high-precision unified clock is achieved in the whole network.
The link delay in the invention can be obtained by a hardware actual measurement mode, and the clock synchronization precision of the invention is only determined by the working frequency of a hardware physical chip. Wherein the time length of the timing is greater than or equal to 2 microseconds.
Illustratively, if a high-speed chip with the working frequency of 133MHz is used, the ultrahigh clock synchronization precision of about 8 nanoseconds can be achieved.
The calculation method of the actually measured link delay in the child node is as follows:
Figure BDA0003338148790000171
in the formula, t2Time t for the child node to receive the response signal Ack sent by the child node1For a moment, T, at which a child node forwards a clock synchronization signal Sync to the child nodecalFor timing the duration of the time, tdelayIs the calculated measured link delay.
Referring to fig. 5, the I-layer switch forwards data from the minimum transmission unit (byte in gigabit network, 4 bytes in 10G below) received from a certain port, and all switches in the I +1 layer receive data synchronously with a deviation of no more than two clock cycles (16 ns): the board level delay plus line delay of data transmitted from layer I does not exceed 500ns (thousand optical networks) per "flow" through one layer of the network, and these delays are fixed after the system is in operation. The invention performs clock synchronization while forwarding data, and the longest clock synchronization time is about 20 ms.
In the step, by using the global high-precision unified clock, after the tree network topology level is determined, the time of each layer of unified clock is about 2 microseconds, and the arbitration time length principle of each time of root arbitration is the same here and is not repeated. Therefore, the rapid spanning tree protocol of the invention can enable the maximum root arbitration to be 20 microseconds and the maximum clock uniform time to be 20 microseconds. The whole arbitration process of the switch is not more than 40 microseconds, and convergence at a microsecond level is realized. The protocol provided by the invention can enable the switch to autonomously select the link to exchange data, and can rebuild a new exchange link at high speed under the condition of port or switch failure.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples described in this specification can be combined and combined by those skilled in the art.
While the present application has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (10)

1. A method for implementing a fast real-time spanning tree protocol is characterized by comprising the following steps:
when a system of any topology network is powered on, each switch sends an initial message to the connected switches and receives initial messages sent by other switches;
the initial message carries the MAC address of the switch, the information of the switch as a root switch and the distance between the switch and the root switch;
each switch compares the MAC address of the switch with the MAC address in the received initial message to arbitrate the root switch, obtains the arbitration result of the root switch, and divides the hierarchy of the switch in any network topology according to the arbitration result; sending the arbitration result, the level of the arbitration result in any network topology and the MAC address of the root switch to the connected switches in a new message form;
each exchanger circularly compares the MAC address of the exchanger with the MAC address in the received new message to arbitrate the root exchanger and obtain the arbitration result of the root exchanger; determining a target switch for sending the MAC address of the root switch according to the arbitration result; dividing the hierarchy of the target switch in the arbitrary network topology according to the hierarchy of the target switch in the arbitrary network topology; sending the arbitration result, the level of the root switch in any network topology and the MAC address of the root switch to the connected switches in a new message form until the arbitration result of the root switch in the message of the root switch reaches global unification or the preset total root arbitration time length after the preset root arbitration time length is reached;
each switch obtains the arbitration result of the root switch which achieves global unification in the arbitrary network topology and the hierarchy of the root switch in the arbitrary network topology;
the preset arbitration time length is positively correlated with the maximum possible layer number of the network topology, and the root arbitration total time length is set according to the maximum network layer number of the network topology.
2. The method as claimed in claim 1, wherein each switch for arbitrating the root switch by comparing its MAC address with the MAC address in the initial message received, obtaining the arbitration result of the root switch, and dividing its hierarchy in the arbitrary network topology according to the arbitration result comprises:
each of the switches is connected to a respective one of the switches,
comparing the MAC address of the user with the MAC address in the initial message to determine whether the MAC address of the user is the minimum;
if the MAC address of the self is minimum, determining that the self is a root switch, and continuously transmitting the initial message to the connected switches;
if the MAC address of the terminal is not the minimum, stopping sending the initial message; arbitrating the switch with the minimum MAC address as a root switch to obtain an arbitration result of the root switch;
and determining the distance between the self and the root switch in physical connection as the self hierarchy in the arbitrary network topology.
3. The method of claim 1, wherein the dividing the hierarchy of the target switch in the arbitrary network topology according to the hierarchy of the target switch in the arbitrary network topology comprises:
determining the physical connection distance between the target switch and the self;
and determining the distance between the target switch and the physical connection of the target switch and the sum of the levels of the target switch in the arbitrary network topology as the level of the target switch in the arbitrary network topology.
4. The method of claim 1, wherein each switch includes a plurality of ports, and the plurality of ports are divided into an upstream port, a downstream port, a peer port, and a user port;
the uplink port is connected with a port of an upper-level switch, the downlink port is connected with a port of a lower-level switch, the same-level port is connected with the same-level switch, and the user port is connected with user equipment;
each switch sends data to the next-level switch in parallel through each downlink port of the switch, and sends data to the previous-level switch in series through one uplink port.
5. The method for implementing rapid real-time spanning tree protocol according to claim 4, wherein each switch, after obtaining the global unified arbitration result of the root switch in the arbitrary network topology and the hierarchy of itself in the arbitrary network topology, further comprises:
each switch, when there is a switch connected with a plurality of upper level switches, determining the switch with the minimum MAC address in the MAC addresses of the plurality of upper level switches; disabling the uplink ports except the switch connected with the minimum MAC address, and disabling the ports of the same layer, so that the root switch to the last layer switch are converted into a tree network topology from any network topology;
the tree network topology comprises a root node and a plurality of branch nodes in a tree structure, the root switch is the root node of the tree network topology, each branch node forms the tree structure according to the hierarchy of the branch node, each branch node only has one father node, and each father node comprises at least one child node.
6. The method for implementing rapid real-time spanning tree protocol according to claim 5, wherein after each switch obtains the global unified arbitration result of the root switch in the arbitrary network topology and its own hierarchy in the arbitrary network topology, the method further comprises:
the root node issues a clock synchronization signal;
and the branch nodes of each level execute global high-precision unified clock alignment so as to keep the branch nodes consistent with the data generation time nodes of the root nodes.
7. The method of claim 6, wherein the branch nodes at each level performing global unified clock alignment to keep themselves consistent with the data time node of the root node comprises:
when receiving a clock synchronization signal sent by a directly connected father node, the branch node of each level forwards the clock synchronization signal to a directly connected child node, and simultaneously starts timing and timing, and feeds back a response signal to the father node when timing is finished;
when a child node receives a response signal fed back by any directly connected child node, calculating and recording actual measurement link delay between the child node and the child node according to the time of receiving the response signal, the time of sending a clock synchronization signal to the child node and the timing duration;
wherein any child node is a branch node or the root node;
when a data packet sent by a directly connected father node is received by the branch node of each level, the data packet is analyzed to determine the actually measured link delay between the father node and the branch node, and a data generation time node of data carried by the data packet is determined according to the receiving time and the actually measured link delay.
8. The method of claim 7, wherein the length of each switch performing root switch arbitration once and the length of the timing timer are determined according to the shortest frame length of data.
9. The method according to claim 8, wherein the predetermined arbitration duration is a product of a duration for performing root switch arbitration once and a maximum number of layers possible in any network topology, the timing duration is greater than or equal to 2 μ sec, and the predetermined arbitration total duration is 40 μ sec.
10. The method for implementing rapid real-time spanning tree protocol according to claim 1, wherein each switch, after obtaining the global unified arbitration result of the root switch in the arbitrary network topology and the hierarchy of itself in the arbitrary network topology, further comprises:
each switch, when detecting that a new switch is accessed, sends a message carrying the hierarchy of the switch, the arbitration result of the root switch and the MAC address of the root switch in any network topology to the accessed new switch;
and the accessed new switch divides the hierarchy of the switch in the random network topology according to the hierarchy carried by the received message.
CN202111300380.7A 2021-11-04 2021-11-04 Method for realizing rapid real-time spanning tree protocol Active CN114039909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111300380.7A CN114039909B (en) 2021-11-04 2021-11-04 Method for realizing rapid real-time spanning tree protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111300380.7A CN114039909B (en) 2021-11-04 2021-11-04 Method for realizing rapid real-time spanning tree protocol

Publications (2)

Publication Number Publication Date
CN114039909A true CN114039909A (en) 2022-02-11
CN114039909B CN114039909B (en) 2023-02-10

Family

ID=80142775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111300380.7A Active CN114039909B (en) 2021-11-04 2021-11-04 Method for realizing rapid real-time spanning tree protocol

Country Status (1)

Country Link
CN (1) CN114039909B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114625359A (en) * 2022-05-16 2022-06-14 西安数道航空技术有限公司 Multi-machine no-coupling digital development platform connected through synchronous concurrent network

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005109846A (en) * 2003-09-30 2005-04-21 Nec Corp Packet switching device and stabilization system of spanning tree topology
CN103532741A (en) * 2013-09-27 2014-01-22 瑞斯康达科技发展股份有限公司 Access level network topology management method and system
CN109218230A (en) * 2017-06-30 2019-01-15 英特尔公司 For balancing the technology of the handling capacity of the input port across multistage network interchanger
CN110140115A (en) * 2016-12-30 2019-08-16 英特尔公司 System and method for realizing fairness in the multistage arbitration for exchange board structure
CN111143257A (en) * 2019-12-02 2020-05-12 深圳市奥拓电子股份有限公司 DDR arbitration controller, video cache device and video processing system
CN111866897A (en) * 2020-07-30 2020-10-30 宁波奥克斯电气股份有限公司 Networking method of intelligent home system and intelligent home system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005109846A (en) * 2003-09-30 2005-04-21 Nec Corp Packet switching device and stabilization system of spanning tree topology
CN103532741A (en) * 2013-09-27 2014-01-22 瑞斯康达科技发展股份有限公司 Access level network topology management method and system
CN110140115A (en) * 2016-12-30 2019-08-16 英特尔公司 System and method for realizing fairness in the multistage arbitration for exchange board structure
CN109218230A (en) * 2017-06-30 2019-01-15 英特尔公司 For balancing the technology of the handling capacity of the input port across multistage network interchanger
CN111143257A (en) * 2019-12-02 2020-05-12 深圳市奥拓电子股份有限公司 DDR arbitration controller, video cache device and video processing system
CN111866897A (en) * 2020-07-30 2020-10-30 宁波奥克斯电气股份有限公司 Networking method of intelligent home system and intelligent home system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114625359A (en) * 2022-05-16 2022-06-14 西安数道航空技术有限公司 Multi-machine no-coupling digital development platform connected through synchronous concurrent network
CN114625359B (en) * 2022-05-16 2022-08-05 西安数道航空技术有限公司 Multi-machine no-coupling digital development platform connected through synchronous concurrent network

Also Published As

Publication number Publication date
CN114039909B (en) 2023-02-10

Similar Documents

Publication Publication Date Title
US11496235B2 (en) Symmetric path/link over LAG interface using LLDP for time synchronization between two nodes using PTP
EP2472795B1 (en) Method and system for re-building single ring network topology
US9485045B2 (en) Communication control equipment
US9264314B2 (en) Method, system, and switch for making bridge in MSTP join region
US9363206B2 (en) Method and apparatus for selecting passive port of transparent clock node based on PTP
WO2013053276A1 (en) Network route convergence processing method and apparatus
Giorgetti et al. Performance analysis of media redundancy protocol (MRP)
JP2011035544A (en) Receiving part, station side device, and frequency correction method in clock data reproduction circuit
CN114039909B (en) Method for realizing rapid real-time spanning tree protocol
CN111654419B (en) Network synchronization method, system, node device and readable storage medium
CN109150358B (en) A kind of distributed clock synchronous method and system
US11916768B2 (en) Information sharing method and apparatus in redundancy network, and computer storage medium
CN114039693B (en) Single clock synchronous concurrent network and data circulation method thereof
CN102075374A (en) Method and system for reconstructing single-ring network topology
Mills et al. Highball: a high speed, reserved-access, wide area network
JP6469027B2 (en) Intra-station optical termination device, optical communication system, and optical communication method
CN114039692B (en) Hard clock synchronization method
KR20120051632A (en) Method for clock synchronization in distributed system having ring topology and apparatus for the same
CN107249147B (en) Information synchronization method and system in a kind of automatically switching optical networks
CN114040262B (en) Network switch
WO2022007682A1 (en) Method and device for sending data
WO2024088105A1 (en) Data synchronization method and apparatus, device, and storage medium
WO2024045815A1 (en) Registration method, related device and optical communication system
CN107332940B (en) Method and system for realizing MAC address synchronization of distributed IP RAN equipment
JP2023554065A (en) Method and apparatus for selecting a clock source

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant