STP Port Roles and Port States: The Complete CCNA Reference
Spanning Tree Protocol (STP) is a Layer 2 loop-prevention mechanism that ensures a single active path between any two network segments. For the CCNA 200-301 exam, mastering STP port roles and states is non-negotiable. This reference covers every role (root, designated, alternate, backup) and every state (blocking through forwarding) with exam-specific traps.
Port Roles
STP assigns one of four roles to each switch port.
Root Port (RP)
- The port on a non-root switch that has the best path cost to the root bridge.
- Each non-root switch has exactly one root port.
- The root bridge has no root ports.
Example: In a triangle topology (SW1 root, SW2, SW3), SW2's root port is the one receiving the superior BPDU from SW1.
Designated Port (DP)
- The port on a segment that forwards traffic toward the root bridge.
- Each segment has exactly one designated port.
- The root bridge has all its ports as designated (unless a loopback exists).
Exam Trap: A root bridge port is always designated, not root. The term "root port" only applies to non-root switches.
Alternate Port (AP)
- A port that receives a superior BPDU from another switch and provides an alternate path to the root bridge.
- Remains in blocking state unless the current root port fails.
Example: In a triangle, the port on SW2 that receives a BPDU from SW3 (with higher path cost) is an alternate port.
Backup Port (BP)
- A port that receives a superior BPDU from the same switch (i.e., another port on the same switch, often due to a hub or shared segment).
- Rare in modern switched networks; mostly seen with hubs.
- Remains in blocking state.
Exam Trap: Backup ports are almost never tested in depth, but remember they occur on shared segments, not point-to-point links.
Port States
STP transitions through five states to prevent loops during convergence.
Blocking
- Initial state after link up.
- Does not forward traffic, does not learn MAC addresses.
- Receives BPDUs but does not send them.
Listening
- Transitional state after blocking when the port is selected as a root or designated port.
- Does not forward traffic, does not learn MAC addresses.
- Receives and sends BPDUs.
Learning
- Transitional state after listening.
- Does not forward traffic, but begins learning MAC addresses.
- Receives and sends BPDUs.
Forwarding
- Final state for root and designated ports.
- Forwards traffic and learns MAC addresses.
- Receives and sends BPDUs.
Disabled
- Administrative shutdown or link failure.
- Does not participate in STP.
Exam Trap: The order of states is Blocking → Listening → Learning → Forwarding. The timer for each is Forward Delay (default 15 seconds). So convergence takes 30 seconds (Listening + Learning) plus 20 seconds for Max Age (BPDU timeout) = 50 seconds total, but the exam expects 30 seconds for topology change without Max Age.
Command to verify: show spanning-tree displays port roles (Root, Desg, Altn, Bcku) and states (BLK, LIS, LRN, FWD).
Real Technical Example
Consider three switches: SW1 (root), SW2, and SW3 connected in a triangle. SW1 priority 4096, others default 32768. SW2 Gi0/1 to SW1, Gi0/2 to SW3. SW3 Gi0/1 to SW1, Gi0/2 to SW2.
- SW1: Both ports are designated, forwarding.
- SW2: Gi0/1 receives superior BPDU from SW1 → root port, forwarding. Gi0/2 receives BPDU from SW3 (cost higher) → alternate port, blocking.
- SW3: Gi0/1 receives superior BPDU from SW1 → root port, forwarding. Gi0/2 receives BPDU from SW2 (cost higher) → alternate port, blocking.
If SW2's root port fails, SW2's alternate port transitions through listening/learning to forwarding in ~30 seconds.
Exam Tips: What to Watch For
- Root port vs. designated port: Root port is always on non-root switch; designated port is on every segment, including root bridge.
- Alternate vs. backup: Alternate receives superior BPDU from another switch; backup from same switch.
- State transition times: Default forward delay = 15s, max age = 20s. Expect questions on convergence time (30s for link failure, 50s for root failure).
- PortFast: Ports with PortFast skip listening/learning and go directly to forwarding. Used on access ports only.
- RSTP differences: RSTP has discarding, learning, forwarding states. Roles: root, designated, alternate, backup. No listening state.
- Show commands:
show spanning-tree brief,show spanning-tree vlan 1.
Conclusion
STP port roles and states form the backbone of loop-free Layer 2 design. For the CCNA 200-301, focus on identifying root and designated ports, understanding state transitions, and recognizing exam traps like the root bridge having no root ports. Practice with show spanning-tree outputs and topology diagrams.
To solidify your knowledge, try practice questions on subnetting.org or the Cisco Learning Network. Drill the port roles and state timers until they become second nature.