You are on page 1of 23

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE 1.

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

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 ..................................................................................................... 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

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

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

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

Chapter 1 STP/RSTP Configuration


1.1 Networking and Service Description
SwitchB

E0/1 E0/1 SwitchA

E0/2 E0/2 SwitchC

S
E0/3 E0/3

Figure 1-1 3 Quidway S3526E switches; 1 PC, 3 standard network cables, and 1 console cable

1.2 Command Line List


The configuration commands in the system view are:
Operation Command

Start/shut down the device RSTP Configure the switch that runs RSTP to work in the STP compatible mode or the RSTP mode Configure the BPDU protection function of the switch Configure the Bridge preference level of the specific switch Specify the switch as the root switch of spanning tree Specify the switch as backup root switch of spanning tree Configure Forward Delay of the specific switch Configure Hello Time of the specific switch Configure Max Age of the specific switch Configure the timeout factor of the specific switch

stp { enable | disable } stp mode { stp | rstp } stp bpdu-protection stp priority bridge-priority stp root primary stp root secondary stp timer forward-delay centiseconds stp timer hello centiseconds stp timer max-age centiseconds stp timeout-factor number

Configuration commands in the port view:

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

Operation

Command

Set Path Cost of the Specific Port Enable RSTP on the specified port Disable RSTP on the specified port Configure the specific port as an edge port/non edge port Configure the loop protection function of the switch Set mCheck of the specified port Set Whether the Specific Port Is Connected to Point-to-Point Link Set Priority of the Specific Port Configure the Root protection function of the switch Set the Maximum Transmission Limit for the Specific Port
Display and Debug STP
Operation

stp cost cost stp enable stp disable stp edged-port { enable | disable } stp loop-protection stp mcheck { primary | secondary stp point-to-point { auto | force-false | force-true } stp port priority port-priority stp root-protection stp transmit-limit packetnum

Command

Display RSTP configuration information about the local switch and the specified ports Turn on RSTP debugging switch (receiving and transmitting of packet, event, and error) Enable the debugging information to be output at the terminal

display stp [ interface interface-list ] [ undo ] debugging stp { error | event | packet | all } terminal debugging

1.3 Configuration procedure


Task 1: Computation process of spanning tree Run stp enable in the system-view. Task 2: Port state switching Disconnect Switch B from Switch C, and observe the change of the Switch C port state Task 3: Two work modes of RSTP Run stp mode { rstp | stp } in system-view. Task 4: Other optional configuration Use commands to change key parameters of STP

1.4 Result Verification


1.4.1 Computation Process of Spanning Tree
As shown in the above figure, 3 Quidway S-series LANSwitches are connected in a ring shape. The MAC addresses of the 3 switches are: Switch A:00e0-fc22-6fda Switch B:00e0-fc17-c484
Confidential Information of Huawei. No Spreading without Permission 3

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

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}

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

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
Confidential Information of Huawei. No Spreading without Permission 5

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

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 Port 1 (Ethernet0/1) of bridge is Forwarding Port spanning tree protocol: enabled Port role: Root Port Port path cost: 200 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc17-c484 The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 0 BPDU sent: 4 TCN: 0, RST: 4, Config BPDU: 0 BPDU received: 458 TCN: 0, RST: 458, Config BPDU: 0

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0


