Spanning Tree Port States

Hi Chris,

The output of a non-root bridge will be the same if you connect a new cable, it will go through the listening > learning > forwarding states. It might be interesting though to look at an interface that is currently in blocking mode.

Just take two switches, enable the debug I did and take a look…good exercise :slight_smile:

Rene

Hi Rene,
In blocking port state,switch not able to receive and transmit any BPDUs,then How blocking port state move to listening state.

--Ravi

Ravi,
In a Blocking state, the switch does receive BPDUs. In fact, it is the act of receiving inferior BPDUs that keeps the state as Blocking. Should an interface stop receiving BPDUs, then it will transition into a Listening-Learning-Forwarding state.

1 Like

Hi Andrew,
Thanks for clearing concept.

-Ravi

Hlw Rene,

Root Port , Designated port will send & Receive BPDU right ??

Alternate Port will send and receive BPDU ???

How a Alternate port know , It have to move Listening, Learning , Forwording after Root port down as per attached Topology on switchC.

br/
zaman

Mohammad,
The concept of an Alternate port was introduced with Rapid Spanning Tree. This feature takes over what the traditional (802.1 D) spanning-tree enhancement of “uplink-fast” used to do. The Alternate port serves as a “hot-standby” for a switch’s Root Port, but Alternate Port is considered to be in a Discarding state (Discarding is the RSTP term for Blocking, Listening, and Disabled for spanning-tree).

This means that an Alternate port can receive BPDUs but will not send them. As soon as a Root Port fails, the Alternate Port will immediately transition to forwarding, skipping the Learning state (there is no such thing as “Listening” in Rapid Spanning Tree).

You are correct that Root and Designated ports both send and receive BPDUs.

1 Like

OMG,This is the easiest way to understand the stp concept and ports state.

1 Like

Hi Rene,

q1) What is the difference between a port in BLOCK and LISTEN state ? LISTEN does send and receive but BLOCK only receives BPDUs ?

q2) I saw an amber light on a port in BLOCK state, but if we have PVST and we configure different root bridges, how does the switch
reflect a ND port that is BLOCK in 1 VLAN but not BLOCK in another VLAN ?

q3) “Only a root or designated port will move to the listening state”
what is the state for the interfaces/ports before everything (e.g. root bridge, root port, designated port) are determined ? – still listening ?

Regards,
Alan

Hi Alan,

  1. In the blocking state, the switch only receives BPDUs but does not send them. In the listening state, we send and receive BPDUs.
  2. If it's an access interface then it will be amber. Trunk interfaces will always have a green led (since you can have more than one VLAN).
  3. When you first enable the interface, it will start in the listening state.

Rene

Hello Rene

In your post you mentioned ports in block mode take the 20+15+15 before forwarding in some cases. Could you tell me in which case cause i was trying to simulate but i only got lis->lear->for states and not Max age time.

Thanks in advance.
Jose

Hello Jose

There are two situations which require a switch to begin STP convergence procedures. The direct and indirect link failures. Let’s take a look at both:

  1. A direct link failure is when a switch detects a loss of carrier on its own port and immediately declares the port as disconnected. Take a look at the following figure:

image

The STP is converged and Port B is in blocking state. Imagine Port A goes down. The bridge no longer detects a carrier on that port and immediately causes Port B to go through the STP procedure going into the Listening and Learning states for a total of 15+15=30 seconds. Convergence time in this case is at 30 seconds.

  1. An indirect link failure is when a link goes down on another switch. This is not immediately detected. Take a look at the following figure:

image

In this figure, SW1 is the Root Bridge and Port B on SW3 is the blocked port. Also, assume SW2 has a better Bridge ID than SW3. Imagine that Port C on SW2 goes down. How will Port B on SW3 react? Let’s go through the steps.

  • SW2 will no longer be receiving BPDUs from SW1 and will declare itself root bridge.
  • SW2 will start advertising new BPDUs to SW3 telling SW3 that it is root bridge. SW3 will ignore them because SW1 BPDUs it’s still receiving are superior.
  • SW3 will keep the information from the previously received BPDUs on Port B for 20 seconds which is the blocking timer
  • Once this timer is expired, Port B will begin considering the BPDUs in the Listening state and will begin relaying SW1’s BPDUs to SW2 since they are superior
  • Then SW2 will detect the better information it is receiving on Port D and will cycle the port through Listening and Learning.
  • Both switches (2 and 3) will eventually place their ports in the forwarding states and connectivity will be recovered.

