What are VLAN and QinQ?: Explained 

What are VLAN QinQ?

What is an Ethernet Frame? 

An Ethernet frame is a fundamental unit of data transmitted over an Ethernet network. It contains the necessary information for data to be transmitted from one device to another within a local area network. Ethernet frames consist of various fields each serving a specific purpose in facilitating communication across the network. 

What is an Ethernet Frame?

Key components of an Ethernet frame include: -

Preamble: – It is a sequence of alternating 1s and 0s used to synchronize the receiver’s clock with the sender’s clock. It prepares the receiver to expect incoming data. 

Start Frame delimiter (SFD): – Marks the end of the preamble and signals the start of the frame. It helps the receiver identify the beginning of the frame’s data section. 

Destination MAC Address: – A 6-byte field identifying the intended recipient device’s Media Access Control (MAC) address. 

Source MAC Address: – A 6-byte field identifying the MAC Address of the sending device. 

EtherType or Length Field: – EtherType indicates the type of protocol carried in the Ethernet frame, such as IPv4 or IPv6 or others. In cases where EtherType is used, the field indicates the data length in the frames. 

Payload: – The actual data being transmitted can vary in length and content. It typically includes the higher-layer protocol data (such as IP Packets, TCP segments, or UDP datagram) encapsulated within the Ethernet frame. 

Frame check sequence (FCS): – A field containing error-checking information, usually a cyclic redundancy check (CRC) to detect any errors that might have occurred during transmission. 

What is VLAN and how does VLAN tagging work?

VLAN, also known as Virtual Local Area Network, is a networking technology that helps to segment a single physical network into multiple separate logical networks. We have already discussed VLAN and its configuration earlier. Here let’s focus on VLAN tagging and its effect on the Ethernet header. 

Let us take the example of the below topology to understand how VLAN tagging changes the Ethernet Header and why it is used. 

What is VLAN and how does VLAN tagging work?

We have 4 host H1, H2, H3 and H4 and two switches S1 and S2 connecting these host 

H1 and H3 are in VLAN 1 while H2 and H4 are in VLAN 2 and Host H1 needs to communicate with Host H3.  

H1 generates a packet that needs to be destined to H3. When this packet arrives S2, S2 needs to know whether this packet belongs to H3 or H4 i.e. VLAN 1 or VLAN 2. 

When the host generates a packet, the data frame looks like given below; – 

Key components of an Ethernet frame include

Notice that the ethernet frame does not have any information regarding the VLAN tagged. 
When a switch receives the ethernet frame, and since that port is already configured with a particular VLAN, the switch adds additional VLAN information known as VLAN tagging. 

data frame

S2 now receives a packet with VLAN tagged to the ethernet frame and now knows that the packet belongs to VLAN 1. Switch then removes the additional header from the ethernet frame and forwards the frame to the Host 3. 

The VLAN tagging is done with the help of a standard known as IEEE802.1Q. 

What are IEEE standards?

IEEE stands for Institute of Electrical and Electronics Engineers. It is a global professional organization composed of engineers, scientists, and professionals dedicated to advancing technology in various fields including electrical engineering, electronics engineering, telecommunication, etc. 

IEEE has various networking and telecommunication standards such as IEEE 802.11 which is used for WIFI, IEEE 802.3 which is standard for ethernet, IEEE 802.15 which is standard for Wireless Personal Area Networks.  

What is 802.1Q?

IEEE 802.1Q also known as VLAN tagging is a standard defining a method for inserting VLAN membership information into the Ethernet Frame. It is a part of the 802.1 group of standards that focus on network bridging and management. 

802.1Q provides a mechanism for identifying VLAN membership of Ethernet frames. It adds a 4-byte tag, called a VLAN tag or VLAN header to the Ethernet Frame’s header. This VLAN tag includes information such as VLAN ID, priority, quality of service, etc.

 VLAN tagging is crucial for carrying VLAN information across network devices like switches, routers, and other networking equipment. It allows the transmission of multiple VLANs over a single network link known as trunk effectively extending VLANs across the network infrastructure. 

802.1Q is an open-source standard and supported by multiple vendors and it is a popular standard used for VLAN tagging. 

The most important use of this standard is the qinq tunneling also called double tagging. 
It is used to encapsulate multiple VLANs within other VLANs. it enables the service provider to transport customer VLAN transparently across their networks by adding a VLAN tag. 

What is ISL?

ISL stands for InterSwitch link. I was a proprietary VLAN trunking protocol developed by Cisco before the IEEE802.1Q standards for VLAN tagging and can only be used on Cisco devices. 
 
ISL serves the same purpose that the 802.1Q serves but it cannot be used on other vendor devices hence with the introduction of the IEEE802.1Q standard for VLAN tagging, ISL become less popular.  
ISL also does not support the feature of QinQ tunneling which was introduced by 802.1Q 

What is QinQ tunneling?

The QinQ supports feature adds another layer of IEEE 802.1Q tag also known as metro tag or PE-VLAN to the 802.1Q tagged packets that enter the network.  
QinQ tunneling involves the insertion of an additional VLAN tag (outer tag) into an Ethernet frame, allowing the transmission of multiple VLANs across a provider’s network infrastructure. This technique is primarily used in service provider networks, especially in metro Ethernet and carrier-grade Ethernet networks. 

QinQ tunneling is commonly used by service providers to transport multiple customer’s VLAN traffic over a single physical link or network. It enables segmentation and isolation of customer traffic while using a shared provider network infrastructure.

 Frames encapsulated using QinQ tunneling have two sets of 802.1Q tags, the outer tag (service provider’s VLAN) and inner tag (Customer’s VLAN) allowing the provider to maintain VLAN separation and manage traffic accordingly. 

Hence, QinQ tunneling is helpful when there are multiple overlapping VLAN IDs between customers and it is used in large enterprise or service provider networks. QinQ is used to facilitate the encapsulation of multiple VLANs within another VLAN. It extends the capabilities of IEEE802.1Q VLAN tagging by allowing the stacking or nesting of VLAN tags. 

VLAN tags

We have already understood the Ethernet Frame and the tagged Ethernet frame and how it looks like the tagged frame is known as the 802.1Q frame. With the help of the 802.1Q standard, we can add one more tag to the already tagged ethernet frame.  
Let us take an example to further understand the use of QinQ tunneling In the service provider network 

service provider network

We have offices of Customer A and Customer B at Sites 1 and Site 2 and Customer A wants to share traffic between Site 1 and Site 2. Similarly, Customer B wants to communicate between Site 1 and Site 2. 

Switch at Site 1 tagged the packet with VLAN ID 10 and Switch of customer B also tagged the packet with VLAN ID 10. As we can see the case of VLAN overlapping. 

Now to differentiate between the customers, the service provider edge switch adds another tag to the already tagged packet. Tags assigned by the service provider will be different for every customer which helps to differentiate the traffic of each customer and in this case, QinQ tunneling is used since VLAN is tagged on an already tagged Ethernet Frame.