Use Cases

Reference Documentation

product_line_custom
Intel® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: Use Cases

How to Get Started

This section will help you to get your system up and running by showing typical simple use cases for Napatech Software Suite and Napatech adapters.

Typical use cases are:

It is important to understand your use case to get the best possible help. Clicking one of the use cases above will take you to that specific use case.

Capture for Real-Time Analysis

This use case covers two use cases; Capture for real-time analysis and capture to disk.

For both use cases the application can either be single threaded, or Multi-CPU splitting to further utilize multi-core systems.

Single Thread

In the single threaded solution, a system with 2 NT4E adapters is used:

Capture1.png
Capture 1




In this use case the ntservice.ini file will have to specify one or more host buffers for NUMA node 0. The number of host buffers depends on how many distinct streams are needed by the application.

In this example 2 host buffers are set up for each of the 2 adapters:

[Adapter0]
AdapterType=NT4E
BusId=00:0A:00:00
HostBufferRx=[2,16,0]
[Adapter1]
AdapterType=NT4E
BusId=00:0B:00:00
HostBufferRx=[2,16,0]

This will result in 2 host buffers being allocated for each adapter in the NUMA node 0 memory controller:

Capture2.png
Capture 2




Application A on NUMA node 0 will then set up the streamId 0 to only use host buffers allocated on NUMA node 0 and then open streamId 0:

NT_NTPL(hCfg, "Setup[NUMANode = 0] = StreamId == 0");
NT_NetRxOpen(&hNet1, "Capture0", PACKET, 0, -1);
Capture3.png
Capture 3




Application A assigns data from port 0 to streamId 0:

NT_NTPL(hCfg, "Assign[StreamId = 0] = Port == 0");

Resulting in:

Capture4.png
Capture 4




This gives an idea about how a typical capture user case looks and how it is configured. It also shows how the NTAPI is used to control NUMA nodes and open up streams. A network stream can be opened either in PACKET mode, as shown here, or in SEGMENT mode, where the only difference is if that NT_NetRxGet() returns a packet or a segment.

Multiple Threads

The same system is considered in a multi-threaded (multi-CPU) use case:

CaptureMultiCPU1.png
Capture Multi-CPU 1




In this use case the ntservice.ini file will have to specify one or more host buffers for each of the involved NUMA nodes. The number of host buffers per NUMA node still depends on how many distinct streams are needed by the applications.

In this example, one host buffer is set up for each of the two adapters for each NUMA node:

[Adapter0]
AdapterType=NT4E
BusId=00:0A:00:00
HostBufferRx=[1,16,0], [1,16,1], [1,16,2]
[Adapter1]
AdapterType=NT4E
BusId=00:0B:00:00
HostBufferRx=[1,16,0], [1,16,1], [1,16,2]

This will result in two host buffers being allocated for each adapter in all three NUMA node memory controllers:

CaptureMultiCPU2.png
Capture Multi-CPU 2




Application A on NUMA node 0 will then set up streamId 0 to only use host buffers allocated on NUMA node 0, streamId 1 to only use host buffers allocated on NUMA node 1, and streamId 2 to only use host buffers allocated on NUMA node 2. It will then set up the hash mode to be 2-tuple hashing and finally assign data from all ports and split it into stream 0, 1 and 2:

NT_NTPL(hCfg, "Setup[NUMANode = 0] = StreamId == 0");
NT_NTPL(hCfg, "Setup[NUMANode = 1] = StreamId == 1");
NT_NTPL(hCfg, "Setup[NUMANode = 2] = StreamId == 2");
NT_NTPL(hCfg, "HashMode = Hash2Tuple");
NT_NTPL(hCfg, "Assign[StreamId = (0..2)] = All");

Resulting in:

CaptureMultiCPU3.png
Capture Multi-CPU 3




Application A will open streamId 0:

NT_NetRxOpen(&hNet, "Capture0", PACKET, 0, -1);

Resulting in:

CaptureMultiCPU4.png
Capture Multi-CPU 4




Application B will open streamId 1:

NT_NetRxOpen(&hNet, "Capture1", PACKET, 1, -1);

Resulting in:

CaptureMultiCPU5.png
Capture Multi-CPU 5




Application C will open streamId 2:

NT_NetRxOpen(&hNet, "Capture2", PACKET, 2, -1);

Resulting in:

CaptureMultiCPU6.png
Capture Multi-CPU 6




This gives an idea on how to set up and configure a multi-CPU splitting use case.

In-Line Real-Time Analysis

The same system is used for an in-line use case:
Inline1.png
In-line 1


In this use case the ntservice.ini file will have to specify one or more host buffers for NUMA node 0. The number of host buffers depends on how many distinct streams are needed by the application.
In this example one host buffer will be set up for adapter 0 on NUMA node 0:
[Adapter0]
AdapterType=NT4E
BusId=00:0A:00:00
HostBufferRx=[1,16,0]
Resulting in a setup:
Inline2.png
In-line 2


Application A opens streamId 0:
NT_NetRxOpen(&hNet, "Inline0", PACKET, 0, -1);
Resulting in:
Inline3.png
In-line 3


Application A assigns data from port 0 to streamId 0 and forward it to port 1:
NT_NTPL(hCfg, "Assign[StreamId = 0; TxPort = 1] = Port == 0");
Resulting in:
Inline4.png
In-line 4


As can be seen, the host buffer is set up to forward all traffic received on port 0 to port 1.

Note: If no application opens streamId 0 then host based retransmit results which can be used instead of local retransmit on 1G adapters.
This gave an idea about how to set up and configure an in-line use case.

Transmit

This use case covers two use cases; Replay of Captured Traffic and Traffic Generation which differ in use but not in how the system is set up and configured.

Replay of Captured Traffic

This use case simply replays traffic that has been captured previously.

Traffic Generation

This use case generates traffic from scratch, meaning that the application builds all the packets from layer 2 and up before sending them.
Again the same system is used:
Transmit1.png
Transmit 1


In this use case, the ntservice.ini file has to specify one or more TX host buffers for NUMA node 0. The number of host buffers depends on how many ports/adapters the spplication transmits to.
In this example, one Rx host buffer and two TX host buffers are set up for adapter 0 on NUMA node 0:
[Adapter0]
AdapterType=NT4E
BusId=00:0A:00:00
HostBufferRx=[1,16,0]
HostBufferTx=[2,16,0]
Resulting in a setup:
Transmit2.png
Transmit 2


When application A now opens a TX stream, it specifies which ports this stream is able to transmit to. In this case ports 0 and 1:
NT_NetTxOpen(&hNet, "Transmit0", 0x03, 0, 0);
Resulting in a setup:
Transmit3.png
Transmit 3


Application A gets a transmit buffer to port 1:
NT_NetTxGet(hNet, &buf, 1, 1024, 1000);
This specifies a buffer of size of 1024 bytes to port 1. After getting the buffer, the data is filled out and the buffer is released:
NT_NetTxRelease(hNet, buf);
Then the packet will be sent.
Note: Depending on the adapter type and the running profile, the adapters will either have one transmit queue per adapter, or one transmit queue per port. However, this will be invisible to the application.