STP Port States:- Blocking, Listing, Learning, and Forwarding

STP (Spanning Tree Protocol) is a layer two protocol. It finds and removes the switching loops from the network. A switching loop occurs when two switches have more than one direct connection. To remove loops from the network, STP starts all ports through four states: blocking, listening, learning, and forwarding. During these states, the STP running switch learns the network topology, selects the root and designated ports, and disables the reaming ports to remove loops.

STP Blocking state

When we start an STP running switch, it does not enable its ports immediately. It keeps all ports in the blocking state for the first 20 seconds. In this period, it accepts and processes only BPDU messages. A BPDU contains the switch's priority ID, MAC address, and other necessary information. Switches use this information to elect the root bridge. Besides the BPDUs, it drops all other frames. From the incoming BPDUs, it learns the network topology and determines the ports that will work as the root ports, designated ports, and blocked ports. After twenty seconds, only the root port and designated ports move into the next state. The remaining ports stay in this state.

STP Listening state

In this state, the switch double-checks the network topology to confirm that the ports it selected as root and designated ports do not cause any loop in the network. Ports remain in this state for the next fifteen seconds. During this state, ports listen and process only BPDUs. They do not process the user frames.

STP Learning state

In this state, ports start processing user frames. They use incoming frames to build the CAM table. However, they do not forward the incoming frames. Ports remain in this for another fifteen seconds.

STP Forwarding state

It is the final state of the STP operation. It is also called convergency. Only the root and designated ports reach this state. STP disables all remaining ports. In this state, ports listen and process both BPDUs and user frames. It uses BPDUs to monitor the network.

STP port states

If any change occurs in the network, it repeats the same process on the affected ports.

STP Disabled State

The STP disabled state is a unique port state. STP uses this state for all ports not participating in the STP operation. Many reasons could prevent a port from participating in the STP operation. For example, an administrator may manually remove a port from STP operation for security reasons, the cable connected to the port may be unplugged, or the port may have no connection. In this case, STP does not send or receive any BPDUs.

ComputerNetworkingNotes CCNA Study Guide STP Port States:- Blocking, Listing, Learning, and Forwarding