Introduction to Spanning Tree Protocol STP/RSTP

Source: Internet
Author: User

STP (Spanning Tree Protocol) is a layer-2 management protocol that selectively blocks redundant network links to eliminate L2 network loops, it also supports link backup.

Like other protocols, the Spanning Tree Protocol is constantly updated with the continuous development of the network. The Spanning Tree Protocol is a broad concept. It does not refer to the STP protocol defined in IEEE 802.1d, but includes STP and various improved Spanning Tree Protocols Based on STP.

STP/RSTP

In the early stages of network development, transparent bridges were used. It is much smarter than a hub that only scales up and broadcasts signals. Its learning capability is to record the source MAC address and port number of the data frame sent to it. The next packet that hits this destination MAC address will only be sent from the port number in the record, unless the target MAC address is not recorded or the target MAC address itself is a multicast address, it will be sent to all ports. Using transparent bridges, different LAN networks can be interconnected, and the network's operational range can be expanded. Moreover, transparent bridges can provide MAC address learning functions, without the proliferation of network packets as the hub does.

A transparent bridge also has its own defect. Its defect lies in its transparent transmission. The transparent bridge does not know how many times the packets can be forwarded as the router does. Once the network has a loop, the packets are continuously circulating and growing in the loop, resulting in a broadcast storm.

To solve this problem, the STP Spanning Tree Protocol was proposed later. Www.bitscn.com

The STP protocol defines rootbridge, rootport, designatedport, and pathcost, the goal is to crop redundant loops by constructing a natural tree, and at the same time achieve link backup and path optimization. The algorithm used to construct this tree is called the Spanning Tree Algorithm SpA (spanning ).
Treealgorithm ).

To implement these functions, the bridge must exchange some information, which is called the configuration message BPDU (bridgeprotocol data unit ). Stp bpdu is a layer-2 packet. The destination MAC address is the multicast address 01-80-c2-00-00-00. All bridges supporting the STP protocol will receive and process the received BPDU packets. The data area contains all the useful information used to generate tree computing.

Process of generating the Tree Protocol: China Network Management Alliance www_bitscn_com

1) first conduct root bridge election. The election is based on the bridge ID (Bridge ID) composed of the bridge priority and the bridge MAC address. The bridge with the smallest bridge ID will become the root bridge in the network. When the bridge priority is the same (the default priority is 32768), the bridge with the smallest MAC address becomes the root bridge.

2) Next, determine the root port, and set the port with the least overhead of the connection path to the root port, the path overhead is equal to '200' except for 'transmission medium rate'. Assume that the link between SW1 and the bridge is a gigabit Ge link, and the link between the bridge and sw3 is a 1000 MB Fe link, the default overhead of sw3 from Port 1 to root bridge is 19, while the overhead of SW1 from Port 2 to root bridge is 4 + 4 = 8, therefore, Port 2 becomes the root port and enters the forwarding status.

3) after the root bridge and the root port are determined, the redundant loop is cropped. This is achieved by blocking the corresponding ports on non-root bridges.

After the build tree is stable for a period of time (the default value is about 30 seconds), all ports either enter the forwarding status or enter the blocking status. Stpbpdu are still regularly sent from the specified ports of each bridge to maintain the link status. If the network topology changes, the Spanning Tree is re-computed and the port status changes accordingly.

Of course, the Spanning Tree Protocol also has a lot of content. Other improved Spanning Tree Protocols are based on this, and their basic ideas and concepts are similar.

The STP protocol brings new life to the transparent bridge. However, it still has shortcomings. The defects of the STP protocol are mainly manifested in the convergence speed.

When the topology changes, the new configuration message must pass through a certain delay before it can be transmitted to the entire network. This delay is called forward delay. The default Protocol value is 15 seconds. Before all bridges receive the changed message, if the forwarding port in the old topology does not find itself in the new topology to stop forwarding, a temporary loop may exist. To solve the problem of temporary loop, the Spanning Tree uses a timer policy, that is, adding an intermediate state that only learns MAC addresses but does not participate in forwarding between the ports from the blocked status to the forwarding status, the duration of two State switches is forward.
Delay to ensure that no temporary loop is generated when the topology changes. However, what this seemingly good solution actually brings is at least two times the convergence time of forward delay!

In order to solve this defect of STP protocol, IEEE introduced the 802.1w standard at the beginning of the century as a supplement to the 802.1d standard. The RSTP (Rapid Spanning Tree Protocol) protocol is defined in the IEEE 802.1w standard ). The RSTP protocol has made three important improvements based on the STP protocol, making convergence much faster (less than 1 second ).

The first improvement is that you have set the replace port (alternate port) and backup port (Backup port) roles for the root port and the specified port, if the root port or specified port fails, the replacement port or backup port enters the forwarding state without delay. Network Management Network bitscn.com

Second, improvement: In a point-to-point link that only connects two exchange ports, a designated port can enter the forwarding state without delay by performing a handshake with the downstream bridge. If it is a shared link connected to more than three bridges, the downstream bridges do not respond to the handshake request sent by the specified upstream port. They can only wait twice for the forward time to enter the forwarding status. Feedom.net

The third improvement: directly connect to the terminal instead of defining the ports connected by other bridges as edge ports ). Edge ports can directly enter the forwarding status without any delay. Because the bridge cannot know whether the port is directly connected to the terminal, manual configuration is required.

It can be seen that the RSTP protocol has indeed improved a lot compared with the STP protocol. To support these improvements, the BPDU format has been modified, but the RSTP protocol is still backward compatible with the STP protocol and can be used for hybrid networking. Even so, RSTP and STP belong to the same single spanning tree.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.