Napatech: Difference between revisions

From VoIPmonitor.org
(Add troubleshooting section for 'sensor down' GUI error with Napatech)
(Review: přidány diagramy, opraveny info boxy (1= prefix), konzistentní formátování číslovaných seznamů)
Line 4: Line 4:


This guide covers building VoIPmonitor sniffer with Napatech SmartNIC support, configuration, and troubleshooting.
This guide covers building VoIPmonitor sniffer with Napatech SmartNIC support, configuration, and troubleshooting.
<kroki lang="mermaid">
%%{init: {'flowchart': {'nodeSpacing': 15, 'rankSpacing': 30}}}%%
flowchart LR
    A[Install Drivers] --> B[Build VoIPmonitor]
    B --> C[Configure]
    C --> D[Set systemd deps]
    D --> E[Start Service]
</kroki>


== First Installation ==
== First Installation ==
Line 27: Line 36:
</syntaxhighlight>
</syntaxhighlight>


'''Note:''' The development branch is named <code>develop</code> (NOT "development"). Use <code>git checkout develop</code> to switch to it.
{{Note|1=The development branch is named <code>develop</code> (NOT "development"). Use <code>git checkout develop</code> to switch to it.}}


If you already have the repository cloned and want to switch to the develop branch:
If you already have the repository cloned and want to switch to the develop branch:
Line 97: Line 106:
#filter = udp or (vlan and udp)
#filter = udp or (vlan and udp)
</syntaxhighlight>
</syntaxhighlight>
{{Warning|1=The BPF <code>filter</code> option MUST be commented out or removed when using Napatech. BPF filters are not compatible with Napatech's NTPL filtering.}}


=== ntpcap.ini Configuration ===
=== ntpcap.ini Configuration ===
Line 221: Line 232:


== Troubleshooting ==
== Troubleshooting ==
<kroki lang="mermaid">
%%{init: {'flowchart': {'nodeSpacing': 10, 'rankSpacing': 25}}}%%
flowchart TB
    A[Problem?] --> B{Spool date 1970?}
    A --> C{No packets?}
    A --> D{Sensor DOWN?}
    A --> E{Build error?}
    B -->|Yes| B1[Set timeSource=OS]
    C -->|Yes| C1[Check ldd libpcap]
    C1 --> C2[Restart ntstop/ntstart]
    D -->|Yes| D1[Start ntservice]
    D1 --> D2[Add systemd deps]
    E -->|Yes| E1[Set HAVE_LIBDPDK=0]
</kroki>


=== Spool Directories with Date 1970-01-01 ===
=== Spool Directories with Date 1970-01-01 ===
Line 228: Line 255:
'''Solution:'''
'''Solution:'''


1. Edit <code>/opt/napatech3/config/ntservice.ini</code>
# Edit <code>/opt/napatech3/config/ntservice.ini</code>
 
# For newer drivers, add:
2. For newer drivers, add:
#: <syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
timeSource = OS
timeSource = OS
</syntaxhighlight>
</syntaxhighlight>
 
#: For older drivers, in the <code>[Adapter0]</code> section:
For older drivers, in the <code>[Adapter0]</code> section:
#: <syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
OsTimeSyncFailover = ENABLE
OsTimeSyncFailover = ENABLE
</syntaxhighlight>
</syntaxhighlight>
 
# Restart services:
3. Restart services:
#: <syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
systemctl stop ntservice
systemctl stop ntservice
systemctl start ntservice
systemctl start ntservice
systemctl restart voipmonitor
systemctl restart voipmonitor
</syntaxhighlight>
</syntaxhighlight>
 
# Verify fix:
4. Verify fix:
#: <syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
ls -ltd /var/spool/voipmonitor/*
ls -ltd /var/spool/voipmonitor/*
</syntaxhighlight>
</syntaxhighlight>
Line 256: Line 279:
If <code>tcpdump</code> or <code>tshark</code> show no packets on Napatech interfaces:
If <code>tcpdump</code> or <code>tshark</code> show no packets on Napatech interfaces:


1. Check interface status:
# Check interface status:
<syntaxhighlight lang="bash">
#: <syntaxhighlight lang="bash">
ip link show napa0
ip link show napa0
ip link show | grep napa
ip link show | grep napa
</syntaxhighlight>
</syntaxhighlight>
 
# Verify drivers are loaded:
2. Verify drivers are loaded:
#: <syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
lsmod | grep ntpcap
lsmod | grep ntpcap
systemctl status ntservice
systemctl status ntservice
</syntaxhighlight>
</syntaxhighlight>
 
# Verify voipmonitor uses Napatech libpcap:
3. Verify voipmonitor uses Napatech libpcap:
#: <syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
ldd /usr/local/sbin/voipmonitor | grep pcap
ldd /usr/local/sbin/voipmonitor | grep pcap
</syntaxhighlight>
</syntaxhighlight>
 
#: Expected output should show <code>/opt/napatech3/lib/libpcap.so.1</code>, NOT system libpcap.
Expected output should show <code>/opt/napatech3/lib/libpcap.so.1</code>, NOT system libpcap.
# If using system libpcap, rebuild voipmonitor:
 
#: <syntaxhighlight lang="bash">
4. If using system libpcap, rebuild voipmonitor:
<syntaxhighlight lang="bash">
cd /usr/src/sniffer
cd /usr/src/sniffer
git pull
git pull
Line 318: Line 337:
'''Solution:''' Disable DPDK support in <code>config.h</code>:
'''Solution:''' Disable DPDK support in <code>config.h</code>:


<syntaxhighlight lang="bash">
# Run configure first:
# Run configure first
#: <syntaxhighlight lang="bash">
./configure --with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib
./configure --with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib
 
</syntaxhighlight>
# Edit config.h - change:
# Edit <code>config.h</code> - change <code>#define HAVE_LIBDPDK 1</code> to:
#define HAVE_LIBDPDK 1
#: <syntaxhighlight lang="c">
# To:
#define HAVE_LIBDPDK 0
#define HAVE_LIBDPDK 0
 
</syntaxhighlight>
# Then compile
# Then compile:
#: <syntaxhighlight lang="bash">
make
make
</syntaxhighlight>
</syntaxhighlight>
Line 342: Line 361:
'''Solution:'''
'''Solution:'''


1. Start the <code>ntservice</code> manually:
# Start the <code>ntservice</code> manually:
<syntaxhighlight lang="bash">
#: <syntaxhighlight lang="bash">
systemctl start ntservice
systemctl start ntservice
</syntaxhighlight>
</syntaxhighlight>
 
# Verify ntservice is running:
2. Verify ntservice is running:
#: <syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
systemctl status ntservice
systemctl status ntservice
lsmod | grep ntpcap
lsmod | grep ntpcap
</syntaxhighlight>
</syntaxhighlight>
 
# Modify systemd service configuration to ensure <code>ntservice</code> starts before <code>voipmonitor</code> at boot:
3. Modify systemd service configuration to ensure <code>ntservice</code> starts before <code>voipmonitor</code> at boot:
#: <syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# Edit voipmonitor.service
systemctl edit voipmonitor
systemctl edit voipmonitor
</syntaxhighlight>
</syntaxhighlight>
 
#: Add this override:
Add this override:
#: <syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
[Unit]
[Unit]
After=ntservice.service
After=ntservice.service
Requires=ntservice.service
Requires=ntservice.service
</syntaxhighlight>
</syntaxhighlight>
 
# Reboot the OS to apply the startup order changes:
4. Reboot the OS to apply the startup order changes:
#: <syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
reboot
reboot
</syntaxhighlight>
</syntaxhighlight>
 
# After reboot, verify the napatech interface is listed in the GUI under '''Settings > Sensors'''. The sensor should appear with GREEN status.
5. After reboot, verify the napatech interface is listed in the GUI under '''Settings > Sensors'''. The sensor should appear with GREEN status.
# If needed, manually restart the voipmonitor service:
 
#: <syntaxhighlight lang="bash">
6. If needed, manually restart the voipmonitor service:
<syntaxhighlight lang="bash">
systemctl stop voipmonitor
systemctl stop voipmonitor
systemctl start voipmonitor
systemctl start voipmonitor
</syntaxhighlight>
</syntaxhighlight>


{{Note|The <code>ntservice</code> must be running BEFORE <code>voipmonitor</code> starts, or the napatech interface will not be available. This is why the systemd dependency configuration is critical.}}
{{Note|1=The <code>ntservice</code> must be running BEFORE <code>voipmonitor</code> starts, or the napatech interface will not be available. This is why the systemd dependency configuration is critical.}}


=== Service Startup Order (init.d) ===
=== Service Startup Order (init.d) ===

Revision as of 21:29, 6 January 2026

Napatech Integration

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

First Installation

Prerequisites

  • Download latest Napatech drivers and untar into /opt/napatech3
  • Build the Napatech driver according to vendor documentation
  • Install required development libraries

Build Steps

# Clone the sniffer source
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

# Install missing dependencies if configure reports errors, then run make
make

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

If you already have the repository cloned and want to switch to the develop branch:

cd /usr/src/sniffer
git fetch origin
git checkout develop
git pull

Verify Build

Check that voipmonitor is linked against Napatech's libpcap:

ldd ./voipmonitor | grep pcap

Expected output:

libpcap.so.1 => /opt/napatech3/lib/libpcap.so.1 (0x00007fc0b69b0000)

Install and Run

# Replace original binary
cp ./voipmonitor /usr/local/sbin/voipmonitor

# Restart the service
systemctl restart voipmonitor

Upgrade

GUI Upgrade (v24.23+)

From sensor version 24.23, you can perform upgrades via the GUI using the upgrade_by_git option. The configure_param option ensures the Makefile is created with appropriate includes/libs.

Add these options 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 restarting the sniffer, click UPGRADE in the GUI. The sniffer will automatically perform: git pull → configure → make clean → make → stop → make install → start.

Manual Upgrade

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

Napatech Driver Configuration

VoIPmonitor Configuration

In /etc/voipmonitor.conf:

interface = napa0

# IMPORTANT: BPF filter option must be commented out!
#filter = udp or (vlan and udp)

⚠️ Warning: The BPF filter option MUST be commented out or removed when using Napatech. BPF filters are not compatible with Napatech's NTPL filtering.

ntpcap.ini Configuration

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

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

[napa0]
StreamId = 0
Tx = 0

For older Napatech driver versions:

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

ntservice.ini Configuration

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

[System]
TimestampFormat = NATIVE_UNIX
TimestampMethod = EOF
HostBufferWaitMethod = 0
SDRAMFillLevelWarning = 0

[logging]
LogMask = 0x07
LogToFile = 0
LogFileName = /tmp/Log3G_%s.log
LogBufferWrap = wrap

[Adapter0]
AdapterType = NT4E
BusId = 00:07:00:00
PacketDescriptor = NT
HostBuffersRx = [8,16,0]
HostBuffersTx = [8,16,0]
TimeSyncProtocol = NT
TimeSyncConnectorIn = Ext
TimeSyncConnectorOut = None
TimeSyncConnectorRepeat = None
TimeSyncTimeJumpThreshold = 1
TimeSyncTimeOffset = 0
MaxFrameSize = 9018
AltTPID = 0x8100
Profile = Capture
DiscardSize = 16
OsTimeSyncFailover = DISABLE

Time Source Configuration

By default, Napatech uses GMT timestamps. To use system time instead:

For newer Napatech drivers:

TimesynConnectorExt1 = None
TimeSyncReferencePriority = OSTime

Alternative for older drivers:

# For GMT (external PPS):
TimeSyncConnectorExt1 = PpsIn

# For system-dependent time:
TimeSyncConnectorExt1 = NttsIn

💡 Tip: If spool directories are created with incorrect dates (e.g., 1970-01-01), see troubleshooting section below.

Systemd Service Configuration

You need to ensure Napatech drivers (ntservice) start before VoIPmonitor. See systemd service file configuration for adding:

After=ntservice.service
Requires=ntservice.service

Traffic Filtering on Napatech Card

To filter traffic directly on the Napatech card, create an NTPL filter file.

Example: /opt/napatech3/myfilter.ntpl

# Start NTPL
# Delete all existing filter
delete = all

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

# Setup filters
# SIP filter (ports 5060, 5061)
Assign[StreamId = 0] = (mUdpSrcPort == 5060, 5061) AND (mUdpDestPort == 5060, 5061)
# RTP filter (ports 10000-61743 in HEX)
Assign[StreamId = 0] = (mUdpSrcPort == (0x2710..0xF12F))
Assign[StreamId = 1] = (mUdpSrcPort == 5060, 5061) AND (mUdpDestPort == 5060, 5061)
Assign[StreamId = 1] = (mUdpSrcPort == (0x2710..0xF12F))
Assign[StreamId = 2] = (mUdpSrcPort == 5060, 5061) AND (mUdpDestPort == 5060, 5061)
Assign[StreamId = 2] = (mUdpSrcPort == (0x2710..0xF12F))
Assign[StreamId = 3] = (mUdpSrcPort == 5060, 5061) AND (mUdpDestPort == 5060, 5061)
Assign[StreamId = 3] = (mUdpSrcPort == (0x2710..0xF12F))
# End NTPL

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

Apply the filter:

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

Troubleshooting

Spool Directories with Date 1970-01-01

If spool directories are created with incorrect timestamps (e.g., 1970-01-01), the Napatech card is providing Unix Epoch time instead of actual system time.

Solution:

  1. Edit /opt/napatech3/config/ntservice.ini
  2. For newer drivers, add:
    timeSource = OS
    
    For older drivers, in the [Adapter0] section:
    OsTimeSyncFailover = ENABLE
    
  3. Restart services:
    systemctl stop ntservice
    systemctl start ntservice
    systemctl restart voipmonitor
    
  4. Verify fix:
    ls -ltd /var/spool/voipmonitor/*
    

Napatech Interfaces in DOWN State

If tcpdump or tshark show no packets on Napatech interfaces:

  1. Check interface status:
    ip link show napa0
    ip link show | grep napa
    
  2. Verify drivers are loaded:
    lsmod | grep ntpcap
    systemctl status ntservice
    
  3. Verify voipmonitor uses Napatech libpcap:
    ldd /usr/local/sbin/voipmonitor | grep pcap
    
    Expected output should show /opt/napatech3/lib/libpcap.so.1, NOT system libpcap.
  4. If using system libpcap, rebuild voipmonitor:
    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
    

Drivers Not Capturing Traffic

Symptoms:

  • GUI shows no calls
  • tshark -i napa0 shows no packets
  • Interfaces are UP but not receiving data

Solution: Restart Napatech drivers:

systemctl stop voipmonitor
cd /opt/napatech3/bin/
./ntstop
./ntstart
systemctl start voipmonitor

Verify traffic capture:

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

If issues persist, check logs:

journalctl -u ntservice -n 50
tail -f /tmp/Log3G_*.log

Compilation Errors with DPDK Headers

If compilation fails with errors like RTE_ETH_MQ_TX_NONE was not declared, system DPDK libraries are conflicting with Napatech SDK.

Solution: Disable DPDK support in config.h:

  1. Run configure first:
    ./configure --with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib
    
  2. Edit config.h - change #define HAVE_LIBDPDK 1 to:
    #define HAVE_LIBDPDK 0
    
  3. Then compile:
    make
    

Sensor Shows as Down in GUI

If the GUI displays an error message "The requested response from the sensor could not be retrieved" or shows the Napatech sensor status as DOWN (red), this indicates the Napatech driver service (ntservice) is not running or failed to start.

Symptoms:

  • GUI shows sensor as down (red status icon)
  • Error message: "The requested response from the sensor could not be retrieved"
  • Napatech interfaces may not appear in GUI Settings -> Sensors

Solution:

  1. Start the ntservice manually:
    systemctl start ntservice
    
  2. Verify ntservice is running:
    systemctl status ntservice
    lsmod | grep ntpcap
    
  3. Modify systemd service configuration to ensure ntservice starts before voipmonitor at boot:
    systemctl edit voipmonitor
    
    Add this override:
    [Unit]
    After=ntservice.service
    Requires=ntservice.service
    
  4. Reboot the OS to apply the startup order changes:
    reboot
    
  5. After reboot, verify the napatech interface is listed in the GUI under Settings > Sensors. The sensor should appear with GREEN status.
  6. If needed, manually restart the voipmonitor service:
    systemctl stop voipmonitor
    systemctl start voipmonitor
    

ℹ️ Note: The ntservice must be running BEFORE voipmonitor starts, or the napatech interface will not be available. This is why the systemd dependency configuration is critical.

Service Startup Order (init.d)

If VoIPmonitor fails with libpcap error no such device exists after upgrade, Napatech drivers may not be initialized when VoIPmonitor starts.

For init.d systems: Edit /etc/init.d/voipmonitor and add before voipmonitor binary execution:

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

For systemd systems: Add to the service unit file:

After=ntservice.service
Requires=ntservice.service

See systemd documentation for details.

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. 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), ntpcap.ini for stream assignment, ntservice.ini for adapter settings. Time source configuration: set timeSource=OS for system time. Troubleshooting covers: 1970-01-01 spool directories (time source misconfiguration), interfaces in DOWN state (requires Napatech libpcap), drivers not capturing (restart with ntstop/ntstart), DPDK compilation errors (set HAVE_LIBDPDK=0 in config.h), service startup order (add ntservice dependency), sensor shows as down in GUI with "The requested response from the sensor could not be retrieved" (start ntservice, configure systemd dependency).

Keywords: Napatech, SmartNIC, compilation, configure, upgrade_by_git, configure_param, ntpcap.ini, ntservice.ini, timeSource, 1970-01-01, NTPL filter, libpcap, ntstop, ntstart, HAVE_LIBDPDK, systemd, init.d, sensor down, ntservice, "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 fix "The requested response from the sensor could not be retrieved" error with Napatech?