STP
— Spanning Tree Protocol (IEEE 802.1D)Ethernet has no TTL field, so a redundant path between switches would make broadcast frames loop and multiply until the network collapses. STP builds a loop-free tree by electing one root bridge, choosing the best path to it from every other bridge, and placing all remaining ports in a blocking state.
Interactive Session: How STP Works
Step through the packet exchange sequence between nodes.
Interactive Execution Sandbox
Interact with a live or clearly-labelled simulated instance of STP.
Threat Model & Attack Simulation
How this protocol is attacked in practice, what defenders can see, and which control stops it.
Threat model & attack simulation
SimulatedDefensive education. Every step runs in this page; no traffic is generated or sent.
Spanning tree root takeover
SpoofingFaster BPDUs from an attacker make it the root bridge, pulling inter-switch traffic through its link.
Send superior BPDUs
The attacker advertises a lower bridge ID and better root path cost than the real root.
A new root bridge appears with an unexpected MAC and priority.
Traffic interception or a network-wide outage if the attacker stops forwarding.
Defences that matter
- BPDU Guard on access ports
- Root Guard on designated ports
- Loop Guard and consistent bridge priorities
This is a conceptual model for defenders, not an exploit toolkit. It contains no payloads, tooling or instructions for attacking systems you do not own.
Protocol Specification & Architecture
Key characteristics, real-world deployment patterns, and trade-offs.
Core Technical Features
- Root bridge election by lowest bridge ID (priority plus MAC address)
- Configuration BPDUs exchanged every 2 seconds by default
- Port roles of root port, designated port and blocked alternate port
- Listening, learning and forwarding state transitions guarded by timers
- Topology Change Notification BPDUs to flush stale MAC tables
Real-World Use Cases
- Preventing broadcast storms in redundant switch topologies
- Campus and data centre access layer loop protection
- Failover when a primary uplink fails
Advantages & Strengths
- Keeps a redundant topology usable without Layer 2 loops
- Vendor-neutral and enabled by default on most switches
Limitations & Vulnerabilities
- Slow convergence, typically 30 to 50 seconds with classic timers
- Blocked links waste available bandwidth until a failure occurs