No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


Configuration Guide - Ethernet Switching

S7700 and S9700 V200R011C10

This document describes the configuration of Ethernet services, including configuring link aggregation, VLANs, Voice VLAN, VLAN mapping, QinQ, GVRP, MAC table, STP/RSTP/MSTP, SEP, and so on.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
QinQ Fundamentals

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.

Figure 10-1  Typical QinQ application

As shown in Figure 10-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. A QinQ packet has 4 more bytes than an 802.1Q packet.


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 in "Ethernet Interface Configuration" in the S7700 and S9700 V200R011C10 Configuration Guide - Interface Management.

Figure 10-2  802.1Q encapsulation

QinQ Implementation

QinQ can be implemented in either of the following ways:

  1. Basic QinQ
    Basic 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.
  2. Selective QinQ
    Selective 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 encapsulation changes a single-tagged packet into a double-tagged packet, and is usually performed on underlayer provider edge (UPE) interfaces connected to customer networks.

Depending on the data encapsulated, QinQ encapsulation is applied as interface-based or flow-based QinQ encapsulation. Additionally, QinQ encapsulation can be performed on routed sub-interfaces.

  • 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, and therefore cannot distinguish users and services at the same time.

  • Flow-based QinQ encapsulation

    This encapsulation mode classifies packets arriving at an interface into different flows, and then determines whether to add outer VLAN tags and which outer VLAN tags to add on a per flow basis. This mode is also called selective QinQ.

    Traffic can be classified based on VLAN ID ranges if a customer uses different VLAN IDs for different services. For example, PC users access the Internet through VLANs 101 to 200, IPTV users through VLANs 201 to 300, and VIPs through VLANs 301 to 400. When receiving service data, the UPE adds outer tag 100 to packets from PCs, outer tag 300 to packets from IPTV users, and outer tag 500 to packets from VIPs.

  • QinQ encapsulation on sub-interfaces

    QinQ encapsulation can be performed on both Layer 2 interfaces and Layer 3 sub-interfaces.

    When service data is transparently transmitted over an MPLS/IP core network using PWE3/VLL/VPLS, a network-end provider edge (NPE) sub-interface adds an outer VLAN tag to a packet based on the inner VLAN tag. Then the packet is transmitted on the VLL/PWE3/VPLS network using the outer VLAN tag. Packets from multiple private VLANs can be transparently transmitted through a sub-interface, which is called a QinQ stacking sub-interface.

    QinQ encapsulation on a sub-interface is also a form of flow-based QinQ encapsulation. The QinQ stacking sub-interface must be used with the L2VPN service (PWE3/VLL/VPLS), and cannot support Layer 3 forwarding.

Updated: 2019-10-18

Document ID: EDOC1000178310

Views: 286932

Downloads: 141

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Previous Next