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