Spanning Tree Protocol is defined by IEEE 802.1D. It prevents loops from being formed when switches or bridges are interconnected via multiple paths. Spanning Tree Protocol is implemented by switches exchanging BPDU messages with other switches to detect loops, which are removed by shutting down selected bridge interfaces. This algorithm guarantees that there is one and only one active path between two network devices.
By default, the root bridge priority is 32768. If all switches have the same root bridge priority, the switch with the lowest MAC address is elected as the root of the Spanning Tree Protocol. Therefore, you should lower the root bridge priority on the switch that you want to be the Spanning Tree Protocol root: the distribution legacy switch. You should also align the FHRP gateway to be the same switch.
Spanning Tree Protocol switch ports enter the following states:
- Blocking: A blocking port would cause a switching loop if it were active. No user data is sent or received over a blocking port, but it may go into forwarding mode if the other links in use fail and the spanning tree algorithm determines that the port may transition to the forwarding state. BPDU data is still received in the blocking state. It prevents the use of looped paths.
- Listening: The switch processes BPDUs and awaits possible new information that would cause it to return to the blocking state. It does not populate the MAC address table and does not forward frames.
- Learning: While the port does not yet forward frames, it does learn source addresses from frames received and adds them to the filtering database (switching database). It populates the MAC address table but does not forward frames.
- Forwarding: A forwarding port receives and sends data in normal operation. Spanning Tree Protocol still monitors incoming BPDUs that would indicate it should return to the blocking state to prevent a loop.
- Disabled: A network administrator can manually disable a port, although this is not strictly part of Spanning Tree Protocol.
Spanning Tree Protocol Metrics
IEEE 802.1d-2004 increases the path cost (used to calculate the cost to the root bridge) from the original 16-bit value to a 32-bit value to provide more granular costs for higher-speed interfaces. The Cisco recommended practice is to ensure that all devices are using the 32-bit cost metrics. Table 6-9 shows IEEE 802.1d and 802.1d-2004 metrics.
Table 6-9 IEEE 802.1d and 802.1d-2004 Metrics
Link Speed | 802.1d Cost Value | 802.1d-2004 Cost Value |
1 Mbps | — | 20,000,000 |
4 Mbps | 250 | — |
10 Mbps | 100 | 2,000,000 |
16 Mbps | 62 | — |
100 Mbps | 19 | 200,000 |
1 Gbps | 4 | 20,000 |
10 Gbps | 2 | 2000 |
100 Gbps | — | 200 |
1 Tbps | — | 20 |
10 Tbps | — | 2 |
Cisco switches support three types of Spanning Tree Protocol:
- Per VLAN Spanning Tree Plus (PVST+)
- Rapid PVST+
- Multiple Spanning Tree (MST)
PVST+
Per VLAN Spanning Tree Plus (PVST+) provides the same functionality as PVST using 802.1Q trunking technology rather than ISL. PVST+ is an enhancement to the 802.1Q specification and is not supported on non-Cisco devices. PVST+ is based on the IEEE 802.1D and adds Cisco-proprietary features such as BackboneFast, UplinkFast, and PortFast.