What is the Spanning Tree Protocol?

The Spanning Tree Protocol, sometimes just referred to as Spanning Tree, is the Waze or MapQuest of modern Ethernet networks, directing traffic along the most efficient route based on real-time conditions.

Based on an algorithm created by American computer scientist Radia Perlman while she was working for Digital Equipment Corporation (DEC) in 1985, the primary purpose of Spanning Tree is to prevent redundant links and the looping of communication pathways in complex network configurations. As a secondary function, Spanning Tree can route packets around trouble spots to ensure that communications are able to wind through networks that might be experiencing disruptions.

Spanning Tree topology vs. Ring topology

When organizations were just starting to network their computers in the 1980s, one of the most popular configurations was the ring network. For example, IBM introduced its proprietary Token Ring technology in 1985.

In a ring network topology, each node connects with two others, one that sits ahead of it on the ring and one that is positioned behind it. Signals only travel around the ring in a single direction, with each node along the way handing off any and all packets looping around the ring.

While simple ring networks work fine when there are only a handful of computers, rings become inefficient when hundreds or thousands of devices are added to a network. A computer might need to send packets through hundreds of nodes just to share information with one other system in an adjacent room. Bandwidth and throughput also become a problem when traffic can only flow in one direction, with no backup plan if a node along the way becomes broken or overly congested.

In the 90s, as Ethernet got faster (100Mbit/sec. Fast Ethernet was introduced in 1995) and the cost of an Ethernet network (bridges, switches, cabling) became significantly cheaper than Token Ring, Spanning Tree won the LAN topology wars and Token Ring quickly faded away.

How Spanning Tree Works

REGISTER NOW for the last FutureIT event of the year! Exclusive professional development workshop available. FutureIT New York, November 8 ]

Spanning Tree is a forwarding protocol for data packets. It’s one part traffic cop and one part civil engineer for the network highways that data travels through. It sits at Layer 2 (data link layer), so it is simply concerned with moving packets to their appropriate destination, not what kind of packets are being sent, or the data that they contain.

Spanning Tree has become so ubiquitous that its use is defined in the IEEE 802.1D networking standard. As defined in the standard, only one active path can exist between any two endpoints or stations in order for them to function properly.

Spanning Tree is designed to eliminate the possibility that data passing between network segments will get stuck in a loop. In general, loops confuse the forwarding algorithm installed in network devices, making it so that the device no longer knows where to send packets. This can result in the duplication of frames or the forwarding of duplicate packets to multiple destinations. Messages can get repeated. Communications can bounce back to a sender. It can even crash a network if too many loops start occurring, eating up bandwidth without any appreciable gains while blocking other non-looped traffic from getting through.

The Spanning Tree Protocol stops loops from forming by closing off all but one possible pathway for each data packet. Switches on a network use Spanning Tree to define root paths and bridges where data can travel, and functionally close off duplicate paths, rendering them inactive and unusable while a primary path is available.

The result is that network communications flow seamlessly regardless of how complex or vast a network becomes. In a way, Spanning Tree creates single paths through a network for data to travel using software in much the same way that network engineers did using hardware on the old loop networks.

Additional Benefits of Spanning Tree

The primary reason Spanning Tree is used is to eliminate the possibility of routing loops within a network. But there are other advantages as well.

Because Spanning Tree is constantly looking for and defining which network paths are available for data packets to travel through, it can detect if a node sitting along one of those primary paths has been disabled. This can happen for a variety of reasons ranging from a hardware failure to a new network configuration. It can even be a temporary situation based on bandwidth or other factors.

When Spanning Tree detects that a primary path is no longer active, it can quickly open another path that had been previously closed. It can then send data around the trouble spot, eventually designating the detour as the new primary path, or sending packets back to the original bridge should it again become available.

While the original Spanning Tree was relatively quick in making those new connections as needed, in 2001 the IEEE introduced the Rapid Spanning Tree Protocol (RSTP). Also referred to as the 802.1w version of the protocol, RSTP was designed to provide significantly faster recovery in response to network changes, temporary outages or the outright failure of components.

And while RSTP introduced new path convergence behaviors and bridge port roles to accelerate the process, it was also designed to be fully backwards compatible with the original Spanning Tree. So it’s possible for devices with both versions of the protocol to operate together on the same network.

Shortcomings of Spanning Tree

While Spanning Tree has become ubiquitous over the many years following its introduction, there are those who argue that it’s time has come. The biggest fault of Spanning Tree is that it closes off potential loops within a network by shutting down potential pathways where data could travel. In any given network using Spanning Tree, about 40% of the potential network paths are closed to data.

In extremely complex networking environments, such as those found within data centers, the ability to scale up quickly to meet demand is critical. Without the limitations imposed by Spanning Tree, data centers could open up a lot more bandwidth without the need for additional networking hardware. This is kind of an ironic situation, because complex networking environments are why Spanning Tree was created. And now the protection provided by the protocol against looping is, in a way, holding those environments back from their full potential.

A refined version of the protocol called Multiple-Instance Spanning Tree (MSTP) was developed to employ virtual LANs and enable more network paths to be open at the same time, while still preventing loops from forming. But even with MSTP, quite a few potential data paths remain closed on any given network employing the protocol.

There have been many non-standardized, independent attempts to improve the bandwidth restrictions of Spanning Tree over the years. While the designers of some of them have claimed success in their efforts, most are not completely compatible with the core protocol, meaning organizations need to either employ the non-standardized changes on all of their devices or find some way to allow them to exist with switches running standard Spanning Tree. In most cases, the costs of maintaining and supporting multiple flavors of Spanning Tree are not worth the effort.

Will Spanning Tree Continue in the Future?

Aside from the limitations in bandwidth due to Spanning Tree closing network paths, there isn’t a lot of thought or effort being put into replacing the protocol. Although IEEE occasionally releases updates to try and make it more efficient, they are always backwards compatible with existing versions of the protocol.

In a sense, Spanning Tree follows the rule of “If it ain’t broke, don’t fix it.” Spanning Tree runs independently in the background of most networks to keep traffic flowing, prevent crash-inducing loops from forming, and routing traffic around trouble spots so that end users never even know if their network experiences temporarily disruptions as part of its day-to-day operations. Meanwhile, on the backend, administrators can add new devices to their networks without too much thought as to whether or not they will be able to communicate with the rest of the network or the outside world.

Because of all that, it’s likely that Spanning Tree will remain in use for many years to come. There might be some minor updates from time to time, but the core Spanning Tree Protocol and all of the critical features it performs are probably here to stay.


Post time: Nov-07-2023