In my previous post I described how STP works in normal circumstances. Each 2 seconds root switch sends BPDU Hello packets on all of its ports (since they are all designated) with cost to reach the root which is equal to 0, with root ID (RID) equal to root switch ID and bridge ID equal to ID of the sending switch, which in this case is the same as RID. When non-root switch receives Hello BPDU from its root port (RP) it adds its cost to reach the root, changes BID and send further. Now, what happens if a switch’s link with the shortest path to reach the root fails? STP starts to converge.
STP convergence process
Switch waits for the Max Age time before considering link as failed. Max Age timer is equal to 10 times of Hello timer. And time between Hellos is usually 2 seconds. First step in convergence process is re-evaluating a root switch. If the original root switch still has connection to the network, then the switch in question will receive Hello BPDU from it and nothing will change. Otherwise switches will elect a new root.
Next, switch needs to choose new RP. It’s simple. Look through costs to reach the root of all available links and choose the cheapest. Additionally, switch selects which ports are now DPs.
After the port roles are identified, switch transition RP from Blocking state to Forwarding. However, it implies two transitional states: Listening and Learning. Listening state is 15 seconds and is necessary for old MAC table entries to timeout. Otherwise temporary loops are possible. In Learning state switch begins to gather MAC addresses from received packets (for the same 15 seconds). In Listening and Learning states switch do not forward packets. After both transitional states have been finished, port is transitioned to a forwarding state. So during STP convergence, port can be inaccessible for 50 seconds.
RSTP convergence
The key difference between STP and RSTP is rapid convergence of the latter. Hence the name Rapid STP. First of all, RSTP waits for 3 times of Hello timer. So it’s 6 seconds instead of 20. Apart from that, when RP link fails RSTP block all its ports, eliminating loops. It means that Listening state is not needed in this case, which saves us another 15 seconds. And in Learning phase switch sends RSTP proposal message to the neighboring switch right away. And quickly receives agreement, which implies that link is established and is in Forwarding state. As a result, RSTP convergence time is shortened from 50 seconds to 1-10 seconds timeframe.
Tags: BID, blocking, BPDU, convergence, designated port, DP, forwarding, Learning, Listening, Max Age, Rapid Spanning Tree Protocol, RID, root port, RP, RSTP, Spanning Tree Protocol, STP, timer
May 21, 2013 at 10:01 am |
very nice article sir….. thanx
March 17, 2014 at 9:40 am |
Superb short notes on STP and RSTP. Nice work
March 17, 2014 at 10:28 am |
Thanks, guys.
July 3, 2016 at 11:52 am |
[…] If you want to know more about how STP works, you can read a few of my previous blog posts on STP here and here. […]
July 19, 2019 at 5:56 pm |
This is wrong RSTP does not use timers, it uses proposals. Testing this in a lab downtime using fping -c -t 10(ms) is nearly undetectable. Timers are for backwards compatibility with STP.
November 2, 2019 at 8:50 pm |
Hi Stephen, I think you’re right. This was probably the worst case example for the cases, where you have a mix of RSTP and STP in your network. Keep in mind this was written in 2012.