Napatech

From VoIPmonitor.org
Revision as of 16:48, 8 January 2026 by Admin (talk | contribs) (Rewrite: consolidated structure, added quick reference table, streamlined config sections)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Napatech Integration

This guide covers building VoIPmonitor sniffer with Napatech SmartNIC support, configuration, and troubleshooting.

Prerequisites

  • Napatech drivers installed in /opt/napatech3 (built per vendor documentation)
  • Development libraries for compilation
  • Root access for driver operations

Building VoIPmonitor with Napatech Support

# Clone source and build
cd /usr/src
git clone -b develop https://github.com/voipmonitor/sniffer.git
cd sniffer

# Configure with Napatech library paths
./configure --with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib
make

# Verify linkage (MUST show /opt/napatech3/lib/libpcap.so.1)
ldd ./voipmonitor | grep pcap

# Install
cp ./voipmonitor /usr/local/sbin/voipmonitor
systemctl restart voipmonitor

ℹ️ Note: The development branch is named develop (not "development"). Use git checkout develop to switch to it.

Upgrading

GUI Upgrade (v24.23+)

Add to /etc/voipmonitor.conf:

upgrade_by_git = yes
git_folder = /usr/src/sniffer
configure_param = --with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib

After restart, click UPGRADE in the GUI. The sniffer automatically performs: git pull → configure → make → install → restart.

Manual Upgrade

cd /usr/src/sniffer
git pull
./configure --with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib
make && make install
systemctl restart voipmonitor

Configuration

VoIPmonitor Configuration

In /etc/voipmonitor.conf:

interface = napa0

# CRITICAL: BPF filter MUST be disabled - not compatible with Napatech NTPL
#filter = udp or (vlan and udp)

⚠️ Warning: The BPF filter option MUST be commented out when using Napatech. Use NTPL filtering instead (see Traffic Filtering).

ntpcap.ini

File: /opt/napatech3/config/ntpcap.ini

[Common]
Ntpl1 = "Assign[streamid=0;txport=0;txignore=true]=all"

[napa0]
StreamId = 0
Tx = 0

For older drivers, use:

[napa0]
Rx1="Assign[streamid=252;txport=0;txignore=true]=all"
Tx=0

ntservice.ini (Key Settings)

File: /opt/napatech3/config/ntservice.ini

Essential settings:

[System]
TimestampFormat = NATIVE_UNIX
TimestampMethod = EOF

[Adapter0]
AdapterType = NT4E          # Match your card type
BusId = 00:07:00:00         # Match your PCI address
Profile = Capture
MaxFrameSize = 9018

Time source configuration (to avoid 1970-01-01 timestamps):

# Newer drivers:
timeSource = OS

# Older drivers (in [Adapter0] section):
OsTimeSyncFailover = ENABLE

Systemd Dependencies

VoIPmonitor must start AFTER Napatech drivers. Configure dependency:

systemctl edit voipmonitor

Add:

[Unit]
After=ntservice.service
Requires=ntservice.service

For init.d systems, add to /etc/init.d/voipmonitor before binary execution:

/opt/napatech3/bin/ntstart.sh
sleep 60

See systemd documentation for details.

Traffic Filtering

To filter traffic on the Napatech card (hardware filtering), create an NTPL file.

Example /opt/napatech3/myfilter.ntpl:

delete = all

# UDP port macros
DefineMacro("mUdpSrcPort", "Data[DynOffset=DynOffUDPFrame;Offset=0;DataType=ByteStr2]")
DefineMacro("mUdpDestPort", "Data[DynOffset=DynOffUDPFrame;Offset=2;DataType=ByteStr2]")

# SIP filter (ports 5060, 5061)
Assign[StreamId = 0] = (mUdpSrcPort == 5060, 5061) AND (mUdpDestPort == 5060, 5061)

# RTP filter (ports 10000-61743)
Assign[StreamId = 0] = (mUdpSrcPort == (0x2710..0xF12F))

# Deduplication
DeduplicationConfig[drop=duplicate] = GroupID == 0
Define ckRecipe = CorrelationKey(Begin=StartOfFrame[0], End=EndOfFrame[0], DeduplicationGroupID=0)
Assign[StreamID=0; CorrelationKey=ckRecipe] = Port == 0

Apply filter:

/opt/napatech3/bin/ntstart.sh -n myfilter.ntpl

