Real-time ML-powered traffic classification & adaptive QoS scheduling — pure Python, no root, any OS.
pip install -r requirements.txt
streamlit run app.pyThat's it. Open the URL Streamlit prints (usually http://localhost:8501).
| File | Purpose |
|---|---|
traffic_generator.py |
Fake traffic engine — simulates VIDEO, AUDIO, GAMING, DOWNLOAD packets |
ml_classifier.py |
Random Forest classifier trained on packet features at startup |
scheduler.py |
FIFO (dumb) vs AI-weighted (smart) bandwidth scheduler |
network_viz.py |
Matplotlib network topology diagram & QoS comparison charts |
app.py |
Streamlit dashboard — dark theme, live updating, three-column layout |
- Watch the dashboard auto-update every second with new traffic data
- Click
⚡ ENABLE AI SCHEDULERto switch from FIFO to AI-weighted mode - Click
🔴 START CONGESTIONto simulate a bandwidth bottleneck (10 Mbps cap) - Compare the DUMB (grey) vs SMART (blue) lines on the QoS charts
| Mode | Behaviour |
|---|---|
| DUMB (FIFO) | All traffic suffers equally — latency spikes, packet loss rises uniformly |
| SMART (AI) | Downloads get throttled first; audio/video stay smooth with minimal impact |
- Algorithm: Random Forest (100 trees, max depth 12)
- Features:
packet_size,inter_arrival_time,burst_rate,protocol_number - Labels:
VIDEO,AUDIO,GAMING,DOWNLOAD - Training: 8,000 synthetic samples generated at startup
- Accuracy: Typically 95%+ on test set
- Python 3.9+
- No root / admin privileges needed
- No real network access required
- Works on Windows, macOS, and Linux
This project uses zero real network tools. No Mininet, no tc, no iptables, no Open vSwitch, no Scapy, no pyshark, no real sockets. Everything is pure Python simulation.