Sniffing modes: Difference between revisions

From VoIPmonitor.org
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
= VoIPmonitor Deployment Guide =
{{DISPLAYTITLE:VoIPmonitor Deployment & Topology Guide}}


== Overview ==
'''This guide provides a comprehensive overview of VoIPmonitor's deployment models. It covers the fundamental choice between on-host and dedicated sensors, methods for capturing traffic, and detailed configurations for scalable, multi-site architectures.'''
VoIPmonitor can run '''on the same host''' as your PBX/SBC or on a '''dedicated sensor''' that receives mirrored traffic. 
This page lists supported deployment models, tunnelling methods, firewall rules and minimal configuration examples.


== Linux host capture ==
== Core Concept: Where to Capture Traffic ==
Running the sniffer directly on a PBX/SBC requires '''no extra hardware''' or topology changes, but adds CPU / RAM / I/O load to that host. 
The first decision in any deployment is where the VoIPmonitor sensor (sniffer) will run.
If sharing resources is unacceptable, use hardware or software mirroring instead.


== Hardware port mirroring ==
=== 1. On-Host Capture (on the PBX/SBC) ===
Port-mirroring (SPAN, RAP…) on your switch sends a copy of selected traffic to a dedicated Linux box running VoIPmonitor.
The sensor can be installed directly on the same Linux server that runs your PBX or SBC.
The sniffer interface is set to promiscuous mode automatically; to capture on multiple ports set <code>interface = any</code> and 
*'''Pros:''' Requires no extra hardware, network changes, or port mirroring. It is the simplest setup.
enable promiscuous mode on each NIC manually:
*'''Cons:''' Adds CPU, memory, and disk I/O load to your production voice server. If these resources are critical, a dedicated sensor is the recommended approach.
  ifconfig eth1 promisc


== Tunnelling options ==
=== 2. Dedicated Sensor ===
* IP-in-IP, GRE, ERSPAN – built-in 
A dedicated Linux server runs only the VoIPmonitor sensor. This is the recommended approach for production environments as it isolates monitoring resources from your voice platform. To use a dedicated sensor, you must forward a copy of the network traffic to it using one of the methods below.
* TZSP (Mikrotik) → <code>udp_port_tzsp = 37008</code> 
* L2TP → <code>udp_port_l2tp = 1701</code> 
* VXLAN (AWS) → <code>udp_port_vxlan = 4789</code> 
* [[audiocodes tunneling]] → <code>udp_port_audiocodes</code> / <code>tcp_port_audiocodes</code> 
* HEP3 → enable <code>hep*</code> options 
* IPFIX (Oracle SBC) → <code>ipfix*</code> options 


== Software packet mirroring ==
== Methods for Forwarding Traffic to a Dedicated Sensor ==
=== All-in-one ===
When the sniffer, MySQL and GUI share a host, the GUI reads PCAPs locally and connects to MySQL over <code>localhost</code>. 
No sensor records are required in the GUI.


=== Multiple remote sensors, one DB / GUI ===
=== A. Hardware Port Mirroring (SPAN/RSPAN) ===
A '''sensor''' (a.k.a. sniffer / probe) can operate in two main ways:
This is the most common and reliable method. You configure your physical network switch to copy all traffic from the switch ports connected to your PBX/SBC to the switch port connected to the VoIPmonitor sensor. This feature is commonly called '''Port Mirroring''', '''SPAN''', or '''RAP'''. Consult your switch's documentation for configuration details.
# '''Standard remote sniffer''' – processes packets locally, stores PCAPs locally, sends only CDRs to MySQL. GUI connects directly to each sensor’s management port.
# '''New client / server mode (v20+)''' – encrypted TCP channel between sensor and a '''central sniffer'''
  * Sensor can process packets locally and send only CDRs, '''or'''
  * mirror packets to the central sniffer for processing. 
  GUI talks only to the central sniffer; sensors can stay behind NAT.


