Introduction:
This document describes how to identify the source of the STP loop problem.
Core Issue:
There is a need to provide information on how to identify the source of the STP loop problem.
Resolution:
First, locate the blocking port that has mistakenly transitioned to the forwarding state.
The status of the port on which STP is running can be checked using commands, as follows.
show spanning-tree vlan <vlan_id>
show spanning-tree vlan <vlan_id> detail
show spanning-tree interface <IF_NAME>
show spanning-tree interface <IF_NAME> detail
The following is an output example of "show spanning-tree vlan <vlan_id>."
You can confirm that Gi1/0/2 is the root port for VLAN20 and Gi1/0/3 is the blocking port for VLAN20 in this switch.
WS-C3750E-48PD#show spanning-tree vlan 20
VLAN0020
Spanning tree enabled protocol ieee
Root ID Priority 32788
Address 0018.ba87.c880
Cost 4
Port 2 (GigabitEthernet1/0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32788 (priority 32768 sys-id-ext 20)
Address 0018.ba87.cb00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi1/0/2 Root FWD 4 128.2 P2p
Gi1/0/3 Altn BLK 4 128.3 P2p
At the same time, you can also confirm whether the relevant VLAN root bridge is the intended switch.
In the above example, the device, whose MAC Address is 0018.ba87.c880, is the root bridge for VLAN20.
Next we will check whether BPDU is transmitted and received without any problems on the path from the relevant switch to the root bridge.
-------------------------------------------------------------
After identifying the blocking port transitioned to the forwarding state, confirm whether BPDU is transmitted and received without any problems on the path from the relevant switch to the root bridge.
Transmission and reception of BPDU can be checked using commands, as follows.
show spanning-tree vlan <vlan_id> detail
show spanning-tree interface <IF_NAME> detail
The following is an output example of "show spanning-tree interface <IF_NAME> detail" command.
Run this multiple times every few seconds, and check if "sent" and "received" increase properly.
In the following example, "received" is increasing properly.
"sent," however, does not increase. This port is a blocking port, and therefore 'sent' does not normally increase.
WS-C3750E-48PD#show spanning-tree interface gig 1/0/3 detail
Port 3 (GigabitEthernet1/0/3) of VLAN0020 is alternate blocking
Port path cost 4, Port priority 128, Port Identifier 128.3.
Designated root has priority 32788, address 0018.ba87.c880
Designated bridge has priority 32788, address 0018.ba87.c880
Designated port id is 128.165, designated path cost 0
Timers: message age 2, forward delay 0, hold 0
Number of transitions to forwarding state: 0
Link type is point-to-point by default
BPDU: sent 1, received 162
WS-C3750E-48PD#
WS-C3750E-48PD#
WS-C3750E-48PD#show spanning-tree interface gig 1/0/3 detail
Port 3 (GigabitEthernet1/0/3) of VLAN0020 is alternate blocking
Port path cost 4, Port priority 128, Port Identifier 128.3.
Designated root has priority 32788, address 0018.ba87.c880
Designated bridge has priority 32788, address 0018.ba87.c880
Designated port id is 128.165, designated path cost 0
Timers: message age 2, forward delay 0, hold 0
Number of transitions to forwarding state: 0
Link type is point-to-point by default
BPDU: sent 1, received 165
WS-C3750E-48PD#
WS-C3750E-48PD#
WS-C3750E-48PD#show spanning-tree interface gig 1/0/3 detail
Port 3 (GigabitEthernet1/0/3) of VLAN0020 is alternate blocking
Port path cost 4, Port priority 128, Port Identifier 128.3.
Designated root has priority 32788, address 0018.ba87.c880
Designated bridge has priority 32788, address 0018.ba87.c880
Designated port id is 128.165, designated path cost 0
Timers: message age 2, forward delay 0, hold 0
Number of transitions to forwarding state: 0
Link type is point-to-point by default
BPDU: sent 1, received 168
After identifying the link with BPDU transmission and reception problems, isolate the problem further by checking whether any errors, etc. are counted on the interface transmitting/receiving BPDU, and whether there are any problems with the usage of resources such as CPU or with the traffic path in the device, etc.
In terms of preventing the STP loop in the event of any failure, UDLD and Loop guard are effective. You may want to consider using such functions as well.
Related Information
Original Document: Cisco Support Community Japan DOC-29635
Author: Yasuhiro Nakajima
Posted on January 25, 2013
https://supportforums.cisco.com/docs/DOC-29635