Beruflich Dokumente
Kultur Dokumente
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
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
S
E0/3 E0/3
Figure 1-1 3 Quidway S3526E switches; 1 PC, 3 standard network cables, and 1 console cable
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
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
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
Confidential Information of Huawei. No Spreading without Permission 5
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
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
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
The spanning tree is now determined, and the tree root is switch B. The tree is illustrated below:
SwitchB
E0/1
E0/1 SwitchA
S
E0/3 E0/3
Figure 1-2
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:
10
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.
11
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.
12
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.3 Check the Received/Transmitted BPDU Message of Port After the Port State Transition
<SwitchC>debugging stp packet <SwitchC>terminal debugging
13
Switch C
Figure 2-1 4 Quidway S3900 switches; 1 PC, 6 standard network cables, and 1 console cable
14
Run MSTP
MSTI configuration
Active region
Figure 2-1
15
[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
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
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
17
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
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
18
19