+8618758069661 [email protected]
Product Search Guide: space = AND, | = OR, ! = NOT

How QinQ Encapsulation and Termination Work: C-TAG, S-TAG and Typical Configurations

Got any Questions? Call us Today!

+8618758069661

Or leave us a message

Online Message

How QinQ Encapsulation and Termination Work: C-TAG, S-TAG and Typical Configurations

Views: 10Original by FCTELAuthor: FCTEL Technical Team
Quick answer:Illustrated explanation of QinQ double VLAN tags, tunnel QinQ, selective QinQ, termination stripping, and the TPID and VID fields.

This article answers: core principles, applicable boundaries, engineering choices, configuration verification, and common questions.

Conclusion first: QinQ adds a carrier tag outside the customer VLAN tag, allowing different customers to reuse the same C-VLAN while being isolated and forwarded by S-VLAN in the backbone network.

How to read the diagrams: This article revolves around “How QinQ encapsulation and termination work: C-TAG, S-TAG and typical configurations”, using two parts: first determine which layer the service is at, and how QinQ encapsulation and termination work: how QinQ encapsulates, maps, or terminates, organized in diagrams. When reading, first confirm QinQ along the signal or state direction, then use QinQ encapsulation to check the boundary, and finally trace abnormal phenomena back to the specific interface, medium, or protocol layer.

Complete horizontal schematic of how QinQ encapsulation and termination work: C-TAG, S-TAG and typical configurations
Figure 1: Core principles, boundaries, and signal paths corresponding to the first part of the main text
Relationships among devices, environment, and links for how QinQ encapsulation and termination work: C-TAG, S-TAG and typical configurations
Figure 2: Relationships among devices, environment, and links
Combined interpretation of scenarios and scientific measurements for how QinQ encapsulation and termination work: C-TAG, S-TAG and typical configurations
Figure 3: Combined interpretation of scenarios and scientific measurements

1. How QinQ encapsulation and termination work: first determine which layer the service is at

The outer S-TAG and inner C-TAG each have fields such as TPID, priority, and VID. Tunnel QinQ uniformly adds the outer tag, selective QinQ can map the outer tag by port, VLAN, or traffic classification, and termination strips the corresponding tag at the egress.

Diagram reading tip: First confirm the input, output, and shared resources, then check each conversion or forwarding along the arrows. Link establishment, protocol interworking, and service security are three different levels.

Protocol functions work as expected only when the role, instance, control packets, and protected objects are consistent. Illustrated explanation of QinQ double VLAN tags, tunnel QinQ, selective QinQ, termination stripping, and the TPID and VID fields. This article revolves around “QinQ, QinQ encapsulation, QinQ termination, C-TAG”. During implementation, mark the role of each interface and path in the drawings, record the differences between normal and fault states, and confirm the solution boundary with measured results.

2. How QinQ encapsulation and termination work: how QinQ encapsulates, maps, or terminates

During planning, avoid conflicts between S-VLAN and the existing network, unify TPID and MTU, and clarify which ports perform encapsulation, transparent transmission, or termination. Use packet capture and MAC/VLAN tables to verify the double tags and end-to-end reachability.

Acceptance recommendation: Execute in the order of “specification check – single-link test – fault simulation – recovery confirmation – record archiving”, changing only one variable at a time to avoid mixing configuration, medium, and device problems together.

3. How QinQ encapsulation and termination work: why cross-layer configuration is prone to errors

QinQ was originally mainly created to expand the VLAN ID space, but with the development of metro Ethernet and carriers’ requirements for refined operation, QinQ’s double tags have further use scenarios. Its inner and outer tags can represent different information, such as the inner tag representing the user and the outer tag representing the service. In addition, QinQ data frames carry two tags across the carrier network, with the inner tag transmitted transparently, which can also be seen as a simple and practical VPN technology. Therefore, it can also serve as an extension of core MPLS VPN in metro Ethernet VPN, ultimately forming an end-to-end VPN technology. Because QinQ is convenient and easy to use, it has now been widely applied by carriers, such as QinQ technology combined with multiple services in metro Ethernet solutions. In particular, the emergence of selective QinQ (Selective QinQ/VLAN Stacking) has made QinQ services attractive to carriers.

We know that a VLAN tag in an ordinary VLAN is used to distinguish users, but what if you want to distinguish both users and service types at the same time? As shown in Figure 7-11, a head office connects two branch subsidiaries, and each branch subsidiary already uses VLANs to distinguish employees in different departments, but the department VLAN ID plans of the two subsidiaries overlap. In this way, if only one layer of VLAN tag is used in the data frame, the head office cannot distinguish which subsidiary the data comes from, and therefore cannot perform any processing on the data from different subsidiaries. Figure 7-11 Typical QinQ application example. To solve this problem, we can imagine creating different VLANs for each subsidiary on the head office’s switch. In this way, when the head office switch port connected to the corresponding subsidiary

receives a data frame, it adds another layer of VLAN tag outside the data frame (at this time the data frame has two layers of VLAN tags; the original VLAN tag is called the inner VLAN tag, and the newly added one is called the outer VLAN tag). For example, the outer VLAN tags added for the data frames of subsidiary 1 and subsidiary 2 are VLAN 10 and VLAN 20 respectively. This makes it possible to distinguish data from different subsidiaries in the head office, and also to provide different services, that is, differentiated services, for the data from these two subsidiaries. In addition, in the traditional Layer 2 LAN interconnection mode based on the 802.1Q protocol, when two user networks need to access each other through a service provider (ISP) (such as in metro Ethernet), the ISP must create different VLANs for each access user. On the one hand, this configuration method makes the user’s VLAN visible on the backbone network

, posing a certain security risk. At the same time, because of the one-to-one VLAN ID mapping, it also consumes a large amount of the service provider’s VLAN ID resources. This is unbearable for larger ISPs, because only 4094 VLAN IDs are available. When the number of access users is large, the ISP network may run out of VLAN IDs. In addition, under this ordinary VLAN deployment method, different ISP access users cannot use the same VLAN ID; otherwise, isolation between different access users cannot be achieved. In this case, the user’s VLAN ID can only be planned uniformly by the ISP, resulting in users having no right to plan their own VLANs. QinQ technology can effectively solve the above problems, because it can use the same outer VLAN tag to encapsulate many users with different inner VLAN tags, solving the ISP’s VLAN ID resource

4. How QinQ encapsulation and termination work: cross-verify with packets, counters, and alarms

Protocol functions work as expected only when the role, instance, control packets, and protected objects are consistent. Illustrated explanation of QinQ double VLAN tags, tunnel QinQ, selective QinQ, termination stripping, and the TPID and VID fields. This article revolves around “QinQ, QinQ encapsulation, QinQ termination, C-TAG”. During implementation, mark the role of each interface and path in the drawings, record the differences between normal and fault states, and confirm the solution boundary with measured results.

5. Protocol Q&A: How QinQ encapsulation and termination work

Is QinQ equal to two ordinary VLANs?

It is not a simple parallel arrangement, but nesting inner and outer tags in the same frame.

Why adjust MTU?

The added tag increases frame length; if the device or link does not support it, large frames will be dropped.

What scenarios is selective QinQ suitable for?

When the outer tag needs to be mapped according to different customer VLANs or service rules.

Translated from the Chinese technical article. Source first published: 2019-10-14. Source last revised: 2026-10-13T23:45:12+08:00. Read the Chinese source