Development Process of Spanning Tree Protocol (1)

Source: Internet
Author: User

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

Because the Spanning Tree Protocol itself is relatively small, it is not as widely known as the routing protocol. But it is in charge of the forwarding power of the port-"the branches shake and the upper-layer protocols have to make a living ". The real situation is true, especially when running together with other protocols, the spanning tree may break the packet paths of other protocols, resulting in various strange phenomena.

Like other protocols, the Spanning Tree Protocol is constantly updated with the continuous development of the network. The "Spanning Tree Protocol" in the title of this article is a broad concept, not specifically the STP protocol defined in IEEE 802.1D, it includes STP and various improved Spanning Tree Protocols Based on STP.

During the development of the Spanning Tree Protocol, old defects are constantly overcome, and new features are constantly developed. Based on the improvement of major functions, we can roughly divide the development process of the Spanning Tree Protocol into three generations.

STP/RSTP

In the early stages of network development, transparent bridges were an important role that had to be played. It is much smarter than a hub that only scales up and broadcasts signals. It will quietly 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.

However, there is no such thing as gold, and transparent bridges also have their own shortcomings. 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 is stored in the loop, the packets are continuously circulating and growing in the loop, it even caused a terrible "broadcast storm ". The reason for the use of the word "Terror" is that in this case, the network will become unavailable and the fault is difficult to locate in a large network, so the broadcast storm is a catastrophic fault in a L2 network.

In this environment, the Spanning TreeProtocol, which plays the savior role, came to the world, with IEEE's 802.1D version being the most popular.

Figure 1 process of generating a tree

The basic idea of STP protocol is very simple. As we all know, the growth of trees in nature will not produce loops. If the network can grow like a tree, there will be no loops. The STP protocol defines the concepts of 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.

It is not difficult to understand the process of Spanning Tree Protocol. First, we should 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. In the network shown in figure 1, each bridge is started with the default configuration. When the bridge priority is the same (the default priority is 32768), the bridge with the smallest MAC address becomes the root bridge, in example 1, SW1 has all its port roles become the specified port and enters the forwarding status.

Next, other bridges will select the "Strongest" branches as the path to the root bridge, and the role of the corresponding port will become the root port. Assume that the link between SW2, SW2, and SW3 in Figure 1 is a gigabit GE link, and the link between SW1 and SW3 is a 10-ge FE link, the default overhead of the SW3 path from Port 1 to the root bridge is 19, while the overhead of the path from Port 2 to the root bridge is 4 + 4 = 8, therefore, Port 2 becomes the root port and enters the forwarding state. Similarly, Port 2 of SW2 becomes the root port, and Port 1 becomes the specified port and enters the forwarding status.

After the root bridge and the root port are confirmed, a tree is generated, as shown in the solid state. The following task is to crop redundant loops. This operation is implemented by blocking the corresponding ports on non-root bridges. For example, the role of Port 1 in SW3 becomes the disabled port and enters the blocking status (represented by "X" in the figure ).


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.