Sniffer distributed architecture: Difference between revisions

From VoIPmonitor.org
(Add SIP Probe → Central Server forwarding pattern using packetbuffer_sender with server_destination/server_bind for merging SIP signaling with RTP media from separate machines)
(Convert pre tags to syntaxhighlight)
Line 111: Line 111:


On each client (A, B, C):
On each client (A, B, C):
<pre>
<syntaxhighlight lang="bash">
server_destination = central.server.ip
server_destination = central.server.ip
server_destination_port = 60024
server_destination_port = 60024
server_password = shared_secret
server_password = shared_secret
</pre>
</syntaxhighlight>


On central server:
On central server:
<pre>
<syntaxhighlight lang="bash">
server_bind = 0.0.0.0
server_bind = 0.0.0.0
server_bind_port = 60024
server_bind_port = 60024
server_password = shared_secret
server_password = shared_secret
</pre>
</syntaxhighlight>


'''Important notes:'''
'''Important notes:'''
Line 151: Line 151:


On source sensor A:
On source sensor A:
<pre>
<syntaxhighlight lang="bash">
mirror_destination = sensor.b.ip
mirror_destination = sensor.b.ip
mirror_destination_port = 5090
mirror_destination_port = 5090
</pre>
</syntaxhighlight>


On receiving sensor B:
On receiving sensor B:
<pre>
<syntaxhighlight lang="bash">
mirror_bind = 0.0.0.0
mirror_bind = 0.0.0.0
mirror_bind_port = 5090
mirror_bind_port = 5090
</pre>
</syntaxhighlight>


'''Use cases:'''
'''Use cases:'''
Line 204: Line 204:


Edit <code>/etc/voipmonitor.conf</code>:
Edit <code>/etc/voipmonitor.conf</code>:
<pre>
<syntaxhighlight lang="bash">
# Enable packet forwarding mode
# Enable packet forwarding mode
packetbuffer_sender = yes
packetbuffer_sender = yes
Line 214: Line 214:


# Do NOT set server_bind, mysqlhost, or other server options
# Do NOT set server_bind, mysqlhost, or other server options
</pre>
</syntaxhighlight>


'''Configuration on Central Server (receiving SIP, capturing RTP):'''
'''Configuration on Central Server (receiving SIP, capturing RTP):'''


Edit <code>/etc/voipmonitor.conf</code>:
Edit <code>/etc/voipmonitor.conf</code>:
<pre>
<syntaxhighlight lang="bash">
# Accept incoming packets from probes
# Accept incoming packets from probes
server_bind = 0.0.0.0
server_bind = 0.0.0.0
Line 229: Line 229:
interface = eth0
interface = eth0
# ... other standard configuration
# ... other standard configuration
</pre>
</syntaxhighlight>


'''How it works:'''
'''How it works:'''
Line 239: Line 239:


'''Restart services:'''
'''Restart services:'''
<pre>
<syntaxhighlight lang="bash">
# On SIP probe
# On SIP probe
systemctl restart voipmonitor
systemctl restart voipmonitor
Line 245: Line 245:
# On central server
# On central server
systemctl restart voipmonitor
systemctl restart voipmonitor
</pre>
</syntaxhighlight>


{{Note|This pattern uses <code>packetbuffer_sender</code> with <code>server_destination</code>/</code>server_bind</code> (client-server mode), which is different from <code>packetbuffer_sender</code> with </code>mirror_destination</code>/</code>mirror_bind</code> (mirror mode).}}
{{Note|This pattern uses <code>packetbuffer_sender</code> with <code>server_destination</code>/</code>server_bind</code> (client-server mode), which is different from <code>packetbuffer_sender</code> with </code>mirror_destination</code>/</code>mirror_bind</code> (mirror mode).}}
Line 276: Line 276:


'''Sensor A (source):'''
'''Sensor A (source):'''
<pre>
<syntaxhighlight lang="bash">
mirror_destination = sensor.b.ip
mirror_destination = sensor.b.ip
mirror_destination_port = 5090
mirror_destination_port = 5090
</pre>
</syntaxhighlight>


