Home > STP Root Port Election Tutorial

STP Root Port Election Tutorial

In this tutorial we will learn in detail how Spanning Tree Protocol (STP) elect root port after choosing a root bridge.

Root port is the port that is closest to the root bridge, which means it is the port that receiving the lowest-cost BPDU from the root. Every non-root bridge must have a root port. All root ports are placed in forwarding state.

Spanning Tree Root Port election process (notice that it is Root Port election, not Root Bridge election process) in a Non-Root Switch includes the following steps:
1. Lowest accumulated cost on interfaces towards Root Bridge
2. Lowest Sender Bridge ID
3. Lowest Sender Port ID (= Port Priority + Port Number) (so port priority is compared first then to Port number)

Let’s see an example below:

Root_port_election_topology.jpg

Note: In fact the MAC address should be something like “00:00:00:00:00:01” but we write “01” in short. Same for “02”, “03” and “04” MAC addresses.

According to the topology, SW1 has the lowest MAC address “01” (hence lowest bridge ID because of same default Bridge Priority 32768) so it will become the Root Bridge. Now we will see which port will become Root Port in each non-root bridge (SW2, SW3, SW4 and SW5).

Root Port election is based on the port having lowest accumulated cost to the Root Bridge SW1 (step 1 above). Here is how to calculate the path cost: SW1 (root bridge) sends BPDU with cost of 0 to other directly connected switches. When a switch receives this BPDU, it adds its own port cost to this value. For example, SW2 has two ways to reach SW1:

+ SW2 – SW1: path cost is 0 + 4 = 4
+ SW2 – SW4 – SW3 – SW1: path cost is 0 + 4 + 4 + 19 = 27

Note: The path cost is calculated as follows:

10 Mbps = 100
100 Mbps = 19
1 Gbps = 4
10 Gbps = 2

Therefore SW2 will choose the first path so the port that is directly connected to SW1 on SW2 will become root port.

Same on SW3, the port that is directly connected to SW1 will be chosen root port.

On SW4, there are two ways to reach SW1:

+ SW4 – SW2 – SW1: path cost is 0 + 4 + 19 = 23
+ SW4 – SW3 – SW1: path cost is 0 + 4 + 4 = 8

Therefore SW4 will choose the port connects to SW3 root port. Now all the root ports have been elected:

Root_port_election_topology_RP_elected.jpg

We found all the root ports on each switch with only step 1 in the three steps above so it is easy. In the next example we will change the topology a bit with all 1Gbps connections and add SW5 to make the election harder:

 

Root_port_election_topology2.jpg

The root ports on SW2 and SW3 are unchanged. But on SW4 both path costs to SW1 are now equal so we need to use step 2 “Lowest Sender Bridge ID”. SW4 will compare BPDU sent from SW2 & SW3 and choose the lower Bridge ID.

In this case SW2 MAC address of 02 is smaller than SW3 MAC address of 03 (while the switch priorities are equal) so SW4 chooses the port connected to SW2 the root port.

How about SW5 root port? SW5 has two paths to reach SW1 but they have same path cost. Also both ports connected to SW4 so the Switch ID value is the same too. Therefore we have to use step 3: the lowest Sender Port ID wins. In this case SW4 has two ports fa0/1 and fa0/2 so fa0/1 wins and SW5 will choose the port connected to fa0/1 of SW4 the root port.

Root_port_election_topology3.jpg

In this topology we have to use up to step 3 as the tie-breaker.

Comments (15) Comments
  1. Robert Smith
    January 9th, 2020

    Can someone please send me the latest 200-125 test dump to {email not allowed} – greatly appreciated

  2. Robert Smith
    January 9th, 2020

    email is rshawn027 (dot) g mail (dot) com

  3. Anonymous
    January 20th, 2020

    Please, would anyone send me the latest 200-125 and 100-105 test dumps, my G mail
    ( ogirimayahaya1 at gmail.com

    I appreciate

  4. Ranvir
    February 2nd, 2020

    Can anybody send me latest 200-125 dumps, I got my exam on 13 Feb. plesae share @{email not allowed}
    I will really appreciate this.
    Thank you

  5. Greg
    February 3rd, 2020

    Greeting alls,
    Got exams on the 14th February, someone please share with me the latest dumps (email: hartgregory10@ gmail. com)
    Heartily thankful.

  6. Ghost
    February 12th, 2020

    Exam on 22 Feb , please if possible send latest 200-125 dumps , {email not allowed} , would be most appreciated.

  7. Ghost
    February 12th, 2020

    Exam on 22 Feb , please if possible send latest 200-125 dumps , dcusack9@ gmail .com , would be most appreciated.

  8. Ghost
    February 13th, 2020

    Exam on 21 Feb , please if possible send latest 200-125 dumps , morenonegrito@ hotmail .com , would be most appreciated.

  9. Kimochi
    January 4th, 2021

    Hi I passed CCNA with 97% thanks for this. Can someone reference website for DCCOR?

  10. Sibonelo
    August 19th, 2021

    I’m interested

  11. Diego Flores
    November 23rd, 2021

    There’s a mistake on the type of connection of the last 2 images, SW2 – SW4 should have a 1Gbps instead of 100Mbps.

  12. 9tut
    November 26th, 2021

    @Diego Flores: The links 100Mbps are correct. They have path cost of 19.

  13. Penil Coutz
    January 3rd, 2022

    I need VCE tests for HPE6-a82 please dm me penil @ leapit. co. za

  14. Yurr
    September 8th, 2022

    Yeah last two images are supposed to all be 1gbps connections

  15. 9tut
    September 11th, 2022

    @Yurr: Thank you for your detection, we updated last two images.

Add a Comment