A selected path is not yet a forwarding path
A port role describes the port's job in the spanning tree. A root port is a switch's selected path towards the root bridge; a designated port advertises the best root information on its segment. A state controls whether the port currently forwards user frames or learns source MAC addresses.
For this lesson SW1 is root, and SW2 and SW3 form the same triangle as before. PC A on SW2 is 192.168.10.10/24 and PC B on SW3 is 192.168.10.20/24, both in VLAN 10. On SW3, Gi1/0/1 connects to SW1, Gi1/0/2 connects to SW2 and Gi1/0/10 connects to PC B. Assume gigabit links using short-method cost 4 and SW2's bridge ID lower than SW3's.
Why ports can't forward straight away
Reason 1: building the tree takes time. Choosing a root, comparing costs and choosing roles all happen through BPDUs. That exchange does not complete everywhere at exactly the same instant. If ports forwarded before a safe topology was established, a broadcast could loop before STP had chosen which ports to block:
Device key: SW1, SW2, SW3 (switch) · PC A, PC B (computer)
Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.
- 1. The switches are still agreeing on a root… No port is blocked yet.
- 2. …when PC A sends a broadcast. If every port were already forwarding…
- 3. …it would loop. Even a few seconds of looping can overload the switches and upset the network. Port states stop this from happening.
Reason 2: old information can remain in use. A BPDU (Bridge Protocol Data Unit) carries the control information used to select the tree. After a failure, another switch can still hold an older record. Classic STP uses timer-based safeguards to allow information to propagate and age before opening a new path. It does not obtain a confirmation from every switch that every database is current. RSTP later introduced faster agreement mechanisms for suitable links.
Blocking, listening, learning, forwarding
| State | Type | Forwards frames | Learns MACs | BPDUs | Duration |
|---|---|---|---|---|---|
| Blocking | Stable | No | No | Receives control information | While redundant |
| Listening | Transitional | No | No | Sends & receives | 15 s |
| Learning | Transitional | No | Yes | Sends & receives | 15 s |
| Forwarding | Stable | Yes | Yes | Sends & receives | Ongoing |
| Disabled | Not participating | No | No | None | Until enabled and the link is operational |
- Disabled: administratively shut down or otherwise not operational for participation. It has no active user forwarding path.
- Blocking: does not forward user frames or learn their source MAC addresses. It can receive BPDUs and remain blocked indefinitely while that path is redundant.
- Listening: a root or designated port is moving towards forwarding. It processes control information but still does not learn source MAC addresses from user frames.
- Learning: learns source MAC addresses from arriving user frames but does not forward those frames. This can reduce unknown-unicast flooding when forwarding starts; it does not guarantee that every destination is already known.
- Forwarding: can forward eligible user frames and learn their source MAC addresses. Control processing continues. BPDU transmission details depend on the role and protocol, not just this state.
A transition to non-forwarding does not need the two forward-delay waits. Opening a new classic-STP path is the operation that needs the listening and learning checks.
Watch a classic-STP port prepare to forward
These illustrative Cisco PVST+ snapshots start after SW3 has selected its roles, not at an exact time measured from pressing a power button. Default forward delay is 15 seconds, VLAN 10 uses classic STP, and these example ports do not use PortFast. Boot time and BPDU arrival can add delay before this sequence starts.
SW3#show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 24586 Address 0200.0000.0001 Cost 4 Port 1 (GigabitEthernet1/0/1) ... Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Root LIS 4 128.1 P2p Gi1/0/2 Altn BLK 4 128.2 P2p Gi1/0/10 Desg LIS 4 128.10 P2p
SW3#show spanning-tree vlan 10 Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Root LRN 4 128.1 P2p Gi1/0/2 Altn BLK 4 128.2 P2p Gi1/0/10 Desg LRN 4 128.10 P2p
SW3#show mac address-table dynamic vlan 10 Mac Address Table ------------------------------------------- Vlan Mac Address Type Ports ---- ----------- -------- ----- 10 0200.0000.000a DYNAMIC Gi1/0/1 10 0200.0000.000b DYNAMIC Gi1/0/10
SW3#show spanning-tree vlan 10 Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi1/0/1 Root FWD 4 128.1 P2p Gi1/0/2 Altn BLK 4 128.2 P2p Gi1/0/10 Desg FWD 4 128.10 P2p
Hello, max age and forward delay
| Timer | Default | What it controls |
|---|---|---|
| Hello | 2 s | How often the root sends BPDUs. Other switches pass them on out of their designated ports. |
| Max age | 20 s | Maximum permitted age of stored configuration information; received message age has already used part of this allowance. |
| Forward delay | 15 s | Time spent in listening, and again in learning |
A missed BPDU does not necessarily invalidate stored information immediately. If its age reaches max age without a valid refresh, the switch throws away that information and works everything out again: who the root is, which port is its root port, and which ports are designated.
In the converged classic tree, the elected root bridge's timer values are advertised and adopted by the other participating switches. Each switch also has locally configured values that matter if it later becomes root. The defaults were designed around bounded network-diameter assumptions, not an unlimited chain of switches. Timer tuning needs the complete design and parameter relationships; do not shorten a single value to make a lab look faster.
RSTP improves the transition mechanisms rather than simply setting every timer to zero. Its rapid operation depends on neighbour compatibility, point-to-point or shared link behaviour and edge status. A migration needs planning; changing the spanning-tree mode can affect the whole switch.
Thirty seconds or fifty: how long recovery takes
The table is a classic-STP calculation using default timers, a usable replacement path and no acceleration features. It illustrates transition work, not a recovery-time guarantee.
| Situation | Waits for | Total |
|---|---|---|
| Selected non-edge port begins opening, or direct link loss selects a replacement | Listening 15 + learning 15, after selection | About 30 s for those stages |
| Stored information must age out before the replacement is selected | Remaining age allowance, then listening 15 + learning 15 | Commonly illustrated as up to about 50 s |
The next lesson shows an indirect failure step by step. PortFast, covered in its own lesson, removes the wait for end devices. RSTP (the Rapid Spanning Tree lessons) can use rapid agreement and alternate-port transitions instead of the full classic wait. Legacy neighbours and other conditions can still require slower handling.
Short lab: observe states without tuning timers
Use an isolated Cisco IOS/IOS XE lab that is already running classic PVST+ for VLAN 10, with SW3 Gi1/0/1 towards SW1 and Gi1/0/2 towards SW2. Keep the original STP and guard settings. Verify that the inter-switch uplink is not an edge/PortFast port. If the image runs RSTP, observe its actual states instead of changing a live switch merely to reproduce this table.
show spanning-tree summary
show spanning-tree vlan 10
configure terminal
interface GigabitEthernet1/0/1
shutdown
end
show spanning-tree vlan 10SW3 only, isolated lab. Record the original roles and timers first. A verified direct root-port shutdown lets you observe the replacement path without disabling loop protection.
Watch Gi1/0/2 as the protocol selects it towards SW2 and permits it to forward. Note when listening, learning and forwarding appear, and compare with the reported timers. Test PC A to PC B after convergence. Restore Gi1/0/1 with no shutdown, verify the original roles return, and leave the original timers unchanged. Packet loss includes more than the state timers, so record observations rather than declaring an exact recovery time.
Test yourself on states and timers
In which state does a port learn MAC addresses but still not forward frames?
Classic STP selects a redundant port to remain non-forwarding. Must it complete listening and learning before it can be blocked?
In a simplified classic STP case, old information has almost the full 20-second max-age allowance left. A replacement then spends 15 seconds listening and 15 learning. What total does this illustrate?
Sources: Cisco STP timers and message age; Cisco RSTP state and transition differences. Commands and snapshots are illustrative, not captures from a tested switch image.