Search

How Spanning Tree Protocol (STP) select Root Port, Spanning Tree Root Port selection

If a Switch has multiple paths to reach the Root Bridge (Root Switch), it must select one path and the associated port as the Root Port. Following are the different steps for selecting the Root Bridge (Switch).

Spanning Tree Root Port selection process in a Non-Root Switch involves the following steps.

  1. Select the port connected to the path with the lowest accumulated Spanning Tree Path Cost to the Root Bridge (Root Switch) as the Root Port, when a Non-Root Switch has multiple paths to reach the Root Switch.
  2. If multiple paths are available to reach the Root Bridge (Root Switch) with the same accumulated Spanning Tree Path Cost in a Non-Root Switch, select the port connected to the neighbor switch which has the lowest Switch ID value as the Root Port.
  3. If all the multiple paths go through the same neighboring switch to reach the Root Bridge (Root Switch), Non-Root Switch will select the local port which receives the lowest port Spanning Tree Port Priority value from neighbor Switch as the Root Port.
  4. If the received Spanning Tree Port Priority value values are the same between the connecting ports to reach the Root Bridge (Root Switch), Non-Root Switch will select the port which receives the lowest physical port number from neighbor Switch as the Root Port. This is the last tie breaker.

1) Select the port connected to the path with the lowest accumulated Spanning Tree Path Cost to the Root Bridge (Root Switch) as the Root Port, when a Non-Root Switch has multiple paths to reach the Root Switch.

Spanning Tree Path with Best Cost

Above topology, omnisecu.com.SW4 has two paths to reach the Root Switch (omnisecu.com.SW1). Total Spanning Tree Path Cost to reach the Root Switch (omnisecu.com.SW1) via left path is 19+4 = 23 (19 is the Spanning Tree Cost for Fast Ethernet Link and 4 is the Spanning Tree Cost for Gigabit Ethernet Link) and the total Spanning Tree Path Cost to reach the Root Switch (Switch 1) via right path is 4+4 = 8 (4 is the Spanning Tree Cost for Gigabit Ethernet Link).

Therefore omnisecu.com.SW4 will select the port with least Spanning Tree Path Cost to reach the Root Switch (omnisecu.com.SW1) as its Root Port (which is marked as RP in omnisecu.com.SW4 in above diagram).

2. If multiple paths are available to reach the Root Bridge (Root Switch) with the same accumulated Spanning Tree Path Cost in a Non-Root Switch, select the port connected to the neighbor switch which has the lowest Switch ID value as the Root Port.

Spanning Tree Low Neighbor Bridge ID

Above topology, omnisecu.com.SW4 has two paths to reach the Root Switch (omnisecu.com.SW1). Total Spanning Tree Path Cost to reach the Root Switch (omnisecu.com.SW1) via left path is 4+4 = 8 (4 is the Spanning Tree Cost for Gigabit Ethernet Link) and the total Spanning Tree Path Cost to reach the Root Switch (omnisecu.com.SW1) via right path is 4+4 = 8 (4 is the Spanning Tree Cost for Gigabit Ethernet Link).

Above topology, both path has the same accumulated Spanning Tree Path Cost to reach the Root Switch (omnisecu.com.SW1). Now the omnisecu.com.SW4 will select the port connected to the Switch which has the lowest Spanning Tree Switch ID, as the Root Port. As shown in above topology, out of the two neighbour switches that can be used to reach the Root Bridge, omnisecu.com.SW2 has the MAC address 0000:0000:0002 and omnisecu.com.SW3 has the MAC address 0000:0000:0003.

Above topology, omnisecu.com.SW2 has the lowest MAC address (0000:0000:0002) and omnisecu.com.SW4 will select the port connected to omnisecu.com.SW2 as the Root Port (which is marked as RP in omnisecu.com.SW4 in above diagram).

3. If all the multiple paths go through the same neighboring switch to reach the Root Bridge (Root Switch), Non-Root Switch will select the local port which receives the lowest port Spanning Tree Port Priority value from neighbor Switch as the Root Port.

Consider the situation where multiple paths are available to reach the Root Bridge (Root Switch) with the same accumulated Spanning Tree Path Cost, and all paths go through the same neighbor switch to reach the Root Bridge. Now both the cases mentioned above are tie.

In this case, Spanning Tree Protocol will choose the local port which recieves the BPDU with lowest Spanning Tree Port Priority value from the neighbour switch as the Root Port. Default Spanning Tree Port Priority value value is 128 and you may change the Port Priority value in increments of 16.

Spanning Tree Low Port Priority

Above topology, omnisecu.com.SW5 has two paths with the same accumulated Spanning Tree Path Cost to reach the Root Switch (omnisecu.com.SW1) and both paths are are connected via omnisecu.com.SW4.

