3.5.1. Root Port, Root Bridge, and Other Port Names
💡 First Principle: STP needs a single "center" of the network to build a loop-free tree. The root bridge is that center—every other switch calculates its best path toward the root, and redundant paths get blocked. Understanding port roles is understanding how STP decides what stays open and what gets shut down.
Loading diagram...
Key Terms:
| Term | Definition |
|---|---|
| Root Bridge | Switch with lowest Bridge ID; all traffic flows toward it |
| Bridge ID | Priority (default 32768) + VLAN ID + MAC address |
| Root Port (RP) | Best path to root bridge on non-root switches (one per switch) |
| Designated Port (DP) | Best path away from root bridge on each segment |
| Blocked/Alternate Port | Redundant port disabled to prevent loops |
| Root Path Cost | Cumulative cost to reach root bridge |
Root Bridge Election:
- Compare Bridge Priority (lower wins, default 32768, increments of 4096)
- If tied, compare MAC address (lower wins)
Path Cost values (IEEE revised, commonly tested):
| Link Speed | STP Cost |
|---|---|
| 10 Mbps | 100 |
| 100 Mbps | 19 |
| 1 Gbps | 4 |
| 10 Gbps | 2 |
Port role selection process: Each non-root switch selects one Root Port (lowest root path cost). On each network segment, the port with the best path to root becomes the Designated Port. All other ports are blocked. When costs tie, the switch uses sender Bridge ID, then sender port priority, then sender port number as tiebreakers.
Set Root Bridge (Primary/Secondary):
Switch(config)# spanning-tree vlan 10 root primary ! Sets priority to 24576
Switch(config)# spanning-tree vlan 10 root secondary ! Sets priority to 28672
Switch(config)# spanning-tree vlan 10 priority 4096 ! Manual priority
⚠️ Exam Trap: STP root bridge election is non-preemptive. If you add a switch with a lower Bridge ID after the network converges, it WILL become root—this can disrupt your entire topology. Always set priorities explicitly on your intended root and secondary root switches.