>The way STP picks the root and designated ports is a little confusing to me.
It's actually:
1) Cost
2) Bridge ID (combination of bridge priority + MAC address)
3) Port ID (combination of Port priority + Port number)
Main Topics
Browse All TopicsSTP looks at lowest Bridge Priority and mac address to select a root bridge.
STP then selects root ports and designated ports.
STP then blocks all ports not root or designated.
The way STP picks the root and designated ports is a little confusing to me.
Lowest of the following until tie is broken;
1) Root Bridge ID
2) Path Cost
3) Sending switch Bridge ID
4) Sending switch Port number
To my questions:
1)Shouldn't the Root bridge always be tied? (There is only one Root Bridge)
2) Path Cost is based on port speeds added up from the root to the switchport trying to become a root or designated port (the amount that will be added is dictated by link speed example: 19 for fastethernet) and the amount added to the path cost as it comes in through the interface can be changed with the port cost command?
3) Sending switch bridge id could be same if multiple paths between two switches?
4) And the ultimate tie breaker is the sending switch port number?
So where does port priority fit in?
Seems like changing the port cost would not only effect the switch you modified but also effect downstream switches as well due to increased or decreased path cost?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
David Hucaby uses this terminology in his BCMSN book when discussing root port selection.
1. Lowest Root Bridge ID
2. Lowest Root Path Cost to Root Bridge
3. Lowest Sender Bridge ID
4. Lowest Sender Port ID
And would the above also be used to select the desgnated port on a link between two switches that already have root ports?
Do iinterfaces only receive BPDUs from the far end of the link? In other words an interface can't receive a BPDU from the switch that it is physically attached to? If you wanted Switch A to be designated port then you would have to lower the corresponding interface port priority or cost on switch B?
Pretty good discussion about this subject here: https://cisco.hosted.jives
We can change the port priority at the interface level as follows: "spanning-tree port-priority priority"
For priority, the range is 0 to 240, in increments of 16; the default is 128. Valid values are 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, and 240. All other values are rejected. The lower the number, the higher the priority.
So on the following switch the defualt port priority of 128 is being used but lower numbered ports have a lower priority. Ex: Gi5/1 is 128.513 and is lower than Gi5/2 128.514
Gi5/1 Root FWD 3004 128.513 P2p
Gi5/2 Altn BLK 3004 128.514 P2p
xxx#sh spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 100
Address xxxx.0407.9000
Cost 3004
Port 513 (GigabitEthernet5/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 49153 (priority 49152 sys-id-ext 1)
Address xxxx.f6e5.ac00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Uplinkfast enabled
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------
Gi5/1 Root FWD 3004 128.513 P2p
Gi5/2 Altn BLK 3004 128.514 P2p
Gi8/5 Desg FWD 3004 128.901 P2p
Gi8/6 Desg FWD 3004 128.902 P2p
Gi8/10 Desg FWD 3004 128.906 P2p
Gi8/11 Desg FWD 3004 128.907 P2p
Gi8/12 Desg FWD 3004 128.908 P2p
Gi8/13 Desg FWD 3004 128.909 P2p
Po2 Desg FWD 3003 128.1666 P2p
Po5 Desg FWD 3003 128.1674 P2p
Po8 Desg FWD 3003 128.1677 P2p
Po7 Desg FWD 3003 128.1678 P2p
Po9 Desg FWD 3003 128.1679 P2p
Po10 Desg FWD 3003 128.1680 P2p
Po14 Desg FWD 3003 128.1683 P2p
Po17 Desg FWD 3003 128.1686 P2p
Po18 Desg FWD 3003 128.1687 P2p
In the above "sh span vlan 1" where does priority 100 come from? I understand Cost 3004 is because uplink fast added 3000 to the cost and these are 1gbit links with a cost of 4.
The config for stp in the config is:
spanning-tree mode pvst
no spanning-tree optimize bpdu transmission
spanning-tree extend system-id
spanning-tree uplinkfast
vlan internal allocation policy ascending
vlan access-log ratelimit 2000
How often do you need to change port priority or cost from the default? Is it a good idea to change defaults of priority and cost?
rochey2009
I am trying to get straight in my mind how stp works so I can go through my network and understand and then maybe improve on the stp topology. At this point I am just researching but I have seen some configurations and root bridge placements that I did not completely understand. I will have more questions to follow with specific configurations and root bridge placements.
>And would the above also be used to select the desgnated port on a link between two switches that already have root ports?
No. A designated port is a port that BPDU's go out, not come in.
>In other words an interface can't receive a BPDU from the switch that it is physically attached to?
Not sure what you're saying. An interface will receive a BPDU if the device on the other end of the link sends out a BPDU.
>If you wanted Switch A to be designated port then you would have to lower the corresponding interface port priority or cost on switch B?
No. If you have a link between two switches and each switch has an equal cost to the root, the only way to force a switch to have the designated port, you would have to lower the bridge ID.
>How often do you need to change port priority or cost from the default?
Only when you have two paths between the switches and they both have equal costs but for some reason you want the forwarding link to be the one with the higher port number.
>Is it a good idea to change defaults of priority and cost?
Not usually.
Do you agree with this post? Check out the graphic below - if what you say is true then port Fa 0/1 on the non-root switch (given it is the lowest received port ID) should have been chosen as the forwarding port (given tests 1,2 and 3 are indecisive) but it wasn't.
To go through your steps:
1. Cumulative path costs are the same - tie.
2. Received Bridge IDs are the same - tie.
3. Priorities remain as default - tie.
4. Lowest received port ID is 0/1 however 0/2 was chosen to forward.
This is what I am confused about: Is it the received values from the bpdu or the values on the switch that are used to make the decision.
I have attached a drawing of three switches. There are three links between switch A and switch B. All link speeds are equal. Will all three ports on Switch A be designated ports and all three ports on Switch B be in blocking state? If not then my next thought would be that one of the three ports on Switch A would be designated and two in blocking and all three ports on Switch B would be in blocking.
The decision tree for selecting root and non-designated (blocking) ports are as follows:
1) Lowest cost
2) Lowest Bridge ID
3) Lowest Port ID
I your diagram, the non-root switch is receiving BPDUs on ports 0/1 and 0/2. To determine which of those two ports is the root, the switch looks at the cost field in the BPDU to see which one has the lowest cost (tie). It then looks at the Bridge ID field (tie). Finally, it looks at the Port ID field in the BPDU. The Port ID field of the BPDU that arrives on F0/2 has some value related to Fa0/1 which is lower than the Port ID field that arrives on the bottom port.
The thing to remember is that the Port ID is in the BPDU and reflects the Port ID on the OTHER SWITCH.
I am testing with two links between two switches. One switch is always the root bridge and that is consistent as long as one link is forwarding bpdus between the two. The root port will change when I change port locations on the root switch as is the consensus of most posts I read but changing the port cost on the non-root switch ports will also change the root port location which is what is confusing me. I will do some more testing and maybe make a drawing to explain my findings. My question is if the root switch bpdus are the values used to determine the root port then why would changing the port cost or priority locally on the non-root switch affect the root port election.
Ok, think I understand.
I will test tonight. Say I am using port 3/5 and port 3/10 on the non-root switch and port 3/5 is the root port and forwarding and 3/10 is blocking.
I should be able to unplug 3/10 and plug it into say 3/1 and after that 3/5 should continue to be the root port?
But I should make sure that the port cost of 3/10 and 3/1 are the same.
Then I should also be able to change to port priority on port 3/1 to something lower than 3/5 and port 3/5 should continue to be the root port?
>It won't matter what port you plug it into on the non-root switch because the port ID in the BPDU won't change.
The root port and blocking port will be determined by values on the root switch.
As long as I make sure the port costs are the same for the ports on the non-root switch, right?
Because if the port costs are not uniform on the non-root switch ports that could increment the bpdu cost and could change which port is root or blocking on the non-root switch.
>As long as I make sure the port costs are the same for the ports on the non-root switch, right?
Correctamundo
>Because
By jove, I think you've got it. ;-)
I have a third switch and I will try to answer my own question about designated and blocked ports in between two switches that each already have a root port upstream to different switches but if someone knows what should happen I would appreciate your input. I made a word document drawing of what I am asking and posted it yesterday but no one responded.
Assuming the root path costs are the same to switch aaaa.aaaa.aaaa and to switch bbbb.bbbb.bbbb, a tie breaker will decide on the designated ports on the three links between switch a and switch b.
Assuming default bridge priority, in this instance bridge a has a lower bridge id because it has a lower mac-address will have each of it's ports (towards switch b) as designated and switch b will have its ports blocked (towards switch a).
I tested 3 switches hooked up similar to the spanning-tree doc I previously attached.
*Keep in mind that this is a case of negotiating which switch will have designated ports and which switch will have blocking ports not a case of which link on one switch will be the root port and which links will be blocking. (I believe it makes a difference)
Here is what I found in my testing.
All three ports on switch A or B are either all forwarding or all blocking no matter what I did to those three ports cost or to the bridge priority.
I found that the switch with the lower bid (bridge id) will have all three ports forwarding (designated) and the switch with the higher bid will all be blocking.
I assume you can't really have a tie on bridge id in this case because even if the priority is the same the mac addresses are different so the port id never comes into play.
Maybe port id comes into play when determining which link of multiple links will become the root port because the upstream switch with a better path cost has already determined that its ports are designated and therefore the bridge id of all the designated ports are a tie.
If I am correct which I may not be.
Manual STP Computation
Tasks
1. Identify Path Costs on links.
For each link between switches, write the Path Cost that each switch uses for the link.
2. Identify Root Bridge.
Find the switch with the lowest Bridge ID; mark it on the drawing.
3. Select Root Ports (one per switch).
For each switch, find the one port that has the best path to the Root Bridge. This is the one with the lowest Root Path Cost. Mark the port with an RP label.
4. Select Designated Ports (one per segment).
For each link between switches, identify which end of the link will be the Designated Port. This is the one with the lowest Root Path Cost; if equal on both ends, use STP tie-breakers. Mark the port with a DP label. (Multiple segments between two specific switches should have one switch with all the DP ports and that switch will have the lower local bridge id)
5. Identify the blocking ports.
Every switch port that is neither a Root nor a Designated Port will be put into the Blocking state. Mark these with an X.
Tie breakers:
1. Lowest Root Bridge ID (used to select the root bridge and after that start at step 2)
2. Lowest Root Path Cost to Root Bridge (select one and only one RP per switch)
3. Lowest Sender Bridge ID (use local bridge id if not selecting a root port)
4. Lowest Sender Port ID (select the RP from multiple links with lowest sender bid)
Tie breakers:
1. Lowest Root Bridge ID (used to select the root bridge and after that start at step 2)
2. Lowest Root Path Cost to Root Bridge (select one and only one RP per switch)
3. Lowest Sender Bridge ID (use local bridge id if not selecting a root port)
4. Lowest Sender Port ID (use to select the RP out of multiple links from the switch with lowest sender bid)
Business Accounts
Answer for Membership
by: rochey2009Posted on 2009-09-23 at 03:12:46ID: 25401372
http://www.techexams.net/f orums/ccna -ccent/263 63-spannin g- tree-por t-priority .html
Have a look at the above link.