The inline_upf_demo application can be used to demonstrate the offload features of the Napatech SmartNIC running Link-Inline™ Software in a UPF test setup.
Demonstrating the offload features in a UPF test setup
The inline_upf_demo application is designed to perform the following
operations:
- The application configures the SmartNIC to forward unmatched frames to the host. This is done on the GTPv1-U tunneled traffic received only on port 0 (uplink traffic).
- The application creates new flow rules for both uplink and downlink traffic.
- Uplink (received on port 0): The source/destination IP addresses and corresponding UDP port numbers on the inner layer of the unmatched frames are used for creating flow rules for uplink traffic.
- Downlink (received on port 1): Flow rules for downlink are created by swapping source and destination IP addresses and corresponding UDP port numbers. The source IP address and source UDP port number on the inner layer of the unmatched frames are used as the destination IP address and destination UDP port number. The destination IP address and destination UDP port number are used as the source IP address and source UDP port number.
- After the new flow rules are created, traffic processing is done as follows:
- Uplink: The SmartNIC performs decapsulation on matched GTPv1-U traffic (received on port 0) and transmit decapsulated traffic on port 1.
- Downlink: The SmartNIC performs encapsulation matched IP traffic (received on port 1) and transmits GTPv1-U encapsulated traffic on port 0.
DPDK EAL parameters
DPDK EAL parameters can be used with a -- separator by the
inline_upf_demo application. For
example:
./dpdk-inline_upf_demo -a 0000:42:00.0 -- -v-a is EAL parameter, and -v is one of the application command-line parameters.
- -a: Specify the PCI bus ID of the target SmartNIC. Mandatory.
- -v: Display verbose logs of reading frames and creating flow rules.
An output
example:
EAL: Detected CPU lcores: 32 EAL: Detected NUMA nodes: 2 EAL: Detected shared linkage of DPDK EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'VA' EAL: VFIO support initialized EAL: Using IOMMU type 1 (Type 1) EAL: Probe PCI driver: net_ntnic (18f4:1c5) device: 0000:42:00.0 (socket 1) ETHDEV: WRN: iova mode (2) should be PA for performance reasons ETHDEV: INF: NT VFIO device setup 0000:42:00.0 NTHW: INF: PCI:0000:42:00.0: FPGA 0200-9563-55-16 (C8255B3710) [644B901E] TELEMETRY: No legacy callbacks, legacy socket not created ETHDEV: INF: PCI:0000:42:00.0:intf_0: link is up ETHDEV: INF: PCI:0000:42:00.0:intf_1: link is up Main core 0 running. [Ctrl+C to quit] lcore 1 processing packets from port 0 queue 0
For a list of available EAL command-line parameters, see https://doc.dpdk.org/guides-23.11/linux_gsg/linux_eal_parameters.html.
RSS
rxqs specifies the number of RX queues to be created. The application
command-line parameter, -r can be used to specify which queues to be used
for RSS. For
example:
./dpdk-inline_upf_demo -a 0000:42:00.0,rxqs=4 -- -r 1,3This creates 4 queues per port (8 in total), and queue 1, 3 are used for traffic distribution. All 4 queues are used for traffic distribution using -r all as follows.
./dpdk-inline_upf_demo -a 0000:42:00.0,rxqs=4 -- -r allWithout the -r parameter, all RX traffic is forwarded to queue 0 by default. The 5-tuple RSS function is used for traffic distribution.
Creating flow rules using a pcap file at startup
Flow rules can be created from a pcap file before starting to receive frames. For
example:
./dpdk-inline_upf_demo -a 0000:42:00.0 -- -f test.pcapThe pcap file must contain frames with the GTPv1-U header. The application creates flow rules using source/destination IP addresses and corresponding UDP port numbers on the inner layer of each frame for uplink traffic. Flow rules for downlink are created by swapping source and destination IP addresses and corresponding UDP port numbers. The source IP address and source UDP port number on the inner layer are used as the destination IP address and destination UDP port number, and the destination IP address and destination UDP port number are used as the source IP address and source UDP port number.
QoS policing
QoS policing can be enabled only on port 0 (uplink traffic). This table shows the
parameters that are related to policing.
In the following example, the MBR is set to 1 Gbps in a policy, and one metering
object per flow is applied. Statistics for usage counters will be displayed using the
metering object IDs, 100 to
1000.
Parameter | Description |
---|---|
-m | -m 1 creates 1 metering object. -m 2 creates 2 metering objects. |
pir | Peak information rate. Sets maximum bit rate in Gbps or Mbps. For example, -m 1,pir=1G sets MBR to 1 Gbps, -m 1,pir=1M sets MBR to 1 Mbps. The default value is 100 Gbps. |
-u | The -u parameter enables the MBR per flow and the monitoring of usage counters per flow. With the -m 1 -u option for example, each flow will be associated to each separate metering object. -m 2 -u applies 2 separate metering objects per flow. If -m is used without the -u parameter, all flows will share the same metering object(s). This means that the MBR is applied on the whole port rather than each flow. |
-s | Specify the range of IDs for metering objects. 0, 1, 2 are reserved for shared metering objects. |
./dpdk-inline_upf_demo -a 0000:42:00.0 -- -m 2,pir=10M,pir=20M -u -s 100-1000
NAT
NAT is enabled using the application command-line parameter, -n. For
example:
./dpdk-inline_upf_demo -a 0000:42:00.0 -- -n
If NAT is enabled, IP addresses and UDP port numbers are changed as follows:
- Source IP addresses and UDP port numbers of uplink traffic (after decapsulation) are modified.
- Destination IP addresses and UDP port numbers on the inner layer (after encapsulation) are modified.
Field | Value |
---|---|
IP address | 20.20.0.0/16, 20.21.0.0/16, 20.22.0.0/16, 20.23.0.0/16 etc. |
UDP port number | 1024 - 65535 |
GTPv1-U decapsulation on uplink traffic
After decapsulation of the outer layer, the SmartNIC encapsulates the MAC header as follows
.
Field | Value |
---|---|
Source MAC address | 18:18:18:18:18:18 |
Destination MAC address | 17:17:17:17:17:17 |
GTPv1-U encapsulation on downlink traffic
For encapsulation on downlink traffic, the following values are used.
The GTPv1-U header fields are configured as follows.
Field | Value |
---|---|
Source MAC address | 1a:1a:1a:1a:1a:1a |
Destination MAC address | 16:16:16:16:16:16 |
Source IPv4 address | 10.10.10.3 |
Destination IPv4 address | 10.10.10.2 |
Source IPv6 address | AAAA::BBBB |
Destination IPv6 address | 1111::2222 |
Source UDP port | 2152 |
Destination UDP port | 2152 |
Field | Value | Description |
---|---|---|
Version | 0x1 | GTP release 99 v1 |
Protocol type | 0x1 | GTP version 1 |
Next Extension header flag | 0x1 | Next Extension header presented |
Sequence number flag | 0x0 | Sequence number not presented |
N-PDU number flag | 0x0 | N-PDU number not presented |
Message type | 0xff | T-PDU |
TEID | 0 | TEID of the received frames on uplink. Increments from 0 for each flow. |
Next Extension header | 0x85 | PDU container |
PDU type | 0x1 | UL PDU session information |
QFI | 0x1 | QoS flow identifier |
Next Extension header | 0x0 | No more extension header |