Configuration Guide
Ethernet Switch Configuration
MSTP Configuration
25 min
introduction introduction mstp (multiple spanning tree protocol) is a protocol for creating multiple spanning trees based on stp/rstp introduced in ieee 802 1s, it binds multiple stp instances to a smaller set of vlans mstp inherits all the advantages of stp/rstp while addressing the issue of link underutilization by forming multiple loop free trees, mstp resolves broadcast storms and provides redundancy the multiple trees achieve load balancing between vlans, directing traffic along different paths for different vlans explanation of principles explanation of principles the principles and calculation methods of mstp closely resemble those of stp/rstp the fundamental idea is to establish a loop free tree structure by prioritizing comparisons, connecting devices from the highest priority root node to lower priority ones this process transforms a cyclic network into a loop free tree structure the following diagram illustrates this concept mstp region mstp region unlike stp/rstp, mstp introduces the concept of regions, which divides the entire network into different regions composed of multiple switches and the segments between them devices within the same mstp region share the following characteristics all devices in the region run mstp all devices have same region name all devices share the same vlan to spanning tree instance mapping configuration all devices share the same mstp revision level configuration a local area network can have multiple mstp regions, and these regions can be directly or indirectly connected physically users can utilize mstp configuration commands to group multiple switches into the same mstp region by configuring, three regions (region1 to region3) are formed as shown in the diagram in mstp, instance 0 has a special significance known as cisti (common and internal spanning tree instance), while the remaining instances are referred to as mstis (multiple spanning tree instances) by default, all vlans are bound to the cisti, ensuring the security of the entire network the cist (common and internal spanning tree) is calculated using the stp or rstp protocol and forms a single spanning tree that connects all switching devices within a network the ist (internal spanning tree) of all mst regions combined with the cst (common spanning tree) forms a complete spanning tree known as cist within each region, it acts as ist, pruning devices to create a spanning tree; between regions, it acts as cst, treating each region as a single node and pruning them to form a spanning tree the resulting effects are illustrated in the diagram cist prunes the circular network into a tree within each domain and trims the entire network into a loop free tree across domains due to the introduction of domains and instances, mstp has two types of root nodes the common and internal spanning tree instance (cist) root and the domain root the cist root is a global concept and there is only one cist root for all interconnected stp/rstp/mstp devices it is also the root of the cist the domain root, on the other hand, is specific to a particular domain and instance it is a localized concept and is also the root of instance0 in region1 mstp topology calculation principle mstp topology calculation principle mstp divides the entire network into multiple mst domains, treating each domain as a node the calculations between different mst domains are performed using the stp or rstp protocol algorithms to generate the common spanning tree (cst), which is a single spanning tree the calculation of the mstp vector priority is as follows true 193,1007 left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type the lowest vector has the highest priority, and the comparison rules are as follows first, compare the root bridge id if the root bridge ids are the same, proceed to compare the external root path cost if the external root path costs are also the same, then compare the domain root ids if the domain root ids are still the same, proceed to compare the internal root path costs if the internal root path costs are still the same, then compare the designated bridge ids if the designated bridge ids are still the same, proceed to compare the designated port ids if the designated port ids are still the same, then compare the receiving port ids csti calculation after the configuration message exchange comparison, select the switch with the highest priority as the root of the cist in the entire network then, within each mst domain, calculate the ist (internal spanning tree) using the mstp protocol algorithm at the same time, mstp treats each mst domain as a single switch and calculates the cst (common spanning tree) between mst domains using the stp or rstp protocol algorithm the cst and ist together form the cist for the entire switch network msti calculation within an mst domain, mstp generates different spanning tree instances (mstis) for different vlans based on the mapping between vlans and instances the characteristics of msti calculation are as follows each msti independently calculates its own spanning tree without interfering with others the calculation method for the spanning tree in each msti is similar to rstp each msti can have its own root and topology each msti sends its own bpdu within its own spanning tree the topology of each msti is determined through configuration commands (not automatically generated) the parameters for each port in different mstis can be different the role and status of each port in different mstis can also be different msti spanning tree algorithm implementation at the beginning, each switch's ports generate configuration messages with itself as the root bridge these messages have a root path cost of 0, the specified bridge id as its own switch id, and the specified port as the current port each switch sends out its own configuration message and processes other configuration messages it receives as follows when a port receives a configuration message with a lower priority than its own (priority comparison is based on the vector priority comparison rules explained earlier), the switch discards the received configuration message and takes no action on the configuration message for that port when a port receives a configuration message with a higher priority than its own, the switch replaces the content of the received configuration message with the content of the port's own configuration message then, the switch compares this port's configuration message with the configuration messages on its other ports and selects the optimal configuration message spanning tree calculation steps root bridge election by comparing the root bridge ids in the configuration messages sent by all switches, the switch with the smallest root bridge id becomes the cist root bridge or mst domain root bridge root port election on non root bridges each non root bridge designates the port that receives the best configuration message as its root port designated port election this step consists of the following two sub steps switch calculates a standardized designated port configuration message for each port based on the root port's configuration message and root port's path cost it replaces the root bridge id with the root port's configuration message root bridge id, adds the root port's path cost to the root port's configuration message root path cost, replaces the designated bridge id with its own switch id, and replaces the designated port id with its own port id switch compares the calculated configuration message from the above rule with the original configuration message on the corresponding port if the original configuration message is better, the port is blocked, and its configuration message remains unchanged the port will only receive configuration messages but not forward data (acting as a root port) if the calculated configuration message is better, the switch designates the port as the designated port, replaces the port's configuration message with the calculated one, and periodically sends it out after the msti spanning tree topology convergence, regardless of whether non root bridges receive messages from the root bridge, they periodically send bpdus according to the hello timer if a port does not receive a bpdu from the designated bridge (the higher level switch it is connected to) for 3 consecutive hello times (default setting), the switch considers the link to that neighbor as failed mstp configuration mstp configuration default configuration default configuration true 321,480 left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type mstp working mode configuration mstp working mode configuration true 307,213 5,243 5 left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type mstp attribute configuration mstp attribute configuration true 313,217 5,287 5 left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type mstp instance configuration mstp instance configuration true 400,387,182 left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left #d8e5f5 unhandled content type left unhandled content type left unhandled content type left unhandled content type display and maintenance display and maintenance true 271,206 3465011286682,202 6534988713318 left #4283c7 unhandled content type left #4283c7 unhandled content type left #4283c7 unhandled content type left unhandled content type left unhandled content type left unhandled content type configuration example configuration example network requirements network requirements all devices in the network belong to the same mst domain, and by configuring mstp, messages from different vlans are forwarded according to different mstis procedure procedure device 1 configuraion \# create vlan 40, 41, and add the interface to the vlan sonic(config)# vlan 40 sonic(config)# vlan 41 sonic(config)# interface ethernet 1 sonic(config if 1)# switchport trunk vlan 40 sonic(config if 1)# switchport trunk vlan 41 sonic(config)# interface ethernet 2 sonic(config if 2)# switchport trunk vlan 40 sonic(config if 2)# switchport trunk vlan 41 \# enable mstp function and configure the domain name of mst domain as test sonic(config)# stp enable mstp sonic(config)# stp name test \# configure msti instance and configure the instance priority of this device sonic(config)# stp instance 40 sonic(config stp 40)# priority 1 sonic(config)# stp instance 41 sonic(config stp 41)# priority 5 \# bind vlan and msti instance sonic(config)# stp bind vlan 40 40 sonic(config)# stp bind vlan 41 41 device 2 configuration \# create vlan 40, 41, and add the interface to the vlan sonic(config)# vlan 40 sonic(config)# vlan 41 sonic(config)# interface ethernet 1 sonic(config if 1)# switchport trunk vlan 40 sonic(config if 1)# switchport trunk vlan 41 sonic(config)# interface ethernet 2 sonic(config if 2)# switchport trunk vlan 40 sonic(config if 2)# switchport trunk vlan 41 \# enable mstp function and configure the domain name of mst domain as test sonic(config)# stp enable mstp sonic(config)# stp name test \# configure msti instance and configure the instance priority of this device sonic(config)# stp instance 40 sonic(config stp 40)# priority 5 sonic(config)# stp instance 41 sonic(config stp 41)# priority 5 \# bind vlan and msti instance sonic(config)# stp bind vlan 40 40 sonic(config)# stp bind vlan 41 41 device 3 configuration \# create vlan 40, 41, and add the interface to the vlan sonic(config)# vlan 40 sonic(config)# vlan 41 sonic(config)# interface ethernet 1 sonic(config if 1)# switchport trunk vlan 40 sonic(config if 1)# switchport trunk vlan 41 sonic(config)# interface ethernet 2 sonic(config if 2)# switchport trunk vlan 40 sonic(config if 2)# switchport trunk vlan 41 \# enable mstp function and configure the domain name of mst domain as test sonic(config)# stp enable mstp sonic(config)# stp name test \# configure msti instance and configure the instance priority of this device sonic(config)# stp instance 40 sonic(config stp 40)# priority 5 sonic(config)# stp instance 41 sonic(config stp 41)# priority 1 \# bind vlan and msti instance sonic(config)# stp bind vlan 40 40 sonic(config)# stp bind vlan 41 41 verify configuration verify configuration view spanning tree information on device 1 sonic# show stp status role flags root root, desg designated, altn alternate, back backup, mstr master, disa disabled state flags disc discard/blocking/listening, lear learning, forw forwarding spanning tree mode mstp mst instance port port role stp state \ 40 ethernet1 desg forw 40 ethernet2 desg forw 41 ethernet1 desg forw 41 ethernet2 root forw view spanning tree information on device 2 sonic# show stp status role flags root root, desg designated, altn alternate, back backup, mstr master, disa disabled state flags disc discard/blocking/listening, lear learning, forw forwarding spanning tree mode mstp mst instance port port role stp state \ 40 ethernet1 altn disc 40 ethernet2 root forw 41 ethernet1 root forw 41 ethernet2 altn disc view spanning tree information on device 3 sonic# show stp status role flags root root, desg designated, altn alternate, back backup, mstr master, disa disabled state flags disc discard/blocking/listening, lear learning, forw forwarding spanning tree mode mstp mst instance port port role stp state \ 40 ethernet1 desg forw 40 ethernet2 root forw 41 ethernet1 desg forw 41 ethernet2 desg forw