;Summary of remote deployment modes
The VoIPmonitor sensor interface will be put into promiscuous mode automatically. To capture from multiple interfaces, set <code>interface = any</code> in <code>voipmonitor.conf</code> and enable promiscuous mode manually on each NIC (e.g., <code>ifconfig eth1 promisc</code>).
 
=== B. Software-based Tunnelling ===
When hardware mirroring is not an option, many network devices and PBXs can encapsulate VoIP packets and send them to the sensor's IP address using a tunnel. VoIPmonitor natively supports a wide range of protocols.
* '''Built-in Support:''' IP-in-IP, GRE, ERSPAN
* '''UDP-based Tunnels:''' Configure the corresponding port in <code>voipmonitor.conf</code>:
** <code>udp_port_tzsp = 37008</code> (for Mikrotik's TZSP)
** <code>udp_port_l2tp = 1701</code>
** <code>udp_port_vxlan = 4789</code> (Common in AWS environments)
* '''Proprietary & Other Protocols:'''
** [[audiocodes tunneling|AudioCodes Tunneling]] (uses <code>udp_port_audiocodes</code> or <code>tcp_port_audiocodes</code>)
** HEP (v3+) (enable <code>hep*</code> options)
** IPFIX (for Oracle SBCs) (enable <code>ipfix*</code> options)
 
== Distributed Deployment Models ==
For monitoring multiple remote offices or a large infrastructure, a distributed model is essential. This involves a central GUI/Database server collecting data from multiple remote sensors.
 
=== Classic Mode: Standalone Remote Sensors ===
In this traditional model, each remote sensor is a fully independent entity.
*'''How it works:''' The remote sensor processes packets and stores PCAPs locally. It connects directly to the central MySQL database to write CDRs. The central GUI must also have direct network access to each sensor's management port (default 5029) to fetch PCAP files.
*'''Pros:''' Simple conceptual model.
*'''Cons:''' Requires opening firewall ports to each sensor and managing database credentials on every remote machine.
 
=== Modern Mode: Client/Server Architecture (v20+) ===
This is the '''recommended''' model for all new distributed deployments. It uses a secure, encrypted TCP channel between remote sensors (clients) and a central sensor instance (server). The GUI only needs to communicate with the central server.
 
This model supports two modes of operation:
# '''Local Processing:''' Remote sensors process packets locally and send only the small CDR data over the encrypted channel. PCAPs remain on the remote sensor.
# '''Packet Mirroring:''' Remote sensors do '''no''' processing. They forward the entire raw packet stream over the encrypted channel to the central server, which handles all processing and storage. This is ideal for low-resource remote devices.
 
==== Comparison of Remote Deployment Modes ====
{| class="wikitable"
{| class="wikitable"
! Deployment
! Deployment Model
! Packet processing
! Packet Processing Location
! PCAP storage
! PCAP Storage Location
! Traffic to DB
! Network Traffic to Central Server
! GUI connectivity
! GUI Connectivity
|-
|-
| Standard remote sniffer
| Classic Standalone
| Remote
| Remote
| Remote
| Remote
| Minimal (CDR only)
| Minimal (MySQL CDRs)
| GUI&nbsp;&nbsp;sensor (management port)
| GUI ↔ each Sensor (management port)
|-
|-
| New client/server&nbsp;(v20+) – '''local processing'''
| '''Modern Client/Server (Local Processing)'''
| Remote
| Remote
| Remote
| Remote
| Encrypted&nbsp;TCP (CDR only)
| Minimal (Encrypted CDRs)
| GUI&nbsp;&nbsp;central sniffer
| '''GUI ↔ Central Server only'''
|-
|-
| New client/server&nbsp;(v20+) '''packet mirroring'''
| '''Modern Client/Server (Packet Mirroring)'''
| Central
| '''Central'''
| Central
| '''Central'''
| Encrypted&nbsp;TCP (full packets)
| High (Encrypted full packets)
| GUI&nbsp;&nbsp;central sniffer
| '''GUI ↔ Central Server only'''
|}
|}


=== New client / server configuration ===
== Configuration & Checklists ==
''client (remote) example''
 
  id_sensor              = <unique < 65536>
=== Client/Server Configuration Example ===
  server_destination      = <central-IP>
Below is a minimal configuration for the modern client/server model.
  server_destination_port = 60024
 
  server_password        = somepassword
;On each ''Remote Sensor (Client)'':
  ; uncomment next line to send full packet stream instead of local processing
<pre>
  ; packetbuffer_sender  = yes
# /etc/voipmonitor.conf on the remote sensor


''server (central) example''
id_sensor              = 2      # MUST be unique for each sensor, < 65536
  server_bind            = 0.0.0.0
server_destination      = 10.0.0.1 # IP address of your central server
  server_bind_port        = 60024
server_destination_port = 60024
  server_password        = somepassword
server_password        = your_strong_password
  ; remember to set mysql* options


Connection uses DH key-exchange + AES encryption and compression. 
# Optional: Uncomment the next line to enable packet mirroring mode
Sensors appear automatically in '''GUI → Settings → Sensors'''.
# packetbuffer_sender  = yes
</pre>


== Cloud mode ==
;On the ''Central Server'':
  id_sensor              = <unique>
<pre>
  cloud_token            = __your_token__
# /etc/voipmonitor.conf on the central server
  cloud_url              = https://cloud.voipmonitor.org/reg/register.php
  packetbuffer_file_path = /var/spool/voipmonitor/packetbuffer


== Firewall checklist ==
server_bind            = 0.0.0.0
* '''New client/server''' – central: 60024/TCP (probes) + 60024/TCP & 5029/TCP (GUI) 
server_bind_port        = 60024
* '''Old mirroring''' – central: 5030/TCP (probes) + 5029/TCP (GUI) 
server_password        = your_strong_password
* '''Standalone''' – DB: 3306/TCP (sensors) 
* '''Cloud''' – probes → cloud.voipmonitor.org :60023/TCP


== Time synchronisation ==
# Remember to configure mysql* options for the central database connection
All machines should run NTP with <code>minpoll 3</code> and <code>maxpoll 4</code>. Clock drift breaks call-leg correlation.
mysqlhost              = localhost
mysqldb                = voipmonitor
mysqluser              = root
mysqlpassword          = db_password
</pre>


== Migration hints ==
=== Firewall Checklist ===
You may run two instances on the same host (one with legacy <code>mirror_bind_ip</code>, one with new <code>server_bind</code>) by giving each:
* '''Modern Client/Server Mode (v20+):'''
* its own <code>id_sensor</code>, <code>managerport</code>, <code>spooldir</code>
** On '''Central Server:''' Allow inbound <code>TCP/60024</code> from remote sensors. Allow inbound <code>TCP/5029</code> for GUI management access.
* a separate init script and/or binary
* '''Cloud Mode:'''
** On '''Remote Sensors:''' Allow outbound <code>TCP/60023</code> to <code>cloud.voipmonitor.org</code>.


== Why choose the new mode? ==
=== Time Synchronization ===
* Encrypted, compressed transport 
Accurate and synchronized time is '''critical''' for correlating call legs from different sensors. All servers (GUI, DB, and all Sensors) must run an NTP client (like `chrony` or `ntpdate`) to keep their clocks in sync.
* One MySQL user on the central sniffer instead of many on each probe 
* GUI needs access only to the central sniffer, not to every probe 
* Optional off-loading of CPU/RAM from remote probes by mirroring packets 


For more details about multi-instance setups, contact support@voipmonitor.org.
== AI Summary for RAG ==
'''Summary:''' This guide covers the deployment topologies for VoIPmonitor. It contrasts running the sensor on the same host as a PBX versus on a dedicated server. For dedicated sensors, it details methods for forwarding traffic, including hardware-based port mirroring (SPAN) and various software-based tunneling protocols (IP-in-IP, GRE, TZSP, VXLAN, HEP, etc.). The core of the article explains distributed architectures for multi-site monitoring, comparing the "classic" standalone remote sensor model with the modern, recommended "client/server" model. It details the two operational modes of the client/server architecture: local processing (sending only CDRs) and packet mirroring (sending full, raw packets for central processing), which is ideal for low-resource endpoints. The guide concludes with minimal configuration examples and firewall rules for the client/server setup and emphasizes the critical importance of time synchronization using NTP.
'''Keywords:''' deployment, architecture, topology, on-host, dedicated sensor, port mirroring, SPAN, RSPAN, traffic mirroring, tunneling, GRE, TZSP, VXLAN, HEP, remote sensor, multi-site, client server mode, packet mirroring, local processing, firewall rules, NTP, time synchronization, cloud mode
'''Key Questions:'''
* How do I set up VoIPmonitor to monitor multiple remote locations?
* What is the difference between the classic remote sensor and the modern client/server mode?
* When should I use packet mirroring (packetbuffer_sender) instead of local processing?
* What are the firewall requirements for the client/server deployment model?
* Can I run the sensor on the same machine as my Asterisk/FreeSWITCH server?
* What is a SPAN port and how is it used with VoIPmonitor?
* Why is NTP important for a distributed VoIPmonitor setup?

Latest revision as of 10:37, 30 June 2025


This guide provides a comprehensive overview of VoIPmonitor's deployment models. It covers the fundamental choice between on-host and dedicated sensors, methods for capturing traffic, and detailed configurations for scalable, multi-site architectures.

Core Concept: Where to Capture Traffic

The first decision in any deployment is where the VoIPmonitor sensor (sniffer) will run.

1. On-Host Capture (on the PBX/SBC)

The sensor can be installed directly on the same Linux server that runs your PBX or SBC.

  • Pros: Requires no extra hardware, network changes, or port mirroring. It is the simplest setup.
  • Cons: Adds CPU, memory, and disk I/O load to your production voice server. If these resources are critical, a dedicated sensor is the recommended approach.

2. Dedicated Sensor

A dedicated Linux server runs only the VoIPmonitor sensor. This is the recommended approach for production environments as it isolates monitoring resources from your voice platform. To use a dedicated sensor, you must forward a copy of the network traffic to it using one of the methods below.

Methods for Forwarding Traffic to a Dedicated Sensor

A. Hardware Port Mirroring (SPAN/RSPAN)

This is the most common and reliable method. You configure your physical network switch to copy all traffic from the switch ports connected to your PBX/SBC to the switch port connected to the VoIPmonitor sensor. This feature is commonly called Port Mirroring, SPAN, or RAP. Consult your switch's documentation for configuration details.

The VoIPmonitor sensor interface will be put into promiscuous mode automatically. To capture from multiple interfaces, set interface = any in voipmonitor.conf and enable promiscuous mode manually on each NIC (e.g., ifconfig eth1 promisc).

B. Software-based Tunnelling

When hardware mirroring is not an option, many network devices and PBXs can encapsulate VoIP packets and send them to the sensor's IP address using a tunnel. VoIPmonitor natively supports a wide range of protocols.

  • Built-in Support: IP-in-IP, GRE, ERSPAN
  • UDP-based Tunnels: Configure the corresponding port in voipmonitor.conf:
    • udp_port_tzsp = 37008 (for Mikrotik's TZSP)
    • udp_port_l2tp = 1701
    • udp_port_vxlan = 4789 (Common in AWS environments)
  • Proprietary & Other Protocols:
    • AudioCodes Tunneling (uses udp_port_audiocodes or tcp_port_audiocodes)
    • HEP (v3+) (enable hep* options)
    • IPFIX (for Oracle SBCs) (enable ipfix* options)

Distributed Deployment Models

For monitoring multiple remote offices or a large infrastructure, a distributed model is essential. This involves a central GUI/Database server collecting data from multiple remote sensors.

Classic Mode: Standalone Remote Sensors

In this traditional model, each remote sensor is a fully independent entity.

  • How it works: The remote sensor processes packets and stores PCAPs locally. It connects directly to the central MySQL database to write CDRs. The central GUI must also have direct network access to each sensor's management port (default 5029) to fetch PCAP files.
  • Pros: Simple conceptual model.
  • Cons: Requires opening firewall ports to each sensor and managing database credentials on every remote machine.

Modern Mode: Client/Server Architecture (v20+)

This is the recommended model for all new distributed deployments. It uses a secure, encrypted TCP channel between remote sensors (clients) and a central sensor instance (server). The GUI only needs to communicate with the central server.

This model supports two modes of operation:

  1. Local Processing: Remote sensors process packets locally and send only the small CDR data over the encrypted channel. PCAPs remain on the remote sensor.
  2. Packet Mirroring: Remote sensors do no processing. They forward the entire raw packet stream over the encrypted channel to the central server, which handles all processing and storage. This is ideal for low-resource remote devices.

Comparison of Remote Deployment Modes

Deployment Model Packet Processing Location PCAP Storage Location Network Traffic to Central Server GUI Connectivity
Classic Standalone Remote Remote Minimal (MySQL CDRs) GUI ↔ each Sensor (management port)
Modern Client/Server (Local Processing) Remote Remote Minimal (Encrypted CDRs) GUI ↔ Central Server only
Modern Client/Server (Packet Mirroring) Central Central High (Encrypted full packets) GUI ↔ Central Server only

Configuration & Checklists

Client/Server Configuration Example

Below is a minimal configuration for the modern client/server model.

On each Remote Sensor (Client)
# /etc/voipmonitor.conf on the remote sensor

id_sensor               = 2      # MUST be unique for each sensor, < 65536
server_destination      = 10.0.0.1 # IP address of your central server
server_destination_port = 60024
server_password         = your_strong_password

# Optional: Uncomment the next line to enable packet mirroring mode
# packetbuffer_sender   = yes
On the Central Server
# /etc/voipmonitor.conf on the central server

server_bind             = 0.0.0.0
server_bind_port        = 60024
server_password         = your_strong_password

# Remember to configure mysql* options for the central database connection
mysqlhost               = localhost
mysqldb                 = voipmonitor
mysqluser               = root
mysqlpassword           = db_password

Firewall Checklist

  • Modern Client/Server Mode (v20+):
    • On Central Server: Allow inbound TCP/60024 from remote sensors. Allow inbound TCP/5029 for GUI management access.
  • Cloud Mode:
    • On Remote Sensors: Allow outbound TCP/60023 to cloud.voipmonitor.org.

Time Synchronization

Accurate and synchronized time is critical for correlating call legs from different sensors. All servers (GUI, DB, and all Sensors) must run an NTP client (like `chrony` or `ntpdate`) to keep their clocks in sync.

AI Summary for RAG

Summary: This guide covers the deployment topologies for VoIPmonitor. It contrasts running the sensor on the same host as a PBX versus on a dedicated server. For dedicated sensors, it details methods for forwarding traffic, including hardware-based port mirroring (SPAN) and various software-based tunneling protocols (IP-in-IP, GRE, TZSP, VXLAN, HEP, etc.). The core of the article explains distributed architectures for multi-site monitoring, comparing the "classic" standalone remote sensor model with the modern, recommended "client/server" model. It details the two operational modes of the client/server architecture: local processing (sending only CDRs) and packet mirroring (sending full, raw packets for central processing), which is ideal for low-resource endpoints. The guide concludes with minimal configuration examples and firewall rules for the client/server setup and emphasizes the critical importance of time synchronization using NTP. Keywords: deployment, architecture, topology, on-host, dedicated sensor, port mirroring, SPAN, RSPAN, traffic mirroring, tunneling, GRE, TZSP, VXLAN, HEP, remote sensor, multi-site, client server mode, packet mirroring, local processing, firewall rules, NTP, time synchronization, cloud mode Key Questions:

  • How do I set up VoIPmonitor to monitor multiple remote locations?
  • What is the difference between the classic remote sensor and the modern client/server mode?
  • When should I use packet mirroring (packetbuffer_sender) instead of local processing?
  • What are the firewall requirements for the client/server deployment model?
  • Can I run the sensor on the same machine as my Asterisk/FreeSWITCH server?
  • What is a SPAN port and how is it used with VoIPmonitor?
  • Why is NTP important for a distributed VoIPmonitor setup?