A virtual local area network (VLAN) tag termination sub-interface can be a dot1q VLAN tag termination sub-interface or a QinQ VLAN tag termination sub-interface. In dot1q/QinQ termination, a device identifies whether a packet has one tag or two tags. The device then forwards the packet after stripping one or both tags or discards the packet.
An increasing number of QinQ encapsulation and termination modes have been developed to distinguish users or services and reduce the use of virtual local area network (VLAN) IDs. These QinQ encapsulation and termination modes enable carriers to implement refined operation.
Users may communicate over various types of Layer 2 virtual private networks (L2VPNs), such as a virtual private wire service (VPWS) or virtual private LAN service (VPLS). To achieve more flexibility in managing packets for these users, you can configure QinQ VLAN tag termination sub-interfaces on edge devices on the L2VPN and configure the attributes of the sub-interfaces to provide L2VPN access.
QinQ VLAN tag termination sub-interfaces can access VPWS or VPLS in symmetrical or asymmetrical mode. User packets are sent to the L2VPN in different modes after being processed by the PE, as described in Table 1 and Table 2.
Inbound Interface Type |
VPWS/VPLS |
|
---|---|---|
Ethernet Encapsulation |
VLAN Encapsulation |
|
Symmetry mode |
Removes the outer tag. |
Keeps both inner and outer tags unchanged. |
Asymmetrical mode |
Removes both inner and outer tags. |
Removes both inner and outer tags and adds another tag. |
Outbound Interface Type |
VPWS/VPLS |
|
---|---|---|
Ethernet Encapsulation |
VLAN Encapsulation |
|
Symmetry mode |
Adds an outer tag. |
Replaces the outer tag. |
Asymmetrical mode |
Adds two tags. |
Removes the existing tag, and adds two tags. |
Each Ethernet frame transmitted between CEs and PEs carries a VLAN tag called a Provider-Tag (P-tag). The tag is a service delimiter required by a carrier for user differentiation.
Ethernet frames transmitted between CEs and PEs do not necessarily carry VLAN tags. If an Ethernet frame carries a VLAN tag, the tag is an internal VLAN tag called a User-Tag (U-tag) in user packets. The U-tag is carried in a packet before the packet is sent to a CE. The U-tag is used by the CE to identify the packet, but PEs do not recognize U-tags.
By default, the encapsulation type is VLAN.
Run system-view
The system view is displayed.
Run interface interface-type interface-number.subinterface-number
The view of an Ethernet sub-interface on the user side of a PE is displayed
(Optional) Create a user VLAN group.
Run vlan-group group-id
A user VLAN group is created.
Run group mode { single | multiple }
The working mode of the VLAN group is configured.
Run quit
Return to the view of the Ethernet sub-interface on the user side of the PE.
Configuring a VLAN group allows you to achieve the following purposes:
Run control-vid vid dot1q-termination [ rt-protocol ] or encapsulation dot1q-termination [ rt-protocol ]
The encapsulation type for a VLAN tag termination sub-interface is configured to be dot1q.
Specify rt-protocol so that the dot1q VLAN tag termination sub-interface supports routing protocols.
To configure a dot1q VLAN tag termination sub-interface and a matching policy for the sub-interface, run the dot1q termination vid low-pe-vid [ to high-pe-vid ] { 8021p { 8021p-value1 [ to val8021p2 ] } &<1-8> | dscp { valdscp1 [ to valdscp2 ] } &<1-10> | eth-type pppoe | default } [ vlan-group group-id ] command.
If you do not configure a matching policy, the dot1q VLAN tag termination sub-interface terminates the VLAN tags of packets carrying the specified VLAN ID. If you configure a matching policy, the sub-dot1q VLAN tag termination sub-interface terminates the VLAN tags of packets carrying the specified VLAN ID+802.1p value/DSCP value/EthType.
After the dot1q termination vid low-pe-vid [ to high-pe-vid ] [ vlan-group group-id ] command is run in the Ethernet sub-interface view, the specified VLAN range belongs to the sub-interface, and any VLAN ID in the VLAN range cannot be configured together with the 802.1p value/DSCP value/EthType on other sub-interfaces.
Run commit
The configuration is committed.
Run system-view
The system view is displayed.
Run interface interface-type interface-number.subinterface-number
The view of an Ethernet sub-interface on the user side of a PE is displayed
(Optional) Create a user VLAN group.
Run vlan-group group-id
A user VLAN group is created.
Run group mode { single | multiple }
The working mode of the VLAN group is configured.
Run quit
Return to the view of the Ethernet sub-interface on the user side of the PE.
Configuring a VLAN group allows you to achieve the following purposes:
Run control-vid vid qinq-termination [ local-switch | rt-protocol ] or encapsulation qinq-termination [ local-switch | rt-protocol ]
The encapsulation type for a VLAN tag termination sub-interface is configured to be QinQ.
Run qinq termination l2 { asymmetry | symmetry [ user-mode ] }
The termination mode is configured for the QinQ VLAN tag termination sub-interface that provides L2VPN access.
This step takes effect only on QinQ VLAN tag termination sub-interfaces that provide L3VPN access. Therefore, before you configure a QinQ VLAN tag termination sub-interface that provides L2VPN access, configure the termination mode of the sub-interface.
If the qinq termination l2 symmetry command is used on a QinQ VLAN tag termination sub-interface, the sub-interface connects to the L2VPN in symmetrical mode. MAC address learning is performed only on the outer tags carried in packets. The sub-interface sends inner tags as part of the data to the peer. To configure QoS for inner tags, run the qinq termination l2 symmetry user-mode command.
If the qinq termination l2 asymmetry command is used on a QinQ VLAN tag termination sub-interface, the sub-interface connects to the L2VPN in asymmetrical mode. MAC address learning is performed on both inner and outer tags carried in packets. The sub-interface does not send inner tags as part of the data to the peer.
If the qinq termination l2 asymmetry command is run on a QinQ VLAN tag termination sub-interface, the sub-interface can terminate single inner and outer VLAN tags carried in packets but cannot terminate VLAN tag ranges.
Run qinq termination pe-vid pe-vid [ to high-pe-vid ] ce-vid ce-vid [ to high-ce-vid ] [ vlan-group group-id ]
The VLAN tag termination function is configured for the QinQ VLAN tag termination sub-interface.
After you specify rt-protocol, the sub-interface terminates double-tagged packets, and both inner and outer tags must be specific VLAN IDs.
Run commit
The configuration is committed.