Professional Documents
Culture Documents
ISSUE 1.1
ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.1 Table of Contents
Table of Contents
Experiment Description.................................................................................................................. 1
Experiment Description.............................................................................................................. 1
Version Introduction................................................................................................................... 1
Experiment Objectives............................................................................................................... 1
Experiment Tasks....................................................................................................................... 1
Relevant Materials..................................................................................................................... 1
Chapter 1 STP/RSTP Configuration............................................................................................... 2
1.1 Networking and Service Description....................................................................................2
1.2 Command Line List.............................................................................................................. 2
1.3 Configuration Procedure...................................................................................................... 3
1.4 Result Verification................................................................................................................ 3
1.4.1 Computation Process of Spanning Tree....................................................................3
1.4.2 Port state switching.................................................................................................... 9
1.4.3 Two Work Modes of RSTP.......................................................................................11
1.4.4 Other Configuration................................................................................................. 12
1.5 FAQ.................................................................................................................................... 13
1.6 Configuration Reference.................................................................................................... 13
1.6.1 Starting up RSTP..................................................................................................... 13
1.6.2 Check the Configured STP Information...................................................................13
1.6.3 Check the Received/Transmitted BPDU Message of Port After the Port State
Transition.......................................................................................................................... 13
1.6.4 Set the STP-Compatible Mode................................................................................13
Chapter 2 MSTP Configuration (Additional task)...................................................................14
2.1 Networking and Service Description..................................................................................14
2.2 Command Line List............................................................................................................ 14
2.3 Configuration Flow............................................................................................................. 15
2.4 Configuration Procedure.................................................................................................... 15
2.5 Result Verification.............................................................................................................. 15
2.6 Configuration Reference.................................................................................................... 17
2.6.1 Configure Vlan......................................................................................................... 17
2.6.2 Starting up MSTP.................................................................................................... 18
2.6.3 Configure MST......................................................................................................... 18
2.6.4 Active region configuration.......................................................................................19
Experiment Description
Experiment Description
This course introduces the computation process and basic principles of STP in detail
in terms of technical theory and operation procedure. This experiment topic describes
the currently prevalent multi-switch for implementing the redundant LAN structure.
Version Introduction
This course corresponds to the product versions: VRP Version 3.10
Experiment Objectives
After completing the hands-on experiment of this course, you will be able to:
Grasp the STP computation process
Understand the port state switching
Understand the two work modes of RSTP protocol
Understand the principle of MSTP protocol
Experiment Tasks
STP/RSTP Computation process and Port state switching.
MSTP configuration.
Relevant Materials
Relevant Huawei product operation manuals
SwitchB
E0/1
S
E0/2
E0/1 E0/2
SwitchC
SwitchA
S S
E0/3 E0/3
Figure 1.1
Operation Command
Set Path Cost of the Specific Port stp cost cost
Enable RSTP on the specified port stp enable
Disable RSTP on the specified port stp disable
Configure the specific port as an edge port/non edge stp edged-port { enable | disable }
port
Configure the loop protection function of the switch stp loop-protection
Set mCheck of the specified port stp mcheck { primary | secondary
Set Whether the Specific Port Is Connected to Point- stp point-to-point { auto | force-
to-Point Link false | force-true }
Set Priority of the Specific Port stp port priority port-priority
Configure the Root protection function of the switch stp root-protection
Set the Maximum Transmission Limit for the Specific stp transmit-limit packetnum
Port
Switch C:00e0-fc26-437c
After the connection is completed, the switch indicator will flash quickly. It indicates
that the 3 switches forward packets to each other, thus forming a loop. You can STP
protocol to avoid loop.
STP is the abbreviation of Spanning Tree Protocol. This protocol can be used for loop
network. It can trim the loop network into tree-shape network without loops by
interdicting some redundancy paths via certain algorithm, so as to avoid the
increment and endless cycling of packets in the loop network.
The RSTP (Rapid STP) realized by Quidway Ethernet switch is the optimized version
of STP. The "Rapid" is shown in the way that the delay when the root port and
designated port enter Forwarding status will be reduced greatly, therefore, the time
need for stabilizing the network topology will be reduced.
On the Quidway Lanswitch, start the STP protocol. The commands are as follows:
[SwitchA] stp enable
[SwitchB] stp enable
[SwitchC] stp enable
After the RSTP protocol is configured in the whole network, each port of the switch
enables the RSTP protocol by default. The switch indicator does not flash quickly any
longer. It indicates that the switch has established the loop-free forwarding spanning
tree. What does this tree look like? We can analyze theoretically first, and verify our
analysis results through the state information of the switch.
The process of the implementing the spanning tree algorithm is as follows:
1) Initial status
Initially, each port of each switch generates a configuration message, using the switch
itself as root. The root path overhead is 0, the specified switch ID is the ID of this
switch, and the specified port is this port.
Switch A:
Configuration message of port Ethernet 0/1:
{32768. 00e0-fc22-6fda,0,32768.00e0-fc22-6fda,e0/1}
Configuration message of port Ethernet 0/3:
{32768. 00e0-fc22-6fda,0,32768.00e0-fc22-6fda,e0/3}
Switch B:
Configuration message of port Ethernet 0/1:
{32768.00e0-fc17-c484,0,32768.00e0-fc17-c484,e0/1}
Configuration message of port Ethernet 0/2:
{32768.00e0-fc17-c484,0,32768.00e0-fc17-c484,e0/2}
Switch C:
Configuration message of port Ethernet 0/2:
{32768.00e0-fc26-437c,0,32768.00e0-fc26-437c,e0/2}
Configuration message of port Ethernet 0/3:
{32768.00e0-fc26-437c,0,32768.00e0-fc26-437c,e0/3}
2) Select the best configuration message, and determine the root switch
Each switch sends its configuration message to the outside. When the port receives a
configuration message with a preference level lower than that of the port itself, the
switch will discard the received configuration message, and do not process the
configuration message of this port. When the port receives a configuration message
with a preference level higher than that of the port itself, the switch will replace the
contents of the configuration message with the received configuration message, then
the Lanswitch will compare the configuration message of this port with the
configuration message of other ports, and select the best configuration message.
According to the comparison principle, the IDs of the switches are compared first. The
ID of the switch is composed of the preference level (default value: 32768) and the
MAC address of the switch. Initially, the preference level of the switch is the default
value, and the one with the lowest MAC value is the root. Obviously, the root switch
should be Switch B.
Use the following commands to view the configured STP information.
[SwitchA]display stp
Protocol mode: IEEE RSTP
The bridge ID (Pri.MAC): 32768.00e0-fc22-6fda
The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec
Root bridge ID(Pri.MAC): 32768.00e0-fc17-c484
Root path cost: 200
Bridge bpdu-protection: disabled
Timeout factor: 3
… …
[SwitchB]display stp
Protocol mode: IEEE RSTP
The bridge ID (Pri.MAC): 32768.00e0-fc17-c484
The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec
Root bridge ID(Pri.MAC): 32768.00e0-fc17-c484
Root path cost: 0
Bridge bpdu-protection: disabled
Timeout factor: 3
… …
[SwitchC]display stp
Protocol mode: IEEE RSTP
The bridge ID (Pri.MAC): 32768.00e0-fc26-437c
The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec
Root bridge ID(Pri.MAC): 32768.00e0-fc17-c484
Root path cost: 200
Bridge bpdu-protection: disabled
Timeout factor: 3
……
We can see that 3 switches present the following information:
Root bridge ID(Pri.MAC): 32768.00e0-fc17-c484.
Therefore, the root switch is 00e0-fc17-c484, namely, Switch B. The default
preference level of the root switch is 32768 (default value, configurable).
3) Then determine the root port, block the redundancy link, and update the
configuration information of the specified port.
The switch port that receives the preferred configuration message is the root port.
The port configuration message will not change. In other ports, if the configuration
message of a port is updated in the “Select the preferred configuration message”
process, the switch will block this port, and the port configuration message remains
unchanged. This port will not forward data any longer, and will only receive but not
send configuration messages. If the configuration message of a port is not updated in
the “Select the preferred configuration message” process, the switch will determine it
as specified port, and the configuration message will change in this way: The tree root
ID is replaced by the tree root ID of the root port; the root path overhead is replaced
by the root path overhead of configuration message plus the corresponding path
overhead of root port; the specified switch ID is replaced by the ID of its own switch;
and the specified port ID is replaced by the ID of its own port.
In this example, the comparison process of all switches is as follows:
Switch A:
Port Ethernet 0/1 receives the configuration message of Switch B, and Switch A
discovers that the configuration message preference level of this port is lower than
the preference level of the received configuration message. Therefore, the
configuration message of Ethernet 0/1 of this port is updated.
Port Ethernet 0/3 receives the configuration message of Switch C, and Switch A
discovers that the configuration message preference level of this port is higher than
the preference level of the received configuration message. Therefore, the received
configuration message is discarded.
Now, the configuration messages of the ports are as follows:
Configuration message of port Ethernet 0/1:
{32768.00e0-fc17-c484,200,32768.00e0-fc17-c484,e0/1}
Configuration message of port Ethernet 0/3:
{32768.00e0-fc22-6fda, 0,32768.00e0-fc22-6fda,e0/3}
Switch A compares the configuration message of each port, selects the configuration
message of port Ethernet 0/1 as the preferred configuration message, then
determines port Ethernet 0/1 as the root port. The configuration messages of all ports
of the whole switch are updated as follows:
The configuration message of the root port Ethernet 0/1 remains unchanged:
{32768.00e0-fc17-c484,200,32768.00e0-fc17-c484,e0/1}. In the configuration
message of port Ethernet 0/3, the tree root ID is updated to the tree root ID of the
preferred configuration message. The root path overhead is updated to 200, and the
ID of the specified switch is updated to the ID of this switch, and the ID of the
specified port is updated to the ID of this port. The configuration message is changed
to: {32768.00e0-fc17-c484,200,32768.00e0-fc22-6fda,e0/3}. Then the specified port
of Switch A sends out its own configuration message periodically.
[SwitchA]display stp interface ethernet0/1 ethernet0/3
Protocol mode: IEEE RSTP
The bridge ID (Pri.MAC): 32768.00e0-fc22-6fda
The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec
Root bridge ID(Pri.MAC): 32768.00e0-fc17-c484
Root path cost: 200
Bridge bpdu-protection: disabled
Timeout factor: 3
Switch B:
Port Ethernet 0/1 receives the configuration message of Switch A. Switch B discovers
that the preference level of the configuration message of this port is higher than that
of the received configuration message, so discards the received configuration
message. The configuration message of port Ethernet 0/2 is similar to port Ethernet
0/1. Switch B discovers that the tree root in the configuration message of each port
and the specified switch are switch B itself, so deems itself as tree root. The
configuration messages of all ports remain unchanged. Afterwards, the configuration
messages are sent out periodically. Now, the configuration messages of the two ports
are as follows:
Configuration message of port Ethernet 0/1: {32768.00e0-fc17-c484,0,32768.00e0-
fc17- c484,e0/1}
Configuration message of port Ethernet 0/2: {32768.00e0-fc17-c484,0,32768.00e0-
fc17- c484,e0/2}
[SwitchB]display stp interface ethernet0/1 ethernet0/2
Protocol mode: IEEE RSTP
The bridge ID (Pri.MAC): 32768.00e0-fc17-c484
The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec
Root bridge ID(Pri.MAC): 32768.00e0-fc17-c484
Root path cost: 0
Bridge bpdu-protection: disabled
Timeout factor: 3
Switch C:
Port Ethernet 0/2 receives the configuration message of Switch B, and Switch C
discovers that the configuration message preference level of this port is lower than
the preference level of the received configuration message. Therefore, the
configuration message of Ethernet 0/2 of this port is updated.
Port Ethernet 0/3 receives the configuration message of Switch A, and Switch C
discovers that the configuration message preference level of this port is lower than
the preference level of the received configuration message. Therefore, the
configuration message of Ethernet 0/3 of this port is updated.
Now, the configuration messages of the ports are as follows:
Configuration message of port Ethernet 0/2:
{32768.00e0-fc17-c484,200,32768.00e0-fc17-c484,e0/2}
Configuration message of port Ethernet 0/3:
{32768.00e0-fc17-c484,400,32768.00e0-fc22-6fda,e0/3}
Switch C compares the configuration message of each port, selects the configuration
message of port Ethernet 0/2 as the preferred configuration message, then
determines port Ethernet 0/2 as the root port. The configuration messages of all ports
of the whole switch are updated as follows:
The configuration message of root port Ethernet 0/2 remains unchanged, and the port
Ethernet 0/3 may be blocked. The port configuration message also remains
unchanged, and this port does not receive the data forwarded from switch A
(exclusive of protocol packets of STP) until new conditions occur and trigger the
recalculation of spanning tree, e.g., the link from switch B to switch C breaks down, or
the port receives a preferred configuration message.
[SwitchC]display stp interface ethernet0/2 ethernet0/3
Protocol mode: IEEE RSTP
The bridge ID (Pri.MAC): 32768.00e0-fc26-437c
The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec
Root bridge ID(Pri.MAC): 32768.00e0-fc17-c484
Root path cost: 200
Bridge bpdu-protection: disabled
Timeout factor: 3
The spanning tree is now determined, and the tree root is switch B. The tree is
illustrated below:
SwitchB
E0/1
S
E0/2
E0/1 E0/2
SwitchC
SwitchA
S S
E0/3 E0/3
Figure 1.2
As shown in the above figure, when the spanning tree is in the stable state,
ethernet0/2 of switch C is in the forwarding state, receives the BPDU message
normally, and receives/sends packets normally. ethernet0/3 is in the discarding state,
receives BPDU messages normally, but cannot receive or send packets. Listed below
are capabilities of relevant ports in receiving/sending BPDU messages.
<SwitchC> debugging stp packet
<SwitchC>terminal debugging
% Current terminal debugging is on
Flags: 2e
Root Identifier: 80.00.00.e0.fc.17.c4.84
Root Path Cost: 00c8
Bridge Identifier: 80.00.00.e0.fc.22.6f.da
Port Identifier: 80.03
Message Age: 0100
Max Age: 1400
Hello Time: 0200
Forward Delay: 0f00
Version 1 Length: 00
*0.10512487 SwitchC RSTP/8/PACKET:
Connect switch B with switch C again, and port ethernet0/2 of switch C will change
the forwarding state again, and the port ethernet0/3 of switch C will be blocked again.
The RSTP (Rapid STP) realized by Quidway Ethernet switch is the optimized version
of STP. The work modes of RSTP include two types: RSTP mode, and STP-
compatible mode. By default, the RSTP works in the RSTP mode. If all devices in the
network run the RSTP, the switch that runs the RSTP will work in the RSTP mode. If
some devices run STP and others run RSTP in the network, it is recommended to set
the switch of RSTP to work in the STP-compatible mode.
Modify the configuration of switch C, and make it work in the STP-compatible mode.
The command is:
[SwitchC]stp mode stp
Display the port information of switch C. Verify the interworking between the STP
work mode and the RSTP work mode.
Finally, there are some key parameters about STP, e.g., use the command “stp
priority { number } to modify the preference of switches, so as to configure the
priority of a specified bridge. Further, you can use the command “stp root primary”
and the command “stp root secondary” to specify the root switch and backup root
switch directly; use the command “stp cost { number }” to modify the cost value of the
port to affect the selection of root port of the spanning tree; or use the command “ stp
edged-port { enable | disable }” to configure the edge port. During recalculation of
the spanning tree, the edge port can be transitioned to the forwarding state directly,
thus avoiding the unnecessary transition time.
The STP implemented by the Quidway S-series switches also includes many other
parameters. By configuring such parameters, the switch performance can be exerted
to a better extent, thus improving the network reliability. The learners can experience
this in the lab.
1.5 FAQ
Q: When I enable “debugging” to check the debugging information, the information
keeps updating, and the screen keeps scrolling down, which is not stoppable. What
should I do?
A: You have to use the command “undo debugging all” to disable the debugging
information and stop the output of information. When inputting the command, the
output information may submerge the command characters that you have input. Just
input the complete command characters and press Enter. In addition, you can use the
mouse to select some of the information, and screen will stop scrolling down.
[SwitchA]stp enable
[SwitchB]stp enable
[SwitchC]stp enable
[SwitchA]display stp
[SwitchB]display stp
[SwitchC]display stp
[SwitchA]display stp interface ethernet0/1 ethernet0/3
[SwitchB]display stp interface ethernet0/1 ethernet0/2
[SwitchC]display stp interface ethernet0/2 ethernet0/3
1.6.3 Check the Received/Transmitted BPDU Message of Port After the Port
State Transition
Switch A Switch B
Permit : Permit :
VLAN 10, 20 VLAN 20, 30
Permit : Permit :
VLAN 10, 20 VLAN 20, 30
Switch D
Switch C
Permit :VLAN 20, 40
Figure 1.3
Figure 2-1
Note:
The first column MSTID indicates the instance of the port. If its value is 0, it means CIST.
The third column Role indicates the role that the port acts as on the instance. Different instances
calculate separately.
The fourth column STP State indicates the status of the port.
Because SWC has the smallest MAC address, it is the root bridge. So the states and the roles are
the same.
From the information above you can know the role of each port. You can also look up
the whole information about STP.
[SWA]dis stp
-------[CIST Global Info][Mode MSTP]-------
CIST Bridge :32768.00e0-fc58-271d
Bridge Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :32768.00e0-fc49-0d31 / 0
CIST RegRoot/IRPC :32768.00e0-fc49-0d31 / 199999
CIST RootPortId :128.2
BPDU-Protection :disabled
TC or TCN received :22
Time since last TC :0 days 0h:3m:58s
----[Port1(Ethernet1/0/1)][FORWARDING]----
Port Protocol :enabled
Port Role :CIST Designated Port
Port Priority :128
Port Cost(Dot1T) :Config=auto / Active=199999
Desg. Bridge/Port :32768.00e0-fc58-271d / 128.1
Port Edged(Admin) :disabled
Point-to-point :Config=auto / Active=true
Transit Limit :3 packets/hello-time
Protection Type :None
Num of Vlans Mapped :1
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0
BPDU Sent :2358
TCN: 0, Config: 0, RST: 0, MST: 2358
----[Port2(Ethernet1/0/2)][FORWARDING]----
Port Protocol :enabled
Port Role :CIST Root Port
Port Priority :128
Port Cost(Dot1T) :Config=auto / Active=199999
Desg. Bridge/Port :32768.00e0-fc49-0d31 / 128.2
Port Edged(Admin) :disabled
Point-to-point :Config=auto / Active=true
Transit Limit :3 packets/hello-time
Protection Type :None
Num of Vlans Mapped :1
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0
BPDU Sent :14
TCN: 0, Config: 0, RST: 0, MST: 14
BPDU Received :3591
TCN: 0, Config: 0, RST: 0, MST: 3591
----[Port3(Ethernet1/0/3)][FORWARDING]----
Port Protocol :enabled
Port Role :CIST Designated Port
Port Priority :128
Port Cost(Dot1T) :Config=auto / Active=199999
Desg. Bridge/Port :32768.00e0-fc58-271d / 128.3
Port Edged(Admin) :disabled
Point-to-point :Config=auto / Active=true
Transit Limit :3 packets/hello-time
Protection Type :None
Num of Vlans Mapped :1
PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0
BPDU Sent :2353
TCN: 0, Config: 0, RST: 0, MST: 2353
BPDU Received :1272
TCN: 0, Config: 0, RST: 0, MST: 1272
I. Configure Switch A
[SWA]vlan 2
[SWA]vlan 3
[SWA]vlan 4
[SWA]interface Ethernet 1/0/1
[SWA-Ethernet1/0/1]port link-type trunk
[SWA-Ethernet1/0/1]port trunk permit vlan all
[SWA]interface Ethernet 1/0/2
[SWA-Ethernet1/0/2]port link-type trunk
[SWA-Ethernet1/0/2]port trunk permit vlan 1 2
[SWA]interface Ethernet 1/0/3
[SWA-Ethernet1/0/3]port link-type trunk
[SWA-Ethernet1/0/3]port trunk permit vlan 2 3
I. Configure Switch A
[SWA]stp region-configuration
[SWA-mst-region]region-name test
[SWA-mst-region]revision-level 0
[SWA-mst-region]instance 1 vlan 1
[SWA-mst-region]instance 3 vlan 3
[SWA-mst-region]instance 4 vlan 4