NOTE:
Don’t confuse Spanning Tree Protocol (STP) with Shielded Twisted Pair (STP).
Spanning Tree Protocol - 1
Ethernet bridges and switches can implement the IEEE 802.1D Spanning-Tree Protocol and use the spanning-tree algorithm to construct a loop free shortest path network.
Shortest path is based on cumulative link costs.
Spanning Tree Protocol - 2
The Spanning-Tree Protocol establishes a
The Spanning-Tree Protocol constructs a topology that has one path for reaching every network node. The resulting tree originates from the root bridge/switch.
The Spanning-Tree Protocol requires network devices to exchange messages to detect bridging loops. Links that will cause a loop are put into a blocking state.
The message that a switch sends, allowing the formation of a loop free logical topology, is called a Bridge Protocol Data Unit (BPDU).
Selecting the Root Bridge
The first decision that all switches in the network make, is to identify the root bridge. The position of the root bridge in a network will affect the traffic flow.
When a switch is turned on, the spanning-tree algorithm is used to identify the root bridge. BPDUs are sent out with the Bridge ID (BID).
The BID consists of a bridge priority that defaults to 32768 and the switch base MAC address.
When a switch first starts up, it assumes it is the root switch and sends BPDUs. These BPDUs contain the switch MAC address in both the root and sender BID. As a switch receives a BPDU with a lower root BID it replaces that in the BPDUs that are sent out. All bridges see these and decide that the bridge with the smallest BID value will be the root bridge.
A network administrator may want to influence the decision by setting the switch priority to a smaller value than the default.
BDPUs
BPDUs contain enough information so that all switches can do the following:
• Select a single switch that will act as the root of the spanning tree
• Calculate the shortest path from itself to the root switch • Designate one of the switches as the closest one to the
root, for each LAN segment. This bridge is called the “designated switch”. The designated switch handles all communication from that LAN towards the root bridge.
• Each non-root switch choose one of its ports as its root port, this is the interface that gives the best path to the root switch.
• Select ports that are part of the spanning tree, the designated ports. Non-designated ports are blocked.
Spanning Tree Port States
Spanning Tree Operation
When the network has stabilized, it has converged and there is one spanning tree per network. As a result, for every switched network the following elements exist:
• One root bridge per network
• One root port per non root bridge • One designated port per segment • Unused, non-designated ports
Root ports and designated ports are used for forwarding (F) data traffic. Non-designated ports discard data traffic.
Non-designated ports are called blocking (B) or discarding ports.
Spanning Tree Recalculation
A switched internetwork has converged when all the switch and bridge ports are in either the forwarding or blocked state.
Forwarding ports send and receive data traffic and BPDUs.
Blocked ports will only receive BPDUs.
When the network topology changes, switches and bridges recompute the Spanning Tree and cause a disruption of user traffic.
Convergence on a new spanning-tree topology using the IEEE 802.1D standard can take up to 50 seconds.
This convergence is made up of the max-age of 20 seconds, plus the listening forward delay of 15 seconds, and the learning forward delay of 15 seconds.