PVST/STP Root Bridge Election Process Explained
STP (Spanning Tree Protocol) is a layer two protocol. It finds and removes switching loops from the network. It builds a virtual topology of the entire network and checks all paths. If switches have more than one path to a single destination, it enables only one path and disables all additional paths to remove loops.
There are many variations of STP. Digital Equipment Corporation (DEC) created the original version of STP for its switches. It was a proprietary protocol. Later, IEEE developed an open-standard version of STP. It runs on all switches. However, it has some limitations. The one limit is that it runs only one instance per switch. Running one instance per switch does not effectively scale a large network, especially when running multiple VLANs. To overcome this issue, Cisco developed its STP variation based on IEEE's STP. It is called PVST (Per VLAN Spanning Tree). PVST uses the same concepts, terms, and logic as the IEEE's STP. This tutorial explains the root bridge election process for PVST. STP also uses the same process, but with a slight difference in BID. Since STP runs only one instance per switch, it does not include the VLAN ID in BID. You can refer to the BID tutorial of this series to learn more about how PVST and STP select BID. Apart from selecting BID, PVST, and STP, use the same logic and concept for the root bridge selection.
PVST runs a separate instance for every VLAN. For example, if you have five VLANs, there will be five PVST instances. Each instance builds and uses its own virtual topology. The PVST virtual topology starts from the root bridge. All PVST running switches first elect a root bridge for every VLAN. After electing a root bridge, they use it as a reference to make all other decisions, such as which ports will block to remove loops and which ports will forward frames. PVST selects only one switch as a root bridge from all switches for every VLAN. For example, if a network has two VLANs, there will be two root bridges, one in each VLAN.

BID (Bridge ID) or switch ID
PVST/STP uses BID (Bridge ID) or switch ID to compare and select the root bridge. The BID is an 8-byte value unique to each switch. PVST's BID consists of three components: the bridge priority (2 bytes), system ID (6 bytes), and VLAN ID. STP's BID consists of only two components: the bridge priority (2 bytes) and the system ID (6 bytes). It does not include VLAN ID.

The bridge priority
The bridge priority is a changeable numeric value. It allows you to manipulate the root bridge selection process. The switch having the lowest bridge priority value becomes the root bridge. The default priority value is 32768. If you want PVST/STP to select a particular switch as the root bridge, you can set its priority to a lower value than the others.

The system ID
The system ID is a non-changeable value. PVST/STP uses the switch's MAC address as the system ID. A MAC address is a globally unique address. No two switches can have the same MAC address. Using the switch's MAC address as the system ID ensures that each switch’s bridge ID remains always unique.

The VLAN ID
The system ID makes the BID unique across the switches. But it does not make them unique across the VLANs. For example, if a switch has two VLANs, the BID will be the same for both.

PVST runs a separate instance for each VLAN, and each instance elects its own root bridge. If VLANs use the same BID, PVST will fail to select the root bridge. To make the BID unique across the VLANs, PVST adds the VLAN ID to the default priority. Adding a VLAN-ID to the default priority ID makes the BID unique across all VLANs and switches in the network.

BID calculation process
A switch uses the following process to calculate a unique BID.
- It checks the running configuration for custom bridge priority. If the custom priority value is set, it uses the configured value.
- If the custom priority value is not set, it uses the default priority value.
- It adds the VLAN ID to the priority value. (STP uses the priority value as it is. It does not add a VLAN ID to the priority value.)
- It uses the switch's MAC address with the calculated priority value.
BID calculation process example
The MAC address of the switch is 1111.1111.1111. You did not change the default priority value. But you configured two VLANs on it. Their IDs are 10 and 20.
BID calculation for the first VLAN = 32768 (Default priority) + 10 (VLAN ID) / 1111.1111.1111
BID for the first VLAN = 32778/1111.1111.1111
BID calculation for the second VLAN = 32768 (Default priority) + 20 (VLAN ID) / 1111.1111.1111
BID for the second VLAN = 32888/1111.1111.1111

