By default, following initialization, 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 highest Bridge Priority 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 3-16 below:

Fig. 3-16. Electing the STP Root Bridge
In Figure 3-16, four switches – Switch 1, Switch 2, Switch 3, and Switch 4 – are all part of the same STP domain. By default, all switches have a Bridge Priority of 32,768. 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 printed in Figure 3-16, Switch 1 will be elected Root Bridge.
Once elected, the Root Bridge becomes the logical center of the Spanning Tree network. This is not to say that the Root Bridge is physically at the center of the network. Make sure 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.
The Cisco IOS software allows administrators to influence the election of the Root Bridge. In addition to this, 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 (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 3-17 below:

Fig. 3-17. Electing the STP Root Bridge (Contd.)
Based on the configuration in Figure 3-17, the most likely switch to be elected 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 sub-optimal 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 as the Root Bridge. Because administrators are aware of the topology and know which switch would assume Root Bridge functionality, they create 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. This is illustrated in Figure 3-18 below:

Fig. 3-18. Viewing the Root ID in a BPDU
When referencing the backup Root Bridge, it is important to understand that this switch will function in the same manner as any other Non-Root Bridge until it assumes the role of Root Bridge. Spanning Tree Root Bridge and backup Root Bridge configuration will be illustrated in detail later in this chapter.