10-06-2007 07:49 AM - edited 03-05-2019 06:55 PM
Hi
I'm a bit confused on this priority topic. If I set the spanning-tree priority to "1" on one switch and then "4096" on another, I would assume that the switch with the priority of "4096" would become the root bridge. However some people are telling me that the switch with the priority of "1" will win and become the root bridge. Could some one please help clarify this!
Thanks
Dan
10-06-2007 07:57 AM
Lower priority = greater chance of becoming the root.
http://www.cisco.com/univercd/cc/td/doc/product/lan/cat3560/12240se/scg/swstp.htm#wp1169930
10-06-2007 08:01 AM
Hi Dan
Default STP priority is 32768.
The lower the priority the more likely the switch is to be come the root bridge. However you normally have to do STP in incerments of 4096 so you would not be able to allocate a priority of 1 to a switch.
HTH
Jon
10-06-2007 08:20 AM
You sure can,
Rack1SW1(config)#spanning-tree vlan 1 priority 1
Rack1SW1(config)#end
Rack1SW1#
*Mar 1 00:16:45.883: %SYS-5-CONFIG_I: Configured from console by console
Rack1SW1#sh run | i spannin
spanning-tree vlan 1 priority 1
Rack1SW1#sh spanning
Bridge Identifier has priority 1, address cc06.1794.0000
Edit: That's Dynamips which runs CST, sorry about that.
Test with real switches & PVST:
Rack1SW1(config)#spanning-tree vlan 1 priority 1
% Bridge Priority must be in increments of 4096.
% Allowed values are:
0 4096 8192 12288 16384 20480 24576 28672
32768 36864 40960 45056 49152 53248 57344 61440
Rack1SW1(config)#spanning-tree vlan 1 priority 0
Rack1SW1(config)#do show run | i spanning
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree vlan 1 priority 0
10-06-2007 11:52 AM
Hi
Thanks for the replies.
Now that's what I thought. So is this an absolute, that you can't assign a switch a priority of "1" or is this just accepted practice where in reality a priority of "1" will take precendence over a value of "4096" thus making the switch with a value of "1" the root switch?
Any comments appreciated.
Thanks
Dan
10-06-2007 12:12 PM
A priority of '0' will take precedence over '4096'.
Priority of '1' does not work in PVST (Per-Vlan Spanning-Tree) mode but as you can see from my post, it does work in CST (Common Spanning-Tree) mode
10-08-2007 09:11 AM
Whether you can enter 1 or not depends on whether extended sysid feature is enabled. In a nutshell, the extended sysid feature steals 12 bits of the priority to store the vlan id in the bridge ID. This way, all the different spanning tree instances on the different vlans have a different bridge ID, even if they share the same mac address (the bridge ID is priority + bridge mac address). Without extended sysid, one different mac address is used for each and every vlan, which is too expensive (just like IP addresses, the number of mac addresses in the world is also limited).
The reason why the lower is the better for STP is probably because it's the way a the cost works: cost 10 is better than cost 100 (meaning that you are closer to the root). So by using consistently the convention "lower is better", the fields of a bpdu (root ID, cost, sender bridge ID and port ID) can be interpreted as a very long integer. There is no need to extract the different fields in the BPDU to compare it to another one... you can compare all the fields bit by bit.
HTH,
Francois
05-21-2024 09:38 AM
I hate that they did it this way, because the wording "high priority" should make it more important and is how it is used in all other elections (not fact checked). Just like "high cost" is a bad thing for deciding between links, which makes sense because you want low cost.
So, the way I remember it for spanning-tree is that the root is the bottom of the tree at 0. The higher the priority the further you get away from the root and so that is why it loses.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide