While doing my reading on Spanning-tree and my INE Vol I labs, I kept referencing back to the book for the tie-breaker criteria for root port selection, and decided I’d post it.
In our scenario, we have two switches, SW4, and SW1, which are directly connected with three fast ethernet links. Here’s how STP would select the root port by the book, then we’ll go over what actually happens, and see how we can influence it.
Root port selection (tie breakers)
- Lowest sending bridge ID
- Lowest STP port cost
- Lowest port-priority
- Lowest interface number
Lowest Sending Bridge ID
Now, in our scenario, the sending bridge is naturally going to have the same BID, because we have 3 links all to the same switch. Remember, the BID is the priority of the bridge (32768 + VLAN ID if system-id extension is enabled), and the MAC address. That being said, regardless, this won’t matter if the links are all to the same switch…
Lowest STP Port cost
This is referring to the outbound port cost. Remember, STP port cost is associated with an interface, NOT the link itself. So, SW4′s interface is 19 by default, which means, all three interfaces tie.
Lowest port-priority
This one confuses people. If we configure a low port priority on SW4..it will NOT influence root port selection. Why? Well, BPDU’s are being sent TO us from SW1, listing the port priorities. You can verify this by debugging and seeing that the port priorities for all three ports are included in incoming BPDU’s.
Lowest interface number
Sad, but true, this is the best we can do! It ends up selecting f0/13, instead of f0/14, or f0/15.
How we can influence root port selection on redundant links
- Adjust the STP port cost (outgoing, remember that) on SW4
- Adjust the port priority on SW1′s links to SW4
At the end of the day, because of the order tiebreakers occur, cost will always override the priority. It makes sense, cost is locally configured, priority is configured on the designated port for that segment. It should be noted, however, that if there is say, a ring topology with 4 switches (such as the INE topology), and you have two links, to two different switches, the process is the same, but root path cost comes into play.
Anyway..off to bed..got some solid labbing done tonight.