'''Sensor B (intermediate):'''
'''Sensor B (intermediate):'''
<pre>
<syntaxhighlight lang="bash">
mirror_bind = 0.0.0.0
mirror_bind = 0.0.0.0
mirror_bind_port = 5090
mirror_bind_port = 5090
Line 288: Line 288:
server_destination_port = 60024
server_destination_port = 60024
packetbuffer_sender = no
packetbuffer_sender = no
</pre>
</syntaxhighlight>


'''Central Server C:'''
'''Central Server C:'''
<pre>
<syntaxhighlight lang="bash">
server_bind = 0.0.0.0
server_bind = 0.0.0.0
server_bind_port = 60024
server_bind_port = 60024
</pre>
</syntaxhighlight>


'''Result:'''
'''Result:'''
Line 307: Line 307:


'''Sensor B (intermediate):'''
'''Sensor B (intermediate):'''
<pre>
<syntaxhighlight lang="bash">
mirror_bind = 0.0.0.0
mirror_bind = 0.0.0.0
mirror_bind_port = 5090
mirror_bind_port = 5090
Line 313: Line 313:
server_destination_port = 60024
server_destination_port = 60024
packetbuffer_sender = yes
packetbuffer_sender = yes
</pre>
</syntaxhighlight>


'''Result:'''
'''Result:'''
Line 324: Line 324:
When using mirror mode, compression can reduce network bandwidth:
When using mirror mode, compression can reduce network bandwidth:


<pre>
<syntaxhighlight lang="bash">
packetbuffer_compress = yes
packetbuffer_compress = yes
packetbuffer_compress_ratio = 100
packetbuffer_compress_ratio = 100
max_buffer_mem = 2000
max_buffer_mem = 2000
</pre>
</syntaxhighlight>


Adjust <code>packetbuffer_compress_ratio</code> if CPU becomes a bottleneck.
Adjust <code>packetbuffer_compress_ratio</code> if CPU becomes a bottleneck.
Line 367: Line 367:


'''On source sniffer (with mirror_destination):'''
'''On source sniffer (with mirror_destination):'''
<pre>
<syntaxhighlight lang="bash">
sipport = 5060,5061
sipport = 5060,5061
</pre>
</syntaxhighlight>


This ensures TCP packets (including TLS handshakes) are also mirrored.
This ensures TCP packets (including TLS handshakes) are also mirrored.
Line 376: Line 376:


Configure SSL decryption options here:
Configure SSL decryption options here:
<pre>
<syntaxhighlight lang="bash">
ssl_ipport = ...
ssl_ipport = ...
ssl_sessionkey = ...
ssl_sessionkey = ...
</pre>
</syntaxhighlight>


==Important Limitations==
==Important Limitations==
Line 395: Line 395:
A future release may support native dual-mode operation with these new options:
A future release may support native dual-mode operation with these new options:


<pre>
<syntaxhighlight lang="bash">
# Server mode (receive connections)
# Server mode (receive connections)
server_bind = 0.0.0.0
server_bind = 0.0.0.0
Line 408: Line 408:
# Enable both modes
# Enable both modes
server_dual_mode = yes
server_dual_mode = yes
</pre>
</syntaxhighlight>


This would enable clean multi-tier architectures without workarounds.
This would enable clean multi-tier architectures without workarounds.

Revision as of 11:19, 4 January 2026


Distributed Architecture: Client-Server and Mirroring Modes

This guide explains how to deploy VoIPmonitor in distributed architectures using client-server mode, packet mirroring, and hybrid configurations.

Overview

VoIPmonitor sniffers can be deployed in multiple architectural patterns:

  • Standalone mode: Single instance capturing and analyzing traffic
  • Client-Server mode: Multiple clients sending CDRs to central server
  • Mirroring mode: Forwarding raw packets to another instance
  • Hybrid mode: Combining mirroring with client-server (workaround)

= Architecture Diagrams (PlantUML)

Standard Architectures

Multiple Clients to Single Server (Recommended)

This is the standard and fully supported architecture for distributed deployments.

Configuration:

On each client (A, B, C):

server_destination = central.server.ip
server_destination_port = 60024
server_password = shared_secret

On central server:

server_bind = 0.0.0.0
server_bind_port = 60024
server_password = shared_secret

Important notes:

  • All clients and the server must use the same server_password
  • Clients do not store CDRs to MySQL (they only send to server)
  • Server stores all CDRs to MySQL database
  • PCAP files are stored on clients by default

Packet Mirroring

