Running inline_upf_demo

Link-Inline™ Software User Guide

Platform
Napatech SmartNIC
Content Type
User Guide
Capture Software Version
Link-Inline™ Software 3.2

Use this procedure to run the inline_upf_demo application in the bare-metal environment.

Before you begin

Make sure that you have:

About this task

The inline_upf_demo application is targeted to demonstrate the offload features in a UPF test setup as shown in this figure.

Page-1 Rounded Rectangle.19 Traffic generator Traffic generator Dynamic connector Dynamic connector.47 Rounded Rectangle.32 DUT DUT Sheet.33 L Shape Sheet.35 Round Corner Rectangle SmartNIC SmartNIC Round Corner Rectangle.24 Round Corner Rectangle.25 Round Corner Rectangle.26 Round Corner Rectangle.27 Round Corner Rectangle.28 Round Corner Rectangle.29 Round Corner Rectangle.30 Round Corner Rectangle.31 Round Corner Rectangle.33 Round Corner Rectangle.34 L Shape.38 Sheet.48 Port 0 Port 0 Sheet.49 Port 1 Port 1 Rounded Rectangle.50 Inline_upf_demo Inline_upf_demo Sheet.52 N3 (GTPv1-U) N3 (GTPv1-U) Sheet.53 N6 N6

In this setup, the traffic generator transmits GTPv1-U tunneled traffic on one port, and transmits IP traffic on another port. On the DUT node, port 0 of the SmartNIC receives GTPv1-U tunneled traffic, and port 1 receives IP traffic.

Procedure

  1. Start the inline_upf_demo application.
    cd /opt/ntinl/examples_v<version>/examples/inline_upf_demo/build
    ./inline_upf_demo -a <PCI_bus_ID> -- -v
    For example:
    ./inline_upf_demo -a 0000:42:00.0,rxqs=4 -- \
    -r all -n -m 2,pir=5M,pir=10M -u -f test.pcap
    The command line options in this example are:
    • -a 0000:42:00.0,rxqs=4: Specify the SmartNIC with the given PCI bus ID and create 4 RX queues per port.
    • -r all: Use all queues for forwarding traffic from the SmartNIC to the host.
    • -n: Enable NAT.
    • -m 2,pir=5M,pir=10M -u: Create two policies per flow, one with MBR 5 Mbps and another with MBR 10 Mbps.
    • -f test.pcap: Create flow rules using a pcap file at startup.
      Note: test.pcap is an example of a pcap file name. To use this option, you need to prepare a pcap file with frames that include the GTPv1-U header.
    An output example:
    EAL: Detected CPU lcores: 32
    EAL: Detected NUMA nodes: 2
    EAL: Detected static 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
    Started flow programming based on test.pcap - please wait
    Start Pre Learning, file: test.pcap
    Flow programming took 20.859950 seconds to execute
    Created 2000000 flows
    Flow program rate: 100000 flow/second
    Main core 0 running. [Ctrl+C to quit]
    lcore 1 processing packets from port 0 queue 0
                    N3 IF ADDRESS IPv4: 10.10.10.3
                    N6 IF SUBNET  IPv4: 20.20.0.0/16
                    NAT UDP src port range: 1024 - 65535
    lcore 2 processing packets from port 0 queue 1
                    N3 IF ADDRESS IPv4: 10.10.10.3
                    N6 IF SUBNET  IPv4: 20.21.0.0/16
                    NAT UDP src port range: 1024 - 65535
    lcore 4 processing packets from port 0 queue 3
    lcore 3 processing packets from port 0 queue 2
                    N3 IF ADDRESS IPv4: 10.10.10.3
                    N6 IF SUBNET  IPv4: 20.22.0.0/16
                    NAT UDP src port range: 1024 - 65535
                    N3 IF ADDRESS IPv4: 10.10.10.3
                    N6 IF SUBNET  IPv4: 20.23.0.0/16
                    NAT UDP src port range: 1024 - 65535

    The test.pcap file contains 1 million frames which creates 1 million flows for uplink and 1million frames for downlink. 4 queues are used for traffic received on port 0.

  2. On another terminal, start the monitoring tool.
    cd /opt/ntinl/tools/ntnic-tools/build/monitoring
    ./monitoring
    Press f to view flow management statistics. An output example:
     ┌────────────── monitoring pci:0000:42:00.0 fpga:200-9563-55-16 ─────────────┐
     │                                                                            │
     │                                                                           ▒│
     │                                                                           ▒│
     │                                                                           ▒│
     │                                                                           ♦│
     └────────────────────────────────────────────────────────────────────────────┘
      FLM statistics
     ┌────────────────────────────────────────────────────────────────────────────┐
     │ FlowMatcherId: 0                                                           │
     │ current              :           4000000                                   │
     │ learn_done           :           4000000                                   │
     │ learn_ignore         :                 0                                   │
     │ learn_fail           :                 0                                   │
     │ unlearn_done         :                 0                                   │
     │ unlearn_ignore       :                 0                                   │
     │ auto_unlearn_done    :                 0                                   │
     │ auto_unlearn_ignore  :                 0                                   │
     │ auto_unlearn_fail    :                 0                                   │
     │ timeout_unlearn_done :                 0                                   │
     └────────────────────────────────────────────────────────────────────────────┘
    
    The monitoring tool shows that 4 million flow rules are created in the SmartNIC. The flow rules include:
    • 1 million flow rules for uplink traffic
    • 1 million flow rules for downlink traffic
    • 2 million policies for uplink traffic (2 policies per flow)
  3. Start transmitting traffic from the traffic generator.