Port 3 (Ethernet0/3) of bridge is Forwarding Port spanning tree protocol: enabled Port role: Designated Port Port path cost: 200 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc22-6fda The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 1 BPDU sent: 563 TCN: 0, RST: 563, Config BPDU: 0 BPDU received: 5 TCN: 0, RST: 5, Config BPDU: 0

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 {32768.00e0-fc17-c484,0,32768.00e0-fc17- c484,e0/1} Configuration message of port {32768.00e0-fc17-c484,0,32768.00e0-fc17- c484,e0/2} Ethernet Ethernet 0/1: 0/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 Port 1 (Ethernet0/1) of bridge is Forwarding Port spanning tree protocol: enabled Port role: Designated Port Port path cost: 200 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc17-c484 The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 0 BPDU sent: 719 TCN: 0, RST: 719, Config BPDU: 0 BPDU received: 6 TCN: 0, RST: 6, Config BPDU: 0 Port 2 (Ethernet0/2) of bridge is Forwarding Port spanning tree protocol: enabled Port role: Designated Port Port path cost: 200 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc17-c484 The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0


Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 0 BPDU sent: 790 TCN: 0, RST: 790, Config BPDU: 0 BPDU received: 3 TCN: 0, RST: 3, Config BPDU: 0

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 Port 2 (Ethernet0/2) of bridge is Forwarding Port spanning tree protocol: enabled Port role: Root Port Port path cost: 200 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc17-c484 The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 0 BPDU sent: 8 TCN: 0, RST: 8, Config BPDU: 0 BPDU received: 1382 TCN: 0, RST: 1382, Config BPDU: 0

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0


Port 3 (Ethernet0/3) of bridge is Discarding Port spanning tree protocol: enabled Port role: Alternate Port Port path cost: 200 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc22-6fda The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 1 BPDU sent: 8 TCN: 0, RST: 8, Config BPDU: 0 BPDU received: 1447 TCN: 0, RST: 1447, Config BPDU: 0

The spanning tree is now determined, and the tree root is switch B. The tree is illustrated below:

SwitchB

E0/1

E0/2 E0/2 SwitchC

E0/1 SwitchA

S
E0/3 E0/3

Figure 1-2

1.4.2 Port state switching


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 Port3: Received Packet //The port in the Discarding state receives the BPDU message normally *0.10511380 SwitchC RSTP/8/PACKET: Protocol Identifier: 0000 Protocol Version ID: 02 BPDU Type: 02 Flags: 2e Root Identifier: 80.00.00.e0.fc.17.c4.84

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0


Root Path Cost: Bridge Identifier: Port Identifier: Message Age: Max Age: Hello Time: Forward Delay: Version 1 Length: *0.10512487 SwitchC 00c8 80.00.00.e0.fc.22.6f.da 80.03 0100 1400 0200 0f00 00 RSTP/8/PACKET:

Port2: Received Packet //The port in the Forwarding state receives BPDU message normally. *0.10646778 SwitchC RSTP/8/PACKET: Protocol Identifier: 0000 Protocol Version ID: 02 BPDU Type: 02 Flags: 2c Root Identifier: 80.00.00.e0.fc.17.c4.84 Root Path Cost: 0000 Bridge Identifier: 80.00.00.e0.fc.17.c4.84 Port Identifier: 80.02 Message Age: 0000 Max Age: 1400 Hello Time: 0200 Forward Delay: 0f00 Version 1 Length: 00 *0.10647379 SwitchC RSTP/8/PACKET:

Now, Switch B is disconnected from Switch C. This way, the ethernet0/2 port of switch C will not break down. The port ethernet0/3 will change from the Discarding state to the Forwarding state, and undertake the data receiving/sending. 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. Preconditions of fast transition of root port state are: Old ports on this switch have stopped forwarding data, and the upstream specified port has begun forwarding data. The ethernet0/2 port of switch C stops forwarding data, and the ethernet0/3 of the upstream specified port switch A has been in the forwarding state, and meets the conditions of fast forwarding. Port ethernet0/3 of switch C will transition to the forwarding state quickly. The debugging information is as follows:
<SwitchC>debugging stp packet <SwitchC>terminal debugging Port3: Received Packet *0.11009688 SwitchC RSTP/8/PACKET: Protocol Identifier: 0000 Protocol Version ID: 02 BPDU Type: 02 Flags: 2c 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.11011618 SwitchC RSTP/8/PACKET:

The port display information of switch C is as follows:


<SwitchC>display stp interface ethernet0/2 ethernet0/3

