Ethernet Switching and Spanning Tree · Topic 2 of 3
MVRP, Q-in-Q and L2PT
JN0-650 study page on MVRP dynamic VLAN registration, Q-in-Q VLAN stacking and L2PT tunneling of Layer 2 control protocols on Junos EX and QFX switches.
- 6 min
- MVRP (802.1ak) registers VLANs dynamically on trunks and replaces GVRP.
- Q-in-Q (802.1ad) adds an outer S-VLAN tag; the customer's C-VLAN is untouched.
- The customer facing port is an access port in the S-VLAN; the provider link is a trunk.
What it is
MVRP (Multiple VLAN Registration Protocol, IEEE 802.1ak) lets switches register and de-register VLANs on their trunks dynamically, so you do not configure every VLAN on every trunk by hand.
Q-in-Q (IEEE 802.1ad, also called VLAN stacking or dot1q tunneling) adds a second VLAN tag. A service provider uses the outer tag to carry many customers across its network, without caring about the customers' own VLANs.
L2PT (Layer 2 protocol tunneling) carries customer Layer 2 control frames, such as spanning tree BPDUs, across the provider network so that the customer sites see each other as directly connected.
How it works
MVRP
MVRP replaces the older GVRP. A switch sends MVRP messages out of its trunk ports declaring the VLANs it needs. Neighbors that hear the declaration add that VLAN to the trunk, and propagate it onward.
| Behavior | Detail |
|---|---|
| Where it runs | Trunk ports |
| What is registered | VLANs that exist on a switch, either configured or learned dynamically |
| Frames | Sent to a reserved multicast address, 01:80:C2:00:00:21 |
| Result | Dynamic VLANs appear on a switch for as long as a neighbor declares them |
set protocols mvrp interface ge-0/0/1
set protocols mvrp interface ge-0/0/2
set interfaces ge-0/0/1 unit 0 family ethernet-switching interface-mode trunk
Registration can be restricted per interface, for example to forbid learning dynamic VLANs from an untrusted port. A switch still needs the VLAN to be defined locally if it has hosts in it, because MVRP only creates trunk membership for the VLAN IDs it hears about.
show mvrp
show mvrp dynamic-vlan-memberships
show vlans
MVRP is a convenience that also spreads mistakes. A VLAN declared by one switch can appear on all trunks, including toward untrusted devices. Run it only on trunks you trust.
Q-in-Q (dot1q tunneling)
A frame from a customer carries its own tag, the C-VLAN. At the provider edge, the switch pushes an additional tag, the S-VLAN, one per customer. The core forwards using the outer tag only. At the far edge the outer tag is popped and the original frame is delivered.
| Term | Meaning |
|---|---|
| C-VLAN | The customer's own VLAN, the inner tag |
| S-VLAN | The service provider VLAN, the outer tag |
| Customer facing port | An access port on the provider switch that adds the S-VLAN |
| Provider trunk | Carries the double tagged frames |
On an ELS switch, tunneling is enabled on the S-VLAN, and the customer facing port is an access port in that VLAN:
set vlans CUST-A vlan-id 100
set vlans CUST-A dot1q-tunneling
set interfaces ge-0/0/10 unit 0 family ethernet-switching interface-mode access vlan members CUST-A
set interfaces xe-0/0/1 unit 0 family ethernet-switching interface-mode trunk vlan members CUST-A
Older non-ELS EX software configures tunneling under ethernet-switching-options dot1q-tunneling. Because of the extra tag, the MTU on the core links must allow four more bytes, and the provider's own MAC table scales better because customer MAC addresses are still learned per S-VLAN.
When the question says that customers use overlapping or unknown VLAN IDs, and the provider must keep them separate with one tag per customer, the answer is Q-in-Q.
L2PT
Without help, a provider switch would process a customer's spanning tree BPDUs, or drop them, and the customer's two sites would not exchange control traffic. L2PT solves this at the provider edge. The ingress switch rewrites the destination MAC address of the control frame to a special multicast address, so the provider core forwards it like normal data. The egress switch rewrites it back, and the far customer site receives it as if the sites were connected by one cable.
On EX switches that use ELS and on QFX, you configure it per customer facing interface with the protocol statement under [edit protocols layer2-control mac-rewrite interface <name>], one statement per protocol to tunnel, such as spanning tree. Older non-ELS EX switches used layer2-protocol-tunneling under the VLAN's dot1q-tunneling instead. Q-in-Q must be configured first, and L2PT goes on the interfaces at both ends of the tunnel.
| Without L2PT | With L2PT |
|---|---|
| BPDUs stop at the provider edge | BPDUs cross the provider network |
| Customer spanning trees are separate | Customer sites form one spanning tree |
Monitoring and troubleshooting
show vlans extensive
show ethernet-switching table
show ethernet-switching interface ge-0/0/10
show spanning-tree interface
| Symptom | Likely cause |
|---|---|
| Customer VLANs not delivered across the provider | Provider trunk does not carry the S-VLAN, or tunneling not enabled on the VLAN |
| Large frames are dropped | MTU does not allow the extra tag |
| Customer spanning tree sees no peer | L2PT not configured for the protocol |
| MVRP does not add a VLAN | MVRP not enabled on both ends, or the port is not a trunk |
| Dynamic VLANs appear where unwanted | Registration is not restricted on that port |
Common mistakes
Confusing the S-VLAN with the C-VLAN. The S-VLAN is the outer tag the provider adds.
Forgetting the MTU. Double tagged frames are four bytes larger.
Expecting Q-in-Q to carry BPDUs unchanged. That needs L2PT.
Running MVRP toward untrusted devices. It can add VLANs you did not intend.
Putting the customer port in trunk mode. The customer facing port is an access port in the S-VLAN.
What to remember for the exam
- MVRP (802.1ak) registers VLANs dynamically on trunks and replaces GVRP.
- Q-in-Q (802.1ad) adds an outer S-VLAN tag; the customer's C-VLAN is untouched.
- The customer facing port is an access port in the S-VLAN; the provider link is a trunk.
- Q-in-Q adds four bytes, so check the MTU.
- L2PT tunnels customer Layer 2 control protocols across the provider core by rewriting the destination MAC address.
show mvrpandshow vlansverify MVRP;show ethernet-switching tableverifies Q-in-Q.
Check yourself
What does the provider add in Q-in-Q?
An outer S-VLAN tag, one per customer, while the customer's inner C-VLAN tag stays unchanged.
Which feature carries a customer's spanning tree BPDUs across a provider network?
L2PT, which rewrites the destination MAC so the core forwards the BPDUs as ordinary data.
On which ports is MVRP run?
On trunk ports that connect switches.
Topic 2 of 3 in Ethernet Switching and Spanning Tree
Test yourself on Ethernet Switching and Spanning Tree
The full Juniper JNCIP-ENT JN0-650 question bank has 858 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.