Fa0/24 port in omnisecu.com.SW4 is configured with a Spanning Tree Port Priority value of 16. omnisecu.com.SW5 will select its local port fa0/24 as the Root Port (which is marked as RP in omnisecu.com.SW5), because fa0/24 is the port which recieves the BPDU with lowest Spanning Tree Port Priority value from the neighbour switch omnisecu.com.SW4.

Click the below link to learn how to change the Spanning Tree Port Priority value.

4. If the received Spanning Tree Port Priority value values are the same between the connecting ports to reach the Root Bridge (Root Switch), Non-Root Switch will select the port which receives the lowest physical port number from neighbor Switch as the Root Port.

Consider the situation where multiple paths are available to reach the Root Bridge (Root Switch) with the same accumulated Spanning Tree Path Cost, and all paths go through the same neighbor switch to reach the Root Bridge. All the ports in the neighbour switch are configured with the same Spanning Tree Port Priority value. Now all the cases mentioned above are tie.

In this case, Spanning Tree Protocol will choose the port on the local switch, which recieves the BPDU with lowest physical port number from the neighbour switch as the Root Port. For example, on a 2960, that would be FastEthernet 0/1 or Gigabit 0/1.

Spanning Tree low interface number

Above topology, omnisecu.com.SW5 has two paths with the same accumulated Spanning Tree Path Cost to reach the Root Switch (omnisecu.com.SW1) and both paths are are connected via Switch 4. Both fa0/23 and fa0/24 ports are connected to fa0/23 and fa0/24 ports on omnisecu.com.SW4, which has the same Spanning Tree Port Priority value.

Now omnisecu.com.SW5 will select fa0/23 as the Root Port (which is marked as RP in omnisecu.com.SW5), because fa0/23 is the port on omnisecu.com.SW5, which recieves the BPDU with lowest physical port number from the neighbour switch, omnisecu.com.SW4. This is the last tie breaker.


 

Related Tutorials
• What is Broadcast Storm
• What is Layer 2 Switching loop
• What is Spanning Tree Protocol (STP)
• What is Bridge Protocol Data Unit (BPDU) frame
• Bridge Protocol Data Unit (BPDU) Frame Format
• What is a Root Bridge (Switch)
• What is a Root Port
• What are Port Cost, Port Priority and Path Cost Values
• How Spanning Tree Protocol (STP) select Root Port
• What is a Designated Port
• How Spanning Tree Protocol (STP) select Designated Port
• Difference between Root Port and Designated Port
• Spanning Tree Port States
• Topology Changes in Spanning Tree Protocol (STP)
• Spanning Tree Protocol (STP) Convergence
• What is Spanning Tree Protocol (STP) PortFast
• How to configure and verify Spanning Tree Protocol (STP) PortFast
• How to enable or disable Spanning Tree Protocol (STP)
• What is Rapid Spanning Tree Protocol (RSTP)
• Difference between Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP)
• Per-VLAN Spanning Tree (PVST) and Per-VLAN Spanning Tree Plus (PVST+)
• What are Spanning Tree Bridge Priority and Bridge ID values
• Spanning Tree Path Cost Value and How is Spanning Tree Path Cost Value Calculated
• Spanning Tree Port Priority and Port ID Values
• How to change Spanning Tree Bridge Root Priority value and What is Extended System ID
• How to configure Spanning Tree Protocol Root Primary and Root Secondary
• What is a Root Bridge (Root Switch)
• How to change Spanning Tree Port Priority Value
• How Spanning Tree Protocol (STP) select Root Port
• What is a Designated Port
• How Spanning Tree Protocol (STP) select Designated Port
• Difference between Root Port and Designated Port
• Spanning Tree Port States
• How BPDU is generated and How BPDU works
• Important Spanning Tree Protocol (STP) Timers and their default values
• How to Configure and Change Spanning Tree Protocol (STP) Default Timer-Values for hello timer, forward delay timer and max age timer
• Topology Changes in Spanning Tree Protocol (STP)
• Spanning Tree Protocol (STP) Convergence
• Where to place the Spanning Tree Protocol Root Switch (Root Bridge)
• Spanning Tree Protocol (STP) UplinkFast, Backbone Fast and Portfast
• What is Spanning Tree Protocol (STP) Uplink Fast
• What is Spanning Tree Protocol (STP) Backbone Fast
• What is Spanning Tree Protocol (STP) PortFast
• How to configure and verify Spanning Tree Protocol (STP) PortFast
• How to enable or disable Spanning Tree Protocol (STP)
• What is Rapid Spanning Tree Protocol (RSTP)
• Difference between Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP)
• Per-VLAN Spanning Tree (PVST) and Per-VLAN Spanning Tree Plus (PVST+)