You are on page 1of 4

Technology Introduction

Access Q-in-Q

Q-in-Q

Introduction to Q-in-Q
In the VLAN tag field defined in IEEE 802.1Q, only 12 bits are used for VLAN IDs, so a
device can support a maximum of 4,094 VLANs. In actual applications, however, a
large number of VLAN are required to isolate users, especially in metropolitan area
networks (MANs), and 4,094 VLANs are far from satisfying such requirements.
The port Q-in-Q feature provided by the device enables the encapsulation of double
VLAN tags within an Ethernet frame, with the inner VLAN tag being the customer
network VLAN tag while the outer one being the VLAN tag assigned by the service
provider to the customer. In the backbone network of the service provider (the public
network), frames are forwarded based on the outer VLAN tag only, while the customer
network VLAN tag is shielded during data transmission.
Figure 1 shows the structure of 802.1Q-tagged and double-tagged Ethernet frames.
The Q-in-Q feature enables a device to support up to 4,094 x 4,094 VLANs to satisfy
the requirement for the amount of VLANs in the MAN.

6 bytes 6 bytes 4 bytes 2bytes 46 to1500 bytes 4 bytes


User
DA SA Etype DATA FCS
VLAN Tag
Single-tagged frame
structure

6 bytes 6 bytes 4 bytes 4 bytes 2 bytes 46 to 1500 bytes 4bytes


Nested User
DA SA Etype DATA FCS
VLAN Tag VLAN Tag
Double-tagged frame structure
Outer Inner
VLAN VLAN
tag tag

Figure 1 802.1Q-tagged frame structure vs. double-tagged Ethernet frame structure

Advantages of Q-in-Q:
z Addresses the shortage of public VLAN ID resource
z Enables customers to plan their own VLAN IDs, with running into conflicts with
public network VLAN IDs.
z Provides a simple Layer 2 VPN solution for small-sized MANs or intranets.

1
Technology Introduction
Access Q-in-Q

Note:
The Q-in-Q feature requires configurations only on the service provider network, and
not on the customer network.

Implementations of Q-in-Q

There are two types of Q-in-Q implementations: basic Q-in-Q and selective Q-in-Q.
1) Basic Q-in-Q
Basic Q-in-Q is a port-based feature, which is implemented through VLAN VPN.
With the VLAN VPN feature enabled on a port, when a frame arrives at the port, the port
will tag it with the port’s default VLAN tag, regardless of whether the frame is tagged or
untagged. If the received frame is already tagged, this frame becomes a double-tagged
frame; if it is an untagged frame, it is tagged with the port’s default VLAN tag.
2) Selective Q-in-Q
Selective Q-in-Q is a more flexible, VLAN-based implementation of Q-in-Q. In addition
to all the functions of basic Q-in-Q, selective Q-in-Q can take different actions based on
different VLANs, including:
z Tagging the frame with different outer VLAN tags based on different inner VLAN
IDs.
z Marking the outer VLAN priority based on the existing inner VLAN priority.
z Modifying the inner customer VLAN ID while tagging the frame with an outer VLAN
lag.

Adjustable TPID Value of Q-in-Q Frames

A VLAN tag uses the tag protocol identifier (TPID) field to identify the protocol type of
the tag. The value of this field, as defined in IEEE 802.1Q, is 0x8100.
Figure 2 shows the 802.1Q-defined tag structure of an Ethernet frame.

6 bytes 6 bytes 4 bytes 2 bytes 46 to 1500 bytes 4 bytes


DA SA VLAN Tag Etype DATA FCS

2 bytes 3bits 1 bit 12 bits


TPID User Priority CFI VLAN ID

Figure 2 VLAN Tag structure of an Ethernet frame

On devices of different vendors, the TPID of the outer VLAN tag of Q-in-Q frames may
have different default values. You can set and/or modify this TPID value, so that the

2
Technology Introduction
Access Q-in-Q

Q-in-Q frames, when arriving at the public network, carries the TPID value of a specific
vendor to allow interoperation with devices of that vendor.
The TPID in an Ethernet frame has the same position with the protocol type field in a
frame without a VLAN tag. To avoid chaotic packet forwarding and receiving, you
cannot set the TPID value to any of the values in the table below.

Table 1 Reserved protocol type values

Protocol type Value


ARP 0x0806
PUP 0x0200
RARP 0x8035

IP 0x0800
IPv6 0x86DD
PPPoE 0x8863/0x8864
MPLS 0x8847/0x8848
IPX/SPX 0x8137
IS-IS 0x8000
LACP 0x8809
802.1x 0x888E
Cluster 0x88A7
Reserved 0xFFFD/0xFFFE/0xFFFF

Selective Q-in-Q
Inner-to-Outer VLAN Priority Mapping

When a frame is tagged with an outer VLAN tag upon its arrival at a basic
Q-in-Q–enabled port, the default priority in the outer VLAN tag is the priority in the inner
VLAN tag. Through the following configuration steps, you can change this priority
mapping relation and assign different outer VLAN priorities for different inner VLAN
priorities.

Outer VLAN Tagging Policy

The outer VLAN tag implemented by the basic Q-in-Q feature is the VLAN tag
corresponding to the port’s default VLAN ID, while the selective Q-in-Q feature allows
adding different outer VLAN tags based on different inner VLAN tags.

3
Technology Introduction
Access Q-in-Q

If the device supports the configuration of basic Q-in-Q and selective Q-in-Q at the
same time on a port and if the two features are both enabled on the port, frames that
meet the selective Q-in-Q condition are handled with selective Q-in-Q on this port, and
other frames with basic Q-in-Q.

You might also like