Networking
Spanning Tree Protocol
Also known as: STP, RSTP, Rapid Spanning Tree, 802.1D
Prevents Layer 2 switching loops by blocking redundant paths — without it, a loop causes a broadcast storm that takes down the network.
Spanning Tree Protocol (STP) prevents Layer 2 switching loops by automatically blocking redundant paths between switches. Without it, a loop in your switch infrastructure would cause a broadcast storm that brings down the network almost instantly.
Ethernet frames have no TTL like IP packets do — a frame caught in a loop will circulate forever, multiplying with each pass until it consumes all available bandwidth. STP prevents this by designating one path between any two switches as active and blocking others.
The protocol elects a root bridge (the switch that becomes the logical center of the spanning tree), then calculates the shortest path from every other switch to the root. Redundant paths are placed in a blocking state — they carry no traffic but are ready to activate if the active path fails. When a link goes down, STP recalculates and unblocks the redundant path.
Rapid Spanning Tree (RSTP) cut failover time from up to a minute (original STP) down to under a second, and is what almost all modern networks run.
The practical implications:
STP is why your "redundant" switch links aren't actually providing double the bandwidth — they're in blocking state, ready for failover, not active. LACP/LAG is how you actually aggregate bandwidth across multiple links while maintaining STP compatibility.
Misconfigured STP can cause unexpected topology changes that briefly disrupt traffic. Making sure your core switch — not some random closet switch — is the designated center of the tree is a basic hardening step.