Sub topic 11
Reading spanning tree output
This chapter assumes you know how switches learn MAC addresses, how VLANs and trunks work, and how to move around a switch command line. It also assumes you have met the root bridge, port roles and port states from earlier chapters. Here you will use that vocabulary to read real output.
Start with one command
The command show spanning-tree vlan 10 is the main tool on Cisco IOS. It prints one block for the root bridge and one for the local switch, followed by a table of ports.
VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 4106
Address 0011.2233.4401
Cost 4
Port 1 (GigabitEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
Address 0011.2233.4402
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------
Gi0/1 Root FWD 4 128.1 P2p
Gi0/2 Altn BLK 4 128.2 P2p
Gi0/5 Desg FWD 4 128.5 P2p EdgeRead it in order
- Protocol line.
rstpmeans Rapid PVST+.ieeemeans classic 802.1D. - Root ID block. This describes the root bridge. The priority 4106 is 4096 plus the VLAN number 10. Cost is this switch's root path cost. Port names the port that leads toward the root.
- Bridge ID block. This describes the local switch. Priority 32778 is the default 32768 plus the VLAN number 10.
- Port table. Each row gives a port's role, state, cost, port priority and number, and link type.
Am I the root?
If the Root ID and Bridge ID addresses match, this switch is the root. The output then says "This bridge is the root", and the Root ID block has no Cost or Port line. In the output above the addresses differ, so this switch is not the root.
Roles, states and types
| Field | Typical values | Meaning |
|---|---|---|
| Role | Root, Desg, Altn, Back | The port's job in the tree |
| Sts | FWD, LRN, LIS, BLK | The port's state. Rapid STP shows FWD or BLK in most cases. |
| Type | P2p, Shr, Edge | Full duplex point-to-point, half duplex shared, or PortFast edge port |
The example shows one root port (Gi0/1) and one alternate port (Gi0/2) in the blocking state. Alternate ports are the loop-free backup path. Gi0/5 is a designated edge port facing a host.
Other useful commands
show spanning-tree summaryshows the mode, the root status for each VLAN, and the count of ports in each state.show spanning-tree interface GigabitEthernet0/1 detailshows BPDUs sent and received and the number of topology changes. It also shows which neighbor last sent a change.show spanning-tree inconsistentportslists ports that BPDU Guard, Root Guard or Loop Guard have put into an inconsistent state.
On a Linux bridge, bridge link show lists each port with its state, and ip -d link show br0 shows the bridge priority and whether STP is on.
Common reading mistakes
- Reading the priority as the configured value. The VLAN number is added to it, so 32778 means priority 32768 for VLAN 10.
- Checking only one VLAN. With per-VLAN spanning tree, each VLAN can have a different root.
- Missing a Type of
Shr. It means the port is half duplex, so it will not use the fast handshake.
Exercise
In the output above, the switch's Bridge ID address is 0011.2233.4402 and the Root ID address is 0011.2233.4401. Which port leads toward the root, and which port is blocking?
Show answer
Gi0/1 leads toward the root, because the Root ID block names it as the port and its role is Root. Gi0/2 is blocking, with the role Altn and the state BLK.