STP in a packet capture

Spanning tree BPDUs read field by field from a capture between two switches, before and after one priority change moves the root.

The lab

Two devices, SW1 and SW2. The capture is on the GigabitEthernet0/0 link between SW1 and SW2.

SW1 and SW2 are joined by two links, which makes a loop, and run Cisco rapid PVST+. SW1 starts with bridge priority 24576 for VLAN 1; SW2 keeps the default, 32768.

The switch with the lowest bridge ID becomes the root, and one of the two links is blocked so frames cannot loop. BPDUs carry the root choice across each link. Then SW2's priority is set to 4096, and the BPDUs change.

The exchange

  1. SW1 to SW2: BPDU: the root is SW1 (priority 24576), cost 0
  2. SW2 to SW1: After SW2's priority is set to 4096: BPDU, the root is SW2, cost 0
  3. SW2 to SW1: Later BPDUs keep naming SW2 as the root

Reading the frames

Frame 1: a BPDU before the change

SW1 is the root, and it sends the BPDUs on this link. Values from one run of this lab.

FieldValueWhat it means
Root identifier24576/1/2a:24:99:24:26:fePriority 24576, system ID extension 1 (the VLAN), and the root's bridge MAC. This is SW1.
Root path cost0The sender's cost to reach the root. Zero, because the sender is the root.
Bridge identifier24576/1/2a:24:99:24:26:feThe bridge that sent this BPDU: SW1 again, because the root sends BPDUs on its designated ports.
Port identifier0x8001Port priority 128 (0x80) and port number 1 on the sending bridge.

Frame 7: a BPDU after the change

SW2's priority is now 4096. It wins the election and sends the BPDUs; SW1 receives them on its root port. Values from one run of this lab.

FieldValueWhat it means
Root identifier4096/1/1e:6c:3e:4f:02:08Priority 4096, lower than SW1's 24576, so SW2 is the new root.
Root path cost0Zero again: the new sender is the new root.
Bridge identifier4096/1/1e:6c:3e:4f:02:08The sender is now SW2.
Hello time2Seconds between BPDUs on this link.

What to take away

Every BPDU names the same root, the bridge with the lowest priority and then the lowest MAC. Lower one bridge's priority and the BPDUs name that bridge as root.

Run it yourself

Open the same lab, run the commands and read the capture on the GigabitEthernet0/0 link between SW1 and SW2 yourself.

Open this lab Free. Sign in to start.

Related learning resources

Sources