10

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0


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: 400 Bridge bpdu-protection: disabled Timeout factor: 3 Port 2 (Ethernet0/2) of bridge is DOWN //This port is disconnected Port spanning tree protocol: enabled Port role: Disabled Port Port path cost: 200000 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc26-437c The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 1 BPDU sent: 8 TCN: 0, RST: 8, Config BPDU: 0 BPDU received: 5166 TCN: 0, RST: 5166, Config BPDU: 0 Port 3 (Ethernet0/3) of bridge is Forwarding //Change to Forwarding state Port spanning tree protocol: enabled Port role: Root Port Port path cost: 200 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc22-6fda The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 1 BPDU sent: 9 TCN: 0, RST: 9, Config BPDU: 0 BPDU received: 5343 TCN: 0, RST: 5343, Config BPDU: 0

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.

1.4.3 Two Work Modes of RSTP


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. Check the STP information:
[SwitchC]display stp interface ethernet0/2 ethernet0/3 Protocol mode: IEEE compatible STP //Work in the STP mode The bridge ID (Pri.MAC): 32768.00e0-fc26-437c The bridge times: Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec

Confidential Information of Huawei.

No Spreading without Permission

11

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0


Root bridge ID(Pri.MAC): 32768.00e0-fc17-c484 SwitchB Root path cost: 400 Bridge bpdu-protection: disabled Timeout factor: 3 //The root switch is still

Port 2 (Ethernet0/2) of bridge is Forwarding Port spanning tree protocol: enabled Port role: Root Port Port path cost: 200 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc17-c484 The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 0 BPDU sent: 13 TCN: 3, RST: 8, Config BPDU: 2 BPDU received: 5185 TCN: 0, RST: 5169, Config BPDU: 16 Port 3 (Ethernet0/3) of bridge is Discarding Port spanning tree protocol: enabled Port role: Alternate Port Port path cost: 200 Port priority: 128 Designated bridge ID(Pri.MAC): 32768.00e0-fc22-6fda The Port is a non-edged port Connected to a point-to-point LAN segment Maximum transmission limit is 3 Packets / hello time Times: Hello Time 2 sec, Max Age 20 sec Forward Delay 15, Message Age 1 BPDU sent: 9 TCN: 0, RST: 9, Config BPDU: 0 BPDU received: 5634 TCN: 0, RST: 5634, Config BPDU: 0

As shown above, the root switch is still Switch B. The shape of the spanning tree does not change. The port ethernet0/2 of switch C is still in the forwarding state. The ethernet 0/3 is still in the discarding state.

1.4.4 Other Configuration


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.

12

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

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.

1.6 Configuration Reference


1.6.1 Starting up RSTP
[SwitchA]stp enable [SwitchB]stp enable [SwitchC]stp enable

1.6.2 Check the Configured STP Information


[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
<SwitchC>debugging stp packet <SwitchC>terminal debugging

1.6.4 Set the STP-Compatible Mode


[SwitchC]stp mode stp [SwitchC]display stp interface ethernet0/2 ethernet0/3

Confidential Information of Huawei.

No Spreading without Permission

13

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

Chapter 2 MSTP Configuration Additional task


2.1 Networking and Service Description
Permit :all VLAN Switch A Permit : VLAN 10, 20 Permit : VLAN 10, 20 Switch B Permit : VLAN 20, 30 Permit : VLAN 20, 30 Switch D Permit :VLAN 20, 40

Switch C

Figure 2-1 4 Quidway S3900 switches; 1 PC, 6 standard network cables, and 1 console cable

2.2 Command Line List


The configuration commands in the system view are:
Operation Enter MSTP region view Command stp region-configuration

Configuration commands in the MST region view:


Operation Specify region name Specify revision level Spanning tree instance Active region configuration Command region-name name revision-level level instance instance-id vlan vlan-list active region-configuration

Display and Debug STP


Operation Display STP configuration information about the local switch and the specified ports Display Spanning tree instance configuration information Display MSTP region configuration information Reset stp Turn on RSTP debugging switch display stp display stp instance instance-id [ interface interface-list ] [ brief ] display stp region-configuration reset stp [ interface interface-list ] debugging stp [ interface interface-list ] { packet | event } Command

14

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

2.3 Configuration flow


Vlan configuration

Run MSTP

MSTI configuration

Active region

Figure 2-1

2.4 Configuration procedure


1) Vlan configuration All the switches configure vlan 1, 2, 3, 4 and set the link between each switch as truck type. 2) Run MSTP In the system view, enable STP by default as MSTP mode. 3) MST configuration All switches belong to the same MST region. Configure every MSTI for every vlan. Configure MST attributes. 4) Active region configuration Manually activate the MST region configuration

