The Big Picture
Spanning Tree Protocol (STP) is the traffic cop for your switches. Its job? Prevent loops that could crash your entire network in seconds.
Here's the thing: network engineers want redundant connections (backups!), but without STP, those backups become a disaster waiting to happen.
The Problem: Broadcast Storms
Imagine you have three switches connected in a triangle (for redundancy). A computer sends out a broadcast message asking "Who has IP 192.168.1.1?"
Without STP, here's what happens:
- Switch 1 sends the broadcast to Switch 2 AND Switch 3
- Switch 2 forwards it to Switch 3, Switch 3 forwards it to Switch 2
- Both switches send it back to Switch 1
- The broadcast loops forever, multiplying each time!
- Within seconds: 100% CPU, network crash, angry users

The Solution: STP Creates a Tree
STP looks at your mesh of switches and logically blocks certain ports to create a loop-free "tree" structure.
The blocked ports aren't wasted - they're standing by as backups. If an active link fails, STP automatically unblocks a backup port. Your network heals itself!
Three Simple Rules
STP follows three rules, always in this order:
- Elect a Root Bridge - One switch becomes the "center" of the tree (the trunk)
- Find the Best Path - Every other switch picks its best port toward the Root
- Block the Rest - Any extra paths get blocked to prevent loops
Why Does STP Take 30-50 Seconds?
When a link changes, ports go through several states before forwarding traffic:
| State | Duration | What's Happening |
|---|---|---|
| Blocking | 20 sec (Max Age) | Listening for BPDUs, not forwarding anything |
| Listening | 15 sec | Participating in election, still not forwarding |
| Learning | 15 sec | Building MAC table, almost ready... |
| Forwarding | ∞ |
This is why RSTP (Rapid STP) was invented - it converges in 1-2 seconds instead of 30-50!
Want More Detail?
Ready to see the election in action? Try the interactive tabs above! →
Switch States
Election Results
Change Priority
Select a switch to change its priority
Port Roles
Click a switch to view
its port roles and costs
Simulation Controls
Link States
Fail links to see how STP
activates backup paths