Sub topic 18
MSTP: mapping many VLANs to a few trees
This chapter assumes you know how classic STP and Rapid STP elect a root, assign port roles, and run one tree per VLAN with Rapid PVST+. It also assumes you can read a Cisco IOS-style command line. Multiple Spanning Tree Protocol (MSTP, IEEE 802.1s) keeps the RSTP logic and changes how many trees run and how VLANs are assigned to them.
The problem MSTP solves
Rapid PVST+ runs a separate spanning tree for every VLAN. That has two costs:
- Each VLAN sends its own BPDUs on every trunk, and each VLAN needs its own state on every switch. With hundreds of VLANs, CPU load and BPDU volume grow with the VLAN count.
- Most of those trees are identical. If VLANs 10 to 50 all prefer the same root and use the same links, the switches compute the same result 41 times.
MSTP lets you define a small number of trees, called instances, and map each VLAN to one of them. A typical design uses two instances. Half the VLANs use one root and half use another, so both uplinks carry traffic and each tree still has no loops.
Instances and the region
An MST instance (MSTI) is one spanning tree. It has its own root bridge election, its own port roles and its own forwarding topology. You choose which VLANs belong to it.
Switches only share instances if they belong to the same MST region. Two switches are in the same region only when all three of these match exactly:
- The region name.
- The revision number.
- The VLAN-to-instance mapping, which switches compare as a hash called the digest.
Compare the digests, not the VLAN lists you believe you typed. A single VLAN mapped differently on one switch puts that switch in a different region. The result is a region boundary where you did not intend one.
Instance 0 and the CIST
Instance 0 always exists. It is called the Internal Spanning Tree (IST). Every VLAN that you do not map to another instance belongs to it, including VLAN 1 by default.
The IST is special for two reasons:
- It is the instance that carries the region's BPDUs. Switches inside a region send a single BPDU per port, and that BPDU contains one small record for each MSTI. Instance information does not need one BPDU per VLAN or one per instance.
- It connects the region to the outside. Between regions, and toward switches running plain RSTP or PVST+, the whole region behaves like one bridge. The tree that spans all regions is the Common Spanning Tree (CST). The IST plus the CST together form the Common and Internal Spanning Tree (CIST).
Ports at the edge of a region are boundary ports. They exchange BPDUs with a neighbor that is outside the region, and they use the CIST view of the topology.
| Term | Meaning |
|---|---|
| MSTI | A spanning tree instance (1 and up) that carries the VLANs you map to it |
| IST (instance 0) | The instance that carries region BPDUs and any unmapped VLANs |
| CST | The single tree that connects regions and non-MST bridges |
| CIST | The IST combined with the CST; the tree seen from outside the region |
| Boundary port | A port that faces a different region or a non-MST bridge |
Bridge priority per instance
Each instance elects its own root using the same rules as before: lowest priority wins, and the MAC address breaks ties. The extended system ID in the priority field now holds the instance number instead of a VLAN ID. So the priority is still a multiple of 4096 and the effective value is the priority plus the instance number.
This is what makes load balancing work. You make one distribution switch the root for instance 1 and the other the root for instance 2. Traffic for VLANs in instance 1 follows the tree rooted at the first switch. Traffic for VLANs in instance 2 follows the other tree.
Configuring MSTP
This example creates a region named CAMPUS, maps four VLANs to two instances, and splits the root roles between two distribution switches. Run the region configuration on every switch in the region. Run the root commands only on the switch they apply to.
! Cisco IOS: on every switch in the region
configure terminal
spanning-tree mode mst
spanning-tree mst configuration
name CAMPUS
revision 1
instance 1 vlan 10,20
instance 2 vlan 30,40
exit
end
! On distribution switch DS1
configure terminal
spanning-tree mst 0 root primary
spanning-tree mst 1 root primary
spanning-tree mst 2 root secondary
end
! On distribution switch DS2
configure terminal
spanning-tree mst 2 root primary
spanning-tree mst 1 root secondary
endTwo details matter:
- The mapping commands take effect when you leave the
spanning-tree mst configurationsubmode. Until then, nothing is applied. - Changing the mapping on a live region can restart spanning tree calculation for the affected instances. Make mapping changes in a maintenance window.
You can set an explicit value instead of the macro, for example spanning-tree mst 1 priority 4096.
Verifying
Check the region first, then each instance.
! Cisco IOS
show spanning-tree mst configuration
show spanning-tree mst configuration digest
show spanning-tree mst 1
show spanning-tree mst interface GigabitEthernet0/1
show spanning-tree mst detailLook for these things:
- The name, revision and digest must be the same on every switch. A differing digest means a different region.
- For each instance, find the local root port and the designated ports, and confirm that the root bridge is the one you chose.
- Boundary ports are labeled
Bound(RSTP)orBound(PVST)in the interface output, so you can see where the region meets another kind of bridge.
Common errors
- Mismatched mapping. One switch has VLAN 30 in instance 1 while its neighbors have it in instance 2. That switch forms its own region. VLANs may be forwarded on a path that other switches have blocked, or blocked where they expect forwarding.
- VLAN not allowed on the trunk but mapped to an instance. MSTP does not check the trunk's allowed VLAN list when it builds the tree. An instance can have a forwarding path in the tree that does not carry the VLANs mapped to it. Keep the allowed VLAN lists consistent with your instance design.
- Root of the CIST outside the region. Inside a region the IST root should be a switch within the region. If the best CIST root is an outside bridge, the region's choice of root port toward it can force inefficient paths for instance 0.
- Mixing with PVST+. An MST region interoperates with Rapid PVST+ switches, but it appears to them as one bridge. The MST side should be the root for all VLANs, or the PVST+ side should be, but avoid a split. Cisco switches block the boundary port with a PVST simulation inconsistency if the rules are broken.
- Forgetting the protection features. PortFast, BPDU Guard and Root Guard work the same way under MSTP. Root Guard applies per port across all instances.
Exercise
A switch has region name CAMPUS, revision 1, and maps VLAN 30 to instance 1. Its neighbors have the same name and revision but map VLAN 30 to instance 2. Which command shows the problem, and what happens to that switch?
Show answer
Run show spanning-tree mst configuration digest (or show spanning-tree mst configuration) on both switches and compare the digests. They will differ, because the VLAN-to-instance mapping is part of the digest. The switch with the different mapping is in a different MST region from its neighbors, and the link between them becomes a region boundary. The two sides then treat each other as one bridge in the CIST, which breaks the intended per-instance topology and load balancing for VLAN 30.