Spanning Tree Protocol : STP Root Bridge Election Procedure
Today I am going to talk about the STP (Spanning tree) Root bridge selection procedure. It is one of the most important topic in the Switching and you guys should know about it. I am taking the case where we have three different switches with the MAC addresses and i will talk about how these switches communicate with each other to finally get the root bridge.
What is the purpose of the Root Bridge ?
The idea is to have all the communication from source to destination from the root bridge so that we can avoid the loop in the switched LAN network. So before starting the communication in the switched network we need to setup a root bridge.
Spanning-tree election occurs when a switch declares itself a root switch. That usually happens when the switch is only coming up online and starts sending out BPDUs out all of its active ports.
If the switch receives a BPDU on one of its ports, it compares that BPDU to its own BPDUs and if that BPDU is inferior, the switch keeps its root status and continues to send out BPDUs each hello interval (2 secs). The other switch will also compare the received BPDU and will find it superior to its own and will stop sending its own BPDUs, recognizing other switch as a root.
Fig 1.1- Root Bridge Selection |
Imagine that NDNA Sw-1 and NDNA Sw-2 both boot up at the same time, while NDNA Sw-3 is turned off. NDNA Sw-1 starts sending out BPDUs, presuming it is the root. So does NDNA Sw-2 and once they both receive each other's BPDUs, NDNA Sw-2 finds out that because NDNA Sw-1's BID is better, it is the root switch and designated switch on the segment between NDNA Sw-1 and NDNA Sw-2.
NDNA Sw-1 finds out that NDNA Sw-2's BPDU is inferior, so it is still the root. At this point, NDNA Sw-2 stops sending its own BPDUs and just starts forwarding NDNA Sw-1's BPDUs out all of its designated ports.
Few minutes later NDNA Sw-3 boots up. It starts sending out its own BPDUs, claiming to be the root. NDNA Sw-1 and NDNA Sw-2 both compare the BPDU from NDNA Sw-3 to the BPDUs stored on the ports facing it.
They both find NDNA Sw-3's BPDUs to be superior and thus NDNA Sw-3 is the new root. Now the topology changes and NDNA Sw-1 and NDNA Sw-2 select their ports facing NDNA Sw-3 as their root ports.
There is a bit more to the whole process, but this is it in the nutshell. The switches don't run root election every 2 seconds, they send out BPDUs (root does) every 2 seconds.