Napatech: Difference between revisions

From VoIPmonitor.org
(Review: přidány diagramy, opraveny info boxy (1= prefix), konzistentní formátování číslovaných seznamů)
(Rewrite: consolidated structure, added quick reference table, streamlined config sections)
 
Line 14: Line 14:
</kroki>
</kroki>


== First Installation ==
== Prerequisites ==


=== Prerequisites ===
* Napatech drivers installed in <code>/opt/napatech3</code> (built per vendor documentation)
* Download latest Napatech drivers and untar into <code>/opt/napatech3</code>
* Development libraries for compilation
* Build the Napatech driver according to vendor documentation
* Root access for driver operations
* Install required development libraries


=== Build Steps ===
== Building VoIPmonitor with Napatech Support ==


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# Clone the sniffer source
# Clone source and build
cd /usr/src
cd /usr/src
git clone -b develop https://github.com/voipmonitor/sniffer.git
git clone -b develop https://github.com/voipmonitor/sniffer.git
Line 31: Line 30:
# Configure with Napatech library paths
# Configure with Napatech library paths
./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
# Install missing dependencies if configure reports errors, then run make
make
make
</syntaxhighlight>
{{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:
<syntaxhighlight lang="bash">
cd /usr/src/sniffer
git fetch origin
git checkout develop
git pull
</syntaxhighlight>
=== Verify Build ===


Check that voipmonitor is linked against Napatech's libpcap:
# Verify linkage (MUST show /opt/napatech3/lib/libpcap.so.1)
<syntaxhighlight lang="bash">
ldd ./voipmonitor | grep pcap
ldd ./voipmonitor | grep pcap
</syntaxhighlight>


Expected output:
# Install
<syntaxhighlight lang="text">
libpcap.so.1 => /opt/napatech3/lib/libpcap.so.1 (0x00007fc0b69b0000)
</syntaxhighlight>
 
=== Install and Run ===
 
<syntaxhighlight lang="bash">
# Replace original binary
cp ./voipmonitor /usr/local/sbin/voipmonitor
cp ./voipmonitor /usr/local/sbin/voipmonitor
# Restart the service
systemctl restart voipmonitor
systemctl restart voipmonitor
</syntaxhighlight>
</syntaxhighlight>


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


=== GUI Upgrade (v24.23+) ===
=== GUI Upgrade (v24.23+) ===


From sensor version 24.23, you can perform upgrades via the GUI using the <code>upgrade_by_git</code> option. The <code>configure_param</code> option ensures the Makefile is created with appropriate includes/libs.
Add to <code>/etc/voipmonitor.conf</code>:
 
Add these options to <code>/etc/voipmonitor.conf</code>:
<syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
upgrade_by_git = yes
upgrade_by_git = yes
Line 81: Line 53:
</syntaxhighlight>
</syntaxhighlight>


After restarting the sniffer, click '''UPGRADE''' in the GUI. The sniffer will automatically perform: git pull → configure → make clean → make → stop → make install → start.
After restart, click '''UPGRADE''' in the GUI. The sniffer automatically performs: git pull → configure → make → install → restart.


=== Manual Upgrade ===
=== Manual Upgrade ===
Line 87: Line 59:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
cd /usr/src/sniffer
cd /usr/src/sniffer
git checkout develop
git pull
git pull
./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
make
make && make install
make install
systemctl restart voipmonitor
systemctl restart voipmonitor
</syntaxhighlight>
</syntaxhighlight>


== Napatech Driver Configuration ==
== Configuration ==


=== VoIPmonitor Configuration ===
=== VoIPmonitor Configuration ===
Line 103: Line 73:
interface = napa0
interface = napa0


# IMPORTANT: BPF filter option must be commented out!
# CRITICAL: BPF filter MUST be disabled - not compatible with Napatech NTPL
#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.}}
{{Warning|1=The BPF <code>filter</code> option MUST be commented out when using Napatech. Use NTPL filtering instead (see [[#Traffic Filtering|Traffic Filtering]]).}}


=== ntpcap.ini Configuration ===
=== ntpcap.ini ===


File: <code>/opt/napatech3/config/ntpcap.ini</code>
File: <code>/opt/napatech3/config/ntpcap.ini</code>
Line 121: Line 91:
</syntaxhighlight>
</syntaxhighlight>


For older Napatech driver versions:
For older drivers, use:
<syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
[napa0]
[napa0]
Line 128: Line 98:
</syntaxhighlight>
</syntaxhighlight>


=== ntservice.ini Configuration ===
=== ntservice.ini (Key Settings) ===


File: <code>/opt/napatech3/config/ntservice.ini</code>
File: <code>/opt/napatech3/config/ntservice.ini</code>
Essential settings:
<syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
[System]
[System]
TimestampFormat = NATIVE_UNIX
TimestampFormat = NATIVE_UNIX
TimestampMethod = EOF
TimestampMethod = EOF
HostBufferWaitMethod = 0
SDRAMFillLevelWarning = 0
[logging]
LogMask = 0x07
LogToFile = 0
LogFileName = /tmp/Log3G_%s.log
LogBufferWrap = wrap


[Adapter0]
[Adapter0]
AdapterType = NT4E
AdapterType = NT4E         # Match your card type
BusId = 00:07:00:00
BusId = 00:07:00:00         # Match your PCI address
PacketDescriptor = NT
Profile = Capture
HostBuffersRx = [8,16,0]
HostBuffersTx = [8,16,0]
TimeSyncProtocol = NT
TimeSyncConnectorIn = Ext
TimeSyncConnectorOut = None
TimeSyncConnectorRepeat = None
TimeSyncTimeJumpThreshold = 1
TimeSyncTimeOffset = 0
MaxFrameSize = 9018
MaxFrameSize = 9018
AltTPID = 0x8100
Profile = Capture
DiscardSize = 16
OsTimeSyncFailover = DISABLE
</syntaxhighlight>
</syntaxhighlight>


=== Time Source Configuration ===
'''Time source configuration''' (to avoid 1970-01-01 timestamps):
<syntaxhighlight lang="ini">
# Newer drivers:
timeSource = OS


By default, Napatech uses GMT timestamps. To use system time instead:
# Older drivers (in [Adapter0] section):
 
OsTimeSyncFailover = ENABLE
'''For newer Napatech drivers:'''
<syntaxhighlight lang="ini">
TimesynConnectorExt1 = None
TimeSyncReferencePriority = OSTime
</syntaxhighlight>
</syntaxhighlight>


'''Alternative for older drivers:'''
=== Systemd Dependencies ===
<syntaxhighlight lang="ini">
# For GMT (external PPS):
TimeSyncConnectorExt1 = PpsIn


# For system-dependent time:
VoIPmonitor must start AFTER Napatech drivers. Configure dependency:
TimeSyncConnectorExt1 = NttsIn
<syntaxhighlight lang="bash">
systemctl edit voipmonitor
</syntaxhighlight>
</syntaxhighlight>


{{Tip|1=If spool directories are created with incorrect dates (e.g., <code>1970-01-01</code>), see [[#Spool Directories with Date 1970-01-01|troubleshooting section below]].}}
Add:
 
== Systemd Service Configuration ==
 
You need to ensure Napatech drivers (ntservice) start before VoIPmonitor. See [[Systemd_for_voipmonitor_service_management#Dependency_Customization|systemd service file configuration]] for adding:
 
<syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
[Unit]
After=ntservice.service
After=ntservice.service
Requires=ntservice.service
Requires=ntservice.service
</syntaxhighlight>
</syntaxhighlight>


== Traffic Filtering on Napatech Card ==
For init.d systems, add to <code>/etc/init.d/voipmonitor</code> before binary execution:
<syntaxhighlight lang="bash">
/opt/napatech3/bin/ntstart.sh
sleep 60
</syntaxhighlight>
 
See [[Systemd_for_voipmonitor_service_management#Dependency_Customization|systemd documentation]] for details.
 
== Traffic Filtering ==


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


Example: <code>/opt/napatech3/myfilter.ntpl</code>
Example <code>/opt/napatech3/myfilter.ntpl</code>:
<syntaxhighlight lang="text">
<syntaxhighlight lang="text">
# Start NTPL
# Delete all existing filter
delete = all
delete = all


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


# Setup filters
# SIP filter (ports 5060, 5061)
# SIP filter (ports 5060, 5061)
Assign[StreamId = 0] = (mUdpSrcPort == 5060, 5061) AND (mUdpDestPort == 5060, 5061)
Assign[StreamId = 0] = (mUdpSrcPort == 5060, 5061) AND (mUdpDestPort == 5060, 5061)
# RTP filter (ports 10000-61743 in HEX)
 
# RTP filter (ports 10000-61743)
Assign[StreamId = 0] = (mUdpSrcPort == (0x2710..0xF12F))
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
# Deduplication
DeduplicationConfig[drop=duplicate] = GroupID == 0
DeduplicationConfig[drop=duplicate] = GroupID == 0
Define ckRecipe = CorrelationKey(Begin=StartOfFrame[0], End=EndOfFrame[0], DeduplicationGroupID=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
Assign[StreamID=0; CorrelationKey=ckRecipe] = Port == 0
</syntaxhighlight>
</syntaxhighlight>


Apply the filter:
Apply filter:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
/opt/napatech3/bin/ntstart.sh -n myfilter.ntpl
/opt/napatech3/bin/ntstart.sh -n myfilter.ntpl
Line 233: Line 177:
== Troubleshooting ==
== Troubleshooting ==


<kroki lang="mermaid">
=== Quick Reference ===
%%{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]
{| class="wikitable"
    C -->|Yes| C1[Check ldd libpcap]
! Problem !! Cause !! Solution
    C1 --> C2[Restart ntstop/ntstart]
|-
    D -->|Yes| D1[Start ntservice]
| Spool directories dated 1970-01-01 || Time source misconfigured || Set <code>timeSource = OS</code> in ntservice.ini
    D1 --> D2[Add systemd deps]
|-
    E -->|Yes| E1[Set HAVE_LIBDPDK=0]
| No packets captured || Wrong libpcap linked || Verify <code>ldd voipmonitor</code> shows Napatech libpcap
</kroki>
|-
| Sensor DOWN in GUI || ntservice not running || Start ntservice, add systemd dependency
|-
| <code>RTE_ETH_MQ_TX_NONE</code> error || DPDK conflict || Set <code>#define HAVE_LIBDPDK 0</code> in config.h
|-
| <code>libpcap error no such device</code> || Driver not initialized || Add ntservice dependency, restart services
|}


=== Spool Directories with Date 1970-01-01 ===
=== Spool Directories with Date 1970-01-01 ===


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


'''Solution:'''
<syntaxhighlight lang="bash">
 
# Fix in ntservice.ini (see Configuration section above)
# Edit <code>/opt/napatech3/config/ntservice.ini</code>
# Then restart:
# For newer drivers, add:
#: <syntaxhighlight lang="ini">
timeSource = OS
</syntaxhighlight>
#: For older drivers, in the <code>[Adapter0]</code> section:
#: <syntaxhighlight lang="ini">
OsTimeSyncFailover = ENABLE
</syntaxhighlight>
# Restart services:
#: <syntaxhighlight lang="bash">
systemctl stop ntservice
systemctl stop ntservice
systemctl start ntservice
systemctl start ntservice
systemctl restart voipmonitor
systemctl restart voipmonitor
</syntaxhighlight>
 
# Verify fix:
# Verify:
#: <syntaxhighlight lang="bash">
ls -ltd /var/spool/voipmonitor/*
ls -ltd /var/spool/voipmonitor/*
</syntaxhighlight>
</syntaxhighlight>


=== Napatech Interfaces in DOWN State ===
=== Napatech Interfaces Not Capturing ===


If <code>tcpdump</code> or <code>tshark</code> show no packets on Napatech interfaces:
<syntaxhighlight lang="bash">
# Check interface status
ip link show napa0


# Check interface status:
# Verify correct libpcap (MUST show /opt/napatech3/lib/libpcap.so.1)
#: <syntaxhighlight lang="bash">
ip link show napa0
ip link show | grep napa
</syntaxhighlight>
# Verify drivers are loaded:
#: <syntaxhighlight lang="bash">
lsmod | grep ntpcap
systemctl status ntservice
</syntaxhighlight>
# Verify voipmonitor uses Napatech libpcap:
#: <syntaxhighlight lang="bash">
ldd /usr/local/sbin/voipmonitor | grep pcap
ldd /usr/local/sbin/voipmonitor | grep pcap
</syntaxhighlight>
#: Expected output should show <code>/opt/napatech3/lib/libpcap.so.1</code>, NOT system libpcap.
# If using system libpcap, rebuild voipmonitor:
#: <syntaxhighlight lang="bash">
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
</syntaxhighlight>
=== Drivers Not Capturing Traffic ===
'''Symptoms:'''
* GUI shows no calls
* <code>tshark -i napa0</code> shows no packets
* Interfaces are UP but not receiving data


'''Solution:''' Restart Napatech drivers:
# Restart drivers
<syntaxhighlight lang="bash">
systemctl stop voipmonitor
systemctl stop voipmonitor
cd /opt/napatech3/bin/
cd /opt/napatech3/bin/ && ./ntstop && ./ntstart
./ntstop
./ntstart
systemctl start voipmonitor
systemctl start voipmonitor
</syntaxhighlight>


Verify traffic capture:
# Verify capture
<syntaxhighlight lang="bash">
tshark -i napa0 -Y "sip || rtp" -n -c 10
tshark -i napa0 -Y "sip || rtp" -n -c 10
</syntaxhighlight>
</syntaxhighlight>


If issues persist, check logs:
If libpcap shows system path instead of Napatech path, rebuild VoIPmonitor (see [[#Building VoIPmonitor with Napatech Support|Build section]]).
<syntaxhighlight lang="bash">
journalctl -u ntservice -n 50
tail -f /tmp/Log3G_*.log
</syntaxhighlight>
 
=== Compilation Errors with DPDK Headers ===
 
If compilation fails with errors like <code>RTE_ETH_MQ_TX_NONE was not declared</code>, system DPDK libraries are conflicting with Napatech SDK.
 
'''Solution:''' Disable DPDK support in <code>config.h</code>:
 
# Run configure first:
#: <syntaxhighlight lang="bash">
./configure --with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib
</syntaxhighlight>
# Edit <code>config.h</code> - change <code>#define HAVE_LIBDPDK 1</code> to:
#: <syntaxhighlight lang="c">
#define HAVE_LIBDPDK 0
</syntaxhighlight>
# Then compile:
#: <syntaxhighlight lang="bash">
make
</syntaxhighlight>


=== Sensor Shows as Down in GUI ===
=== 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 (<code>ntservice</code>) is not running or failed to start.
Error: '''"The requested response from the sensor could not be retrieved"'''


'''Symptoms:'''
<syntaxhighlight lang="bash">
* GUI shows sensor as down (red status icon)
# Start ntservice
* Error message: "The requested response from the sensor could not be retrieved"
* Napatech interfaces may not appear in GUI Settings -> Sensors
 
'''Solution:'''
 
# Start the <code>ntservice</code> manually:
#: <syntaxhighlight lang="bash">
systemctl start ntservice
systemctl start ntservice
</syntaxhighlight>
# Verify ntservice is running:
#: <syntaxhighlight lang="bash">
systemctl status ntservice
systemctl status ntservice
lsmod | grep ntpcap
 
</syntaxhighlight>
# Configure dependency (see Systemd Dependencies section)
# Modify systemd service configuration to ensure <code>ntservice</code> starts before <code>voipmonitor</code> at boot:
#: <syntaxhighlight lang="bash">
systemctl edit voipmonitor
systemctl edit voipmonitor
</syntaxhighlight>
# Add After= and Requires= for ntservice.service
#: Add this override:
 
#: <syntaxhighlight lang="ini">
# Reboot to apply
[Unit]
After=ntservice.service
Requires=ntservice.service
</syntaxhighlight>
# Reboot the OS to apply the startup order changes:
#: <syntaxhighlight lang="bash">
reboot
reboot
</syntaxhighlight>
# 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">
systemctl stop voipmonitor
systemctl start voipmonitor
</syntaxhighlight>
</syntaxhighlight>


{{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.}}
{{Note|1=The <code>ntservice</code> must be running BEFORE <code>voipmonitor</code> starts. The systemd dependency configuration is critical.}}


=== Service Startup Order (init.d) ===
=== Compilation Errors (DPDK Conflict) ===


If VoIPmonitor fails with <code>libpcap error no such device exists</code> after upgrade, Napatech drivers may not be initialized when VoIPmonitor starts.
If build fails with <code>RTE_ETH_MQ_TX_NONE was not declared</code>:


'''For init.d systems:''' Edit <code>/etc/init.d/voipmonitor</code> and add before voipmonitor binary execution:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
/opt/napatech3/bin/ntstart.sh
# After running ./configure, edit config.h
sleep 60
# Change: #define HAVE_LIBDPDK 1
# To:    #define HAVE_LIBDPDK 0
 
make
</syntaxhighlight>
</syntaxhighlight>


'''For systemd systems:''' Add to the service unit file:
== See Also ==
<syntaxhighlight lang="ini">
After=ntservice.service
Requires=ntservice.service
</syntaxhighlight>


See [[Systemd_for_voipmonitor_service_management#Dependency_Customization|systemd documentation]] for details.
* [[Sniffer_installation]] - General sniffer installation
* [[DPDK]] - DPDK high-performance capture (alternative to Napatech)
* [[Systemd_for_voipmonitor_service_management]] - Service management details
* [[Scaling]] - Performance optimization


== AI Summary for RAG ==
== AI Summary for RAG ==


'''Summary:''' Guide for building VoIPmonitor sniffer with Napatech SmartNIC support. Build process: clone source with <code>git clone -b develop</code>, configure with <code>--with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib</code>, and make. For GUI upgrades (v24.23+), set <code>upgrade_by_git=yes</code> and <code>configure_param</code> 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 <code>timeSource=OS</code> 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).
'''Summary:''' Guide for building VoIPmonitor sniffer with Napatech SmartNIC support. Build process: clone source with <code>git clone -b develop</code>, configure with <code>--with-dpdk-include=/opt/napatech3/include --with-dpdk-lib=/opt/napatech3/lib</code>, and make. Verify build with <code>ldd voipmonitor | grep pcap</code> - must show Napatech libpcap path. For GUI upgrades (v24.23+), set <code>upgrade_by_git=yes</code> and <code>configure_param</code> in voipmonitor.conf. Configuration requires: <code>interface=napa0</code> in voipmonitor.conf (BPF filter must be disabled/commented), ntpcap.ini for stream assignment, ntservice.ini for adapter and time settings. Critical: set <code>timeSource=OS</code> 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, 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"
'''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:'''
'''Key Questions:'''
Line 429: Line 284:
* What does libpcap error no such device exists mean?
* 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"?
* 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?
* How do I verify VoIPmonitor is using Napatech libpcap?
* How do I configure NTPL hardware filtering on Napatech?

Latest revision as of 16:48, 8 January 2026

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?