21
UNDERSTANDING SPANNING TREE
The Spanning Tree Protocol (STP) is a network protocol that ensures a loop-free topology for any bridged Ethernet local
area network. The basic function of STP is to prevent bridge loops and the resulting broadcast radiation. Spanning tree
also allows a network design to include spare (redundant) links to provide automatic backup paths if an active link fails,
without the danger of bridge loops, or the need for manual enabling/disabling of these backup links.
As the name suggests, Spanning Tree creates a tree within a network of connected Ethernet switches, and disables those
links that are not part of the spanning tree, leaving a single active path between any two network nodes.
Eliminating Loops
If your switches are connected in a loop without STP, each switch would infinitely duplicate the first broadcast packet it
received because there’s nothing to prevent a loop.
STP prevents loops by blocking one or more of the links. If one of the links in use goes down, then it would fail over to a
previously-blocked link. How spanning tree chooses which link to use depends entirely on the topology that it can see.
The idea behind a spanning tree topology is that bridges can discover a subset of the topology that is loop-free: that’s
the tree. STP also makes certain there is enough connectivity to reach every portion of the network by spanning the
entire LAN.
Spanning Tree Configuration
Bridges will perform the spanning tree algorithm when they are first connected to the network or whenever there is a
topology change.
When a bridge hears a “configuration message,” it will begin its disruptive spanning tree algorithm. This starts with the
election of a “root bridge” through which all data will flow.
Next, each bridge determines the shortest path to the root bridge so that it knows how to get to the “center.” A second
election happens on each LAN, and it elects the designated bridge, or the bridge that’s closest to the root bridge. The
designated bridge will forward packets from the LAN toward the root bridge.
The final step for an individual bridge is to select a root port. This simply means “the port that I use to send data towards
the root bridge.”
n NOTE: Every single port on a bridge (even those connected to endpoints) will participate in the spanning tree unless a port is
configured as “ignore.”
A newly-connected bridge will send a reconfiguration message, and other connected devices will comply. All traffic is
stopped for 30-50 seconds while the spanning tree is calculated.
Spanning tree drawbacks
One drawback of STP is that even though there may be many physical or equal-cost multiple paths through your
network from one node to another, all your traffic will flow along a single path defined by a spanning tree. The benefit
of this is that traffic loops are avoided, but the cost of restricting traffic to a unique path means blocking alternative, and
sometimes more direct, paths. That means that your full potential network capacity can never be realized.