Analysis and solutions to broadcast storm (STP configuration)

Table of Contents

1. Broadcast Storm

2. Solution: Configure STP


1.Broadcast Storm

The following figure is an example

Configure switch LSW1

<Huawei>sys
Enter system view, return user view with Ctrl + Z.
[Huawei]sysname LSW1
[LSW1]stp
Sep 14 2023 05:35:15-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 4, the
change loop count is 0, and the maximum number of records is 4095.
          ^
Error:Incomplete command found at '^' position.
[LSW1]undo info-center enable
Info: Information center is disabled.
[LSW1]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW1]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge:32768.4c1f-cc15-19c9
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times:Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC:32768.4c1f-cc15-19c9/0
CIST RegRoot/IRPC:32768.4c1f-cc15-19c9/0
CIST RootPortId:0.0
BPDU-Protection:Disabled
TC or TCN received :2
TC count per hello :0
STP Converge Mode:Normal
Time since last TC :0 days 0h:1m:27s
Number of TC :4
Last TC occurred:GigabitEthernet0/0/3
----[Port1(GigabitEthernet0/0/1)][LEARNING]----
 Port Protocol:Enabled
 Port Role :Designated Port
 Port Priority:128
 Port Cost(Dot1T):Config=auto / Active=20000
 Designated Bridge/Port:32768.4c1f-cc15-19c9 / 128.1
 Port Edged :Config=default / Active=disabled
 Point-to-point :Config=auto / Active=true
 Transit Limit:147 packets/hello-time
 Protection Type:None

[LSW1]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI FORWARDING NONE
   0 GigabitEthernet0/0/2 DESI FORWARDING NONE
   0 GigabitEthernet0/0/3 DESI FORWARDING NONE
[LSW1]display mac-address
Port STP role STP status Port ID
GE 0/0/1 Specified port FORWARDING (Forwarding) 0
GE 0/0/2 Specified port FORWARDING (Forwarding ) 0
GE 0/0/3 Specified port FORWARDING (forwarding) 0

Disable g0/0/1 and g0/0/2 ports

[LSW1]display mac-address
[LSW1]interface gigabitethernet 0/0/1
[LSW1-GigabitEthernet0/0/1]undo stp enable
[LSW1-GigabitEthernet0/0/1]qu
[LSW1]interface gigabitethernet 0/0/2
[LSW1-GigabitEthernet0/0/2]undo stp enable
[LSW1-GigabitEthernet0/0/2]qu

Do the same with LSW2

<Huawei>sys
Enter system view, return user view with Ctrl + Z.
[Huawei]sysname LSW2
[LSW2]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2]
Sep 14 2023 05:44:17-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 5, the
change loop count is 0, and the maximum number of records is 4095.
[LSW2]undo info-center enable
Info: Information center is disabled.
[LSW2]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge:32768.4c1f-cc39-46ec
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times:Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC:32768.4c1f-cc39-46ec/0
CIST RegRoot/IRPC:32768.4c1f-cc39-46ec/0
CIST RootPortId:0.0
BPDU-Protection:Disabled
TC or TCN received :108
TC count per hello :0
STP Converge Mode:Normal
Time since last TC :0 days 0h:3m:14s
Number of TC :10
Last TC occurred:GigabitEthernet0/0/2
----[Port1(GigabitEthernet0/0/1)][LEARNING]----
 Port Protocol:Enabled
 Port Role :Designated Port
 Port Priority:128
 Port Cost(Dot1T):Config=auto / Active=20000
 Designated Bridge/Port:32768.4c1f-cc39-46ec / 128.1
 Port Edged :Config=default / Active=disabled
 Point-to-point :Config=auto / Active=true
 Transit Limit:147 packets/hello-time
 Protection Type:None

[LSW2]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI FORWARDING NONE
   0 GigabitEthernet0/0/2 DESI FORWARDING NONE
   0 GigabitEthernet0/0/3 DESI FORWARDING NONE
[LSW2]display mac-address
[LSW2]interface g0/0/1
[LSW2-GigabitEthernet0/0/1]undo stp enable
[LSW2-GigabitEthernet0/0/1]qu
[LSW2]interface g0/0/2
[LSW2-GigabitEthernet0/0/2]undo stp enable
[LSW2-GigabitEthernet0/0/2]qu

When we ping two PCs to each other, i.e.

PC>ping 192.168.100.19 -c 8
PC>ping 192.168.100.29 -c 8

#Request timeout will occur
Ping 192.168.100.19: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!

At this time we look at the mac address table

[LSW1]display mac-address
MAC address table of slot 0:
-------------------------------------------------- --------------------------
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
               VSI/SI MAC-Tunnel
