# Why does STP choose the lowest bridge ID as the root bridge?

The switch which has the lowest bridge ID can be the root bridge,and the bridge ID is made of priority and MAC address,that is ,

bridge ID = priority + MAC address So we will choose the switch which has the lowest priority to be the root bridge,if priority of all switches are the same,we will choose the switch which has the lowest MAC address to be the root bridge.

So my question are

1. Why should we choose the switch which has "the lowest" bridge ID to be the root bridge,not "the highest" ?

2.Why can one of switches has the lower priority?if priority can change,then base on what reason,so we let this switch has the lower or lowest priority ? The position in the topology? the performance of switch?

• The lowest bridge ID - concatenated priority value and base MAC address - has the highest root priority.
– Zac67
Commented Sep 3, 2021 at 9:01

1. Why should we choose the switch which has "the lowest" bridge ID to be the root bridge,not "the highest" ?

The reason is simply because lower numbers come first when counting forward. For example: 1, 2, 3, 4, etc.

1 came first, therefore it is first in line for priority. 2 came after it, so that’s second in line for priority. It’s just a matter of thinking of the priority order the same way that you increment numbers when counting forward. Whichever came first is first in line.

1. Why can one of switches has the lower priority?if priority can change,then base on what reason,so we let this switch has the lower or lowest priority ? The position in the topology? the performance of switch?

Your switch priorities should be based on which switch you want to be the root for any particular VLAN ID. For example, if you have systems using VLAN 100, 200, and 300 in your main building but systems using VLAN 400 are in a separate building, you don’t want the systems using VLAN 400 to have to go across a trunk to the main building for those switches to process the traffic and then the traffic come back to the switch the systems are actually connected to, adding a delay, etc., so you set the root for VLAN 400 to be the switch that’s physically where the systems using VLAN 400 are at. The inverse is true for VLANs 100, 200, and 300 - the root for those would be on the main switch and not the switch where VLAN 400 is being used at. That’s just a rough example of why you set the priorities statically.

1. Why should we choose the switch which has "the lowest" bridge ID to be the root bridge,not "the highest" ?

Because that is the standard, and it has been for decades, so it is not possible to change. You could, of course, join the IEEE and participate in the 802 committee to argue your position, but do not think it will actually change because it would cost \$ billions replacing all the network switches in the world.

2.Why can one of switches has the lower priority?if priority can change,then base on what reason,so we let this switch has the lower or lowest priority ? The position in the topology? the performance of switch?

The priority on business-grade switches can easily be changed, and you should do that so that you have a specific switch set as the root, and another switch set up to be the root if the root fails. Leaving the root bridge to chance is a really bad idea that can lead to big problems.

• I can't understand the question of 2.,I mean that if I have three switches,A,B and C,if the priority of C is the lowest,it means C is the root bridge,the question I want to ask is that why the priority of C can be the lowest? Commented Sep 3, 2021 at 0:20
• Because you configured the priority to be lowest. You do that because you want it to be the root. You are supposed to do that. Commented Sep 3, 2021 at 0:23

Why can one of switches has the lower priority?if priority can change,then base on what reason,so we let this switch has the lower or lowest priority ? The position in the topology? the performance of switch?

There's another aspect to this, and I think it wasn't pointed out in the other answers (although it builds on Jesse P.'s answer):

If none of the switches of the given spanning-tree was configured to have a proper (non-default) lower/better priority, and with all other parameters being equal (default priority is 32k, usually), the Bridge ID/MAC address of the switches becomes the tie-breaker. In that case, the switch with the lowest Bridge ID is elected as root bridge (nothing new so far).

This might seem pretty clever and "so why should I worry" at first, but there's a catch: Vendors over time have been assigning MAC addresses to their devices incrementally, so the oldest devices have tendency to have the lowest MAC addresses/Bridge IDs.

And that's how a badly maintained spanning tree can end up with the root bridge unexpectedly being the 20 years old FastEthernet switch in a lost corner of the datacenter. Connectivity issues will arise sooner than later...

So it can't be emphasized enough: Understand your switched network and its topology, keep an eye on the traffic patterns, and set the root bridge accordingly for your spanning tree(s).

• Yeah. Good points I didn’t think to mention in my answer. Commented Sep 3, 2021 at 10:41

Why should we choose the switch which has "the lowest" bridge ID to be the root bridge,not "the highest" ?

One simple reason why Radia Perlman chose lower: Stability

Since MAC addresses are chosen by the switch manufacturer, addresses are usually assigned sequentially. That means that new switches have higher MAC addresses than old ones.

If STP used the highest bridge ID, then whenever a new switch (or a replacement switch) would be added to the network, the root would change (since the new switch has a higher MAC address). This would cause interruptions and unexpected topology changes.

If the lowest ID is used, then the root will stay the same over time as switches are added or replaced, keeping the topology stable.

• That only holds water if your switches all come from the same vendor and use the same OUI - but still, fair point, especially for that time period.
– Zac67
Commented Sep 8, 2021 at 14:18

The bridge priority (and other xSTP priority parameters) is user-configurable.

2.Why can one of switches has the lower priority?if priority can change,then base on what reason,so we let this switch has the lower or lowest priority ? The position in the topology? the performance of switch?

just to be sure, network administrator can set a priority if he wants. Basically it will allow him to control what spanning tree is constructed.

In addition to what other answers say. You generally want your root bridge to be somewhere in the middle of your network (topologically). Otherwise you can end up with a tree in which packets follow very inefficient paths. You can read about "betweenness centrality" to understand why.

So you are correct in your assumptions.

• in theory it does not really mater if its lowest or highest I think it matters a lot. Commented Sep 8, 2021 at 12:55
• why? you write a formula with either `<` or `>`. How does it matter which one? Commented Sep 8, 2021 at 12:56
• See my answer to this question. Commented Sep 8, 2021 at 12:57
• It's important that the network doesn't change unexpectedly. Imagine a network that has been running for some time. Then one day a technician replaces a switch, or adds a new one in a remote office. The topology will change, and may cause major outages. Because it's a remote office, you might not be aware that someone was adding a switch. Commented Sep 8, 2021 at 13:27
• In theory, theory and practice are the same. In practice, they are different. :-) Commented Sep 8, 2021 at 13:40