How-to: Configure Spanning tree protocol Part2

In the first post STP part1, we discussed the root bridge election process, that was the first step in calculating the spanning tree topology. Lets dive and explore step2.

Step2: Best Path selection

After choosing and agreeing on the root switch for the domain, each switch starts looking for the shortest path to the root of the tree. The path with the lowest cost is selected to be the only active path. Path selection is based on the port cost concept which is based on the port speed as shown in the table below



4 Mbps


10 Mbps


16 Mbps


45 Mbps


100 Mbps


155 Mbps


622 Mbps


1 Gbps


10 Gbps


If the switch has two paths or more to the root only one of them must be active to prevent bridging loops and other ports must be in blocking state. How this decision is made by the switch ?

choosing the best path involves two steps as listed below:

First: Selecting root port per switch is based on the following rules

  • Select the port with the lowest cost. if they have the same cost then
  • Select the path that is connected to the lowest Bridge ID. if they are connected to the same bridge then
  • Select the path with the lowest neighbor port ID (port priority + port number).

Second: Selecting the designated port per segment is based on the following rules

After selecting a root port for every switch a designated port should be selected for every segment; only one designated port is allowed per segment.

  • Port that has the lowest cost to the root on this segment else:
  • Lowest BID and the final tie breaker is
  • Lowest Port ID.

The bridge containing the designated port for a specific segment is called the designated switch for this segment.

To quickly recap the idea of how STP works:

  • One root bridge is elected in the network based on the BID value.
  • One root port is selected on every switch.
  • Finally One designated port is elected per Ethernet segment.

Configuration part:

Once you have finished your design which is the hardest part in STP implementation, the configuration is not a hard issue. I really don't want to make this post too long so I will make another post explaining how to influence path selection by configuration.

Check Also