-------------------------------------------------- --------------------------
5489-9880-36b4 1 - - GE0/0/1 dynamic 0/-
5489-98a8-0ea0 1 - - GE0/0/2 dynamic 0/-
-------------------------------------------------- --------------------------
Total matching items on slot 0 displayed = 2

[LSW2]display mac-address
MAC address table of slot 0:
-------------------------------------------------- --------------------------
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
               VSI/SI MAC-Tunnel
-------------------------------------------------- --------------------------
5489-9880-36b4 1 - - GE0/0/2 dynamic 0/-
5489-98a8-0ea0 1 - - GE0/0/1 dynamic 0/-
-------------------------------------------------- --------------------------
Total matching items on slot 0 displayed = 2 

At this time, you can see the data packet capture. The data capture speed is very fast. A broadcast storm occurs. Thousands of data are sent in an instant. There will also be a significant delay when entering commands in the switch.

View LSW2’s mac address table at different time periods

You can see the same mac address, but different ports are recorded (mac address shock)

This is because broadcast storms cause broadcast messages to be forwarded in an infinite loop on the network. The switch will continue to receive repeated broadcast messages and record the source MAC address and receiving port of each message. At this time, the CPU utilization will continue to increase and the network performance will deteriorate.

[LSW2]display mac-address
MAC address table of slot 0:
-------------------------------------------------- --------------------------
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
               VSI/SI MAC-Tunnel
-------------------------------------------------- --------------------------
5489-9880-36b4 1 - - GE0/0/1 dynamic 0/-
5489-98a8-0ea0 1 - - GE0/0/2 dynamic 0/-
-------------------------------------------------- --------------------------
Total matching items on slot 0 displayed = 2

[LSW2]display mac-address
MAC address table of slot 0:
-------------------------------------------------- --------------------------
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
               VSI/SI MAC-Tunnel
-------------------------------------------------- --------------------------
5489-9880-36b4 1 - - GE0/0/2 dynamic 0/-
5489-98a8-0ea0 1 - - GE0/0/1 dynamic 0/-
-------------------------------------------------- --------------------------
Total matching items on slot 0 displayed = 2 

2. Solution: Configure STP

The following figure is an example

Configure LSW1

<Huawei>sys
Enter system view, return user view with Ctrl + Z.
[Huawei]sysname LSW1
[LSW1]
Sep 14 2023 06:29:37-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 4, the
change loop count is 0, and the maximum number of records is 4095.
[LSW1]UNDO info-center enable
Info: Information center is disabled.
[LSW1]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW1]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge:32768.4c1f-cc15-4618
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times:Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC:32768.4c1f-cc15-4618/0
CIST RegRoot/IRPC:32768.4c1f-cc15-4618/0
CIST RootPortId:0.0
BPDU-Protection:Disabled
TC or TCN received :5
TC count per hello :0
STP Converge Mode:Normal
Time since last TC :0 days 0h:2m:14s
Number of TC :5
Last TC occurred:GigabitEthernet0/0/1
----[Port1(GigabitEthernet0/0/1)][DISCARDING]----
 Port Protocol:Enabled
 Port Role :Designated Port
 Port Priority:128
 Port Cost(Dot1T):Config=auto / Active=20000
 Designated Bridge/Port:32768.4c1f-cc15-4618 / 128.1
 Port Edged :Config=default / Active=disabled
 Point-to-point :Config=auto / Active=true
 Transit Limit:147 packets/hello-time
 Protection Type:None

[LSW1]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI LEARNING NONE
   0 GigabitEthernet0/0/2 DESI LEARNING NONE
   0 GigabitEthernet0/0/3 DESI LEARNING NONE
[LSW1]display stp interface g0/0/1
-------[CIST Global Info][Mode STP]-------
CIST Bridge:32768.4c1f-cc15-4618
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times:Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC:32768.4c1f-cc15-4618/0
CIST RegRoot/IRPC:32768.4c1f-cc15-4618/0
CIST RootPortId:0.0
BPDU-Protection:Disabled
TC or TCN received :5
TC count per hello :0
STP Converge Mode:Normal
Time since last TC :0 days 0h:0m:29s
Number of TC :8
Last TC occurred:GigabitEthernet0/0/3
----[Port1(GigabitEthernet0/0/1)][FORWARDING]----
 Port Protocol:Enabled
 Port Role :Designated Port
 Port Priority:128
 Port Cost(Dot1T):Config=auto / Active=20000
 Designated Bridge/Port:32768.4c1f-cc15-4618 / 128.1
 Port Edged :Config=default / Active=disabled
 Point-to-point :Config=auto / Active=true
 Transit Limit:147 pack
