Spanning Tree Protocol Quick Reference
During my Cisco 100-101 and 200-101 CCNA exams, I compiled a list of flash card type system to help me learn the ideas of the curriculum.
Spanning Tree Protocol – 802.1d
Steps to STP convergence:
1. Elect the root bridge
– Lowest Bridge ID wins.
– If there is a tie, the lowest MAC address
2. Find the best path to the root bridge.
– Lowest cost
– Lowest upstream Bridge ID
– Lowest port priority
– Lowest port ID
3. Block anything left over.
Link Speed Cost
Electing the Root Bridge
The switch with the lowest bridge ID wins. The default is set to 32768.
If two or more switches tie, the tiebreaker is the switches MAC address. The lowest MAC address among the switches wins the Root Bridge election.
Find the best path to the Root Bridge.
Ports with the least cost (as above) are elected the root ports. If there is a tiebreaker, the switch that has the lowest Bridge ID wins.
Finding the Designated Ports
Designated ports (DP) can only have one per segment. The switch with the least cost to the root bridge wins the DP election. If there is a tie with the cost, the switch with the lowest physical interface wins. If this is a tie (Both interfaces are Fa0/0 for example), the switch with the lowest mac address/BID wins, and the higher interface is moved to a blocking state.
Blocking anything left over
After the above steps have been completed, we should have the root bridges and designated ports set. Any ports that are not the root, or designated ports are blocked.
After the above has completed, the network is said to be converged.
Verifying Spanning Tree Protocol
– Displays Bridge ID
– Displays the local and root MAC address
– If this switch is the root bridge
– Link state and interface
spanning-tree vlan cost
– Sets the cost of that interface
Influencing STP decisions
To influence which switch gets to be the root bridge, use the following
spanning-tree vlan root primary/secondard
If the current root is higher than 24,576, the local switch uses a base of 24,576.
If the current root is lower than 24,576, the local switch uses a value in multiples of 4092 that still results in the local switch being the root bridge.
Spanning Tree States
– Clears any learnt MAC addresses in the CAM table and listen for BPDU’s for 15 seconds.
– The switch is sending and receiving BPDU’s at this time.
– The switch starts learning the MAC addresses and populates the CAM table
– This state lasts 15 seconds by default.
– The topology has converged and this port is forwarding.
– The topology has converged and this port is blocking.
Spanning Tree Timers
Hello Timer: The Hello Timer is configured on the root switch. Every other switch will gather this setting from the root bridge.
By default, the hello timer is set to 2 seconds.
Forward Delay: The delay that affects the process that occurs when an interface changes from a blocking state to a forwarding state. A port stays in an interim listening state, then a learning state, for the number of seconds set by the forward delay timer.
Max Age: The Hold Down/Dead Timer is by default set to the hello timer times 10; (20 seconds).
PortFast and Cisco BPDU Guard
Port fast moves a switchport to a forwarding state without first going through the Listening and Learning states. For obvious reasons, this should only be used on access ports that are connected to PC’s, and NOT routers, switches, hubs etc.. as this will create broadcast storms.
Cisco BPDU Guard and PortFast usually go hand in hand. Cisco BPDU Guard’s job is to listen for any BPDU’s, and if it detects one, it will shut the interface down to stop a broadcast storm.
The spanning-tree portfast interface command enables PortFast on that interface.
The spanning-tree bpduguard enable interface command enables Cisco BPDU Guard on that interface.
Rapid Spanning Tree Protocol – 802.1W
RSTP is a proactive version of STP and is bypasses the 15 seconds of listening and learning.
RSTP removes the blocking state and introduces the alternate state.
If a new link is connected to another router and a superior BPDU is sent, the port is instantly blocked. The other end receivbing the new BPDU sends a BPDU back instructing the originator to transition it.