Root Port Election (STP or RSTP)

Published on
13,893 Points
4 Endorsements
Last Modified:
Please see preceding article here: http://www.experts-exchange.com/Networking/Operating_Systems/A_11209-Root-Bridge-Election.html


Figure 1

After Root Bridge has been elected, then what?.....

Let's start by defining a Root Port in lay man's terms

A Root Port is the switchport a switch chooses with the determination that it is the closest or fastest port to reaching the Root Bridge.

Notice "reaching the Root Bridge"
It is easy to confuse Root Ports as the ports on the Root Bridge. The Root Port is the port that leads to the Root Bridge.

From San Francisco, California, Interstate 5 Southbound leads to Los Angeles. You will not find any Highway inside Los Angeles that says "To Los Angeles". If you see any such sign around the area, then it means you are not in Los Angeles. The same I5 that takes you to L.A from S.F, takes you back to S.F. from L.A. in the reverse direction. The sign changes to "To San Francisco"

Long story short. You will never find a Root Port on a Root Bridge.
Any switch you see with a Root Port Label means it is not a Root Bridge.

I hope I made that clear enough without bugging you with repetition.

With that out of the way, there are several criteria the switch uses to determine which of its ports is most reliable path to the Root Bridge.

This also implies the following.
- There can only be 1 Root Port on a switch.
- All switches except the Root Bridge must each have a Root Port

Before I proceed with those criteria, I should highlight the purpose of the Root Bridge and why every other switch needs to get to it as quickly as possible.

The main function of Spanning Tree is to prevent loops in a network especially when alternate or redundant links are configured.
It therefore needs 1 switch that all other switches can connect to. When this is determined, it then further determines the quickest or most efficient path(s) other switches can use to get to the Root Bridge. If it must block redundant links, it makes more sense to block less efficient links for optimum performance.

This then takes us to how the most efficient port is determined.
The major focus in a switching environment is speed and efficiency.

The switch therefore chooses the link it believes is the fastest and most reliable.

Every link has a cost attached to it based on the bandwidth or speed of the link.

Refer to the values in the table below


Table 1
These values are IEEE recommendations and cuts across different platforms or vendors

The higher the speed, the lower the cost,
The lower the cost, the more reliable the link.

In Spanning Tree, the rule of thumb is LOWER IS BETTER!
Think of trees and think about LOWEs (free advertisement but that's ok)

In essence, the shortest path (not in distance but in cost value), is considered the most efficient and most reliable path.

Please note that, EVERY other switch in the network apart from the Root Bridge that PARTICIPATES in Spanning Tree will always have 1 port it designates as the shortest path to the Root Bridge.

The shortest path is then LABELED the ROOT PORT. Once the Root Port is determined, the switch looks to see if there is another link or path to the Root Bridge. If any is found, the switch automatically blocks that link from actively forwarding packets (Hold this thought here!, I will elaborate more on this later when dealing with designated port).

Imagine a tree and and pay attention to the root.
The tree is the Root Bridge - sort of bridges all
the roots together.


Figure 2

That is the concept behind spanning tree. Another good way of looking at it is the way Jeremy Ciora (CBT Nuggets) described it in one of his video tutorials - Imagine spanning tree as the falling of trees over bad links. When no other path exists to the Root Bridge, it's time for Caltrans to remove the trees from the highway. (If you are not from California, Caltrans is California's state agency responsible for highway, bridge, and rail transportation planning, construction, and maintenance)

Going back to figure 1, after the Root Bridge has been elected, the figure will look something like this. (Please refer to the article (Root Bridge Selection) if you need to review how the root bridge was selected.


Figure 3

Remember the statement above,
Once the Root Port is determined, the switch looks to see if there is another link or path to the Root Bridge. If any is found, the switch automatically blocks that link from actively forwarding packets....

Our Root Bridge is Switch C.
Switch D has 2 paths to get to C
a. From its Root Port (Gi0/2) -> C's Fa0/2
b. From its Designated Port (Gi0/1) -> B's Gi0/1 -> B's Gi0/2 -> A's Fa0/2 -> A's Fa0/2 -> C's Fa0/1
Question is, why didn't Switch D block it's Gi0/1 since that's another path to the Root Bridge?

If you observe the Figure 3 very well, you will notice that Switch D's Gi0/1 port is connected to Switch B's Gi0/1 port which happens to be a Root Port also, meaning that, Switch D needs that link to access the Root Bridge.

If you continue through path B for Switch D, you will notice that the link gets blocked eventually by Switch B at FGi0/2.

I know it's getting a little more complex here but take it bit by bit and you'll be fine.
You may also have wondered as to how the blocked port is determined.
Why didn't Switch A block the link instead?
Another great question.

Remember Spanning Tree's Lower is Better Slogan.
Spanning Tree uses MAC Address or Priority value to determine which switch becomes the Root Bridge. The 1st criteria used is PRIORITY, then MAC Address if there is a tie in priority values.

The Switch with lowest priority or lowest MAC Address becomes the Root Bridge (Master). Same concept applies to Blocked or Alternate Ports. The switch with the lower priority or MAC Address gets to keep it's port (since it is superior of the two).

Please note

1. Any port connecting to a Root Port will always be a Designated Port and is never Blocked.
2. There is no Root Port on a Root Bridge.
3. There is never a Blocked or Alternate Port on a Root Bridge
4. All the Ports on a Root Bridge are Designated Ports (Always in a forwarding state)
5. A Blocked or Alternate Port always connect to a Designated Port
6. Designated Ports can pair with another Designated Port, but Alternate Ports can only pair with Designated Port.

Take your time to sink this in.

You may ask, Can a Blocked Port on a switch pair with a Designated Port on a Root Bridge? Great question, and the answer is YES.

Anytime you identify a Root Bridge, mark all its ports as Designated, then look for paths other switches will use to connect to it. Only 1 path is allowed per switch to the Root Bridge. If 2 paths link to the Root Bridge, 1 link must be blocked, if 3, 2 links must be blocked; if 100 paths, 99 links must be blocked. The goal is to prevent a ring from forming between 2 switches.

I hope this is clear enough. There are more concepts with respect to Spanning Tree but the goal of this article is to keep it simple and as basic as possible.

Before I wrap up, I would like to touch up on one more possible but uncommon scenario.

What happens with Redundant links between 2 switches?

Observe the two paths from Switch B to Switch A
- The Priority values are the same
- The MAC addresses are the same

So, how does the switch determine which port to block?

Back to our Spanning Tree Slogan, "Lower is better"
The 2 ports on Switch B are
a. Fa0/1
b. Fa0/2

Can you guess which port is lower? Of course, Fa0/1

So Switch B keeps Fa0/1 up and blocks Fa0/2


Figure 4

That's it, about Root Ports in its most basic description.

I hope this helps

All the best
Enjoy this complimentary article view.

Get unlimited access to our entire library of technical procedures, guides, and tutorials written by certified industry professionals.

Get 7 days free
Click here to view the full article

Using this article for work? Experts Exchange can benefit your whole team.

Learn More
Experts Exchange is a tech solutions provider where users receive personalized tech help from vetted certified professionals. These industry professionals also write and publish relevant articles on our site.
Ask questions about what you read
If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.
Learn from the best.