STP bridge priority values

In Spanning Tree Protocol (STP), the bridge priority determines the root bridge in the network:

STP how to find the root bridge

Valid values for bridge priorities are between 0 and 61440, but the value must be in increments of 4096. This is because the VLAN ID is a 12-bit value that can represent up to 4096 VLAN IDs. The Bridge Priority is effectively a 4-bit value and is stored in a 16-bit field along with the VLAN ID:

stp-bridge-priority-vlan-id.excalidraw

In the Per-VLAN Spanning Tree Plus (PVST+) variant of STP, which is common on Cisco devices, the 2-byte (16-bit) Priority field in the BPDU is divided into two parts. The most significant 4 bits are for the Priority, and the least significant 12 bits are for the VLAN ID.

Thus only Bridge priorities incremented in steps of 2^12 (4096) are valid. For instance, a bridge with a set priority of 12288 that is using VLAN 7 will actually have a priority value in the BPDU field of 12288+7 = 12295. That priority value is unique to VLAN 7 since there can be a root bridge for each individual VLAN, and the priorities must be unique.