Electing Root bridge
PVST/STP uses the BID of all participating switches to select the root bridge. It chooses the switch having the lowest BID as the root bridge.
Let us take an example.
There are three switches. The MAC address of the first switch is 1111.1111.1111. The MAC address of the second switch is 2222.2222.2222. The MAC address of the third switch is 3333.3333.3333.
With the default priority ID and VLAN configuration, the bridge ID of switches will be as follows.
32768 (Default priority) + 1 (Default VLAN ID) / 1111.1111.1111 (MAC address) = 32769/1111.1111.1111 (BID of Switch 1)
32768 (Default priority) + 1 (Default VLAN ID) / 2222.2222.2222 (MAC address) = 32769/2222.2222.2222 (BID of Switch 2)
32768 (Default priority) + 1 (Default VLAN ID) / 3333.3333.3333 (MAC address) = 32769/3333.3333.3333 (BID of Switch 3)
Since the BID of Switch 1 is lower than the BID of Switch 2 and 3, PVST selects Switch 1 as the root bridge.

Now, let’s suppose that you want PVST to select Switch 2 as the root bridge. To do this, change the default priority ID for Switch 2 to 4096. After this change, the new BID for Switch 2 will be as follows.
4096 (Custom priority) + 1 (Default VLAN ID) / 2222.2222.2222 (MAC address) = 4097/2222.2222.2222 (BID of Switch 2)
Now, the BID of Switch 2 becomes lower than the BID of Switch 1 and Switch 3. PVST selects Switch 2 as the root bridge.

Packet Tracer example
Create a Packet Tracer lab as shown in the following image.

PVST is by default enabled on all Cisco switches. When you start PVST running switches, they first elect a root bridge and then use it as the starting point for building their virtual topology.
To view whether a switch is a root bridge, use the show spanning-tree command in privileged mode. The output of this command includes three sections. The first section provides information about the root bridge. The second section provides information about the local switch. The third section shows the ports' status.
The following image shows the output of this command on Switch 0.

The above output verifies that this is a non-root bridge.
The following image shows the output of this command on Switch 1.

As the above output shows, this is also a non-root bridge.
The following image shows the output of this command on Switch 2.

The above output verifies that it is a root bridge.
Manipulating the Root Bridge election process
To manipulate the root bridge election process, you have to change the default priority. The spanning tree command in global configuration mode sets the default priority for the specified VLAN. The new priority value must be in multiples of 4096. If you use a value that is not a multiple of 4096, the command rejects it.
The following command changes the default priority on S1 to 0.
Router(Config)spanning-tree vlan 1 priority 0

The changes take effect immediately. PVST reruns the root bridge election process. Since the priority value of this switch has changed to lower than that of others, PVST selects S1 as the root bridge. You can view the spanning tree information again to verify it.

This tutorial is part of the tutorial series "STP, RSTP, PVST, RPVST, and MSTP Explained with Examples". Other parts of this series are the following.
Chapter 01 Introduction and overview of STP and RSTP
Chapter 02 STP, RSTP, PVST, RPVST, and MSTP
Chapter 03 Similarities and Differences between STP and RSTP
Chapter 04 STP and RSTP Terminology
Chapter 05 STP/RSTP Timers Explained
Chapter 06 The Bridge ID and System ID Extension Explained
Chapter 07 PVST/STP Root Bridge Election Process Explained
Chapter 08 STP Port and Path Costs Explained
Chapter 09 STP Port States:- Blocking, Listing, Learning, and Forwarding
Chapter 10 STP - Spanning Tree Protocol Explained With Examples
Chapter 11 RSTP Port States and Types Explained
Chapter 12 PVST/RPVST and EtherChannel Explained
Chapter 13 RSTP / RPVST Explained with Examples
Conclusion
This way, by using the priority value, you can manipulate the PVST/STP root bridge election process. You can select any switch as the root bridge by setting its priority lower than the others. The root bridge is the center point of the PVST/STP virtual topology. By default, PVST/STP selects the switch that has the lowest BID as the root bridge. However, you can manipulate the root bridge election process by changing the default priority ID.
By ComputerNetworkingNotes Updated on 2026-05-12