L2 · switching · reviewed
MSTP
Multiple Spanning Tree Protocol
Maps many VLANs onto a handful of spanning trees, and decides who shares a topology by hashing the mapping rather than by trusting the configuration to match.
Presenter modeEmbed this figure
Why it exists
One spanning tree across all VLANs leaves half the uplinks blocked. One tree per VLAN uses them, and costs a topology calculation and a BPDU stream per VLAN — which on a thousand VLANs is a thousand of each.
MSTP maps many VLANs onto a few instances. Two instances with different roots use both uplinks, and cost two calculations regardless of how many VLANs are mapped into them. IEEE 802.1Q-2022 §13.4
The mapping only works if every switch agrees on it, and the interesting engineering is in how that agreement is established: not by exchanging the table, but by hashing it. IEEE 802.1Q-2022 §13.7
Agreeing by hash, not by intention
Two switches are in one region only if a sixteen-octet digest matches. The digest is computed over the thing people forget to compare.
Three switches are meant to be one region. All three are configured with the region name `campus` and revision 1. SW-A: Region campus / rev 1. SW-B: Region campus / rev 1. SW-C: Region campus / rev 1.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| SW-A | switch | Region: campus / rev 1 |
| SW-B | switch | Region: campus / rev 1 |
| SW-C | switch | Region: campus / rev 1 |
| SW-A — SW-B | link | forwarding |
| SW-A — SW-C | link | forwarding |
Three switches are meant to be one region. All three are configured with the region name `campus` and revision 1.
What changed
- SW-A: Region → campus / rev 1
- SW-B: Region → campus / rev 1
- SW-C: Region → campus / rev 1
How it works
A region is identified by a name, a revision number and the VLAN-to-instance table, hashed together into sixteen octets. Switches compare digests, so agreement costs the same whether the table has one entry or four thousand. IEEE 802.1Q-2022 §13.7
That trade has a sharp edge. When the digest differs, it will not say which input differed — and a difference in any one of the three produces the identical symptom.
Instance 0 is the CIST and is not an ordinary instance. It is what the region uses to reach anything outside it, and every VLAN not mapped somewhere else lands in it — following a topology nobody designed for it. IEEE 802.1Q-2022
To the outside, a region presents itself as a single bridge. At a boundary port every instance follows the CIST, so per-instance tuning inside the region has no effect on how traffic leaves it. IEEE 802.1Q-2022
Try it
Compare MST regions
Match the name and revision, then leave the digest different — that is still two regions.
Two regions — CST between them
Name "campus" and revision 1 match, but the digests differ. The digest covers the VLAN-to-instance map, so these are two regions. That is the usual misconfiguration.
On the wire
Constructed examples, encoded from the field table below them — not captured traffic.
- IEEE 802.3 MAC frame
- Destination 01:80:C2:00:00:00, the Bridge Group Address. A length field, not an EtherType. IEEE 802.1D-2004
- IEEE 802.2 LLC
- DSAP 0x42, SSAP 0x42, control 0x03 (unnumbered information). IEEE 802.1D-2004
- Bridge Protocol Data Unit
- The fields below, in network byte order. IEEE 802.1D-2004
Configure it
spanning-tree mode mstSwitching mode is disruptive: every port re-converges. Do it in a window, and do it on every switch in the intended region before judging whether the region formed.
spanning-tree mst configuration name campus revision 1 instance 1 vlan 10,30,50 instance 2 vlan 20,40,60All three digest inputs in one stanza. This block must be byte-identical on every switch in the region — including on switches with no ports in some of these VLANs.
Common mistake: Mapping only the VLANs a switch actually carries. The digest covers the whole table, so a partial mapping is a different region.
IEEE 802.1Q-2022 §13.7
spanning-tree mst 1 priority 8192 spanning-tree mst 2 priority 16384Per instance, which is the point. A global `spanning-tree priority` makes one switch root for everything and quietly undoes the load sharing the instances were created for.
IEEE 802.1Q-2022 §13.4
! on Dist-2, the mirror image: ! spanning-tree mst 1 priority 16384 ! spanning-tree mst 2 priority 8192Written here because the pair only makes sense together. Configuring one side and not the other gives one root for both instances and no sharing.
spanning-tree portfast default spanning-tree portfast bpduguard default spanning-tree loopguard defaultThe same edge and guard discipline as RSTP, because MSTP is RSTP’s convergence with a different mapping of VLANs to trees.
show spanning-tree mst configuration digestThe confirmation step, and the one people skip. Two switches intended to be one region either print the same sixteen octets or they do not — everything else is inference.
IEEE 802.1Q-2022 §13.7
Verify
show spanning-tree mst configuration digest- The one value that decides region membership.
show spanning-tree mst 1- Root and port roles for that instance alone.
show spanning-tree mst interface Gi1/0/1- Per-instance role on one port, including at a boundary.
show spanning-tree inconsistentports- Ports held by a guard, including PVST simulation.
Caveats
- The mapping stanza must be identical on every switch in the region, including VLANs a switch has no ports in.
- Per-instance priority is what shares load; a global priority silently does not.
- At a region boundary every instance follows the CIST, so per-instance tuning has no effect there.
When it breaks
Symptom first, because that is what you have when it happens.
Two switches that should share a region each behave as their own, and every VLAN converges as if the other were a separate domain.
Narrow it down
- Compare the region name, the revision number and the VLAN-to-instance mapping on both.
- Read the configuration digest each advertises — it is a hash of all three.
- Look for a VLAN created on one switch and not mapped on the other.
Cause
The digest differs, so the two are not in one region. Any difference produces the same result: a VLAN mapped on one and not the other changes the hash exactly as a misspelled name does.
Fix
Make name, revision and mapping identical. Compare the digest first — it is one value, and it is the thing being compared.
IEEE 802.1Q-2022 §13.7A VLAN that was working stops after a new VLAN is added elsewhere on the network.
Narrow it down
- Check whether the new VLAN was mapped to an instance on every switch in the region.
- Compare digests before and after the change.
- Look for switches that now consider themselves boundary devices.
Cause
Adding a VLAN changes the mapping and therefore the digest. A switch that did not get the change leaves the region, and every instance it holds is recalculated against the outside world.
Fix
Apply the mapping region-wide in one change. This is the strongest argument in switching for configuration management.
Load sharing across two uplinks does not happen — all VLANs use the same one.
Narrow it down
- Check how many instances exist and which VLANs are in each.
- Confirm the bridge priority differs per instance, not just globally.
- Look at whether every VLAN landed in instance 0 by default.
Cause
All VLANs are in one instance. MSTP shares load by having instances choose different roots, and unmapped VLANs default to the CIST, where there is only one topology to have.
Fix
Map VLANs to at least two instances and set the priority per instance so each prefers a different uplink.
IEEE 802.1Q-2022 §13.4Load sharing works between access and distribution and collapses onto one path leaving the region.
Narrow it down
- Identify which ports are region boundary ports.
- Check the port role per instance on those ports — they will all match the CIST.
- Confirm whether the far side is in a different region or running plain RSTP.
Cause
Outside a region only the CIST exists. Every instance follows the CIST role at a boundary port, so per-instance priorities have nothing to act on there.
Fix
Extend the region to cover both ends of the links you want to share load across, or accept one path at the boundary and design for it.
IEEE 802.1Q-2022A boundary port toward a per-VLAN switch is blocked and reported as inconsistent, and no VLAN passes over it.
Narrow it down
- Check what the neighbour runs — per-VLAN spanning tree emits a BPDU per VLAN.
- Look for a port reported as being in a PVST simulation inconsistent state.
- Compare which bridge is root for VLAN 1 against which is root for the CIST.
Cause
A region emits one BPDU for the CIST, and a per-VLAN neighbour expects one per VLAN. The simulation that bridges the two only holds while the region is root for every VLAN the neighbour has — otherwise it blocks rather than risk a partial topology.
Fix
Make the MSTP region the root for the VLANs concerned, or move the neighbour into the region. Disabling the guard removes the warning and not the hazard.
Design notes
Treat the VLAN-to-instance mapping as region-wide state and apply it everywhere in one change. It is expressed as per-switch configuration, partial application is silent, and the outage lands on a VLAN nobody touched.
Map every VLAN explicitly, including ones a switch has no ports in. A switch needs the mapping, not the VLAN, and an unmapped VLAN quietly follows the CIST.
Set bridge priority per instance, not globally. A global priority makes one switch root for everything, which is the design MSTP was deployed to get away from.
Keep the number of instances small — two or three is usually enough for load sharing. Every instance is a topology to compute, monitor and reason about during an incident, and the marginal value drops fast after the second.
Misconceptions
- “MSTP runs one spanning tree per VLAN, more efficiently than PVST+.”
- It runs one per instance, and an instance carries many VLANs. That is the entire saving: a thousand VLANs sharing two instances cost two topology calculations rather than a thousand. IEEE 802.1Q-2022 §13.4
- “Switches in the same region need the same VLANs.”
- They need the same VLAN-to-instance mapping, which is a different requirement. A VLAN mapped on one switch and absent from the mapping on another breaks the region even if neither has any ports in it.
- “The region name is cosmetic.”
- It is hashed into the digest along with the revision and the mapping. A typo partitions the region as completely as a wrong mapping, and produces a far more confusing symptom. IEEE 802.1Q-2022 §13.7
- “Instance 0 is just another instance.”
- It is the CIST: the tree that reaches outside the region, and the one every unmapped VLAN falls into. Tuning it as though it were an ordinary instance changes how the region connects to everything beyond it. IEEE 802.1Q-2022
More walkthroughs
Two instances so two uplinks get useddesign-choice
One instance is one topology, and one topology has one root. Load sharing is a decision about how many trees to run, not about how many links exist.
With every VLAN in the default instance there is one tree, so one uplink forwards and the other blocks. Half the money spent on uplinks is idle. Dist-1. Dist-2. Access: Instances 0 only.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| Dist-1 | switch | — |
| Dist-2 | switch | — |
| Access | switch | Instances: 0 only |
| Access — Dist-1 | link | forwarding |
| Access — Dist-2 | link | blocking |
| Dist-1 — Dist-2 | link | forwarding |
With every VLAN in the default instance there is one tree, so one uplink forwards and the other blocks. Half the money spent on uplinks is idle.
What changed
- Access: Instances → 0 only
- Emphasis: Blocked, always
A new VLAN broke an old onefailure
Adding VLAN 50 on one switch changes its digest, drops it out of the region, and the outage shows up on VLAN 10.
A new VLAN 50 is needed for a project. It is created and mapped to instance 1 on SW-B, where the ports for it are. Nothing else is touched. SW-A. SW-B · changed: Added VLAN 50 → instance 1. SW-C.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| SW-A | switch | — |
| SW-B · changed | switch | Added: VLAN 50 → instance 1 |
| SW-C | switch | — |
| SW-A — SW-B · changed | link | forwarding |
| SW-B · changed — SW-C | link | forwarding |
A new VLAN 50 is needed for a project. It is created and mapped to instance 1 on SW-B, where the ports for it are. Nothing else is touched.
What changed
- SW-B · changed: Added → VLAN 50 → instance 1
- Emphasis on SW-B · changed
Terms
- MST digest
- A 16-octet HMAC-MD5 of the VID-to-MSTID table. Two bridges share a region only when name, revision, and digest all match. Matching names with different maps do not merge.
- MST region
- The set of switches that share a spanning tree instance map. Membership is decided by comparing a digest of the region name, the revision and the whole VLAN-to-instance table — not by comparing configuration.
- CIST
- Instance 0, and not an ordinary instance: it is the tree a region uses to reach anything outside itself, and the one every unmapped VLAN falls into. At a region boundary every other instance follows it.