Procedure
If STP frequently flaps, the switch needs to continuously perform STP topology calculation and update its MAC table and ARP table, resulting in high CPU usage.
Fault location
When suspecting frequent STP flapping, run the display stp topology-change command on the switch every several seconds to check current STP topology change information. Alternatively, check the alarms and logs generated on the switch to determine whether STP topology changes occur on the switch.
Run the display stp topology-change command on the switch every several seconds to check STP topology change statistics and whether the Number of topology changes field increases.
<HUAWEI> display stp topology-change CIST topology change information Number of topology changes :5 Time since last topology change :0 days 0h:23m:19s Topology change initiator(detected) :10GE1/0/1 Number of generated topologychange traps : 5 Number of suppressed topologychange traps: 3
After confirming that frequent network topology changes occur, run the display stp tc-bpdu statistics command on the switch every several seconds to check statistics about TC BPDUs received by ports. According to the statistics, locate the TC packet source and device that sends these packets.
<HUAWEI> display stp tc-bpdu statistics -------------------------- STP TC/TCN information -------------------------- MSTID Port TC(Send/Receive) TCN(Send/Receive) 0 10GE1/0/3 2/3 0/0 1 10GE1/0/5 1/0 -/-
1. If only the TC(Send) statistics increase, topology changes occur on the switch.
2. If the TC(Send) statistics of only one port increase, this port flaps.
3. If the TC(Send) statistics of many ports increase, check NMS events and logs on the switch to analyze the root cause of STP topology changes and determine which port flaps.
4. If both the TC(Send) and TC(Receive) statistics of a port increase, check NMS events and logs on the switch to determine whether topology changes occur on this switch and result in STP flapping and then check whether STP flapping occurs on the peer device connected to this port.
Suggestions
1. Enable the TC protection alarm function to help administrators learn about the TC BPDU processing on the switch.
To enable the TC protection and TC protection alarm functions, run the snmp-agent trap enable feature-name mstp and stp tc-protection commands in the system view.
NOTE:
After the TC protection alarm function has been enabled, the switch will generate two alarms: MSTP_1.3.6.1.4.1.2011.5.25.42.4.2.15 hwMstpiTcGuarded and MSTP_1.3.6.1.4.1.2011.5.25.42.4.2.16 hwMstpProTcGuarded.
After the TC protection function has been enabled, the switch processes only the maximum number of TC BPDUs (one TC BPDU by default) configured using the stp tc-protection threshold threshold command within the period (2s by default) specified using the stp tc-protection interval interval-value command.
2. Rectify the fault according to topology changes.
If STP topology changes are caused by access-side port status transition, run the following commands to configure this port as an STP edge port or enable the STP BPDU protection function to reduce the impact of the BPDUs on the CPU.
<HUAWEI> system-view[~HUAWEI] interface 10ge 1/0/1[~HUAWEI-10GE1/0/1] stp edged-port enable[*HUAWEI-10GE1/0/1] quit[*HUAWEI] stp bpdu-protection[*HUAWEI] commit
If you have any problems, please post them in our Community. We are happy to solve them for you!