QinQ Fundamentals
QinQ expands VLAN space by adding an additional 802.1Q VLAN tag to an 802.1Q-tagged packet. Devices forward packets over the public network according to outer VLAN tags of the packets, and learn MAC addresses from the outer VLAN tags. The private VLAN tags in the packets are forwarded as payload of the packets.
As shown in Figure 6-1, customer network A is divided into private VLANs 1 to 10, and customer network B is divided into private VLANs 1 to 20. The carrier allocates public VLANs 3 and 4 to customer networks A and B respectively. When tagged packets from networks A and B arrive at the carrier network, the packets are tagged outer VLANs 3 and 4. Therefore, the packets from different customer networks are separated on the carrier network, even though the customer networks use overlapping VLAN ranges. When the packets reach the PE on the other side of the carrier network, the PE removes public VLAN tags from the packets and forwards the packets to the CE of the respective customer network.
QinQ Packet Encapsulation Format
A QinQ packet has a fixed format, in which an 802.1Q tag is added outside the existing 802.1Q tag of the packet. QinQ allows overlaying of multiple tags.
Because a QinQ packet has 4 more bytes than an 802.1Q packet, the maximum frame length allowed by each interface on the carrier network should be at least 1504 bytes. The default frame length allowed by interfaces of a switch is larger than 1504 bytes, so you do not need to adjust it. For details on how to configure the frame length allowed by an interface, see Setting the Jumbo Frame Length Allowed on an Interface.
QinQ Implementation
QinQ can be implemented in either of the following ways:
- Basic QinQBasic QinQ is implemented based on interfaces. After basic QinQ is configured on an interface, the device adds the default VLAN tag of this interface to all packets regardless of whether the packets carry VLAN tags.
- If a single-tagged packet is received, the packet becomes a double-tagged packet.
- If an untagged packet is received, the packet is tagged with the default VLAN ID of the local interface.
- Selective QinQSelective QinQ is implemented based on interfaces and VLAN IDs. That is, an interface can forward packets based on a single VLAN tag or double VLAN tags. In addition, the device processes packets received on an interface as follows based on their VLAN IDs:
- Adds different outer VLAN tags to packets carrying different inner VLAN IDs.
- Marks outer 802.1p fields and adds different outer VLAN tags to packets according to the 802.1p fields in inner VLAN tags.
In addition to separating carrier and customer networks, selective QinQ provides extensive service features and allows flexible networking.
QinQ Encapsulation
QinQ technology converts single-tagged packets into double-tagged packets.
QinQ is classified into basic QinQ and selective QinQ depending on the data encapsulated. Basic QinQ is based on interfaces and selective QinQ is based on VLAN IDs.
Interface-based QinQ encapsulation
This encapsulation mode is also called QinQ tunneling. It encapsulates packets arriving at the same interface with the same outer VLAN tag.
VLAN ID-based QinQ encapsulation
VLAN ID-based QinQ, also called selective QinQ, encapsulates packets with different outer tags to differentiate users.
MQC-based QinQ encapsulation
MQC-based QinQ encapsulation, also called selective QinQ, classifies traffic and encapsulates outer tags of matching data flows.