QinQ is a technology used to expand VLAN space by adding another 802.1Q VLAN tag to a tagged 802.1Q packet. To accommodate to the ME network development, QinQ becomes diversified in its encapsulation and termination modes and is more intensely applied in service refined operation. The following describes the format of a QinQ packet, QinQ encapsulation on an interface, and QinQ termination on a sub-interface.
A QinQ packet has a fixed format. In the packet, another 802.1Q tag is added before an 802.1Q tag. A QinQ packet is 4–byte longer than a common 802.1Q packet.
Figure 1 shows 802.1Q encapsulation.
QinQ encapsulation is to add another 802.1Q tag to a single-tagged packet. QinQ encapsulation is usually performed on UPE interfaces connecting to users.
Currently, only interface-based QinQ encapsulation is supported. Interface-based QinQ encapsulation, also known as QinQ tunneling, encapsulates packets that enter the same interface with the same outer VLAN tag. This encapsulation mode cannot flexibly distinguish between users and services.
The following section describes the termination types, the VLAN tag termination sub-interfaces, and the applications of VLAN tag termination.
VLAN tag termination sub-interfaces
Sub-interface for dot1q VLAN tag termination
A sub-interface that terminates packets carrying one VLAN tag.
Sub-interface for QinQ VLAN tag termination
A sub-interface that terminates packets carrying two VLAN tags.
Dot1q and QinQ VLAN tag termination sub-interfaces do not support transparent transmission of packets that do not contain a VLAN tag, and discard received packets that do not contain a VLAN tag.
Layer 3 Ethernet interfaces on routers
Conventional Layer 3 Ethernet interfaces do not identify VLAN packets. After receiving VLAN packets, they consider the packets invalid and discard them. To implement inter-VLAN communication, create Ethernet sub-interfaces on an Ethernet interface and configure the sub-interfaces to remove tags from VLAN packets.
Communication between devices in the LAN and WAN
Most LAN packets carry VLAN tags. Certain wide area network (WAN) protocols, such as Point-to-Point Protocol (PPP), cannot identify VLAN packets. Before forwarding VLAN packets from a LAN to a WAN, a device needs to record the VLAN information carried in the VLAN packets and then remove the VLAN tags.
When a device receives packets, it adds the locally stored VLAN information to the packets and forwards them to VLAN users.
User-VLAN sub-interfaces are used for user access to a BRAS. Different user-VLAN sub-interfaces can be configured on an interface for different VLAN users. After users' VLAN packets arrive on a BRAS, the BRAS can differentiate user services based on the VLAN IDs in the packets and then use proper authentication and address allocation methods for the users. After that, the BRAS sends users' VLAN packets to a RADIUS server for user location identification.
After user-VLAN sub-interfaces on a BRAS receive matching packets, they remove VLAN tags and then forward the packets at Layer 3.
Single-tagged VLAN packets
User-VLAN sub-interfaces remove the single VLAN tags and forward the packets at Layer 3.
Double-tagged VLAN packets
User-VLAN sub-interfaces remove the double VLAN tags and forward the packets at Layer 3.
The outer and inner VLAN tags in double-tagged packets identify services and users, respectively.
Any-other packets
If packets received on user-VLAN sub-interfaces are neither single-tagged nor double-tagged VLAN packets permitted by the sub-interfaces, these packets are forwarded by user-VLAN sub-interfaces of any-other type at Layer 3.
VE interfaces do not support packets of any-other type.
Usage scenario of user-VLAN sub-interfaces
An IP core network cannot identify VLAN tags in user packets. If VLAN users need to access an IP core network through a BRAS over a Layer 2 network, user-VLAN sub-interfaces can be configured on the BRAS to remove the VLAN tags. If VLAN users need to access an IP core network through a BRAS over a Layer 3 network, Dot1q or QinQ VLAN tag termination sub-interfaces can be configured on the BRAS to remove the VLAN tags.