Understanding the Spanning Tree protocol family
Switch Keeper
The Spanning Tree protocol, which was designed to provide a loop-free Ethernet network topology, has been around for more than 30 years and has been through many iterations. The various versions include the conventional Spanning Tree protocol, Per-VLAN Spanning Tree protocol, Rapid Spanning Tree protocol, and a more recent version known as the Multiple Spanning Tree protocol. This introduction to Spanning Tree looks at some of the important enhancements introduced with later variants.
Broadcast Storm
Ethernet uses a multiaccess broadcast technique. A switch spreads the broadcast message all over the network to make sure all hosts can receive the message. To accomplish the task, when the switch receives a broadcast, it duplicates the message to all ports except the port that sends the broadcast.
In Figure 1, PC1 generates broadcast traffic. When SW1 receives the traffic, it duplicates to all other ports. SW2 does the same thing, so that all hosts in the network receive the broadcast message. This mechanism works perfectly in a simple network that does not have a loop connection.
A loop connection complicates the simple scenario depicted in Figure 1. In Figure 2, when SW1 receives a broadcast, it duplicates the message to SW2. SW2 receives the message and sends it to SW3. When SW3 receives the message, it duplicates it back to SW1, and the process repeats forever. This phenomenon is called a broadcast storm, which can consume all available CPU resources and network bandwidth. The entire network could be unavailable in several seconds after a broadcast storm occurs.
Spanning Tree Protocol
The Spanning Tree protocol (STP) is designed to eliminate the loop by blocking some links in the network. STP can define the port role and control the state of the switch ports. By moving the port from the forward state to the blocking state or vice versa, the paths between switches can be closed or opened. Decisions about which paths to open or close are made using the Spanning Tree Algorithm (STA). STP will choose a switch to be the root switch automatically. (It is also possible to choose the root switch manually through configuration.) After a root switch is chosen, all non-root switches should only have one path to reach the root switch.
If more than one path exists, all paths should be blocked except the best one. The best path is the path that has the lowest root cost. Root cost is a relative measure of the bandwidth of all linkages the message needs to pass through before reaching the root switch. Higher bandwidth linkages have lower costs. You can customize the root cost on each port to override the automatically calculated value in order to choose which path to use as the active path. The blocked paths become standby connections and will be awakened if the original root path is disconnected.
In Figure 3, SW1 is configured to be the root switch. SW3 has two paths to reach the root switch, left and right. The right path is blocked because of its higher root path cost.
Topology Change
When a network port on a switch goes from DOWN to UP, the physical connection may become totally different. Any change to an existing network, such as adding a new switch, could cause looping. On the other hand, if a port goes from UP to DOWN, a link between the switches may be disconnected and cause the switch to lose the original root path. So, switches will keep track of the root path cost of each port. Changes to the physical connection will change the root path cost, and STP needs to change the network topology.
Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.