Experimental topology
Experimental requirement
- All devices are running STP
- Change blocking port
Experimental steps
1. All devices run STP, and observe the state after convergence
[SW1]stp mode stp [SW2]stp mode stp [SW3]stp mode stp
2. Check STP status in SW1 and find that SW1 becomes root bridge
Analysis: the principle of spanning tree convergence election is to compare the device root bridge ID, root path cost, specified bridge ID and port ID. once the size is compared, the role will be determined and subsequent parameters will not be compared.
Root bridge ID = switch priority (32768) + MAC address
Root path cost = the sum of all path costs for a non root switch to reach the root bridge
Specify bridge ID = switch priority (32768) + MAC address
Port ID = port priority (128) + port number
[Huawei]dis stp -------[CIST Global Info][Mode STP]------- CIST Bridge :32768.4c1f-cc40-5e35 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-cc40-5e35 / 0 CIST RegRoot/IRPC :32768.4c1f-cc40-5e35 / 0 CIST RootPortId :0.0 BPDU-Protection :Disabled TC or TCN received :13 TC count per hello :0 STP Converge Mode :Normal Time since last TC :0 days 1h:4m:16s Number of TC :8 Last TC occurred :Ethernet0/0/1
3. View the port role and status of each device
Looking at SW3, it is found that E0/0/2 interface is blocked.
[SW1]dis stp brief MSTID Port Role STP State Protection 0 Ethernet0/0/1 DESI FORWARDING NONE 0 Ethernet0/0/2 DESI FORWARDING NONE
[SW2]dis stp brief MSTID Port Role STP State Protection 0 Ethernet0/0/1 DESI FORWARDING NONE 0 Ethernet0/0/2 ROOT FORWARDING NONE
[SW3]dis stp brief MSTID Port Role STP State Protection 0 Ethernet0/0/1 ROOT FORWARDING NONE 0 Ethernet0/0/2 ALTE DISCARDING NONE
4. Change the overhead on SW3 to make the blocking port switch to e 0/0/1.
It is observed that E0/0/1 port becomes standby port.
[Huawei-Ethernet0/0/1]stp cost 400001 [Huawei-Ethernet0/0/1]dis stp brief MSTID Port Role STP State Protection 0 Ethernet0/0/1 ALTE DISCARDING NONE 0 Ethernet0/0/2 ROOT FORWARDING NONE
Analysis: to change the blocking port to E0/0/1, we need to spend more on SW3 to SW1 than SW3 to LW1 through SW2. Huawei's default port cost is 200000, and we need to change the E0/0/1 interface cost of SW1 to 400001.