In this case, the total time is 20+15+15=50.

The 50 second convergence time is more often quoted for STP because it is the absolute longest time that you may have to wait for STP to fully converge.

I hope this has been helpful!

Laz

2 Likes

Thanks so much Laz.

Jose

1 Like

Hi Rene and staff,
you can tune spanning-tree timers (delays)

  • forward timer between 4 and 30s (15s by default) used as listening delay and learning delay
  • hello time between 1 and 10 s (2s by default)
  • max age between 6 and 40 s (20 s by default)

In blocking mode you have to wait 20 s to forward to listening state: I did not find how to tune this delay

Is it that the blocking delay is equal to max age: this would be logic
Please could you confirm ?
Regards

Hi Rene and staff,
reading carefully the last Laz’s post (in the case of indirect failure), i should have done it before my previous post (i apologize)

it seems that the delay in blocking mode is not 20s, but result from the formula

blocking delay = max age - BPDU age
(with max age = 20s by default)

BPDU age starts at 0 from the root, and is incremented by 1 on each downstream SW

So, max age = 20s by default (and you can tune it between 6 and 40), but you cant tune blocking delay because it results from the formula

Yet, this is why Laz says the absolute longest time is 50 s, because the absolute longest time is 20s for the blocking mode
Please could you confirm ?
Regards

Hello Dominique

Yes, tuning the max-age will indeed tune the blocking delay… so what you describe in your post is correct.

I found the following document useful to further understand the intricacies of STP timers, I hope you find it useful.

I hope this has been helpful!

Laz

Hi Rene,

The port which is in blocking state has to wait for 20 seconds , any specific region behind this ?

Hello Pradyumna

The blocking state timer (and all STP timers) are configured in such a way so that the formation of a layer 2 loop can be avoided.

In the lesson, Rene states:

When an interface is in blocking mode and the topology changes, it’s possible that an interface that is currently in blocking mode has to move to the forwarding state. When this is the case, the blocking mode will last for 20 seconds before it moves to the listening state.

As soon as a blocked port receives information that the topology is changed, via BDPUs (a blocked port will only receive and process BPDUs), and it too may need to change, it doesn’t immediately go into the listening state but waits 20 seconds. This delay is used to allow the other areas of the STP topology to stabilize before changing to the listening state, and reacting to them.

The timers (blocking 20, listening 15, learning 15) have been defined after experimentation and research, and are based on the optimum values for most network topologies. Remember, that for this lesson, Rene is speaking about the original STP implementation of IEEE 802.1D defined in 1990 (thirty years ago!!), an implementation that is great for teaching network fundamentals, but one that should not be used in modern networks.

I hope this has been helpful!

Laz

1 Like

Q-1:- What i understood, kindly correct me if i am wrong .
If a root and designated port breaks then the switch will take only 30sec to make the block port as root port …
But when it take 50 sec.?

How TCN and Configuration BPDU transited between the switches ??
(SW1=>sw2=>Sw3)
Will sw1 will send the BPDU to sw3 ?, if it will send then what sw-2 will modify in that bpdu before it sends to sw3 ?..

Hello Narad

If a port is down, and it is just plugged in, then it will take 50 seconds because it goes blocked for 20, listen for 15, and learning for 15 = 50 seconds. Even if there is a topology change, such as when a root or designated port fails, any ports that were in the blocking state will remain in that state for 20 seconds before going to listening and learning. Therefore the total amount of time would still remain 50 seconds before forwarding…

Take a look at this lesson:

I hope this has been helpful!

Laz

Thanks Sir for your help…!!

1 Like