In recent blogs I’ve talked about port roles which are designated and root ports. But today we are going to talk about port states which are blocking, listening, learning, and forwarding. Every port, no matter which role they are, is either blocking or forwarding. During a topology change, ports can be seen listening or learning. In order for me to talk about them, I need to make it clear what a transitional state is versus a stable state. A stable state is the state of the STP topology where the network has fully converged. This is the state where the port states have been determined, the ports are either forwarding or blocking and their roles have been designated as either designated or root ports. In this state, the root bridge has been elected and user data traffic is actually transmitted across the network while redundant paths are in a blocking state until a topology change serving as a backup. In a stable state, BPDUs are continually being propagated at the hello interval, and the state will remain a stable state until a topology change occurs such as a link going down, or a switch being added to the network. A transitional state is a state where a port is going through the process from blocking to forwarding. A port will enter a transitional state when it first comes online, or when a topology change occurs. During a transitional state, a port will go from blocking, to listening and then to learning. Listening and learning are the two main states that are transitional and during these states, the ports are determining whether a port should be forwarding or blocking. Each transitional state follows the forward delay timer, which is about 15 seconds per state in Cisco switches. This allows the switch adequate time to decide on the new topology.
Blocking – The blocking state is a stable state that remains as a backup or a redundant path. During this state the port is listening to BPDUs and in most cases will not be sending any BPDUs. The blocking state still listens to BPDUs in order to know when a topology has changed so it can calculate its new role and state. The blocking state will neither learn any MAC addresses nor forward any user data. It simply discards any traffic that comes its way, while keeping listening for BPDUs. Its purpose is to prevent layer 2 loops while still having a backup if anything fails or changes by logically blocking redundant links.
Listening- When a topology changes like a switch being added to a network or a link failing, a port will transition from blocking to listening. A port can also be in a listening state when the link first comes online if it is a candidate for forwarding.In this state, the port will be sending and receiving BPDUs and the switches will determine and calculate whether a port should be forwarding or blocking. If the port is chosen to be designated or root port the port will then transition to learning. If the port will cause a layer 2 loop then the port will go back to blocking. In the listening state, the port is neither forwarding user data frames or learning any MAC addresses and will last a total of the forward delay timer which is 15 seconds on most Cisco switches.
Learning– The next state after listening is learning and is also a transitional state. In this state the port has assumed that it will become a forwarding port either being a designated or root port. Since the port will be most likely forwarding, this state will be learning MAC addresses while they receive frames but will not be forwarding them. This state is also the interval of the forward delay timer which is 15 seconds on Cisco switches and is vital for preventing unnecessary flooding because of an empty MAC address table. In the learning state, it will still listen and forward BPDUs. This state’s sole purpose is to populate the MAC address table, so that traffic can be intelligently forwarded and to avoid a giant burst of unknown unicast flooding as soon as the topology has fully converged.
Forwarding- The last state after the learning state is the forwarding state which is a stable state. This state means that it is fully safe for the port to forward traffic and will be either a designated or root port. The switches have all come to agreement that the ports that are forwarding will not cause any layer 2 loops. In the forwarding state, the port listens to and sends BPDUS. In this state user data frames are actually forwarded on top of MAC address learning as well for intelligent switching.
Convergence- Because of the transitional states that STP has to go through, convergence can take from 30 seconds to 50 seconds. If the switch is first being enabled it will take roughly 30 seconds (15s Listening and 15s Learning). If an STP is going through a topology change because of absence of BPDU it can take up to 50 seconds (20s Max Age timer + 15s Listening + 15s Learning).
Leave a Reply