STP Configuration I Table of Contents Table of Contents Chapter 1 Configuring STP............................................................................................................................1 1.1 STP Introduction...............................................................................................................................1 1.2 SSTPConfiguration Task List..........................................................................................................2 1.3 SSTP Configuration Tasks.............................................................................................................. 2 1.3.1 Choosingthe STP Mode.......................................................................................................2 1.3.2 Disabling/Enabling STP.......................................................................................................2 1.3.3 Disabling/Enabling STP on a Port......................................................................................3 1.3.4 Settingthe Bridge Priority.....................................................................................................3 1.3.5 Setting the Hello Time..........................................................................................................4 1.3.6 Setting the Max Age............................................................................................................. 4 1.3.7 Setting the Forward Delay...................................................................................................4 1.3.8 Setting the PortPriority.........................................................................................................4 1.3.9 Value of the path cost of a port...........................................................................................5 1.3.10 Monitoring the STP state...................................................................................................5 1.3.11 Setting the SNMP Trap...................................................................................................... 5 1.4 Setting the Spanning Tree of VLAN...............................................................................................6 1.4.1 Overview................................................................................................................................ 6 1.4.2 VLAN STP Configuration Tasks..........................................................................................6 Chapter 2 Configuring RSTP.........................................................................................................................8 2.1 RSTP Configuration Task List.........................................................................................................8 2.2 RSTP Configuration Tasks..............................................................................................................8 2.2.1 Enabling/disabling RSTP of the Switch.............................................................................8 2.2.2 Settingthe Bridge Priority.....................................................................................................8 2.2.3 Setting the Forward Time.................................................................................................... 9 2.2.4 Setting the Hello Time..........................................................................................................9 2.2.5 Setting the Max Age...........................................................................................................10 2.2.6 Value of the path cost of a port.........................................................................................10 2.2.7 Setting the Port Priority....................................................................................................10 2.2.8 Setting the Edge Port.........................................................................................................11 2.2.9 Setting the Port Connection Type.....................................................................................11 2.2.10 Restarting the protocol conversion check.................................................................... 12 Chapter 3 Configuring MSTP...................................................................................................................... 13 3.1 MSTP Introduction..........................................................................................................................13 3.1.1 Overview.............................................................................................................................. 13 3.1.2 MST Region.........................................................................................................................13 3.1.3 IST, CST, CIST and MSTI..................................................................................................13 3.1.4 Port Role.............................................................................................................................. 15 3.1.5 MSTP BPDU........................................................................................................................18 3.1.6 Stable State.........................................................................................................................19 3.1.7 Hop Count............................................................................................................................20 3.1.8 STP Compatibility............................................................................................................... 20 3.2 MSTP Configuration Task List......................................................................................................20 3.3 MSTP Configuration Tasks........................................................................................................... 21 3.3.1 Default MSTP Configuration.............................................................................................21 II Table of Contents 3.3.2 Enabling and disabling MSTP.......................................................................................... 22 3.3.3 Configuring MSTP region..................................................................................................22 3.3.4 Configuring network root................................................................................................... 23 3.3.5 Configuring secondary root...............................................................................................24 3.3.6 Configuring Bridge Priority................................................................................................ 25 3.3.7 Configuring time parameters of STP...............................................................................25 3.3.8 Configuring network diameter...........................................................................................26 3.3.9 Configuring maximum hop count..................................................................................... 27 3.3.10 Setting the Port Priority....................................................................................................27 3.3.11 Value of the path cost of a port.......................................................................................28 3.3.12 Setting the Edge Port.......................................................................................................28 3.3.13 Setting the Port Connection Type..................................................................................28 3.3.14 Activating MST-compatible mode.................................................................................. 29 3.3.15 Restarting the protocol conversion check.................................................................... 30 3.3.16 Configuring role restriction of the port...........................................................................30 3.3.17 Configuring TCN restriction of the port......................................................................... 30 3.3.18 Check MSTP information................................................................................................ 31 III STP Configuration Chapter 1 Configuring STP 1.1 STP Introduction The standard Spanning Tree Protocol (STP) is based on the IEEE 802.1D standard. An OLT stack appears as a single spanning-tree node to the rest of the network, and all stack members use the same bridge ID. The spanning-tree algorithm and the spanning-tree protocol can set any bridge LAN to be a simply connected mobile topology. In the mobile topology, some bridge ports can forward frames, while other ports are blocked and cannot forward data. A port in blocked state can also be contained in the mobile topology. When some network device is out of effect, added or removed, the port in blocked state will enter the forwarding state. In the spanning-tree topology, a bridge is regarded as a root or a root bridge. Each LAN segment has a bridge port to take in charge of data forwarding from this network segment to the root. This bridge port is regarded as the designated port of this LAN segment, while the bridge where the bridge port locates is regarded as the designated bridge of LAN The root is the designated bridge of each LAN segment that connects this root. In each bridge port, the port that is nearest to the root bridge is the root port of this bridge and only the root port and the designated port are in forwarding state; another kind of ports are open, but they are not root ports or designated ports but standby ports. The following parameters decide the structure of the stabile mobile topology: (1) Each unique bridge identifier (2) path cost of each port (3) ID of each bridge port The bridge with the highest priority (the identifier value is the smallest) will be chosen as the root bridge. The ports of each bridge in the network all have root path cost, that is, the root path cost is the smallest value of the path cost sum of all ports between the root bridge and the bridge. The designated port of each LAN segment means the port that connect this LAN segment and has the smallest root path cost; if several ports have the same root path cost, their bridge identifiers will first be compared and then their port identifiers. According to this method, each LAN segment has only one designated port and each bridge has only one root port. The spanning tree topology makes the loop inexistent in a network, guaranteeing the stability and fault recovery of the network. With the wide spread of Ethernet switch, STP plays a more and more important role. Therefore, STP is provided as a basic function of switches. Rapid Spanning-Tree Protocol (RSTP) is an important update of 802.1D STP. When faults occur in the bridge, bridge port or LAN segment in a network, RSTP will realize the rapid convergence of the network topology. In this case, the new root port on the bridge will enter the forwarding state promptly, and at the same time the direct 1 STP Configuration acceptance between bridges can make a designated port to forward data immediately. Please refer to Chapter 2 for RSTP protocolConfiguring RSTP. This chapter describes how to configure the standard STP of the switch. Note: 802.1D STP and 802.1D RSTP mentioned in this text are simplified as SSTP and RSTP respectively. SSTP here is short for Single Spanning-Tree Protocol. 1.2 SSTPConfiguration Task List  Choosing the STP Mode  Disabling/Enabling STP  Disabling/Enabling STP on a Port  Setting the Bridge Priority  Setting the Hello Time  Setting the Max Age  Setting the Forward Delay  Setting the Port Priority  Value of the path cost of a port  Monitoring the STP state  Setting the SNMP Trap 1.3 SSTP Configuration Tasks 1.3.1 Choosingthe STP Mode Run the following command to set the STP mode: Command Purpose spanning-tree mode {sstp | pvst | rstp | mstp} Selects the STP mode. 1.3.2 Disabling/Enabling STP By default, when STP is started, the running mode is RSTP; if STP is not required, you can stop it from running. Run the following command to disable STP: Command Purpose 2 STP Configuration no spanning-tree Disables STP. Run the following commands to enable STP: Command Purpose spanning-tree Enables STP that runs in default mode—RSTP. spanning-tree mode {sstp | pvst | rstp | mstp} Selects a mode for the enabled STP. 1.3.3 Disabling/Enabling STP on a Port By default, STP is running on all switch ports (physical ports and aggregation ports); if you want to disable STP, you can run the following command in port configuration mode. Command Purpose no spanning-tree Disables STP to run on the ports. After STP is forbidden to run on a port, this port maintains a designated port and its forwarding state and stops to transmit BPDU again. However, each STP mode still has such operations as type checkup, numbering, edge information update and topology information update towards BPDU that a port receives. Note: When no spanning-tree is set and a port has served as a root port, alternate port, master port or backup port, the protocol information that this port receives in RSTP/MSTP mode will age immediately and transfer to be a designated port, while the protocol information that this port receives in SSTP/PVST mode will remain the original role for a certain period and then age after the timer times out. Note: Every STP mode supports the BPDU Guard function on the port on which no spanning-tree is set. 1.3.4 Settingthe Bridge Priority You can choose the spanning-tree root of the network topology by changing the bridge priority of a switch. Run the following commands to set the bridge priority of SSTP: Command Purpose spanning-tree sstp priority value Modifies the bridge priority of the SSTP mode. no spanning-tree sstp priority Resumes the SSTP bridge priority to the default value, 32768. 3 STP Configuration 1.3.5 Setting the Hello Time You can configure the hello time of the SSTP to decide the packet transmission's interval when the switch works as the root. Run the following commands to set the SSTP hello time. Command Purpose spanning-tree sstp hello-time value Modifies the hello time in SSTP mode. no spanning-tree sstp hello-time Resumes the SSTP hello time to the default value, 2 seconds. 1.3.6 Setting the Max Age You can configure the SSTP max age to decide the maximum lifespan of the packet when the switch works as the root. Run the following commands to configure the SSTP max age. Command Purpose spanning-tree sstp max-age value Modifies the Max Age of the SSTP mode. no spanning-tree sstp max-age Resumes the max age to the default value, 20 seconds. 1.3.7 Setting the Forward Delay You can configure the forward delay time of the SSTP to decide the state change interval of all switches when these switches works as the root. Run the following commands to configure the SSTP forward delay. Command Purpose spanning-tree sstp forward-time value Modifies the forward time of the SSTP mode. no spanning-tree sstp forward-time Resumes the default forward time, 15 seconds. 1.3.8 Setting the PortPriority When a loop generates, STP will change the states of some ports to the blocking state to cut off the loop. You can control whether to block a port by setting the port priority and the port path cost. Run the following commands to set the port priority of SSTP: Command Purpose spanning-tree port-priority value Sets the port priority in all modes. spanning-tree sstp port-priority value Modifies the port priority of the SSTP mode. no spanning-tree sstp port-priority Resumes the port priority to the default value, 4 STP Configuration 128. 1.3.9 Value of the path cost of a port Run the following commands to set the port path cost of SSTP. Command Purpose spanning-tree cost value Sets the port priority in all modes. spanning-tree sstp cost value Modifies the port path cost in SSTP mode. no spanning-tree sstp cost Resumes the port path cost to the default value. 1.3.10 Monitoring the STP state To monitor STP configuration and STP’s state, run the following commands in EXEC mode: Command Purpose show spanning-tree Displays the state of STP in current mode. show spanning-tree detail Displays the detailed information about STP in current mode. show spanning-tree interface Displays the information about a port in STP in current mode. 1.3.11 Setting the SNMP Trap You can monitor the change of STP in a switch remotely from the network management software of the host by configuring the trap function of STP. STP protocols support two types of traps: newRoot and topologyChange. When a switch changes from a non-root to a root, the newRoot Trap message will be transmitted; when the topology change is detected, such as a non-edge port is changed from the non-forwarding state to the forwarding state, the topologyChange Trap message will be transmitted. Note: The STP trap can be received only when the network management software supports trap reception. The network management need be imported into the bridge MIB and OID is 1.3.6.1.2.1.17. Run the following commands in global configuration mode to enable the STP trap: Command Purpose spanning-tree management trap Enables the STP trap. [ newroot | topologychange ] If the trap type is not designated, two kinds of traps will be enabled at the same time. no spanning-tree management trap Disables the STP trap. 5 STP Configuration 1.4 Setting the Spanning Tree of VLAN 1.4.1 Overview In SSTP mode, the whole network only has one spanning-tree instance, and the state of a port in the spanning tree decides its state in all VLANs. When multiple VLANs exist in a network, the isolation between SSTP and VLAN topology may lead to the communication block of some network parts. The switch supports that independent SSTP runs on a certain number of VLANs and guarantees that a port has different states in different VLANs. At the same time the flow balance can be realized between VLANs. It should be noted that the VLAN number which can independently running STP protocol depends on the actual version. Othter VLAN topology exceeding the number limit will not affected by STP. 1.4.2 VLAN STP Configuration Tasks Run the following commands to set the features of SSTP in VLAN: Command Purpose spanning-tree mode pvst Enables STP distribution according to VLAN. spanning-tree vlan vlan-list Distributes the STP instance for a designated VLAN. vlan-list means the VLAN list (similarly hereinafter). no spanning-tree vlan vlan-list Deletes the spanning-tree instance in a designated VLAN spanning-tree vlan vlan-list priority value Sets the spanning-tree priority in a designated VLAN. no spanning-tree vlan-list priority Resumes the spanning-tree priority in a VLAN to the default value. spanning-tree vlan vlan-list forward-time value Sets the Forward Delay of a designated VLAN. no spanning-tree vlan vlan-list forward-time Resumes the Forward Delay of a designated VLAN. spanning-tree vlan vlan-list max-age value Sets the max age of a designated VLAN. no spanning-tree vlan vlan-list max-age Resumes the Max-Age of a designated VLAN to the default value. spanning-tree vlan vlan-list hello-time value Sets the Hello-time of a designated VLAN. no spanning-tree vlan vlan-list hello-time Resumes the hello-time of a designated VLAN to the default value. Run the following commands to set the port’s features in switch port configuration mode: 6 STP Configuration Command Purpose spanning-tree vlan vlan-list cost Sets the path cost of a port in a designated VLAN. no spanning-tree vlan vlan-list cost Resumes the path cost of a port in VLAN to the default value. spanning-tree vlan vlan-list port-priority Sets the port priority in VLAN. no spanning-tree vlan vlan-list port-priority Resumes the priority of a port in VLAN to the default value. In monitor or configuration mode, run the following commands to browse the state of the spanning tree in a designated VLAN: Command Purpose show spanning-tree vlan vlan-list Browses the state of the spanning tree in a VLAN. show spanning-tree pvst instance-list To check the corresponding relation between PVST instances and VLAN, run this command. 7 STP Configuration Chapter 2 Configuring RSTP 2.1 RSTP Configuration Task List  Enabling/disabling RSTP of the Switch  Setting the Bridge Priority  Setting the Forward Time  Setting the Hello Time  Setting the Max Age  Value of the path cost of a port  Setting the Port Priority  Setting the Edge Port  Setting the Port Connection Type  Restarting the protocol conversion check 2.2 RSTP Configuration Tasks 2.2.1 Enabling/disabling RSTP of the Switch Run the following commands in global configuration mode. Command Purpose spanning-tree mode rstp Enables RSTP. no spanning-tree mode Disables stp funciton. 2.2.2 Settingthe Bridge Priority The bridge priority decides whether this bridge can be chosen as the root bridge of the whole spanning tree. Setting a comparatively low priority can make a bridge to be the root bridge of the spanning tree. Run the following commands in global configuration mode. Command Purpose spanning-tree rstp priority value Sets the priority of a bridge. no spanning-tree rstp priority Resumes the bridge priority to be the default 8 STP Configuration value. It is especially noted that if the priorities of all bridges in an entire OLT network have the same value the bridge with the smallest MAC address will be chosen as the root bridge. In case that RSTP is enabled, if the bridge priority is changed the spanning tree will be calculated again. In the default settings, the bridge priority is set to 32768. 2.2.3 Setting the Forward Time Link fault will trigger the recalculation of the spanning-tree structure, but the new configuration information, which is obtained through recalculation, cannot be sent to the whole network immediately; if the newly chosen root port and designated port starts data forwarding immediately, temporary loop may be caused. To solve this problem, RSTP adopts a state removal mechanism. Before the root port and the designated port begin to forward data, an intermediate state must be experienced. The intermediate state changes into the forwarding state after the forward delay that guarantees the new configuration information has spread all over the whole network. The Forward Delay of a bridge depends on the diameter of the OLT network. Generally speaking, the longer the network diameter is, the longer the forward delay should be set to be. Run the following commands in global configuration mode. Command Purpose spanning-tree rstp forward-time value Sets the Forward Delay. no spanning-tree rstp forward-time Resumes the default forward delay, 15 seconds. It is especially noted that if Forward Delay is set too small the temporary redundant path may occur in the network, but if Forward Delay is set too big the network may be disconnected for a long time. That's why users are recommended to take the default value. In the default settings, the forward delay of a bridge is 15 seconds. 2.2.4 Setting the Hello Time A suitable hello time not only guarantees that a bridge can detect a link fault in a network promptly but also occupies a few network resources. Run the following commands in global configuration mode. Command Purpose spanning-tree rstp hello-time value Sets the Hello Time. no spanning-tree rstp hello-time Resumes the hello time to the default value. It takes attention that if a long hello time is set, packet loss in the links may cause a bridge not to receive the hello packets for a long time and the bridge then regards the occurrence of link faults and starts spanning-tree recalculation, but if a too short hello time is set the bridge will frequently send the configuration information and then the network bandwidth will be heavily occupied and the network/CPU load will be increased. That's why users are recommended to take the default value. 9 STP Configuration In the default settings, the hello time of a bridge is 2 seconds. 2.2.5 Setting the Max Age The max age is used to judge whether the configuration information expires. Users can set the max age according actual conditions. Run the following commands in global configuration mode. Command Purpose spanning-tree rstp max-age value Setting the Max Age no spanning-tree rstp max-age Resumes the max age to the default value, 20 seconds. Link fault, reduces the network auto-adaptivity. We recommend user to use the default value. Note: if you configure the Max Age to a relatively small value, then the calculation of the spanning tree will be relatively frequent, and the system may regard the network block as link failure. If you configurethe Max Age to a relatively big value, then the link status will go unnoticed in time. The Max Age of bridge is 20 seconds by default. 2.2.6 Value of the path cost of a port The path cost is related with the link rate of the port. If the link rate is required to be high, the path cost should be set to a small value; when the path cost is set to its default value, RSTP can automatically check the link rate of the current Ethernet port and calculate the corresponding path cost. Run the following commands in interface configuration mode. Command Purpose spanning-tree rstp cost value Sets the path cost of a port. no spanning-tree rstp cost Resumes the path cost of a port to the default value. It is especially noted that the settings of the path cost will lead to the recalculation of the spanning tree, so users are recommended to take the default value and wait RSTP to calculate the path cost of the current Ethernet port automatically. By default, the path costs of all Ethernet ports of a bridge are all set to 2000,000 at the 10Mbps port rate, or set to 200,000 at the 100Mbps port rate. 2.2.7 Setting the Port Priority Port priority settings can be used to designate a specific Ethernet port to be contained in the spanning tree. In general, the smaller the value is, the higher the port priority is, and the Ethernet port has more possibility to be contained in the spanning tree. If all Ethernet ports of a bridge adopt the same priority value, the index number of an Ethernet port decides whether the Ethernet port has a high priority or not. Run the following commands in interface configuration mode. 10 STP Configuration Command Purpose spanning-tree rstp port-priority value Sets the port priority. no spanning-tree rstp port-priority Resumes the port priority to the default value. It should be noted that the change of the priority of an Ethernet port can lead to the recalculation of the spanning tree. The priority of all Ethernet ports of a bridge is 128 by default. 2.2.8 Setting the Edge Port The edge port means this port connects terminal devices of a network. A mandatory edge port will enter the forwarding state after link-up. In port configuration mode, run the following command to set the edge port of RSTP: Command Purpose spanning-tree rstp edge Sets the edge port. In auto mode, if a port has not received BPDU in a certain time this port is viewed as the edge port. 2.2.9 Setting the Port Connection Type If switches, on which RSTP is run, are in the point-to-point connection, these switches can establish a topology rapidly through the handshake mechanism. When the port connection type is set, the connection of a port can be set point-to-point. By default, RSTP will judge whether a port is in the point-to-point connection according to the duplex mode of this port. If this port works in full duplex mode, RSTP regards this port is in a point-to-point connection; if this port works in half duplex mode, RSTP regards this port’s connection is shared. If it is confirmed that RSTP or MSTP is running on the switches connected by a port, you should set this port’s connection type to point-to-point so that fast handshake should be conducted. In the port configuration mode, run the following command to set the connection type of a port. Command Purpose spanning-tree rstp point-to-point Sets the point to point interface. [ force-true | force-false | auto ] force-true: Mandatorily sets the connection to point-to-point. force-false: Mandatorily sets the connection to non-point-to-point. auto: Automatically checks the port type. 11 STP Configuration 2.2.10 Restarting the protocol conversion check RSTP makes a switch to work together with a traditional 802.1D STP switch through a protocol transfer mechanism. If one port of the switch receives the STP configuration message, the port then only transmits the STP message. After a port enters the STP-compatible state, even if this port does not receive 802.1D STP BPDU again, this port will not resume the RSTP state. In this case, you can run spanning-tree rstp migration-check to enable the protocol transfer checkup process and resume this port to the RSTP mode. In global mode run the following command to restart RSTP transfer checkup: Command Purpose spanning-tree rstp migration-check Restarts RSTP transfer checkup on all ports. In switch port configuration mode, run the following command to conduct protocol transfer checkup on this port: Command Purpose spanning-tree rstp migration-check Restarts RSTP transfer checkup on the current port. 12 STP Configuration Chapter 3 Configuring MSTP 3.1 MSTP Introduction 3.1.1 Overview Multiple Spanning Tree Protocol (MSTP) is used to establish a simple and complete topology in the bridge LAN. MSTP is compatible with STP (Spanning Tree Protocol) and RSTP (Rapid Spanning Tree Protocol). Both STP and RSTP only construct a single spanning tree topology in a network and the packets of all VLANs are forwarded along with this unique topology. STP converges too slowly, while RSTP guarantees the a rapid and stable network topology through handshake. MSTP keeps the fast handshake of RSTP to guarantee fast topology establishment, and at the same time MSTP allows different VLANs to be classified into different spanning trees to establish multiple tree topologies in the network. In a MSTP-constructing network, frames that belong to different VLANs can be forwarded on different paths to realize the load balance of VLAN data. Different from PVST (per-VLAN Spanning Tree), MSTP permits multiple VLANs to be classified into the same spanning tree topology, effectively reducing spanning trees that are used to support VLANs. 3.1.2 MST Region In MSTP, the relationship of VLAN and spanning tree is described through a MSTP. The MST configuration table, along with a configuration name and a configuration edit number, makes up of a MST configuration identifier. In a network, the bridges that interconnect with others and possess the same MST configuration identifier are regarded that they are in the same MST region. The bridges in the same MST region generally have the same VLAN settings so that the frames of these VLANs can only be running at the inside of this MST region. 3.1.3 IST, CST, CIST and MSTI Figure 2.1 shows an MSTP network, which consists of 3 MST regions and a switch running 802.1D STP protocol. 13 STP Configuration Figure 2.1 MSTP topology 1. CIST CIST stands for Common and Internal Spanning Tree. Common and Internal Spanning Tree (CIST) means the spanning tree comprised by allsingle switches and interconnected LAN. These switches may belong to different MSTregions. They may be switches running traditional STP or RSTP. Switches running STP or RSTP in the MST regions are considered to be in their own regions. After the network topology is stable, the whole CIST chooses a CIST root bridge. An internal CIST root bridge will be selected in each region, which is the shortest path from the heart of the region to CIST root. 2. CST CST stands for Common Spanning Tree. If each MST region is viewed as a single switch, CST is then the spanning tree that connects these “single switches”. As shown in figure 2.1, regions 1-3 and the STP switch constitute a CST of this network. 3. IST IST stands for Internal Spanning Tree. IST means a CIST part in a MST region, or be considered that IST and CST constitute CIST. 14 STP Configuration 4. MSTI MSTI stands for Multiple Spanning Tree Instance. MSTP permits different VLANs to be classified into different spanning trees to establish multiple MSTIs. In general, MSTI 0 means CIST, which can be expanded to the whole network, while other MSTIs are each in a region. Each MSTI can be distributed to multiple VLANs. Originally, all VLANs are distributed in CIST. All MSTIs in the MST region are independent and they can choose different switches to be their roots. For example, in region 3 of figure 2.1, the root of MSTI01 may be the switch at the left bottom corner, while the root of MSTI00 (CIST) may be the switch in the middle. 3.1.4 Port Role MSTP, like RSTP, has the similar function to conduct port role distribution. 1. Root Port Figure 2.2 Root port The root port means the path between the current switch to the root bridge. This path has the minimum root path cost. 2. Alternate Port 15 STP Configuration Figure 2.3 Alternate Port The alternate port serves as path backup between the current switch and the root bridge. When the root port fails to connect, the alternate port can be immediately transferred to be a new root port and start work. 3. Designated Port Figure 2.4 Designated port The designated port can be used to connect the downstream switch or the downstream LAN and then runs as the path between LAN and thr root bridge. 4. Backup Port Figure 2.5 Backup port 16 STP Configuration When two ports of a switch connect directly or connect the same LAN, the port with relatively low priority will run as the backup port and the other port will run as the designated port. If the designated port invalidates, the backup port will serve as the designated port. 5. Master port Figure 2.6 Master port The master port is used as the shortest path between MST region and CIST root bridge. The master port is also the root port of the root bridge in CIST region. 6. Boundary Port The concept of the boundary port is different from in CIST and in MSTI. In CIST, the boundary port means a port connecting another MST region; while in MSTI, the boundary port means that this spanning tree instance is not extended outside of this port. 7. Edge Port In RSTP and MSTP, the edge port means a port directly connecting the host, and is capable of entering the forwarding state directly without waiting and loop. 17 STP Configuration Figure 2.7 Edge port Originally, MSTP, including RSTP, regards all ports are edge ports and therefore the network topology can be established swiftly. If a port in this case receives BPDU from another switch, the port will resume its edge state from its normal state; if it receives 802.1D STP BPDU, it has to wait for double forward delays and then enters its forwarding state. 3.1.5 MSTP BPDU Similar to STP and RSTP, switches running MSTP can communicate with each otherthrough Bridge Protocol Data Unit (BPDU). All configuration information about the CIST and MSTI can be carried by BPDU. Table 2.1 and Table 2.2 list the structure ofBPDU used by the MSTP. Table 2.1 MSTP BPDU Field Name Byte Number Protocol Identifier 1 – 2 Protocol Version Identifier 3 BPDU Type 4 CIST Flags 5 CIST Root Identifier 6 – 13 18 STP Configuration CIST External Root Path Cost 14 – 17 CIST Regional Root Identifier 18 – 25 CIST Port Identifier 26 – 27 Message Age 28 – 29 Max Age 30 – 31 Hello Time 32 – 33 Forward Delay 34 – 35 Version 1 Length 36 Version 3 Length 37 – 38 Format Selector 39 Configuration Name 40 – 71 Revision 72 – 73 Configuration Digest 74 – 89 CIST Internal Root Path Cost 90 – 93 CIST Bridge Identifier 94 – 101 CIST Remaining Hops 102 MSTI Configuration Messages 103 ~ Table 2.2 MST configuration information Field Name Byte Number MSTI FLAGS 1 MSTI Regional Root Identifier 2 – 9 MSTI Internal Root Path Cost 10 – 13 MSTI Bridge Priority 14 MSTI Port Priority 15 MSTI Remaining Hops 16 3.1.6 Stable State The MSTP switch performs calculation and compares operations according to thereceived BPDU, and finally ensures that: (1) One switch is selected as the CIST root of the whole network. (2) Each switch and LAN segment can decide the minimum cost path to the CIST root, ensuring a complete connection and prevent loops. (3) Each region has a switch as the CIST regional root. The switch has the minimumcost path to the CIST root. (4) Each MSTI can independently choose a switch as the MSTI regional root. 19 STP Configuration (5) Each switch in the region and the LAN segment can decide the minimum costpath to the MSTI root. (6) The root port of CIST provides the minimum-cost path between the CISTregional root and the CIST root. (7) The designated port of the CIST provided its LAN with the minimum-cost path tothe CIST root. (8) The Alternate port and the Backup port provides connection when the switch,port or the LAN does not work or is removed. (9) The MSTI root port provides the minimum cost path to the MSTI regional root. (10) The designated port of MSTI provides the minimum cost path to the MSTIregional root. (11) A master port provides the connection between the region and the CIST root. In the region, the CIST root port of the CIST regional root functions as the masterport of all MSTI in the region. 3.1.7 Hop Count Different from STP and RSTP, the MSTP protocol does not use Message Age and Max Age in the BPDU configuration message to calculate the network topology. MSTP usesHop Count to calculate the network topology. To prevent information from looping, MSTP relates the transmitted information to theattribute of hop count in each spanning tree. The attribute of hop count for BPDU is designated by the CIST regional root or the MSTI regional root and reduced in eachreceiving port. If the hop count becomes 0 in the port, the information will be dropped and then the port turns to be a designated port. 3.1.8 STP Compatibility MSTP allows the switch to work with the traditional STP switch through protocolconversion mechanism. If one port of the switch receives the STP configuration message, the port then only transmits the STP message. At the same time, the portthat receives the STP information is then considered as a boundary port. Note: When a port is in the STP-compatible state, the port will not automatically resume to the MSTP state even if the port does not receive the STP message any more. In this case, you can run spanning-tree mstpmigration-check to clear the STP message that the port learned, and make the port to return to the MSTPstate. The switch that runs the RSTP protocol can identify and handle the MSTP message. Therefore, the MSTP switch does not require protocol conversion when it works with the RSTP switch. 3.2 MSTP Configuration Task List  Default MSTP Configuration 20 STP Configuration  Enabling and disabling MSTP  Configuring MSTP region  Configuring network root  Configuring secondary root  Configuring bridge priority  Configuring time parameters of STP  Configuring network diameter  Configuring maximum hop count  Configuring port priority  Configuring path cost for port  Configuring the edge port  Configuring port connection type  Activating MST-compatible mode  Restarting the protocol conversion check  Configuring role restriction of the port  Configuring TCN restriction of the port  CheckMSTPinformation 3.3 MSTP Configuration Tasks 3.3.1 Default MSTP Configuration Attributes Default Settings STP mode RSTP (PVST, SSTP and MSTP is not enabled) Area name Its default value is the MAC address of a switch. Area edit level 0 MST configuration list All VLANs are mapped to CIST (MST00). Spanning-tree port priority (CIST and all 32768 MSTI) Spanning-tree port priority (CIST and all 128 MSTI) Path cost of the spanning-tree port (CIST and 1000 Mbps:20000 allMSTI) 21 STP Configuration 100 Mbps:200000 10 Mbps:2000000 Hello Time 2 seconds Forward Delay 15 seconds Maximum-aging Time 20 seconds Maximum hop count 20 3.3.2 Enabling and disabling MSTP The STP protocol can be started in RSTP mode by default. You can stop it running when the spanning-tree is not required. Run the following command to set the STP to the MSTP mode: Command Purpose spanning-tree Enables STP in default mode. spanning-tree mode mstp Enables MSTP. Run the following command to disable STP: Command Purpose no spanning-tree Disable the STP. 3.3.3 Configuring MSTP region The MST area where the switch resides is decided by three attributes: configurationname, edit number, the mapping relation between VLAN and MSTI. You can configure them through area configuration commands. Note that the change of any of the three attributes will cause the change of the area where the switch resides. In original state, the MST configuration name is the character string of the MACaddress of the switch. The edit number is 0 and all VLANs are mapped in the CIST (MST00). Because different switch has different MAC address, switches that run MSTP are in different areas in original state. You can run spanning-tree mstp instance instance-id vlan vlan-list to create a new MSTI and map the esignated VLAN to it. If the MSTI is deleted, all these VLANs are mapped to the CIST again. Run the following command to set the MST area information: Command Purpose spanning-tree mstp name string Configures the MST configuration name. string means the character string of the configurationname. It contains up to 32 characters, capital sensitive. The default value is the character string of the MAC address. no spanning-tree mstp name Sets the MST configuration name to the default value. spanning-tree mstp revision value Sets the MST edit number. 22 STP Configuration value represents the edit number, ranging from 0 to 65535. The default value is 0. no spanning-tree mstp revision Sets the MST edit number to the default value. spanning-tree mstp instance Maps VLAN to MSTI. instance-id vlan vlan-list Instance ID of the spanning-tree, which stands for an MSTI Value range: 1-15 vlan-list: means the VLAN list that is mapped to thespanning tree. It ranges from 1 to 4094. Instance ID is an independent value which stands for an STP instance. vlan-list can represent a group of VLANs, suchas ”1,2,3”, ”1-5” and “1,2,5-10”. "1,2: 5 -10"... no spanning-tree mstp instance Cancels the VLAN mapping of MSTI and disables instance-id thespanning tree instance. instance-id: Instance ID of the spanning-tree, which stands for a MSTI. Value range: 1-15 Run the following command to check the configuration of the MSTP area: Command Purpose show spanning-tree mstp region Displays the configuration of the MSTP area. 3.3.4 Configuring network root In MSTP, each spanning tree instance has a Bridge ID, containing the priority value and MAC address of the switch. During the establishment of spanning tree topology, the switch with comparatively small bridge ID is selected as the network root. MSTP can set the switch to the network root through configuration. You can run the command Spanning-tree mstp instance-id root to modifythe priority value of the switch in a spanning tree instance from the default value (32768) to a sufficiently small value, ensuring the switch turns to be the root in the spanning tree instance. In general, after the command to set the primary root is executed, the protocol automatically check the bridge ID of the current network’s root and then sets the priority of the bridge ID to 24576, which guarantees that the current switch serves as the root of the STP instance. If the priority value of the network root is less than 24576, the protocol will automatically set the STP priority of the current bridge to a value which is 4096 smaller than the priority of the root. It deserves attention that 4096 is the step of the priority value of the bridge. When setting the root, you can run the diameter subcommand to the network diameter of the spanning tree network. The keyword is effective only when the spanning tree instance ID is 0. After the network diameter is set, MSTP automatically calculates proper STP time parameters to ensure the stability of network convergence. Time 23 STP Configuration parameters include Forward Delay and Maximum Age. The subcommandHello-time can be used to set a new hello time to replace the default settings. Run the following command to set the switch to the network root: Command Purpose spanning-tree mstp instance-id root primary Sets the switch to the root in the designated spanning treeinstance. [ diameter net-diameter [ hello-time seconds ] ] instance-id represents the number of the spanning treeinstance, ranging from 0 to 15. net-diameter represents the network diameter, which is anoptional parameter. It is effective when instance-id is 0. It ranges from 2 to 7. seconds represents the unit of the hello time, ranging from1 to 10. no spanning-tree mstp instance-id root Cancels the root configuration of the switch in the spanning tree. instance-id represents the number of the spanning treeinstance, ranging from 0 to 15. Run the following command to check the MSTP message: Command Purpose show spanning-tree mstp Checks the MSTP message. [ instance instance-id ] 3.3.5 Configuring secondary root After the network root is configured, you can run spanning-tree mstp instance-id root secondary to set one or multiple switches to the secondary roots or the backuproots. If the root does not function for certain reasons, the secondary roots will become the network root. Different from primary root configuration, after the command to set the secondary root is executed, the protocol directly set the STP priority of the switch to 28672. In case that the priority value of other switches in the network is 32768 by default, the current switch serves as the secondary root. When configuring the secondary root, you can run the subcommands diameter and hello-time to update the STP time parameters. When the secondary root becomes the primary root and starts working, all these parameters starts functioning. Run the following command to set the switch to the secondary root of the network: Command Purpose spanning-tree mstp instance-id root secondary Sets the switch to the secondary root in the designated spanning tree instance. [ diameter net-diameter [ hello-time seconds ] ] instance-id represents the number of the spanning treeinstance, ranging from 0 to 15. 24 STP Configuration net-diameter represents the network diameter, which is anoptional parameter. It is effective when instance-id is 0. It ranges from 2 to 7. seconds represents the unit of the hello time, ranging from1 to 10. no spanning-tree mstp instance-id root Cancels the root configuration of the switch in the spanning tree. instance-id represents the number of the spanning treeinstance, ranging from 0 to 15. Run the following command to check the MSTP message: Command Purpose show spanning-tree mstp Checks the MSTP message. [ instance instance-id ] 3.3.6 Configuring Bridge Priority In some cases, you can directly set the switch to the network root by configuring the bridge priority. It means that you can set the switch to the network root without running the subcommand root. The priority value of the switch is independent in eachspanning tree instance. Therefore, the priority of the switch can be set independently. Run the following command to configure the priority of the spanning tree: Command Purpose spanning-tree mstp instance-id priority value Sets the priority of the switch. instance-id represents the number of the spanning treeinstance, ranging from 0 to 15. value represents the priority of the bridge. It can be one ofthe following values: 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672,32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440。 no spanning-tree mstp instance-id priority Resumes the bridge priority of the switch to the defaultvalue. instance-id represents the number of the spanning treeinstance, ranging from 0 to 15. 3.3.7 Configuring time parameters of STP The following are STP time parameters:  Hello Time: The interval to send the configuration message to the designated port when theswitch functions as the network root. 25 STP Configuration  Forward Delay: Time that the port needs when it changes from the Blocking state to theLearning state and to the Forwarding state in STP mode.  Max Age: The maximum live period of the configuration information about the spanningtree. To reduce the shock of the network topology, the following requirements for the time parameters must be satisfied:  2 x (fwd_delay - 1.0) >= max_age  max_age >= (hello_time + 1) x 2 Running the following command to set the time parameter of MSTP: Command Purpose spanning-tree mstp hello-time seconds Resumes Hello Time to the default value. seconds: value range: 1-10 seconds, Default value: 2 seconds no spanning-tree mstp hello-time Resumes the hello time to the default value. spanning-tree mstp forward-time seconds Sets the parameter Forward Delay. seconds: value range from 4 to 30 seconds, the default value is 15 seconds. no spanning-tree mstp forward-time Resumes Forward Delay to the default value. spanning-tree mstp max-age seconds Sets the parameter Max Age. seconds: value range from 6 to 40 seconds, the default value is 20 seconds. no spanning-tree mstp max-age Resumes the Max Age to the default value. It is recommended to modify the time parameter of STP through setting the root or network diameter, ensuring the rationality of the time parameter. The newly-set time parameters are valid even if they do not comply with the previous formula’s requirements. Pay attention to the notification on the console when you perform configuration. 3.3.8 Configuring network diameter Network diameter stands for the maximum number of switches between two hosts in the network, representing the scale of the network. You can set the MSTP network diameter by running the command spanning-treemstp diameter net-diameter. The parameter net-diameter is valid only to CIST. Afterconfiguration, three STP time parameters is automatically updated to comparativelybetter values. Run the following command to configure net-diameter: 26 STP Configuration Command Purpose spanning-tree mstp diameter net-diameter Configure net-diameter. net-diameter: value range: 2-7; default value: 7 no spanning-tree mstp diameter Resumes net-diameter to the default value. The net-diameter parameter is not saved as an independent configuration in the switch. Only the time parameter which is modified through network diameter configuration can be saved. 3.3.9 Configuring maximum hop count Use the following command to configure the max hop-count. Command Purpose spanning-tree mstp max-hops hop-count Set the maximum hops. hop-count: value range: 6-40 
 Default value: 20 no spanning-tree mstp max-hops Resume the maximum hop count to the default value. 3.3.10 Setting the Port Priority If a loop occurs between two ports of the switch, the port with higher priority will enterthe forwarding state and the port with lower priority is blocked. If all ports have thesame priority, the port with smaller port number will first enter the forwarding state. In port configuration mode, run the following command to set the priority of the STPport: Command Purpose spanning-tree mstp instance-id port-priority Sets the priority of the STP port. priority instance-id represents the number of the spanning treeinstance, ranging from 0 to 15. priority stands for the port priority. It can be one of thefollowing values: 0, 16, 32, 48, 64, 80, 96, 112 128, 144, 160, 176, 192, 208, 224, 240, spanning-tree port-priority value Sets the port priority in all spanning tree instances. value: value of the port priority, which can be one of the following values. 0, 16, 32, 48, 64, 80, 96, 112 128, 144, 160, 176, 192, 208, 224, 240, no spanning-tree mstp instance-id port-priority Resumes the port priority to the default value. no spanning-tree port-priority Resumes the port priority to the default value in all spanning tree instances. 27 STP Configuration 3.3.11 Value of the path cost of a port In MSTP, the default value of the port’s path cost is based on the connection rate. If a loop occurs between two switches, the port with less path cost will enter the forwarding state. The less the path cost is, the higher rate the port is. If all ports have the samepath cost, the port with smaller port number will first enter the forwarding state. In port configuration mode, run the following command to set the path cost of the port: Command Purpose spanning-tree mstp instance-id cost cost Sets the path cost of the port. instance-id represents the number of the spanning treeinstance, ranging from 0 to 15. cost stands for the path cost of the port, which ranges from 1 to 200000000. spanning-tree cost value Sets the path cost of the port in all spanning tree instances. value: Path cost of a port, which ranges between 1 and 200,000,000 no spanning-tree mstp instance-id cost Resumes the port path cost to the default value. no spanning-tree cost Resumes the path cost of the port to the default value. 3.3.12 Setting the Edge Port The edge port means this port connects terminal devices of a network. A mandatory edge port will enter the forwarding state after link-up. In port configuration mode, run following command to set the edge port of MSTP: Command Purpose spanning-tree mstp edge Sets the edge port. no spanning-tree mstp edge Resume the default setting. 3.3.13 Setting the Port Connection Type If switches, on which RSTP is run, are in the point-to-point connection, these switches can establish a topology rapidly through the handshake mechanism. When the port connection type is set, the connection of a port can be set point-to-point. By default, RSTP will judge whether a port is in the point-to-point connection according to the duplex mode of this port. If this port works in full duplex mode, RSTP regards this port is in a point-to-point connection; if this port works in half duplex mode, RSTP regards this port’s connection is shared. If it is confirmed that RSTP or MSTP is running on the switches connected by a port, you should set this port’s connection type to point-to-point so that fast handshake should be conducted. 28 STP Configuration In the port configuration mode, run the following command to set the connection type of a port. Command Purpose spanning-tree mstp point-to-point force-true Sets the port connection mode to point-to-point. spanning-tree mstp point-to-point force-false Sets the port connection mode to non-point-to-point. spanning-tree mstp point-to-point auto Sets the port connection mode to auto-check (the default mode). no spanning-tree mstp point-to-point Resumes the port connection type to the default settings. 3.3.14 Activating MST-compatible mode The MSTP protocol that our switches support is based on IEEE 802.1Q. In order to be compatible with other MSTPs, especially MSTP that the Cisco switches support, the MSTP protocol can work in MST-compatible mode. Switches running in MSTP-compatible mode can identify the message structure of other MSTPs, check the contained MST regional identifier and establish the MST region. The MST-compatible mode and the STP-compatible mode are based on MSTPprotocol conversion mechanism. If one port of the switch receives BPDU in compatible mode, the port automatically changes to the mode and sends BPDU in compatible mode. To resume the port to standard MST mode, you can run spanning-tree mstpmigration-check. In global configuration mode, run the following commands to enable or disable theMST-compatible mode: Command Purpose spanning-tree mstp mst-compatible Enable the MST-compatible mode of the switch. no spanning-tree mstp mst-compatible Disable the MST-compatible mode of the switch. Note: The main function of the compatible mode is to create the MST area for switches and other MSTP-runningswitches. In actual networking, make sure that the switch has the same configuration name and the same edit number. It is recommended to configure switches running other MSTP protocols to the CIST root, ensuring that the switch enters the compatible mode by receiving message. If the MST-compatible mode is not activated, the switch will not resolve the whole BPDU-compatiblecontent and take the content as the common RSTP BPDU. In this way, the switch cannot be in the samearea with the MST-compatible switch that it connects. A port in compatible mode cannot automatically resumes to send standard MST BPDU even if thecompatible mode is shut down in global configuration mode. In this case, run migration-check. 29 STP Configuration 3.3.15 Restarting the protocol conversion check MSTP allows the switch to work with the traditional STP switch through protocolconversion mechanism. If one port of the switch receives the STP configuration message, the port then only transmits the STP message. At the same time, the port that receives the STP information is then considered as a boundary port. Likewise, in MST compatible mode, if one interface receives the compatible BPDU, the interface will also forward compatible BPDU. Note: When a port is in the STP-compatible state, the port will not automatically resume to the MSTP state even if the port does not receive the STP message any more. In this case, you can run spanning-tree mstpmigration-check to clear the STP message that the port learned, and make the port to return to the MSTPstate. The switch that runs the RSTP protocol can identify and handle the MSTP message. Therefore, the MSTP switch does not require protocol conversion when it works with the RSTP switch. In global configuration mode, run the following command to clear all STP informationthat is detected by all ports of the switch: Command Purpose spanning-tree mstp migration-check Clears all STP information that is detected by all ports of the switch. In port configuration mode, run the following command to clear STP informationdetected by the port. Command Purpose spanning-tree mstp migration-check Clears STP information detected by the port. 3.3.16 Configuring role restriction of the port The port will not be selected as the root port if the role restriction of the port is enabled. In the port configuration mode, run the following command to set the role restriction of a port. Command Purpose spanning-tree mstp restricted-role Sets the port not to be the root port 3.3.17 Configuring TCN restriction of the port The topology change will not be transferred to other port if TCN restriction of the port is enabled. In the port configuration mode, run the following command to set the TCN restriction of a port. Command Purpose spanning-tree mstp restricted-tcn Enable the topology changes on one port cannot 30 STP Configuration be transmissed to other ports. 3.3.18 Check MSTP information In monitoring mode, global configuration mode or port configuration mode,run the following command to check all information about MSTP. Command Purpose show spanning-tree Checks MSTP information. (Information about SSTP, PVST, RSTP and MSTP can be checked) show spanning-tree detail Checks MSTP information. (Information about SSTP, PVST, RSTP and MSTP can be checked) show spanning-tree interface interface-id Checks the STP interface information. (Information about SSTP, PVST, RSTP and MSTP can be checked) show spanning-tree mstp Checks all MST instances. show spanning-tree mstp region Checks the MST area configuration. show spanning-tree mstp instance instance-id Checks information about a MST instance. show spanning-tree mstp detail Checks detailed MST information. show spanning-tree mstp interface interface-id Checks MST port configuration. show spanning-tree mstp protocol-migration Checks the protocol conversion state of the port. 31