AI-Driven DDoS Detection & Mitigation for 5G Networks using Machine Learning + SDN + Real-Time Analytics
Sentinel AI is an enterprise-grade, AI-powered 5G DDoS Detection & Mitigation System integrating:
- Machine Learning (Python + Flask)
- Software-Defined Networking (SDN) via Ryu Controller
- Mininet network emulation
- React real-time monitoring dashboard
- Node.js backend orchestration
- Locust traffic & DDoS load testing
The system delivers real-time attack detection, network slice intelligence, and autonomous mitigation using OpenFlow rules.
- Ensemble ML models: RandomForest, XGBoost, LightGBM, LSTM, SVM
- Sub-50ms real-time inference
- 17+ flow features extracted from Scapy/pyshark
- eMBB (High Bandwidth)
- URLLC (Low Latency)
- mMTC (IoT)
- Automatically blocks malicious IPs
- Auto-unblocks after recovery
- Falls back to rule-based detection if ML model fails
- Dynamic flow rules
- DROP/FORWARD decisions
- IP quarantine system
- Live traffic charts
- Slice classifier
- Blocked IP list
- Detection confidence
- ML logs & alerts
βββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββ
β Traffic β ---> β Packet Capture β ---> β Feature β
β (Real/Simulated)β β (Scapy / Pyshark) β β Extraction β
βββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββ
β Network Slicing β <--- β ML Engine β ---> β Backend API β
β eMBB/URLLC/mMTC β β RandomForest etc. β β Node.js β
βββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββ
β Ryu SDN β <--- β Mitigation Logic β ---> β React Dashboard β
β Controller β β Auto-block IPs β β Real-time UI β
βββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββ
Sentinel-AI/
β
βββ frontend/ # React Dashboard (Port 5173)
βββ backend/ # Node.js API Server (Port 3000)
βββ model/ # ML Engine + Flask API (Port 5001)
β
βββ README.md
βββ LICENSE
sequenceDiagram
participant M as Mininet
participant R as Ryu Controller
participant F as Flask API
participant ML as ML Model
participant N as Node Backend
participant D as Dashboard
M->>R: Network Traffic
R->>F: Flow Statistics
F->>ML: Processed Data
ML-->>F: Attack Detection
F->>R: Mitigation Rules
F->>N: Alert Updates
N->>D: Real-time Visualization
wsl --install
wsl --install -d Ubuntu-20.04sudo apt update
sudo apt upgrade
sudo apt install mininet -y
sudo mn --test pingallsudo apt install -y python3-pip
pip3 install --upgrade pip setuptools wheel
pip3 install eventlet==0.33.3
pip3 install ryupython3.8 -m venv ryu-venv
source ryu-venv/bin/activate
ryu-manager --versionsource ryu-venv/bin/activate
ryu-manager ryu.app.simple_switch_13 ryu.app.ofctl_restsudo mn --topo single,3 --mac --switch ovsk \
--controller=remote,ip=127.0.0.1,port=6633cd backend
npm install
npm startcd frontend
npm install
npm run devcd model
pip install -r requirements.txt
cd app
python app.pypip install locustlocust -f locustfile.pyhttp://localhost:8089
| Model | Purpose |
|---|---|
| Random Forest | Primary classifier |
| XGBoost | Gradient boosted accuracy |
| LightGBM | Fast, memory-efficient |
| LSTM | Temporal behavior detection |
| SVM | Boundary-based detection |
| Logistic Regression | Baseline |
| KNN | Similarity detection |
The backend issues:
- DROP rules for blocking malicious IPs
- ALLOW rules for clean traffic
- Flow cleanup after threat resolves
Protocols used:
- OpenFlow 1.3
- REST API of
ryu.app.ofctl_rest
DDoS Detected
β
Block IP (OpenFlow DROP rule)
β
Monitor traffic for recovery
β
Auto-unblock IP
β
System returns to stable state
- Live packet monitoring
- Threat alerts
- Real-time ML predictions
- Slice classification
- Blocked IP list
- System health & status
- Docker & Kubernetes deployment
- Federated learning for edge devices
- 5G NR physical-layer packet support
- GPU-accelerated inference
This project is for academic and research use. Refer to the LICENSE file for details.
Sentinel AI provides a complete, autonomous, real-time DDoS defense system for modern 5G networks, utilizing:
- AI
- SDN
- Network slicing
- Real-time analytics
- Self-healing mechanisms
Perfect for research, enterprise labs, and advanced cybersecurity projects.