Perform a Test in a Container

Enabling the Napatech SmartNICs with Link-Capture™ Software in Containers

Platform
Napatech SmartNIC
Content Type
Application Note
Capture Software Version
Link™ Capture Software 12.11

Running applications in a container is similar to running applications on the host.

About this task

This procedure shows how to capture traffic using the throughput tool in a container.

Procedure

  1. Configure a filter.
    On the host, run the following command.
    /opt/napatech3/bin/ntpl -e "Assign[streamid=0]=All"
  2. Configure the host loopback on a port of the SmartNIC and start transmitting on port 0.
    On the host, run the following commands.
    /opt/napatech3/bin/config --cmd set --port 0 --host_loopback on
    /opt/napatech3/bin/pktgen -p 0 -r 0
    Frames can be transmitted from the host and receive on the same port without a pluggable module or cabling using this host-loopback feature.
  3. In the container, start the throughput tool.
    For example:
    dnf install numactl numactl-devel
    dnf install time
    /usr/bin/time /opt/napatech3/bin/throughput -s 0
    An output example:
    ...
    Throughput:  78195759 packets @   2993268 pps,  0 packets dropped,   Wire: 24520
    Throughput:  81189927 packets @   2993569 pps,  0 packets dropped,   Wire: 24523
    Done:  Received: 84915050 packets   Wire: 86953011200 bytes   Pci: 88311652000 bytes   Dropped: 0 packets  0 bytes
    
    Max throughput:    2995717 pps  Wire: 24540.915 Mbps  Pci: 24924.367 Mbps
    Min throughput:    2990280 pps  Wire: 24496.379 Mbps  Pci: 24879.135 Mbps
    Avg throughput:    2993201 pps  Wire: 24520.305 Mbps  Pci: 24903.435 Mbps
    
    Total throughput:  Received: 84915050 packets   Wire: 86953011200 bytes   Pci: 88311652000 bytes   Dropped: 0 packets  0 bytes
    
    4.72user 0.41system 0:28.55elapsed 17%CPU (0avgtext+0avgdata 165976maxresident)k
    0inputs+0outputs (0major+684minor)pagefaults 0swaps
  4. Check the statistics using the monitoring tool.
    In the container, run:
    /opt/napatech3/bin/monitoring
    An output example:
    *───────────────────── monitoring (v. 3.28.12.9-2bab268f) ─────────────────────┐
    │  P  A        Type       Link    Down          Rx          Tx  Max  Temp.     │
    │  0  0 SFP28-SR-DR H-Loopback       0   24999.79M   24999.79M  9018 46.90 C   │
    │  1  0 SFP28-SR-DR       Down       0       0.00M       0.00M  9018 48.10 C   │
    └──────────────────────────────────────────────────────────────────────────────┘
     Port  0 - Adapter 0 Intf 0: NT50B01_2x25
    ┌──────────────────────────────────────────────────────────────────────────────┐
    │                                RX RMON1 counters                      Totals │
    │ Packets         : #000000002865158064  Octets          : #000002933921857536 │
    │ Broadcast       : #000000000000000000  Multicast       : #000000000000000000 │
    │ 64 octets       : #000000000000000000  65-127 octets   : #000000000000000000 │
    │ 128-255 octets  : #000000000000000000  256-511 octets  : #000000000000000000 │
    │ 512-1023 octets : #000000000000000000  1024-1518 octets: #000000002865158064 │
    │ Undersize       : #000000000000000000  Oversize        : #000000000000000000 │
    │ Fragments       : #000000000000000000  Collisions      : #000000000000000000 │
    │ Drop events     : #000000000000000000  Crc/Align errors: #000000000000000000 │
    │ Jabbers         : #000000000000000000  Ext drops       : #000000000000000000 │
    └──────────────────────────────────────────────────────────────────────────────┘
     Reset Tx/Rx 0RMON 1ExtRMON 2Checksum 3Decode 4Drop 5IPF Dec/Hex Tot/Spd
     Quit  Sensors Color stat XTimeSync IEEE 1588 PTP EStream LFlowstat FDump
  5. Disable the host loopback feature on port 0 of the SmartNIC.
    On the host, run the following command.
    /opt/napatech3/bin/config --cmd set --port 0 --host_loopback off