By default, following initialisation, all switches initially assume that they are the Root of the Spanning Tree, until they exchange BPDUs with other switches. When switches exchange BPDUs, an election is held and the switch with the lowest Bridge ID in the network is elected the STP Root Bridge. If two or more switches have the same priority, the switch with the lowest order MAC address is chosen. This concept is illustrated in Figure 31.4 below:
Figure 31.4 – Electing the STP Root Bridge
In Figure 31.4, four switches – Switch 1, Switch 2, Switch 3, and Switch 4 – are all part of the same STP domain. By default, all of the switches have a Bridge Priority of 32768. In order to determine which switch will become the Root Bridge, and thus break the tie, STP will select the switch based on the lowest-order MAC address. Based on this criterion, and referencing the information shown in Figure 31.4, Switch 1 will be elected the Root Bridge.
Once elected, the Root Bridge becomes the logical centre of the Spanning Tree network. This is not to say that the Root Bridge is physically at the centre of the network. Ensure that you do not make that false assumption.
NOTE: It is important to remember that during STP Root Bridge election, no traffic is forwarded over any switch in the same STP domain.
Cisco IOS software allows administrators to influence the election of the Root Bridge. In addition, administrators can also configure a backup Root Bridge. The backup Root Bridge is a switch that administrators would prefer to become the Root Bridge in the event that the current Root Bridge failed or was removed from the network.
It is always good practice to configure a backup Root Bridge for the Spanning Tree domain. This allows the network to be deterministic in the event that the Root Bridge fails. The most common practice is to configure the highest priority (i.e., the lowest numerical value) on the Root Bridge and then the second-highest priority on the switch that should assume Root Bridge functionality in the event that the current Root Bridge fails. This is illustrated in Figure 31.5 below:
Figure 31.5 – Electing the STP Root Bridge (Continued)
Based on the configuration in Figure 31.5, the most likely switch to be elected as the Root Bridge in this network is Switch 1. This is because, although all priority values are the same, this switch has the lowest-order MAC address. In the event that Switch 1 failed, STP would elect Switch 2 as the Root Bridge, because it has the second-lowest MAC address. However, this would result in a suboptimal network topology.
To address this, administrators can manually configure the priority on Switch 1 to the lowest possible value (0) and that of Switch 2 to the second-lowest possible value (4096). This will ensure that in the event that the Root Bridge (Switch 1) fails, Switch 2 will be elected the Root Bridge. Because administrators are aware of the topology and know which switch would assume Root Bridge functionality, they created a deterministic network that is easier to troubleshoot. The Root ID is carried in BPDUs and includes the Bridge Priority and MAC address of the Root Bridge.
EXAM TIP: If you want to force a switch to become the Root Bridge, you can perform the following (see also Figure 31.6 below):
- You can manually set the priority
Switch(config)#spanning-tree vlan 2 priority ?
<0-61440> bridge priority in increments of 4096
- Or set it as the Root Bridge using macro the commands primary or secondary
Switch(config)#spanning-tree vlan 2 root ?
primary Configure this switch as primary root for this spanning tree
secondary Configure switch as secondary root
Figure 31.6 – Forcing a Switch to Become the Root Bridge
SwitchC#show spanning-tree vlan 5
VLAN0005
Spanning tree enabled protocol ieee
Root ID Priority 0
Address 0000.0000.000c
This bridge is the root
Bridge ID Priority 0 (priority 0 sys-id-ext 5)
SwitchD#show spanning-tree vlan 5
VLAN0005
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address 0000.0000.000d
Bridge ID Priority 4096 (priority 8192 sys-id-ext 5)
SwitchD#show spanning-tree vlan 5
VLAN0005
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address 0000.0000.000d
Bridge ID Priority 4096 (priority 8192 sys-id-ext 5)
Note that the VLAN number is often added to the priority number, as shown in the output below:
SwitchA#show spanning-tree vlan 5
Bridge ID Priority 32773 (priority 32768 sys-id-ext 5)
Address 0013.c3e8.2500
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Role Sts Cost Prio.Nbr Type
——— —- — —- ——– —-
Fa0/15 Desg FWD 19 128.15 P2p
Fa0/18 Desg FWD 19 128.18 P2