2.5 Result Verification


After finishing configuration, until network is stable, we can check all switches ports status.
[SWA]display stp brief MSTID Port 0 Ethernet1/0/1 0 Ethernet1/0/2 0 Ethernet1/0/3 1 Ethernet1/0/1 1 Ethernet1/0/2 1 Ethernet1/0/3 3 Ethernet1/0/1 3 Ethernet1/0/3 4 Ethernet1/0/1 [SWB]display stp brief MSTID Port 0 Ethernet1/0/1 0 Ethernet1/0/4 0 Ethernet1/0/5 Role STP State DESI FORWARDING ROOT FORWARDING DESI FORWARDING DESI FORWARDING ROOT FORWARDING DESI FORWARDING DESI FORWARDING DESI FORWARDING DESI FORWARDING Protection NONE NONE NONE NONE NONE NONE NONE NONE NONE

Role STP State ALTE DISCARDING ROOT FORWARDING ALTE DISCARDING

Protection NONE NONE NONE

Confidential Information of Huawei.

No Spreading without Permission

15

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0


1 1 1 3 3 4 Ethernet1/0/1 Ethernet1/0/4 Ethernet1/0/5 Ethernet1/0/1 Ethernet1/0/5 Ethernet1/0/1 ALTE ROOT ALTE ROOT ALTE ROOT DISCARDING FORWARDING DISCARDING FORWARDING DISCARDING FORWARDING NONE NONE NONE NONE NONE NONE

[SWC]display stp brief MSTID Port 0 Ethernet1/0/2 0 Ethernet1/0/4 0 Ethernet1/0/6 1 Ethernet1/0/2 1 Ethernet1/0/4 1 Ethernet1/0/6 4 Ethernet1/0/6 [SWD]display stp brief MSTID Port 0 Ethernet1/0/3 0 Ethernet1/0/5 0 Ethernet1/0/6 1 Ethernet1/0/3 1 Ethernet1/0/5 1 Ethernet1/0/6 3 Ethernet1/0/3 3 Ethernet1/0/5 4 Ethernet1/0/6

Role STP State DESI FORWARDING DESI FORWARDING DESI FORWARDING DESI FORWARDING DESI FORWARDING DESI FORWARDING DESI FORWARDING

Protection NONE NONE NONE NONE NONE NONE NONE

Role STP State ALTE DISCARDING DESI FORWARDING ROOT FORWARDING ALTE DISCARDING DESI FORWARDING ROOT FORWARDING ROOT FORWARDING DESI FORWARDING ROOT FORWARDING

Protection NONE NONE NONE NONE NONE NONE NONE NONE NONE

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

16

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0