Mirror mode forwards raw network packets from one sniffer to another.

Sensor A ──(packets)──→ Sensor B

Configuration:

On source sensor A:

mirror_destination = sensor.b.ip
mirror_destination_port = 5090

On receiving sensor B:

mirror_bind = 0.0.0.0
mirror_bind_port = 5090

Use cases:

  • Forwarding packets from appliances without VoIPmonitor
  • Port mirroring / SPAN to VoIPmonitor instance
  • Distributed packet capture with central analysis

Forwarding from SIP Probe to Central Server

This pattern is used when SIP signaling and RTP media are captured on separate machines. A SIP-only probe captures SIP packets and forwards them to a central server where RTP packets are also captured, allowing complete CDR generation.

SIP Probe (only SIP) ──(SIP packets)──→ Central Server (SIP + RTP)

Use case:

  • Environment where SIP servers and RTP engines are deployed on separate machines
  • Need to merge SIP signaling from one location with RTP media from another

Configuration on SIP Probe (sending SIP packets):

Edit /etc/voipmonitor.conf:

# Enable packet forwarding mode
packetbuffer_sender = yes

# Send to central server that will merge SIP with RTP
server_destination = central.server.ip
server_destination_port = 60024
server_password = shared_secret

# Do NOT set server_bind, mysqlhost, or other server options

Configuration on Central Server (receiving SIP, capturing RTP):

Edit /etc/voipmonitor.conf:

# Accept incoming packets from probes
server_bind = 0.0.0.0
server_bind_port = 60024
server_password = shared_secret

# This server should also be capturing RTP locally
# Configure interface/port as usual
interface = eth0
# ... other standard configuration

How it works:

  1. SIP probe captures SIP signaling packets only
  2. SIP probe forwards raw packets to central server via server_destination
  3. packetbuffer_sender = yes enables packet forwarding (instead of analyzing locally and sending CDRs)
  4. Central server receives SIP packets and merges them with locally captured RTP packets
  5. Central server generates complete CDRs with both signaling and media information

Restart services:

# On SIP probe
systemctl restart voipmonitor

# On central server
systemctl restart voipmonitor

ℹ️ Note: This pattern uses packetbuffer_sender with server_destination/server_bind (client-server mode), which is different from packetbuffer_sender with mirror_destination/mirror_bind (mirror mode).

Hybrid Chain Configuration (Workaround)

⚠️ Warning: A single sniffer instance cannot operate in both client and server modes simultaneously using server_bind + server_destination. These options are mutually exclusive.

However, a workaround exists using mirroring combined with client mode:

A (mirror) ──(packets)──→ B (mirror_bind + server_destination) ──(CDRs/packets)──→ C (server)

Scenario 1: CDR Forwarding

In this configuration, the intermediate sniffer (B) analyzes packets and forwards only CDRs to the central server.

Sensor A (source):

mirror_destination = sensor.b.ip
mirror_destination_port = 5090

Sensor B (intermediate):

mirror_bind = 0.0.0.0
mirror_bind_port = 5090
server_destination = central.server.ip
server_destination_port = 60024
packetbuffer_sender = no

Central Server C:

server_bind = 0.0.0.0
server_bind_port = 60024

Result:

  • B analyzes packets from A
  • B stores PCAP files locally
  • B sends only CDRs to C
  • C stores CDRs in MySQL and knows PCAPs are on B

Scenario 2: Packet Forwarding

The intermediate sniffer forwards raw packets instead of CDRs.

Sensor B (intermediate):

mirror_bind = 0.0.0.0
mirror_bind_port = 5090
server_destination = central.server.ip
server_destination_port = 60024
packetbuffer_sender = yes

Result:

  • B forwards raw packets from A+B to C
  • C analyzes all packets and stores PCAP files
  • C stores CDRs in MySQL

Compression for Mirroring

When using mirror mode, compression can reduce network bandwidth:

packetbuffer_compress = yes
packetbuffer_compress_ratio = 100
max_buffer_mem = 2000

Adjust packetbuffer_compress_ratio if CPU becomes a bottleneck.

GUI Visibility

Automatic visibility:

  • Client-server mode: Only the central server appears in GUI
  • Hybrid chain: Only the final server (C) and intermediate forwarder (B) appear

Manual sensor registration:

If you want sensor A to appear in GUI (for RRD charts, remote upgrades):

  1. Go to GUI → Settings → Sensors
  2. Add sensor A manually with its manager_ip:manager_port
  3. Ensure manager_aes_key and manager_aes_iv match GUI database values

Performance Optimization

Client-Server Mode for Better Performance

Switching from standalone to client-server architecture can significantly improve MySQL insert performance:

  1. Centralized writes: Single server instance handles all MySQL inserts (reduces lock contention)
  2. Enable mysql_enable_set_id: Let application handle ID auto-increment instead of MySQL
  3. Optimize MySQL configuration: Tune innodb_flush_log_at_trx_commit, innodb_io_capacity, etc.

Migration steps:

  1. Configure server: Set server_bind, server_bind_port, server_password
  2. Initially set mysql_enable_set_id = no on server
  3. Migrate sniffers one by one: Set server_destination, remove mysqlhost
  4. After all sniffers migrated: Enable mysql_enable_set_id = yes on server and restart

SRTP/DTLS Decryption in Mirror Mode

When using mirror mode, ensure SSL/TLS decryption is configured correctly:

On source sniffer (with mirror_destination):

sipport = 5060,5061

This ensures TCP packets (including TLS handshakes) are also mirrored.

On receiving sniffer (with mirror_bind):

Configure SSL decryption options here:

ssl_ipport = ...
ssl_sessionkey = ...

Important Limitations

⚠️ Warning: The hybrid chain workaround is not officially supported and may not work in future sniffer releases.

Key limitations:

  1. server_bind and server_destination cannot coexist in one instance
  2. Hybrid chain architecture is unstable across sniffer versions
  3. No per-client authentication (same password for all clients)
  4. Recommended: Use standard multiple clients → single server architecture

Future Enhancement (VS-1605)

A future release may support native dual-mode operation with these new options:

# Server mode (receive connections)
server_bind = 0.0.0.0
server_bind_port = 60024
server_bind_password = receive_secret

# Client mode (send to upstream)
server_destination = upstream.ip
server_destination_port = 60025
server_destination_password = send_secret

# Enable both modes
server_dual_mode = yes

This would enable clean multi-tier architectures without workarounds.


AI Summary for RAG

Summary: This guide explains how to deploy VoIPmonitor in distributed architectures using standalone, client-server, packet mirroring, and hybrid chain topologies. It documents how multiple remote sensors can send data to a central server, how mirror mode forwards raw packets between sniffers, and how a workaround combines mirroring with client mode to build multi-tier chains. The article clarifies where CDRs and PCAPs are stored in each scenario, how sensors appear in the GUI, how to manually register sensors, and how to optimize MySQL and VoIPmonitor configuration when migrating to client-server mode for better performance. It also covers forwarding SIP packets from a SIP-only probe to a central server that merges them with RTP media, using `packetbuffer_sender=yes` with `server_destination`/`server_bind` to create complete CDRs. Additionally, the article covers SRTP/DTLS decryption in mirror mode, current limitations (such as lack of dual-mode server/client in one process), and a proposed future enhancement (VS-1605) that would enable clean multi-hop deployments without workarounds. Keywords: distributed architecture, client-server mode, mirror mode, hybrid chain, remote sensor, CDR forwarding, packet mirroring, packetbuffer_sender, SIP probe forwarding, RTP media merging, server_destination, server_bind, compression, MySQL performance, SRTP, DTLS, GUI sensors, manager_ip, scalability, multi-site monitoring Key Questions:

  • How do I connect multiple VoIPmonitor sensors to a single central server using client-server mode?
  • When should I use packet mirroring instead of sending only CDRs from remote sensors?
  • How are CDRs and PCAP files stored and accessed in client-server versus hybrid chain configurations?
  • What are the limitations of combining server_bind and server_destination in a single sniffer instance?
  • How can I optimize MySQL and VoIPmonitor settings when migrating from standalone to client-server architecture?
  • How do I ensure that all sensors are visible in the GUI and correctly registered for remote management?
  • What are the current constraints and future plans (VS-1605) for native multi-tier VoIPmonitor deployments?
  • How do I forward SIP packets from a probe to a central server when SIP signaling and RTP media are captured on separate machines?
  • How do I configure `packetbuffer_sender=yes` with `server_destination` to merge SIP signaling from one location with RTP media from another?