STP prevents packet loops in multi-switch networks by establishing a tree topology where one switch acts as the root bridge and blocks redundant links. It works by exchanging BPDU messages to elect the root bridge and determine the optimal path to it, blocking ports on other paths to prevent loops. Modern variants like RSTP improve performance by defining different port roles and converging faster to reduce downtime when the topology changes.
2. - STP – Brief Overview
○ Spanning Tree Protocol in a nutshell
○ Algorithm / Protocol
○ Add Links for redundancy
○ Prevent packet loops in
multi-interconnected switch networks
(Broadcast storm)
3. STP – What Does It Do?
○ What are redundant networks?
○ Switch interconnection - multiple routes for data flow
○ Has an optimal path - lowest metric
○ Redundant = Backup, incase optimal path is down
4. STP – What Does It Do?
○ What are switching loops?
○ Switch broadcasts can cause loops
in redundant networks
○ Packets sent in circles endlessly,
duplicated at each broadcast
○ Packet duplication + circulation
= broadcast storm
8. STP - Root bridge
○ What is the root bridge?
○ Place where traffic flows
○How is the root bridge selected?
○ Lowest Mac Address
○What happens if STP is left alone?
○ One switch acts as the root for every VLAN!
9. STP – Root Bridge cont.
○How to fix this from happening?
○ SW1(config) #spanning-tree vlan 1
○What happens to the ports?
○ STP will block unused ports at layer 2
○ Set off an election
○What happens when there’s a topology change?
○ Spanning tree algorithm
○ SW2 (config) #spanning-tree vlan 20 root primary
○ SW2 (config) #spanning-tree vlan 30 root primary
10. STP - BPDU
○What is BPDU?
○ Bridge Protocol Data Units
○ Final process, root bridge
○BPDU and its configurations
○ Contains various information
11. BPDU - Results
○How are results exchanged?
○ One switch in the network being elected
○ Forwarding state root ports
○ Interfaces in the spanning-tree instance are selected. Root parts
and designated ports are put into the forwarding state.
12. STP - Layer 2 network
○Spanning tree retrieval
○ Done via BPDU messages
○ Message exchanging between switches
○ Designated switch for each LAN
○These Message result in
○ Removal of redundant loops
○ Unique root switch
○ Unique designated switch
13. .
STP - Problems
15 seconds of listening for BPDUs.
switch / sends receives BPDUs.
15 seconds of learning mac address.
populates the cam table
(bonus) switch will wait up to 20 seconds max before moving
a blocked port into listening phase.
Port is forwarding traffic
14. STP – Problems continued
Problems with PCs - Modern PCs can boot faster than 30 seconds
Problems with uplink ports: 30 seconds of downtime causes big problems
Solution = Rapid Spanning Tree !
Solution = Portfast !
15. STP – PVST+
Runs an instance of STP per Vlan
Allows different root bridges per Vlan
Root for vlan 10
Root for vlan 20
16. STP – Rapid STP
○ Rapid STP
○ 802. 1w
○ Proactive system
○ Redefined port roles
○ Many STP similarities
17. STP – How RSTP improves Performance
More logical port types
Root port - used to reach the root bridge
Designated port - forwarding port, one
per line
Alternative port - discarding port, backup
path to root
A
B C
18. Conclusion
○ Spanning-Tree Protocol (STP) prevents loops from forming when
switches or bridges are interconnected via multiple paths.
○ Spanning-Tree Protocol implements the 802.1D IEEE algorithm by
exchanging BPDU messages with other switches to detect loops, and
then removes the loop by shutting down selected bridge interfaces.
○ Spanning-Tree Protocol guarantees that there is one and only one active
path between two network devices.
Any questions?