[Enterprise SONiC] Selective QinQ Follow
QinQ is a feature designed for service providers who carry traffic of multiple customers across their networks and are required to maintain the VLAN and Layer 2 protocol configurations of each customer without impacting the traffic of other customers. The SPVLAN (Service Provider VLAN) tags will be inserted in the customer frames when they enter the service provider network, and the tags will be stripped after they leave the service provider network.
- Select QinQ configuration
- Selective QinQ configuration with TPID
- CLI Error handling with TPID configuration
Tested model & firmware version:
- Switch model name:
AS4630-54TE(EPS201)
AS7326-56X(DCS203)
AS7726-32X(DCS204)
AS5812-54X(DCS208) - Edgecore SONiC version:
202006.4
202012.1 ~ 202012.4
202111.0 ~ 202111.8
Restriction:
- Before 202012.2 doesn’t support the CLI for QinQ. ( 202012.3 or later support the CLI for QinQ)
- The TPID configuration is supported in 202111.0 or later.
- The default TPID is 0x8100.
- TPID support to modify, including 0x8100/0x88a8/0x9100/0x9200( Some other values that have been used are 0x9100, 0x9200 and 0x88A8 (used for Q-in-Q outer TPID)).
- The TPID configuration supports on physical/PortChannel interfaces.
- When the TPID does not match, the packet is recognized by the receiving interface as untagged. The unrecognized VLAN Tag and the rest of that packet are all treated as customer payload and forwarded it accordingly.
- For this SONiC TPID configuration feature it is primarily used for the HW ASIC to be able to treat non-matching TPID VLAN tags as customer payload in order to preserve the VLAN TAG. There is no attempt to configure the LINUX Kernel to handle Q-in-Q packets nor changing its default 802.1Q TPID 0x8100 to some other values.
- AS7816 can not use QinQ on breakout port TPID not work
Select QinQ configuration
Topology:
Pre-configuration:
- Ethernet0 on AS7326-56X down-speed to 10G.(refer to [Edgecore SONiC] Switch Port Attributes )
admin@AS7326-56X:~$ show interfaces status Ethernet0 Interface Lanes Speed MTU Oper FEC Alias Vlan Oper Admin ProtoDown Eff Admin Type Asym PFC Oper Speed ----------- ------- ------- ----- ---------- ------------- ------ ------ ------- ----------- ----------- -------------- ---------- ------------ Ethernet0 3 10G 9100 none Eth6/3(Port1) routed up up False up SFP/SFP+/SFP28 N/A 10G
- VLAN setting as topology, all of connect ports are VLAN100(service VLAN) member. (refer to [Edgecore SONiC] VLAN & Inter-VLAN Routing )
AS7326-56X:
admin@AS7326-56X:~$ show vlan brief
+-----------+--------------+------------+-----------+----------+---------------+----------------------------+
| VLAN ID | IP Address | Ports | Port | Proxy | DHCP Helper | DHCP Relay Configuration |
| | | | Tagging | ARP | Address | |
+===========+==============+============+===========+==========+===============+============================+
| 100 | | Ethernet0 | tagged | disabled | | Source Interface: |
| | | Ethernet48 | tagged | | | Link Selection: |
| | | | | | | Server Vrf: |
| | | | | | | Server ID Override: |
+-----------+--------------+------------+-----------+----------+---------------+----------------------------+
AS7726-32X:
admin@AS7726-32X:~$ show vlan brief
+-----------+--------------+------------+-----------+----------+---------------+----------------------------+
| VLAN ID | IP Address | Ports | Port | Proxy | DHCP Helper | DHCP Relay Configuration |
| | | | Tagging | ARP | Address | |
+===========+==============+============+===========+==========+===============+============================+
| 100 | | Ethernet0 | tagged | disabled | | Source Interface: |
| | | Ethernet4 | tagged | | | Link Selection: |
| | | | | | | Server Vrf: |
| | | | | | | Server ID Override: |
+-----------+--------------+------------+-----------+----------+---------------+----------------------------+
Expect result:
- The traffic can be forwarding between PC1 and PC2 with VLAN10 tag.
- The traffic between AS7326-56X and AS7726-32X are double tag.(Service tag is 100 and customer tag is 10)
Procedure:
Before the 202012.3 versions, please follow below the steps to set the QinQ.
Steps 1. Create a JSON file to select the QinQ configuration for the input port. When you enter traffic using the VLAN10 tag, it pushes the VLAN100 tag and forwards it according to the MAC address table. When exiting from the port, VLAN100 is popped and output.
- AS7326-56X:
admin@AS7326-56X:~$ cat qinq.json
{
"VLAN_STACKING": {
"Ethernet0|ingress|10": {
"action": "push",
"s_vlanid": "100"
},
"Ethernet0|egress|100": {
"action": "pop"
}
}
}
- AS7726-32X:
admin@AS7726-32X:~$ cat qinq.json
{
"VLAN_STACKING": {
"Ethernet4|ingress|10": {
"action": "push",
"s_vlanid": "100"
},
"Ethernet4|egress|100": {
"action": "pop"
}
}
}
Steps 2. Apply the configuration with "config load"
- AS7326-56X:
admin@AS7326-56X:~$ sudo config load qinq.json -y
Running command: /usr/local/bin/sonic-cfggen -j qinq.json --write-to-db
- AS7726-32X:
admin@AS7726-32X:~$ sudo config load qinq.json -y
Running command: /usr/local/bin/sonic-cfggen -j qinq.json --write-to-db
202012.3 or later version support CLI, here's the CLI for setting QinQ.
- AS7326-56X:
admin@AS7326-56X:~$ sudo config vlan-stacking add Ethernet0 ingress 10 push 100
admin@AS7326-56X:~$ sudo config vlan-stacking add Ethernet0 egress 100 pop - AS7726-32X:
admin@AS7726-32X:~$ sudo config vlan-stacking add Ethernet4 ingress 10 push 100
admin@AS7726-32X:~$ sudo config vlan-stacking add Ethernet4 egress 100 pop
Check status:
admin@AS7326-56X:~$ show vlan-stacking
Interface Stage Match VLAN Action Apply VLAN
----------- ------- ------------ -------- ------------
Ethernet0 egress 100 pop
Ethernet0 ingress 10 push 100
Result:
- MAC table learning:
AS7326-56X:
admin@AS7326-56X:~$ show mac
No. Vlan MacAddress Port Type
----- ------ ----------------- ---------- -------
1 100 8C:EA:1B:30:DA:4F Ethernet0 Dynamic
2 100 8C:EA:1B:30:DA:50 Ethernet48 Dynamic
Total number of entries 2
AS7726-32X:
admin@AS7726-32X:~$ show mac
No. Vlan MacAddress Port Type
----- ------ ----------------- --------- -------
1 100 8C:EA:1B:30:DA:50 Ethernet4 Dynamic
2 100 8C:EA:1B:30:DA:4F Ethernet0 Dynamic
Total number of entries 2
- Packet capture between AS7326-56X and AS7726-32X.
Selective QinQ configuration with TPID
Topology:
Pre-configuration:
Refer to the configurations in "Selective QinQ configuration".
Expect result:
- The traffic can be forwarded between PC1 and PC2 with VLAN10 tag.
- The traffic between AS7326-56X and AS7726-32X is double tag. (Service tag is 100 with TPID is 0x9100 and customer tag is 10)
Procedure:
Steps 1. Modify TPID on ports that connect between AS7326-56X and AS7726-32X.
AS7326-56X:
admin@AS7326-56X:~$ sudo config interface tpid Ethernet48 0x9100
AS7726-32X:
admin@AS7726-32X:~$ sudo config interface tpid Ethernet0 0x9100
Note: there is Error handling for this command, please refer to "CLI Error handling with TPID configuration".
Result:
- MAC table learning:
AS7326-56X:admin@AS7326-56X:~$ show mac
AS7726-32X:
No. Vlan MacAddress Port Type
----- ------ ----------------- ---------- -------
1 100 8C:EA:1B:30:DA:4F Ethernet0 Dynamic
2 100 8C:EA:1B:30:DA:50 Ethernet48 Dynamic
Total number of entries 2admin@AS7726-32X:~$ show mac
No. Vlan MacAddress Port Type
----- ------ ----------------- --------- -------
1 100 8C:EA:1B:30:DA:50 Ethernet4 Dynamic
2 100 8C:EA:1B:30:DA:4F Ethernet0 Dynamic
Total number of entries 2
- TPID configuration status:
AS7326-56X:admin@AS7326-56X:~$ show interface tpid Ethernet48
AS7726-32X:
Interface Alias Oper Admin TPID
----------- ------------- ------ ------- ------
Ethernet48 Eth49(Port49) up up 0x9100
admin@AS7326-56X:~$ show interface tpid Ethernet0
Interface Alias Oper Admin TPID
----------- ------------- ------ ------- ------
Ethernet0 Eth6/3(Port1) up up N/Aadmin@AS7726-32X:~$ show interface tpid Ethernet0
Interface Alias Oper Admin TPID
----------- ------------- ------ ------- ------
Ethernet0 Eth1/1(Port1) up up 0x9100
admin@AS7726-32X:~$ show interface tpid Ethernet4
Interface Alias Oper Admin TPID
----------- ------------- ------ ------- ------
Ethernet4 Eth2/1(Port2) up up N/A
CLI Error handling with TPID configuration
- There is a warning message when the system isn't ready and configures the TPID by CLI.
admin@SONiC:~$ sudo config interface tpid Ethernet64 0x9200
System not ready to accept TPID config. Please try again later. - There is a warning message when we configure the TPID on the device which didn't support TPID configuration on LAG.
admin@SONiC:~$ sudo config interface tpid PortChannel0002 0x9200
HW is not capable to support PortChannel TPID config. -
Once a port is already bound as part of a LAG, TPID configure directly to the LAG member port is not allowed or it will trigger the warning message.
admin@SONiC:~$ sudo config interface tpid Ethernet4 0x9200
Ethernet4 is already member of PortChannel0002. Set TPID NOT allowed. -
TPID values support: 0x8100 (default), 0x9100, 0x9200, and 0x88A8. once the user attempts to configure any TPID value other than these 4 values, it will trigger the warning message.
admin@SONiC:~$ sudo config interface tpid Ethernet64 0x0800
TPID 0x0800 is not allowed. Allowed: 0x8100, 0x9100, 0x9200, or 0x88A8.
Comments
0 comments
Please sign in to leave a comment.