Real-time Network Traffic Analysis Dashboard
A professional-grade network monitoring tool that provides complete visibility into your local network. Discover connected devices, monitor bandwidth usage, track DNS queries, identify network services, and analyze traffic patterns in real-time through an intuitive web interface.
- π± Device Discovery - Automatically scan and discover all connected devices on your network with nmap
- π DNS Tracking - See which websites and domains are being accessed by each device
- π Service Detection - Identify network services (HTTP, SSH, MySQL, RDP, etc.) using port analysis
- π Bandwidth Analytics - Real-time bandwidth monitoring with per-device and network-wide metrics
- π Traffic Timeline - Visualize network activity over time with interactive charts
- ποΈ Per-Device Monitoring - Focus on a single device to see detailed statistics and activity
- Real-time Processing - Packet capture and analysis with zero latency
- Automatic Discovery - Network range auto-detection
- Device Status Tracking - Online/offline device status
- Low Memory Footprint - Efficient packet storage with circular buffer
- Thread-safe Operations - Robust background processing
- Professional Logging - Comprehensive logging for debugging and monitoring
- Python 3.8+
- Ubuntu/Debian (or compatible Linux)
- nmap - Network scanning utility
- Sudo access - Required for packet capture
-
Clone or download the project:
cd ~/Desktop/network-dashboard
-
Create virtual environment:
python3 -m venv .venv source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Ensure nmap is installed:
sudo apt-get update sudo apt-get install -y nmap
Run the dashboard:
sudo /path/to/.venv/bin/streamlit run dashboard.pyOpen in browser:
http://localhost:8501
π‘ Note: Requires sudo for packet capture privileges
streamlit>=1.28.0 # Web dashboard framework
pandas>=2.0.0 # Data processing
scapy>=2.5.0 # Packet capture
plotly>=5.17.0 # Interactive visualizations
python-nmap>=0.0.1 # Network scanning
network-dashboard/
βββ README.md # This file
βββ requirements.txt # Python dependencies
βββ config.py # Configuration constants
βββ dashboard.py # Main Streamlit application
β
βββ src/ # Source modules
β βββ __init__.py
β βββ packet_processor.py # Packet capture & analysis
β βββ network_scanner.py # Device discovery
β βββ utils.py # Utility functions
β
βββ .venv/ # Virtual environment (created after setup)
βββββββββββββββββββββββββββββββββββββββββββ
β Streamlit Web Interface β
β (Dashboard β’ Device Selection β’ Stats) β
ββββββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββ΄βββββββββββ
β β
βββββββββΌβββββββββββ ββββββββΌβββββββββββ
β PacketProcessor β β NetworkScanner β
β β β β
β β’ Capture β β β’ nmap scan β
β β’ Extract DNS β β β’ Device list β
β β’ Port analysis β β β’ Status track β
β β’ Per-device β β β
β stats β β β
ββββββββββ¬ββββββββββ ββββββββββ¬βββββββββ
β β
ββββββββββββββ¬βββββββββ
β
βββββββββββΌβββββββββ
β Linux Kernel β
β β’ Packet capture β
β β’ nmap scanning β
ββββββββββββββββββββ
-
Device Discovery
- Scanner runs periodic network scans (every 30 seconds)
- Identifies online/offline devices
- Maintains device hostname cache
-
Packet Capture
- Scapy sniffs all IP packets on the network
- Extracts protocol, ports, DNS queries
- Aggregates per-device statistics
-
Data Visualization
- Streamlit renders real-time dashboard
- Updates every 2 seconds
- User selects device to focus monitoring
- Top devices by bandwidth and packets
- Protocol distribution (TCP/UDP/ICMP)
- Top network services
- Bandwidth timeline
- All connected devices table
- Device metrics (packets, bandwidth, services, domains)
- Websites visited (DNS queries)
- Services used (port analysis)
- Traffic timeline
- Recent packets captured
Edit config.py to customize:
# Scan frequency (seconds)
NETWORK_SCAN_INTERVAL = 30
# Network range (auto-detected by default)
DEFAULT_NETWORK_RANGE = "192.168.1.0/24"
# Maximum packets to keep in memory
MAX_PACKETS_STORED = 10000# Solution: Run with sudo
sudo /path/to/.venv/bin/streamlit run dashboard.py- Check if nmap is installed:
which nmap - Verify network range:
hostname -I - Manual scan test:
sudo nmap -sn 192.168.1.0/24 - Click "π Scan Now" button to force rescan
- Generate network traffic:
ping google.comorcurl https://google.com - Check packet capture interface
- Verify running with sudo
- Reduce
MAX_PACKETS_STOREDin config - Check system resources:
free -h - Monitor logs for errors
Supports 24+ common services:
- HTTP/HTTPS (80, 443)
- SSH (22)
- DNS (53)
- FTP (20, 21)
- SMTP/POP3/IMAP (25, 110, 143)
- MySQL/PostgreSQL (3306, 5432)
- RDP (3389)
- MongoDB (27017)
- And many more...
- Packet Capture: Requires root/sudo - ensure you run in trusted environments
- DNS Logging: All DNS queries are captured - be aware of privacy implications
- Network Access: Only use on networks you own or have permission to monitor
- Data Storage: Packets kept in memory only - no persistent storage by default
Improvements welcome! Feel free to:
- Report bugs and issues
- Suggest new features
- Submit improvements
- Optimize performance
MIT License - See LICENSE file for details
NetLens Contributors - Professional network monitoring made simple.
Last Updated: April 2026
Version: 1.0.0
Status: Production Ready