Question

Difference between changing STP interface port cost and interface port priority

Asked by: Dragon0x40

STP 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.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-09-23 at 01:35:15ID24754163
Tags

STP

,

Cisco

,

Switches

,

Catalyst

Topic

Network Switches & Hubs

Participating Experts
2
Points
500
Comments
21

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

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.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

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.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

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.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Question on STP
    Cisco says: -------------------------------------------------------------- The exhange of BDPUs results in the following: • The election of a unique root switch for the stable spanning-tree network topology. • The election of a designated switch for every switched LAN segm...
  2. To use STP?
    I have the following diagram: internet | | | | 2811--eigrp--2811 <-----using HSRP | | | | | | C3560A===C3560B | | | | ASA5510 ...
  3. STP questions
    1. When you have multiple VLANs, is their a root brdige for every VLAN? If yes, is it the same switch? so if VLAN1 had a switch as a root bridge, would VLAN2 consider that same switch a root bridge? 2 .Does STP automatically run per every new vlan created? 3. Do most organ...
  4. Protect against loops using Spanning Tree Protocol (STP)
    I periodically suffer from students looping network cables from one cat5 socket to another causing a loop that kills the network. My network is flat (one subnet) with servers going in one switch, uplinks to other switches, then fibre uplinks to other cabinets. I have read a ...
  5. Configure HSRP or STP
    Hi I try to setup network and I want to made redundancy between Cisco switch do I need to setup HSRP or STP And how I can setup each one according to the diagram Regards

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

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.

Join the Community

Answers

 

by: rochey2009Posted on 2009-09-23 at 03:12:46ID: 25401372

 

by: donjohnstonPosted on 2009-09-23 at 05:26:58ID: 25402268

>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)


 

by: Dragon0x40Posted on 2009-09-23 at 11:18:36ID: 25406183

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.jivesoftware.com/thread/5503?start=15&tstart=0

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?


 

by: rochey2009Posted on 2009-09-23 at 11:59:01ID: 25406621

Priority 100 is defined on the root bridge. The root bridge has a mac-address of xxxx.0407.9000.

What is your topology? What are you trying to achieve?

 

by: Dragon0x40Posted on 2009-09-23 at 12:09:06ID: 25406721

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.

 

by: donjohnstonPosted on 2009-09-23 at 17:45:24ID: 25409401

>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.

 

by: Dragon0x40Posted on 2009-09-23 at 21:35:54ID: 25410103

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.

 

by: Dragon0x40Posted on 2009-09-23 at 21:56:29ID: 25410180

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.

 

by: rochey2009Posted on 2009-09-24 at 02:30:39ID: 25411352

Table 9-8. Spanning-Tree Tie-Breaker Criteria

1 Lowest Root Bridge ID

2 Lowest Root Path Cost

3 Lowest Sender Bridge ID

4 Lowest Sender Port ID

It's because its the sends port id which breaks the tie (root bridge), not the receivers (Non-root bridge).

 

by: donjohnstonPosted on 2009-09-24 at 05:01:26ID: 25412306

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.


 

by: Dragon0x40Posted on 2009-09-24 at 08:23:01ID: 25414308

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.

 

by: donjohnstonPosted on 2009-09-24 at 08:26:44ID: 25414347

The cost field in the BPDU is increased when the BPDU enters the port. So changing the cost of a port on the root-switch will have no effect on the topology. However, changing the cost on the non-root switch will.

 

by: Dragon0x40Posted on 2009-09-24 at 10:01:17ID: 25415446

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?

 

by: donjohnstonPosted on 2009-09-24 at 10:05:40ID: 25415481

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.

 

by: Dragon0x40Posted on 2009-09-24 at 13:34:40ID: 25417581

>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.

 

by: donjohnstonPosted on 2009-09-24 at 14:39:33ID: 25418278

>As long as I make sure the port costs are the same for the ports on the non-root switch, right?

Correctamundo

>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.

By jove, I think you've got it. ;-)

 

by: Dragon0x40Posted on 2009-09-24 at 19:03:33ID: 25419631

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.

 

by: rochey2009Posted on 2009-09-25 at 02:20:37ID: 25421239

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).

 

by: Dragon0x40Posted on 2009-09-25 at 02:33:07ID: 25421285

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)

 

 

by: Dragon0x40Posted on 2009-09-25 at 02:49:57ID: 25421355

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)

 

by: rochey2009Posted on 2009-09-25 at 03:29:46ID: 25421547

That looks ok.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...