[LSW1]display stp interface g0/0/1 brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI FORWARDING NONE
[LSW1]display mac-address

Use the same configuration for switch LSW2

The switch with the highest priority is selected as the root bridge. If the priorities are equal, the switch with the smallest MAC address is selected as the root bridge. By default, the priority of the switch is 32768, here set the priority of LSW2 to 8192

<Huawei>sys
Enter system view, return user view with Ctrl + Z.
[Huawei]sysname LSW2
[LSW2]STP
Sep 14 2023 06:33:29-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 4, the
change loop count is 0, and the maximum number of records is 4095.
          ^
Error:Incomplete command found at '^' position.
[LSW2]undo info-center enable
Info: Information center is disabled.
[LSW2]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge:32768.4c1f-ccd4-5efe
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times:Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC:32768.4c1f-cc15-4618/40000
CIST RegRoot/IRPC:32768.4c1f-ccd4-5efe/0
CIST RootPortId:128.1
BPDU-Protection:Disabled
TC or TCN received :62
TC count per hello:2
STP Converge Mode:Normal
Time since last TC :0 days 0h:3m:24s
Number of TC :6
Last TC occurred:GigabitEthernet0/0/1
----[Port1(GigabitEthernet0/0/1)][DISCARDING]----
 Port Protocol:Enabled
 Port Role:Root Port
 Port Priority:128
 Port Cost(Dot1T):Config=auto / Active=20000
 Designated Bridge/Port:32768.4c1f-cc75-09aa / 128.3
 Port Edged :Config=default / Active=disabled
 Point-to-point :Config=auto / Active=true
 Transit Limit:147 packets/hello-time
 Protection Type:None

[LSW2]display stp int g0/0/1
-------[CIST Global Info][Mode STP]-------
CIST Bridge:32768.4c1f-ccd4-5efe
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times:Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC:32768.4c1f-cc15-4618/40000
CIST RegRoot/IRPC:32768.4c1f-ccd4-5efe/0
CIST RootPortId:128.1
BPDU-Protection:Disabled
TC or TCN received :78
TC count per hello:2
STP Converge Mode:Normal
Time since last TC :0 days 0h:3m:42s
Number of TC :6
Last TC occurred:GigabitEthernet0/0/1
----[Port1(GigabitEthernet0/0/1)][LEARNING]----
 Port Protocol:Enabled
 Port Role:Root Port
 Port Priority:128
 Port Cost(Dot1T):Config=auto / Active=20000
 Designated Bridge/Port:32768.4c1f-cc75-09aa / 128.3
 Port Edged :Config=default / Active=disabled
 Point-to-point :Config=auto / Active=true
 Transit Limit:147 packets/hello-time
 Protection Type:None

[LSW2]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 ROOT FORWARDING NONE
   0 GigabitEthernet0/0/2 ALTE DISCARDING NONE
   0 GigabitEthernet0/0/3 DESI FORWARDING NONE
[LSW2]display stp int g0/0/1 brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 ROOT FORWARDING NONE

[LSW2]display mac-address
#Set priority
[LSW2]stp priority 8192

[LSW2]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI DISCARDING NONE
   0 GigabitEthernet0/0/2 DESI DISCARDING NONE
   0 GigabitEthernet0/0/3 DESI DISCARDING NONE
[LSW2]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI FORWARDING NONE
   0 GigabitEthernet0/0/2 DESI FORWARDING NONE
   0 GigabitEthernet0/0/3 DESI FORWARDING NONE
[LSW2]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI FORWARDING NONE
   0 GigabitEthernet0/0/2 DESI FORWARDING NONE
   0 GigabitEthernet0/0/3 DESI FORWARDING NONE
[LSW2]display stp int g 0/0/1 brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI FORWARDING NONE

Use the same configuration for switch LSW3

<Huawei>sys
Enter system view, return user view with Ctrl + Z.
[Huawei]sysname LSW3
[LSW3]
Sep 14 2023 06:36:08-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 4, the
change loop count is 0, and the maximum number of records is 4095.

[LSW3]undo info-center enable
Info: Information center is disabled.
[LSW3]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW3]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge:32768.4c1f-cc75-09aa
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times:Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC:32768.4c1f-cc15-4618/20000
CIST RegRoot/IRPC:32768.4c1f-cc75-09aa/0
CIST RootPortId:128.1
BPDU-Protection:Disabled
TC or TCN received :93
TC count per hello:2
STP Converge Mode:Normal
Time since last TC :0 days 0h:2m:13s
Number of TC :13
Last TC occurred:GigabitEthernet0/0/3
----[Port1(GigabitEthernet0/0/1)][DISCARDING]----
 Port Protocol:Enabled
 Port Role:Root Port
 Port Priority:128
 Port Cost(Dot1T):Config=auto / Active=20000
 Designated Bridge/Port:32768.4c1f-cc15-4618 / 128.1
 Port Edged :Config=default / Active=disabled
 Point-to-point :Config=auto / Active=true
 Transit Limit:147 packets/hello-time
 Protection Type:None