BPDU Received :996 TCN: 0, Config: 0, RST: 0, MST: 996 ----[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

2.6 Configuration Reference


2.6.1 Configure Vlan
I. Configure Switch A
[SWA]vlan 10 [SWA]vlan 20 [SWA]vlan 30 [SWA]vlan 40 [SWA]interface Ethernet [SWA-Ethernet1/0/1]port [SWA-Ethernet1/0/1]port [SWA]interface Ethernet [SWA-Ethernet1/0/2]port [SWA-Ethernet1/0/2]port [SWA]interface Ethernet [SWA-Ethernet1/0/3]port [SWA-Ethernet1/0/3]port

1/0/1 link-type trunk trunk permit vlan all 1/0/2 link-type trunk trunk permit vlan 10 20 1/0/3 link-type trunk trunk permit vlan 20 30

II. Configure Switch B


[SWB]vlan 10 [SWB]vlan 20 [SWB]vlan 30 [SWB]vlan 40 [SWB]interface Ethernet 1/0/1

Confidential Information of Huawei.

No Spreading without Permission

17

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0


[SWB-Ethernet1/0/1]port [SWB-Ethernet1/0/1]port [SWB]interface Ethernet [SWB-Ethernet1/0/4]port [SWB-Ethernet1/0/4]port [SWB]interface Ethernet [SWB-Ethernet1/0/5]port [SWB-Ethernet1/0/5]port link-type trunk trunk permit vlan all 1/0/4 link-type trunk trunk permit vlan 10 20 1/0/5 link-type trunk trunk permit vlan 20 30

III. Configure Switch C


[SWC]vlan 10 [SWC]vlan 20 [SWC]vlan 40 [SWC]interface Ethernet [SWC-Ethernet1/0/2]port [SWC-Ethernet1/0/2]port [SWC]interface Ethernet [SWC-Ethernet1/0/4]port [SWC-Ethernet1/0/4]port [SWC]interface Ethernet [SWC-Ethernet1/0/6]port [SWC-Ethernet1/0/6]port

1/0/2 link-type trunk trunk permit vlan 10 20 1/0/4 link-type trunk trunk permit vlan 10 20 1/0/6 link-type trunk trunk permit vlan 20 40

IV. Configure Switch D


[SWD]vlan 20 [SWD]vlan 30 [SWD]vlan 40 [SWD]interface Ethernet [SWD-Ethernet1/0/3]port [SWD-Ethernet1/0/3]port [SWD]interface Ethernet [SWD-Ethernet1/0/5]port [SWD-Ethernet1/0/5]port [SWD]interface Ethernet [SWD-Ethernet1/0/6]port [SWD-Ethernet1/0/6]port

1/0/3 link-type trunk trunk permit vlan 20 30 1/0/5 link-type trunk trunk permit vlan 20 30 1/0/6 link-type trunk trunk permit vlan 20 40

2.6.2 Starting up MSTP


[SWA]stp [SWB]stp [SWC]stp [SWD]stp enable enable enable enable

2.6.3 Configure MST


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

II. Configure Switch B


[SWB]stp region-configuration [SWB-mst-region]region-name test [SWB-mst-region]revision-level 0 [SWB-mst-region]instance 1 vlan 1 [SWB-mst-region]instance 3 vlan 3 [SWB-mst-region]instance 4 vlan 4

18

Confidential Information of Huawei.

No Spreading without Permission

ODL010005 STP/RSTP/MSTP Laboratory Exercise Guide ISSUE1.0

III. Configure Switch C


[SWC]stp region-configuration [SWC-mst-region]region-name test [SWC-mst-region]revision-level 0 [SWC-mst-region]instance 1 vlan 1 [SWC-mst-region]instance 3 vlan 3 [SWC-mst-region]instance 4 vlan 4

IV. Configure Switch D


[SWD]stp region-configuration [SWD-mst-region]region-name test [SWD-mst-region]revision-level 0 [SWD-mst-region]instance 1 vlan 1 [SWD-mst-region]instance 3 vlan 3 [SWD-mst-region]instance 4 vlan 4

2.6.4 Active region configuration


[SWA-mst-region]active [SWB-mst-region]active [SWC-mst-region]active [SWD-mst-region]active region-configuration region-configuration region-configuration region-configuration

Confidential Information of Huawei.

No Spreading without Permission

19

You might also like