Analogy: Imagine three rooms connected by three corridors in a circle. Without a clear rule, a message would circulate in the loop forever. STP closes one corridor and keeps it as a reserve — if an active corridor is blocked, the reserve one opens.
Bridge ID is priority plus MAC address and the lowest value wins, so SW1 with priority 4096 becomes root. SW2 and SW3 each pick the lowest-cost port toward the root as their root port, and the link between them is blocked to break the loop. Port roles: designated (one per segment), root (path to the root) and blocking (standby). RSTP speeds up convergence; PortFast plus BPDU Guard belong on access ports.
How the Root Bridge is elected
- Each switch sends a BPDU with Bridge ID = Priority (default 32768) + MAC Address.
- The switch with the lowest Bridge ID becomes the Root Bridge.
- If the Priority is identical — the lower MAC address wins (usually the oldest switch — not desirable!).
- Root Port — The port with the lowest cost to the Root, one on each non-Root switch.
- Designated Port — One active port on each network segment.
- Blocking / Alternate Port — The redundant port that is blocked to prevent a loop.