[LSW3]display stp int g0/0/1
-------[CIST Global Info][Mode STP]-------
CIST Bridge:32768.4c1f-cc75-09aa
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times:Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC:32768.4c1f-cc15-4618/20000
CIST RegRoot/IRPC:32768.4c1f-cc75-09aa/0
CIST RootPortId:128.1
BPDU-Protection:Disabled
TC or TCN received :104
TC count per hello:1
STP Converge Mode:Normal
Time since last TC :0 days 0h:2m:26s
Number of TC :13
Last TC occurred:GigabitEthernet0/0/3
----[Port1(GigabitEthernet0/0/1)][LEARNING]----
 Port Protocol:Enabled
 Port Role:Root Port
 Port Priority:128
 Port Cost(Dot1T):Config=auto / Active=20000
 Designated Bridge/Port:32768.4c1f-cc15-4618 / 128.1
 Port Edged :Config=default / Active=disabled
 Point-to-point :Config=auto / Active=true
 Transit Limit:147 pack
[LSW3]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 ROOT LEARNING NONE
   0 GigabitEthernet0/0/2 ALTE DISCARDING NONE
   0 GigabitEthernet0/0/3 DESI LEARNING NONE
   0 GigabitEthernet0/0/4 DESI LEARNING NONE
[LSW3]display stp int g0/0/1 brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 ROOT FORWARDING NONE
[LSW3]display mac-address

[LSW3]stp priority 4096
[LSW3]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI DISCARDING NONE
   0 GigabitEthernet0/0/2 DESI DISCARDING NONE
   0 GigabitEthernet0/0/3 DESI DISCARDING NONE
   0 GigabitEthernet0/0/4 DESI DISCARDING NONE
[LSW3]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI LEARNING NONE
   0 GigabitEthernet0/0/2 DESI LEARNING NONE
   0 GigabitEthernet0/0/3 DESI LEARNING NONE
   0 GigabitEthernet0/0/4 DESI LEARNING NONE
[LSW3]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI LEARNING NONE
   0 GigabitEthernet0/0/2 DESI LEARNING NONE
   0 GigabitEthernet0/0/3 DESI LEARNING NONE
   0 GigabitEthernet0/0/4 DESI LEARNING NONE
[LSW3]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI FORWARDING NONE
   0 GigabitEthernet0/0/2 DESI FORWARDING NONE
   0 GigabitEthernet0/0/3 DESI FORWARDING NONE
   0 GigabitEthernet0/0/4 DESI FORWARDING NONE

[LSW3]display stp interface g0/0/1 brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI FORWARDING NONE

According to both LSW2 and LSW3, it can be seen that the change of port status takes time. The specific time can be seen in the figure below:

After completing the configuration of LSW3, check the status of each port of LSW2 and LSW1.

[LSW2]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 ROOT FORWARDING NONE
   0 GigabitEthernet0/0/2 ALTE DISCARDING NONE
   0 GigabitEthernet0/0/3 DESI FORWARDING NONE

[LSW1]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 ROOT FORWARDING NONE
   0 GigabitEthernet0/0/2 ALTE DISCARDING NONE
   0 GigabitEthernet0/0/3 DESI FORWARDING NONE

[LSW3]display stp brief
 MSTID Port Role STP State Protection
   0 GigabitEthernet0/0/1 DESI FORWARDING NONE
   0 GigabitEthernet0/0/2 DESI FORWARDING NONE
   0 GigabitEthernet0/0/3 DESI FORWARDING NONE
   0 GigabitEthernet0/0/4 DESI FORWARDING NONE

You can see that the g0/0/2 ports of LSW1 and LSW2 are disabled.

For the rules of stp port selection, you can read this article:

http://t.csdn.cn/ySTni

You can also see the stp port role name above:

  1. Root Port: The port connected to the switch with the lowest priority, which is the port closest to the root switch of the spanning tree.

  2. Designated Port: For each network segment (LAN), STP selects a designated port that is used to send and receive packets and serves as the main path to the switches connected to the network segment.

  3. Blocking Port: Inactive, used to prevent loops from forming. Blocked ports do not pass data and do not participate in spanning tree calculations.

  4. Non-Designated Port: As opposed to a designated port, a port that is not selected as the primary path on a specific network segment.

The port assignments are as follows: