NTop: A Complete Beginner’s Guide to Network Traffic MonitoringNetwork traffic monitoring lets you see what’s happening on your network: who’s talking to whom, which applications use the most bandwidth, and where performance problems or security anomalies may originate. NTop (often referred to as nTopng in its modern form) is a widely used, lightweight tool that provides real‑time and historical views of traffic, flows, protocols, and endpoints. This guide explains what NTop is, how it works, how to install and configure it, and how to use its features to monitor and troubleshoot networks.
What is NTop?
NTop is an open-source network traffic monitoring tool that inspects packets and aggregates them into flows, statistics, and visual dashboards. It evolved from the original nTop project into nTopng (nTop Next Generation), which offers a modern web interface, extensible plugins, and better performance. NTop can run on Linux, macOS, and many BSD systems, and it’s often deployed on routers, network probes, or dedicated monitoring servers.
Key facts
- NTop (nTopng) provides real‑time network traffic analysis and historical reporting.
- It inspects packets, builds flows, and presents visual dashboards and detailed host/application statistics.
Core concepts
- Packet capture: NTop captures packets from a network interface (or reads from pcap files) to analyze traffic.
- Flow aggregation: Packets are grouped into flows (conversations) between endpoints; flows reduce data volume and simplify analysis.
- Protocol and application detection: NTop classifies traffic by protocol and application using deep packet inspection (DPI) and heuristics.
- Hosts and interfaces: The tool tracks statistics per interface and per host (IP or MAC), including bytes, packets, throughput, and top talkers.
- Historical data: NTop can store time series and metadata to show trends, peaks, and historical usage.
- Alerts and thresholds: It can trigger alerts or flags based on thresholds and anomalies (depending on setup and licensing).
Editions and licensing
NTop offers multiple editions:
- Community/Open-source edition: Free, with core features suitable for many small to medium deployments.
- Professional/Enterprise editions: Paid versions with advanced features (longer data retention, enhanced DPI, clustering, integrations, commercial support).
Use cases
- Bandwidth monitoring: Identify top talkers, heavy users, and bandwidth-hungry applications.
- Performance troubleshooting: Correlate latency, throughput drops, or congestion with specific flows or hosts.
- Security monitoring: Spot unusual connections, port scans, suspicious flows, or unexpected protocols.
- Capacity planning: Analyze historical trends to plan upgrades or enforce QoS policies.
- Compliance and forensics: Retain flow metadata for auditing and incident investigation (when configured to store data).
Installing NTop (nTopng)
Below are concise installation steps for a common environment: a Linux server running a recent Ubuntu/Debian release. Adjust package names or steps for other distributions.
Prerequisites:
- A machine with network access to the traffic you want to monitor.
- Sudo/root privileges.
-
Add the nTop repository and install dependencies:
sudo apt-get update sudo apt-get install -y wget gnupg2 wget https://packages.ntop.org/apt/20.04/all/ntop.key sudo apt-key add ntop.key sudo wget https://packages.ntop.org/apt/20.04/all/ntop.list -O /etc/apt/sources.list.d/ntop.list sudo apt-get update
-
Install nTopng and supporting packages:
sudo apt-get install -y pfring nprobe ntopng ntopng-data
-
Start and enable the service:
sudo systemctl enable --now ntopng sudo systemctl status ntopng
-
Access the web UI: open a browser to http://
:3000 (default). The first-run wizard will ask to set admin credentials.
Notes:
- You may need to install nProbe (for NetFlow/IPFIX) or configure PF_RING for high-performance capture on busy links.
- On smaller setups you can run nTopng directly capturing from an interface (e.g., eth0) or reading a pcap.
Basic configuration
Configuration files are typically under /etc/ntopng/ or passed via command-line. Common options:
- –interface: which interface to capture (e.g., –interface “eth0”)
- –local-networks: CIDR list of local networks to categorize internal vs. external traffic
- –http-port: change the web UI port (default 3000)
- –data-dir: where nTopng stores its database and history
- –community: enable community features
Example systemd override (to monitor eth0):
- Create /etc/default/ntopng or edit /etc/ntopng/ntopng.conf and add:
-G=/var/run/ntopng.pid -i=eth0 --local-networks "192.168.0.0/16,10.0.0.0/8"
- Restart:
sudo systemctl restart ntopng
Web UI walkthrough
The nTopng web interface is organized into dashboards and detailed pages. Typical sections:
- Dashboard / Home: high-level traffic summaries, top hosts, top applications.
- Interfaces: per-interface throughput, packet rates, errors.
- Hosts: list of devices, with metadata, geolocation, bytes/packets, and protocols used.
- Flows/Connections: active and historical flows, with ports, bytes, duration.
- Protocols/Apps: breakdown of traffic by protocol or application (HTTP, DNS, TLS, BitTorrent, etc.).
- Alerts/Events: configured events and anomalies.
- Discovery: services observed per host (open ports, HTTP hosts).
Key actions:
- Click a host to see flows, protocols, historical charts, and enriched info (DNS names, MAC vendor).
- Filter by IP, protocol, or port to focus on particular traffic.
- Use time-range selector to compare intervals or view historical spikes.
Practical examples
- Find top bandwidth users
- Open Dashboard → Top Hosts or Interfaces. Sort by bytes or bandwidth to identify heavy consumers. Drill in to view individual flows and associated applications.
- Investigate a slow application
- Note the time of slowdown. Use the time-range selector in nTopng to inspect flows during that period. Look for retransmits, high RTT, or flows sharing the same path causing congestion.
- Detect suspicious traffic
- In Hosts or Flows, sort by unusual ports or external destinations. Use the Alerts view for port scans or anomalies. Cross-check DNS resolutions and GeoIP to spot unexpected remote endpoints.
- Retain flows for forensic review
- Configure data retention in the nTopng settings or export flows (e.g., as pcap, JSON, or via nProbe to an external collector).
Integrations and extensions
- nProbe: Flow exporter that converts packets to NetFlow/IPFIX for long-term collectors.
- Elasticsearch/Grafana: Export metrics to Elasticsearch for advanced querying and visualize in Grafana.
- SIEMs: Send alerts or flow records to SIEMs for correlation with other security logs.
- nthttp, plugins: nTopng supports plugins to extend protocol detection and add custom dashboards.
Performance and tuning
- Capture method: PF_RING or AF_PACKET with zero-copy improves performance on high-speed links.
- Sampling: Enable packet sampling or flow sampling if monitoring very high-volume links to reduce load.
- Hardware: Use a dedicated monitoring NIC and sufficient CPU/RAM for DPI and historical storage.
- Retention: Longer retention needs more storage; tune aggregation levels to balance granularity and disk use.
Troubleshooting common issues
- No traffic seen: ensure correct interface selected, check permissions (run as root or give capture capabilities), and confirm mirror/SPAN or inline placement.
- High CPU load: enable PF_RING, reduce DPI depth, or sample traffic.
- Missing application identification: some traffic is encrypted or obfuscated; ensure nTopng’s DPI and SSL/TLS fingerprinting are up to date and consider decrypting (only with authorization) if necessary.
- Web UI inaccessible: check firewall rules, confirm ntopng service is running, and validate the configured port.
Security and privacy considerations
- DPI inspects packet payloads for classification; be mindful of privacy and legal implications when capturing content.
- Limit UI access (HTTPS, strong admin password, IP‑based access control).
- If exporting flows to third parties, ensure data is anonymized if required by policy.
Example commands and snippets
Start nTopng on interface eth1:
sudo ntopng --interface "eth1" --local-networks "192.168.1.0/24"
Export traffic to NetFlow collector using nProbe (example):
sudo nprobe --collector-port 2055 --collector-ip 10.0.0.5 -i eth1
Further learning
- Read the official nTop documentation for advanced configuration and plugin development.
- Practice by deploying nTopng in a lab: run it on a VM, mirror traffic from a test switch, and experiment with filters, flows, and alerts.
- Combine nTopng with packet capture tools (tcpdump, Wireshark) for packet-level inspection after identifying suspicious flows.
NTop (nTopng) is a practical, scalable way to gain visibility into network behavior. Start small—monitor one interface, learn to read the dashboards and flows—then expand to flow export, retention, and integrations as needs grow.
Leave a Reply