A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
You're reviewing a network diagram with a senior engineer. She points at a link and asks: 'On which end is the root port, and which end is designated?' You know the port roles exist but you've never thought through how STP actually assigns them. This lesson fixes that.
STP assigns every port on every switch one of a small set of roles. Two of them forward, two of them don't. The algorithm sounds complicated but the rules are simple once you internalize them.
| Role | Meaning | Forwards traffic? |
|---|---|---|
| Root | Best path to the root bridge from this switch — exactly one per non-root switch per VLAN | Yes |
| Designated | Best port on a given segment — one per segment per VLAN | Yes |
| Alternate | A potential path to the root but not currently the best one | No (blocked) |
| Disabled | Administratively shut down or failed | No |
The root bridge always has all ports as designated (no root port — it *is* the root). Every other switch has exactly one root port (the port with the lowest cost path to the root). Every segment has one designated port (the port on that segment closest to the root). Everything else is alternate or disabled.
SW3 has two links. The direct link to SW1 has cost 4 (Gigabit). The path through SW2 has cost 4 + 4 = 8. Lower cost wins — the direct link is SW3's root port, and the SW2 link becomes alternate. Blocked. If the direct link dies, the alternate takes over.
Notice the total: Max Age (20) + Listening (15) + Learning (15) = 50 seconds for classic STP to converge. RSTP cuts this dramatically by negotiating directly between switches rather than waiting out timers. That's why production networks migrated to RSTP over a decade ago.
STP uses cost values based on link bandwidth. The IEEE revised these in 2004 — the current values are what you'll see on modern switches.
| Bandwidth | Old cost (802.1D) | New cost (802.1t) |
|---|---|---|
| 10 Mbps | 100 | 2,000,000 |
| 100 Mbps | 19 | 200,000 |
| 1 Gbps | 4 | 20,000 |
| 10 Gbps | 2 | 2,000 |
| 100 Gbps | 1 | 200 |
The root bridge sends BPDUs with cost 0. The next switch receives them, adds its own ingress port's cost, and forwards. Every switch tracks the cumulative cost to reach the root on each port. The port with the lowest cumulative cost becomes the root port.
SW4 has two uplinks: Gi0/1 to SW1 (root bridge) at 1 Gbps, and Gi0/2 to SW2 at 10 Gbps. SW2's own cost to reach the root is 4. What is SW4's root port?
Select the safest next action.
That scenario needs a cleaner cost basis to be unambiguous — flagged for improvement. The key principle stands: cost is cumulative from the root, and the lowest total wins, regardless of hop count.
Finish the lesson once you have worked through the material. This awards ★ 35 XP.