Spanning-Tree Protocols · Topic 2 of 3
Convergence, MSTP and VSTP
Learn spanning tree convergence, topology changes, MSTP regions and instances and per-VLAN VSTP on MX routers for JNCIS-SP JN0-364, with config and checks.
- 6 min
- STP: up to 50 seconds (max age 20 plus listening 15 plus learning 15).
- RSTP: alternate port takeover, proposal and agreement on point-to-point links, edge ports, failure detected after 3 missed hellos (6 seconds).
- RSTP topology change: only a non-edge port going to forwarding; TC flag and MAC flush.
What it is
Convergence is the time from a topology change, such as a failed link, until every bridge again agrees on one loop-free tree and traffic flows. Classic STP can take up to 50 seconds; RSTP usually needs only a few seconds.
STP and RSTP build one tree for all VLANs, so a blocked link carries no traffic at all. MSTP (Multiple Spanning Tree Protocol, IEEE 802.1s) maps groups of VLANs to a few independent trees. VSTP (VLAN Spanning Tree Protocol) runs one tree per VLAN and is the Junos protocol that works with Cisco PVST+ and Rapid-PVST+.
How it works
STP convergence
When a root port fails without a direct link-down signal, an STP bridge waits for the stored BPDU to expire (max age, 20 seconds), then moves a new port through listening and learning (15 seconds each). That adds up to about 50 seconds. With a direct link failure the max age wait is skipped, leaving about 30 seconds.
A topology change in STP is sent as a TCN BPDU toward the root. The root then sets the topology change flag in its BPDUs, and every bridge shortens its MAC aging to the forward delay so stale entries clear.
RSTP convergence
| Event | RSTP reaction |
|---|---|
| Root port fails | A precomputed alternate port becomes root port and forwards at once |
| Neighbor stops sending BPDUs | Information is aged after three missed hellos, 6 seconds by default |
| New designated port on a point-to-point link | Proposal and agreement handshake, no timer wait |
| Edge port comes up | Forwards at once and causes no topology change |
| Non-edge port moves to forwarding | Topology change: the bridge sets the TC flag and flushes MACs learned on its other non-edge ports |
RSTP falls back to the slow timer-based behavior on shared links, and toward a neighbor still running STP. If a link to an old STP bridge is later upgraded, clear spanning-tree protocol-migration makes the port try RSTP again.
Mark host-facing ports as edge and make sure switch links are point to point (full duplex or mode p2p). Without both, RSTP drops back to timers and converges no faster than STP.
MSTP
An MSTP region is a group of bridges that share the same three values:
| Parameter | Statement |
|---|---|
| Region name | configuration-name |
| Revision level | revision-level |
| VLAN-to-instance mapping | msti N vlan [ ... ], sent as a digest |
If any of the three differ, the bridges are in different regions.
Inside a region, each MSTI (multiple spanning-tree instance) has its own root and port roles. Instance 0, the IST, carries every VLAN not mapped to another MSTI. Between regions, and toward RSTP or STP bridges, the CIST (common and internal spanning tree) treats each region as one large virtual bridge. A region supports up to 64 MSTIs.
user@mx# set protocols mstp configuration-name SP-REGION
user@mx# set protocols mstp revision-level 1
user@mx# set protocols mstp interface ge-1/0/0
user@mx# set protocols mstp interface ge-1/0/1
user@mx# set protocols mstp msti 1 vlan [ 100 200 ]
user@mx# set protocols mstp msti 1 bridge-priority 4k
user@mx# set protocols mstp msti 2 vlan [ 300 400 ]
user@mx# set protocols mstp msti 2 bridge-priority 8k
Making a different bridge root for each MSTI spreads VLANs across links that STP or RSTP would leave idle.
VSTP
VSTP builds a separate tree for each VLAN, which gives the finest load balancing but costs one set of BPDUs per VLAN. It is configured per VLAN ID:
user@mx# set protocols vstp vlan 100 bridge-priority 4k
user@mx# set protocols vstp vlan 100 interface ge-1/0/0
user@mx# set protocols vstp vlan 100 interface ge-1/0/1
user@mx# set protocols vstp vlan 200 interface ge-1/0/0
Inside a virtual switch, the same statements go under routing-instances NAME protocols vstp. Juniper documents VSTP and RSTP as the only protocols that can be configured at the same time; MSTP cannot be combined with RSTP.
| RSTP | MSTP | VSTP | |
|---|---|---|---|
| Trees | One | One per MSTI, plus the IST | One per VLAN |
| Load balancing across VLANs | No | Yes, per instance | Yes, per VLAN |
| BPDU load | Lowest | Low | Highest |
| Interoperates with | STP | RSTP, STP | PVST+, Rapid-PVST+ |
Monitoring and troubleshooting
user@mx> show spanning-tree bridge
user@mx> show spanning-tree interface
user@mx> show spanning-tree mstp configuration
show spanning-tree mstp configuration shows the region name, revision level, VLAN-to-MSTI mapping and digest, which is the first check when two MSTP bridges should be in one region but are not. For any protocol, confirm that the expected bridge is root, each port's role and state match the design, and no port facing hosts is a non-edge port.
Common mistakes
A one-character region mismatch. A different name, revision or VLAN mapping puts bridges in different regions, and the link between them becomes a region boundary.
Expecting RSTP speed on shared links. Proposal and agreement only work on point-to-point links.
Mixing MSTP and RSTP on one device. Only VSTP and RSTP can be configured together.
VLANs not mapped to any MSTI stay in instance 0, the IST. If a VLAN is missing from the msti list on one bridge, the mapping digest differs and the region splits.
What to remember for the exam
- STP: up to 50 seconds (max age 20 plus listening 15 plus learning 15).
- RSTP: alternate port takeover, proposal and agreement on point-to-point links, edge ports, failure detected after 3 missed hellos (6 seconds).
- RSTP topology change: only a non-edge port going to forwarding; TC flag and MAC flush.
- MSTP region = name, revision level and VLAN mapping; IST is instance 0; up to 64 MSTIs; CIST links regions.
- VSTP: one tree per VLAN; works with PVST+ and Rapid-PVST+.
- VSTP and RSTP can run together; MSTP and RSTP cannot.
show spanning-tree bridge,show spanning-tree interface,show spanning-tree mstp configuration.
Check yourself
Two MSTP bridges have the same region name and revision level but one maps VLAN 300 to MSTI 2 and the other does not. Are they in the same region?
No, the VLAN-to-instance mapping digest differs, so they form different regions.
In RSTP, which kind of port change triggers a topology change?
A non-edge port moving to the forwarding state; edge ports coming up do not.
Which Junos spanning tree protocol interoperates with Rapid-PVST+?
VSTP, which runs one spanning tree per VLAN.
Topic 2 of 3 in Spanning-Tree Protocols
Test yourself on Spanning-Tree Protocols
The full Juniper JNCIS-SP JN0-364 question bank has 860 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.