PacketLab
Switching · Spanning Tree

Port states

Separate data forwarding, source learning and control processing in classic STP.

Independent lab examples; selected output and frame summaries are illustrative. Port naming and command support vary by switch and software release.

Network and objective

Classic PVST+ is used to expose original STP behavior; rapid-PVST+ and MST are separate lessons.

Use three fresh isolated switches with Gigabit trunks: SW1 Gi1/0/23 ↔ SW2 Gi1/0/23; SW1 Gi1/0/24 ↔ SW3 Gi1/0/24; SW2 Gi1/0/24 ↔ SW3 Gi1/0/23. Both VLANs10/20 exist on every switch. Baseline SW1/SW2/SW3 priorities are4096/8192/12288, with short costs and no extra links. Start independently from the included baseline for each lesson; subsequent repair snippets apply to the named device.

Ethernet switchingIllustrative topology
Physical links are solid; device roles and relevant links are labeled.
Physical links are solid; device roles and relevant links are labeled.

How it works

Classic STP distinguishes blocking, listening, learning, forwarding and disabled. Blocking and listening do not learn ordinary source addresses; learning populates the MAC table but does not forward ordinary user data. Forwarding performs both.

Default forward delay is15seconds, so a timer-driven listening→learning→forwarding transition commonly takes30seconds after selection. A stale path may first require max-age handling. These are scoped classic timers, not a universal outage duration and not the rapid protocol’s proposal/agreement process.

Configure or inspect

SW1

vlan 10
vlan 20
spanning-tree mode pvst
spanning-tree pathcost method short
spanning-tree vlan 10 priority 4096
spanning-tree vlan 20 priority 4096
interface range GigabitEthernet1/0/23 - 24
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 switchport nonegotiate
 no shutdown
exit

SW2

vlan 10
vlan 20
spanning-tree mode pvst
spanning-tree pathcost method short
spanning-tree vlan 10 priority 8192
spanning-tree vlan 20 priority 8192
interface range GigabitEthernet1/0/23 - 24
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 switchport nonegotiate
 no shutdown
exit

SW3

vlan 10
vlan 20
spanning-tree mode pvst
spanning-tree pathcost method short
spanning-tree vlan 10 priority 12288
spanning-tree vlan 20 priority 12288
interface range GigabitEthernet1/0/23 - 24
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 switchport nonegotiate
 no shutdown
exit

Verify the result

Illustrative output · selected lines
Constructed classic port transition after path selection:
0 s     listening   learn=no   user forwarding=no
15 s    learning    learn=yes  user forwarding=no
30 s    forwarding  learn=yes  user forwarding=yes
SW3#show spanning-tree vlan 10
Gi1/0/24  Root FWD 4
Gi1/0/23  Altn BLK 4

The transition sequence explains behavior; it is not a captured debug trace. A link being physically up can precede ordinary forwarding.

Failure and recovery

A host DHCP attempt may start while its non-edge port is still transitioning. Use an appropriate edge-port setting for a genuine endpoint rather than disabling STP globally.

For an actual endpoint port, verify there is no downstream bridge and apply the scoped PortFast policy from the next lesson.

Further reading

Key Takeaways

  • Classic port role and port state are separate.
  • Learning does not forward user data.
  • Listening does not learn ordinary sources.
  • Classic delay timers are not rapid-protocol guarantees.
  • Physical up can precede forwarding readiness.

Port states Quiz

Six questions · four options each · select one answer per question. Submit all answers to see your score and explanations.

1. Which classic state learns but does not forward?
2. Does listening learn ordinary sources?
3. What is the default forward-delay interval here?
4. Do two such intervals imply every outage lasts30seconds?
5. What does FWD indicate?
6. Should delayed host access be fixed by disabling STP?