Implementing STP
When multiple switches exist in the same layer 2 domain you run the risk of loops forming (bridging loops). Spanning Tree Protocol (STP) detects and prevents these loops. In essence if a loop exists the interfaces allowed to forward traffic are limited by preventing traffic being forwarded done (blocking). Over the years the STP has evolved with both standards based implementations and propriety ones;
- 802.1d (STP)
- 802.1w (RSTP)
- 802.1s (MST/MISTP)
- PVST+
- Rapid-PVST+
Each have a slightly different way of preventing bridging loops, however a number of components exists with all.
STP goes through the following process
- Root Bridge Election
- Root port elections
- designated port election
- Bridging loops removed
STP Tiebreaker
- Lowest BID – 64 bit value (16 bit priority field and 48 bit MAC)
- Lowest path cost to the root
- lowest sender BID
- Lowest sender port ID
STP port states
- Disabled
- Blocking (20 seconds)
- Listening (15 seconds)
- Learning (15 seconds)
- Forwarding
BPDU
send every 2 sec
Improving STP Stability
- Root Guard
- UDLD
- Loop Guard
Commands
#forward-time (#sec) – change time from the 50 seconds to shorter
bridge (#) protocol vlan-bridge
spanning-tree vlan <id> root primary !# uses a macro that looks at the current root BID and sets a lower
spanning-tree vlan <id> root secondary !# also uses macro
spanning-tree vlan <id> priority <value>
spanning-tree link-type point-to-point
Lab Examples
Resources
- Interconnections: Bridges, Routers, Switches, and Internetworking Protocols (2nd Edition) (Radia Perlman)
- CCNP BCMSN: Exam Certification Guide (David Hucaby) – Ciscopress
- CCNP Switch: Cert Kit (David Hucaby, Denise Donohue & Sean Wilkins) – Ciscopress