Troubleshooting

Quick Reference

Problem Cause Solution
Spool directories dated 1970-01-01 Time source misconfigured Set timeSource = OS in ntservice.ini
No packets captured Wrong libpcap linked Verify ldd voipmonitor shows Napatech libpcap
Sensor DOWN in GUI ntservice not running Start ntservice, add systemd dependency
RTE_ETH_MQ_TX_NONE error DPDK conflict Set #define HAVE_LIBDPDK 0 in config.h
libpcap error no such device Driver not initialized Add ntservice dependency, restart services

Spool Directories with Date 1970-01-01

The Napatech card is providing Unix Epoch time instead of system time.

# Fix in ntservice.ini (see Configuration section above)
# Then restart:
systemctl stop ntservice
systemctl start ntservice
systemctl restart voipmonitor

# Verify:
ls -ltd /var/spool/voipmonitor/*

Napatech Interfaces Not Capturing

# Check interface status
ip link show napa0

# Verify correct libpcap (MUST show /opt/napatech3/lib/libpcap.so.1)
ldd /usr/local/sbin/voipmonitor | grep pcap

# Restart drivers
systemctl stop voipmonitor
cd /opt/napatech3/bin/ && ./ntstop && ./ntstart
systemctl start voipmonitor

# Verify capture
tshark -i napa0 -Y "sip || rtp" -n -c 10

If libpcap shows system path instead of Napatech path, rebuild VoIPmonitor (see Build section).

Sensor Shows as Down in GUI

Error: "The requested response from the sensor could not be retrieved"

# Start ntservice
systemctl start ntservice
systemctl status ntservice

# Configure dependency (see Systemd Dependencies section)
systemctl edit voipmonitor
# Add After= and Requires= for ntservice.service

# Reboot to apply
reboot

ℹ️ Note: The ntservice must be running BEFORE voipmonitor starts. The systemd dependency configuration is critical.

Compilation Errors (DPDK Conflict)

If build fails with RTE_ETH_MQ_TX_NONE was not declared:

# After running ./configure, edit config.h
# Change: #define HAVE_LIBDPDK 1
# To:     #define HAVE_LIBDPDK 0

make

See Also

AI Summary for RAG

Summary: Guide for building VoIPmonitor sniffer with Napatech SmartNIC support. Build process: clone source with git clone -b develop, configure with --with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib, and make. Verify build with ldd voipmonitor | grep pcap - must show Napatech libpcap path. For GUI upgrades (v24.23+), set upgrade_by_git=yes and configure_param in voipmonitor.conf. Configuration requires: interface=napa0 in voipmonitor.conf (BPF filter must be disabled/commented), ntpcap.ini for stream assignment, ntservice.ini for adapter and time settings. Critical: set timeSource=OS in ntservice.ini to avoid 1970-01-01 timestamps. Systemd dependency on ntservice is mandatory - voipmonitor must start after ntservice. Troubleshooting covers: 1970-01-01 spool directories (time source), interfaces not capturing (wrong libpcap), sensor DOWN in GUI (ntservice not running), DPDK compilation errors (set HAVE_LIBDPDK=0).

Keywords: Napatech, SmartNIC, high-performance capture, compilation, configure, upgrade_by_git, configure_param, ntpcap.ini, ntservice.ini, timeSource, 1970-01-01, NTPL filter, hardware filtering, libpcap, ntstop, ntstart, HAVE_LIBDPDK, systemd dependency, ntservice, sensor down, "The requested response from the sensor could not be retrieved"

Key Questions:

  • How do I compile VoIPmonitor with Napatech support?
  • What configure options are needed for Napatech?
  • How do I upgrade VoIPmonitor with Napatech via GUI?
  • Why are spool directories created with date 1970-01-01?
  • How do I fix Napatech interfaces in DOWN state?
  • VoIPmonitor not capturing calls with Napatech, how to fix?
  • How do I restart Napatech drivers?
  • How to fix RTE_ETH_MQ_TX_NONE compilation error?
  • How to configure Napatech driver dependency in systemd?
  • What does libpcap error no such device exists mean?
  • Sensor shows as down in GUI with "The requested response from the sensor could not be retrieved"?
  • How do I verify VoIPmonitor is using Napatech libpcap?
  • How do I configure NTPL hardware filtering on Napatech?