QinQ Mapping
Implementation
QinQ mapping is performed after packets are received on the inbound interface and before packets are forwarded through the outbound interface.
Before sending a packet from a local VLAN, a sub-interface replaces the VLAN tag of the packet sent with a specified VLAN tag.
After receiving a packet, a sub-interface replaces the VLAN tag of packet with a local VLAN tag.
In real-world applications, QinQ mapping can map customer VLAN (C-VLAN) tags to a service VLAN (S-VLAN) tag to shield different customer VLANs.
The VLAN IDs deployed in new sites and old sites conflict, but new sites need to communicate with old sites.
Sites connected to the public network use conflicting VLAN IDs but do not need to communicate with one another.
The VLAN IDs on both ends of the public network are different.
1-to-1 mapping
When a sub-interface receives a single-tagged packet, it maps the VLAN tag to a specified tag.
2-to-1 mapping
When a sub-interface receives a double-tagged packet, it maps the outer VLAN tag to a specified tag and retains the inner VLAN tag.
In Figure 10-6, 1-to-1 QinQ mapping is configured on GE1/0/1.1 interfaces of Device2 and Device3. Frames sent from PC1 to PC2 are processed as follows:
PC1 sends an untagged frame to Device1. After receiving the frame, Device1 adds VLAN tag 20 to the frame.
Device1 forwards the frame with VLAN tag 20 to Device2. Device2 replaces VLAN tag 20 with S-VLAN tag 50 on sub-interface GE1/0/1.1.
Device2 sends the frame with S-VLAN tag 50 through GE1/0/2.
The frame is transparently transmitted on the ISP network.
When the frame arrives at GE1/0/1.1 of Device3, Device3 replaces VLAN tag 50 with VLAN tag 40.
Frames sent from PC2 to PC1 are processed in a similar way.
QinQ mapping allows PC1 to communicate with PC2.
Comparison Between QinQ Mapping and VLAN Mapping
Table 10-4 compares QinQ mapping and VLAN mapping.