Sub topic 3
The bridge ID and why priority comes first
This chapter assumes you know how switches learn MAC addresses, what a VLAN is, and how to read a switch CLI. It explains the identifier that every switch puts in its BPDUs and how that identifier decides which switch becomes the root bridge.
What the bridge ID contains
Each switch advertises a bridge ID (BID) in its BPDUs. The BID is 8 bytes long and has three parts:
| Part | Size | Purpose |
|---|---|---|
| Priority | 4 bits | Administrator-set preference. Lower is better. |
| Extended system ID | 12 bits | Carries the VLAN ID on per-VLAN spanning tree. |
| MAC address | 48 bits | Unique tie-breaker, taken from the switch. |
The priority and the extended system ID share the same 16 bits. Because the extended system ID uses the low 12 bits, only the top 4 bits are left for the priority. That is why priority values move in steps of 4096 (0, 4096, 8192, and so on up to 61440). The default is 32768.
The extended system ID makes the BID differ per VLAN. For VLAN 10 with the default priority, the value shown in the output is 32768 + 10 = 32778.
Why priority comes first
Switches compare BIDs as a single number, so the most significant field wins. Priority is the leftmost field, so it is compared first. The MAC address matters only when priorities are equal.
This ordering gives the administrator control. If MAC address came first, the oldest or lowest-numbered hardware would always win, and you could not choose the root without replacing equipment. Because priority comes first, one setting on one switch overrides every MAC address in the network.
A worked comparison
Suppose three switches run VLAN 10 with these values:
| Switch | Priority | MAC address | Priority + VLAN |
|---|---|---|---|
| SW1 | 32768 | 0000.0c11.1111 | 32778 |
| SW2 | 32768 | 0000.0c00.0001 | 32778 |
| SW3 | 4096 | 0000.0cff.ffff | 4106 |
SW3 wins even though it has the highest MAC address, because 4106 is lower than 32778. If SW3 is removed, SW1 and SW2 tie on priority, and SW2 wins with the lower MAC address.
Common errors
- Leaving every switch at the default priority. The root is then the switch with the lowest MAC address, which is often an old switch at the network edge.
- Setting a priority that is not a multiple of 4096. IOS rejects the value.
- Forgetting that the displayed priority includes the VLAN ID. A value of 32778 for VLAN 10 is the default, not a custom setting.
Exercise
Switch A has priority 8192 and MAC 0000.0cff.0001. Switch B has priority 4096 and MAC 0000.0cff.0002. Both run VLAN 1. Which switch is the root, and why?
Show answer
Switch B is the root. Priority is compared first and 4096 is lower than 8192, so the MAC addresses are never compared.