7-4. Navigating a Spanning-Tree Topology Although navigating a spanning-tree topology is a rather tedious process, it is usually the only way to verify that the STP is operating as it was intended. Many times, you will have a diagram of the switches in the network showing the physical or logical interconnections. The spanning-tree topology, however, usually goes undocumented until there is a problem. You might have to troubleshoot a network that is foreign to you, or one that is not completely documented. In this case, you need to get an idea of the current active STP topologyespecially the root bridge location. 1. | Find the root bridge.
- a. Choose a switch to use as a starting point.
Ideally, you want to start out on the root bridge at the "top" of the STP hierarchy. If you don't know which switch is the root for a given VLAN, any switch will do as a starting point.
- b. Display the root ID, local BID, and root port:
COS | show spantree vlan active | IOS | (exec) show spanning-tree vlan vlan |
An example of the COS output follows. Notice that the designated root port consists of a list of switch ports (1/1, 1/2, 2/1, and 2/2). On this COS switch, the four ports have been bundled as an EtherChannel. STP treats this as a single logical link:
switch (enable) show spantree 534 active VLAN 534 Spanning tree mode PVST+ Spanning tree type ieee Spanning tree enabled Designated Root 00-d0-04-57-3a-15 Designated Root Priority 8000 Designated Root Cost 2 Designated Root Port 1/1-2,2/1-2 (agPort 13/1) Root Max Age 20 sec Hello Time 2 sec Forward Delay 15 sec Bridge ID MAC ADDR 00-d0-ff-8a-2a-15 Bridge ID Priority 32768 Bridge Max Age 20 sec Hello Time 2 sec Forward Delay 15 sec Port Vlan Port-State Cost Prio Portfast Channel_id ------------------------ ---- ------------- --------- ---- -------- ---------- 1/1-2,2/1-2 534 forwarding 2 32 disabled 769 3/1,4/1 534 forwarding 12 32 disabled 833 5/4 534 forwarding 4 32 disabled 0 5/5 534 forwarding 4 32 disabled 0 5/6 534 forwarding 4 32 disabled 0 5/7 534 forwarding 4 32 disabled 0 An example of the Supervisor IOS command follows:
switch#show spanning-tree vlan 534 Spanning tree 534 is executing the IEEE compatible Spanning Tree protocol Bridge Identifier has priority 49152, address 0005.32f5.45ef Configured hello time 2, max age 20, forward delay 15 Current root has priority 8000, address 00d0.0457.3a15 Root port is 67, cost of root path is 3006 Topology change flag not set, detected flag not set, changes 132 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Timers: hello 0, topology change 0, notification 0 Fast uplink switchover is enabled Stack port is GigabitEthernet0/2 Interface Fa0/1 (port 13) in Spanning tree 534 is FORWARDING Port path cost 3019, Port priority 128 Designated root has priority 8000, address 00d0.0457.3a15 Designated bridge has priority 49152, address 0005.32f5.45ef Designated port is 14, path cost 3006 Timers: message age 0, forward delay 0, hold 0 BPDU: sent 2967446, received 0 The port is in the portfast mode ...(output removed)... Interface Gi0/1 (port 67) in Spanning tree 534 is FORWARDING Port path cost 3004, Port priority 128 Designated root has priority 8000, address 00d0.0457.3a15 Designated bridge has priority 32768, address 00d0.ff8a.2a15 Designated port is 7, path cost 2 Timers: message age 3, forward delay 0, hold 0 BPDU: sent 3, received 2967537 Interface Gi0/2 (port 75) in Spanning tree 534 is FORWARDING Port path cost 4, Port priority 128 Designated root has priority 8000, address 00d0.0457.3a15 Designated bridge has priority 49152, address 0005.32f5.45ef Designated port is 75, path cost 3006 Timers: message age 0, forward delay 0, hold 0 BPDU: sent 2967519, received 1 switch#
- c. Follow the root port toward the root bridge.
Remember that a switch has only one root port, and that port leads toward the root bridge. A switch can have many designated ports, and those lead away from the root bridge. Our goal is to find the neighboring switch that is connected to the root port.
Notice in the example output of Step 1b that the COS displays the root port as a physical module and port number (1/1-2, 2/1-2as a single bundled Gigabit EtherChannel), but the Supervisor IOS shows this as a logical port number (port 67). The port number is an index into the interfaces according to the STP. You can either page through the output until you find the interface with the port number or you can use the EXEC command show spanning-tree brief | begin VLANvlan to see only the port number associated with the specific VLAN number. An example of this follows:
switch# show spanning-tree brief | begin VLAN534 VLAN534 Spanning tree enabled protocol IEEE ROOT ID Priority 8000 Address 00d0.0457.3a15 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 49152 Address 0005.32f5.45ef Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Port Designated Name Port ID Prio Cost Sts Cost Bridge ID Port ID ------- ------- ---- ---- --- ---- -------------- ------- Fa0/1 128.13 128 3100 BLK 3006 0005.32f5.45ef 128.13 Fa0/2 128.14 128 3019 FWD 3006 0005.32f5.45ef 128.14 ...(output removed)... Gi0/1 128.67 128 3004 FWD 2 00d0.ff8a.2a15 129.7 Gi0/2 128.75 128 4 FWD 3006 0005.32f5.45ef 128.75 Here, STP port 67 corresponds to the physical interface Gigabit0/1. The Supervisor IOS output also shows a bonus piece of informationthe MAC address of the designated bridge on the root port.
- d. Identify the designated bridge on the root port:
COS | show cdp neighbor mod/num detail | IOS | (exec) show cdp neighbor type mod/num detail |
The neighboring switch can be found as a Cisco Discovery Protocol (CDP) neighbor, if CDP is in use. Look for the neighbor's IP address in the output. An example follows:
switch#show cdp neighbor gigabitEthernet 0/1 detail ------------------------- Device ID: SCA03320048(Switch-B) Entry address(es): IP address: 192.168.254.17 Platform: WS-C6509, Capabilities: Trans-Bridge Switch Interface: GigabitEthernet0/1, Port ID (outgoing port): 5/7 Holdtime : 120 sec After the IP address has been found, you can open a Telnet session to the neighboring switch.
- e. Repeat Steps 1b, 1c, and 1d until you are at the root.
How will you know when you have reached the root bridge? The local BID will be identical to the root bridge ID, and the root cost will be 0. See the following example from a Catalyst OS switch:
switch (enable) show spantree 534 active VLAN 534 Spanning tree mode PVST+ Spanning tree type ieee Spanning tree enabled Designated Root 00-d0-04-57-3a-15 Designated Root Priority 8000 Designated Root Cost 0 Designated Root Port 1/0 Root Max Age 20 sec Hello Time 2 sec Forward Delay 15 sec Bridge ID MAC ADDR 00-d0-04-57-3a-15 Bridge ID Priority 8000 Bridge Max Age 20 sec Hello Time 2 sec Forward Delay 15 sec Port Vlan Port-State Cost Prio Portfast Channel_id ------------------------ ---- ------------- --------- ---- -------- ---------- 1/1-2,2/1-2 534 forwarding 2 32 disabled 769 3/1-2,4/1-2 534 forwarding 2 32 disabled 833 3/3 534 forwarding 4 32 disabled 0 Notice that the root bridge and local BID MAC addresses are the same and that the root priorities are also the same. (Recall that the BID is made up of both the MAC address and the bridge priority.) This must be the root bridge for VLAN 534.
| 2. | Draw out the active topology from the top down.
Beginning at the root bridge, look for other switches that are participating in the spanning tree for a specific VLAN.
- a. Identify other neighboring switches:
COS | show cdp neighbor detail | IOS | (exec) show cdp neighbor detail |
Every neighbor can be identified by name, IP address, and connecting port. There will usually be more neighbors listed on switches that are toward the core layer and fewer neighbors on the access layer.
- b. Identify the BID, the root and designated ports, and their costs:
COS | show spantree vlan active | IOS | (exec) show spanning-tree brief | begin VLANvlan |
The BID and the root port will be listed first. The switch ports on VLAN number vlan will be listed, along with their STP states and port costs. The designated ports are the ones marked in the forwarding state.
- c. Identify the blocking ports:
COS | show spantree blockedports vlan | IOS | (exec) show spanning-tree vlan vlan | include BLOCKING |
- d. Move to a neighboring switch and repeat Steps 2a through 2c.
| |