Before a switched network running Spanning Tree Protocol converges, a decision must be made about the forwarding state of each interface to prevent loops. In an effort to transition from a Blocking state to Forwarding as safely as possible, Spanning Tree places ports into a series of states which cautiously inform the switch if the individual ports can forward frames loop-free.
The states are listed in the table below, beginning with Blocking, then Listening, Learning, and finally Forwarding. The port stays in each transitory state for the length of the ForwardDelay timer (15 seconds by default).
802.1D STP Port State
RSTP Port State
The disabled state occurs when a port is administratively shut down.
Once a port is enabled, it goes into the Blocking State. The port is very limited – ports in the Disabled State do not forward or receive frames and do not learn any MAC addresses. The port does accept BPDUs from neighbor switches.
After Blocking, a port transitions to Listening State. As the name implies, a port in the Listening State listens for BPDUs (as well as starts to send them). This bidirectional BPDU communication allows the port to participate in the Root Bridge election process.
Ports in the Listening state still cannot send or receive data frames, meaning MAC learning has not started.
Ports entering the Learning state begin to learn MAC addresses from the data frames they receive. The learned MAC addresses populate the switch’s MAC address table (aka CAM table). Ports in the Learning state also continue to send and receive BPDUs.
After the Learning state is complete, ports transition to the Forwarding state. Ports in the Forwarding state learn MAC addresses and send and receive both BPDUs and data frames. It is only in the Forwarding state that ports start to actually send data frames.
STP Port State Verification
Verifying the current STP state of an interface can be done using the show spanning-tree interface command.