Napatech

Napatech

Rapid Configuration Environment

To speed up application software development and solution deployment, Napatech provides a Rapid Configuration Environment. This includes the Napatech Programming Language (NTPL) and software development tools for on-the-fly configuration and monitoring of Napatech Network Adapters.
 
NTPL is an interpreted scripting language and can be used for adapter configuration in a number of situations:
  • NTPL commands are designed for ease of use and can be inserted into application code developed based on the Napatech Common Interface (NTCI). NTCI API function calls and NTPL commands can be mixed in the same application for maximum flexibility in programming style and application control.
  • When the Napatech Packet Capture (PCAP) API and LibPCAP library are used, an NTPL command file configures how the library operates.
  • For rapid prototyping, NTPL commands can be issued on a command line using NtplTool. In this way filters can be changed on the fly, hash key generation can be changed, multi-CPU buffer splitting can be changed etc. All of this can be done without the need to write a single line of application code nor the need for recompilations.
 
Using the rapid prototyping functionality provided by Napatech, commands can simply be typed one by one on a command line, and then, as they work, be placed in a command file or customer application code.
 
The NTPL language can also be used to configure buffer allocation, time synchronization and packet descriptors.

NTPL Example Code

The NTPL example below sets up a Napatech Network Adapter to perform various advanced tasks:

  • Line 1: Sets up the adapter to time-stamp captured frames using a PCAP nanosecond (ns) time format (32-bit seconds followed by 32-bit ns). This is done when configuring time setting. Other time stamp formats supported are: Native, NDIS, PCAP microsecond, Native NDIS and Native UNIX.
  • Line 2: Sets up the adapter to generate sorted 5-tuple hash keys to equally balance the load on multiple CPU cores.
  • Line 3: Captures UDP frames to host buffer 0 (feed 0), and at the same time slices the UDP frames so that the first 32 bytes of the UDP payload is delivered to the customer application.
  • Line 4: Captures TCP frames to host buffers 1 and 2 (feeds 1 and 2), and at the same time slices the TCP frames so that the first 64 bytes of the TCP payload is delivered to the customer application. The distribution of frames between the two host buffers will be based on the generated 5-tuple hash key.
  • Line 5: Captures HTTP frames to host buffers 3, 4, 5, 6 and 7. The distribution of frames between the 5 host buffers will be based on the generated 5-tuple hash key. The HTTP capture command has a higher priority than the two previous capture commands and will therefore overrule these commands.
  • Line 6: Sets up the adapter to remove duplicate frames on ports 0 and 1, if the frames are less than 50 ms apart, and the layer 2 parts of the frames are identical (MAC addresses and encapsulations are excluded from the compare).

  1. TimeSyncTimeSet[TimeStampFormat = PCAP_NANOTIME] = Current
  2. HashMode = Hash5TupleSorted
  3. Capture[Priority=1; Feed=0; SliceOffset = 32; SliceAddHeader= Layer2And3And4HeaderSize] = Layer4Protocol == UDP
  4. Capture[Priority=1; Feed=1,2; SliceOffset = 64; SliceAddHeader = Layer2And3And4HeaderSize] = Layer4Protocol == TCP
  5. Capture[Priority=0; Feed=3..7] = mTcpSrcPort == mTcpPort_HTTP
  6. Deduplication[DynOffset = Layer2HeaderSize; Timeout = 50] = Channel == 0,1


Additional Information

Highlights:
  • Rapid adapter configuration
  • Napatech Programming Language (NTPL)
  • Single command or script-based

See Also:
© Napatech A/S, all rights reserved. Terms & Conditions