This project demonstrates real-time monitoring, detection, and mitigation of Denial-of-Service (DoS) attacks in an SDN environment. It uses a custom POX controller module (traffic_monitoring.py) and a Mininet virtual network topology to simulate both legitimate and malicious traffic, detect anomalies, and automatically block offending hosts.
- Features
- Prerequisites
- Installation
- Network Topology
- Usage
- Test Cases
- Wireshark Analysis (Optional)
- Performance Verification
- Contributing
- License
- Custom Mininet topology with multiple hosts and switches
- Traffic-monitoring POX module to compute per-port byte and packet rates
- Anomaly detection based on configurable thresholds (packet rate, throughput)
- Dynamic flow-rule insertion to block malicious IPs
- Real-time controller logging for visibility
- Python 3.x
- Mininet 2.3+
- POX SDN controller
hping3,iperf3(for traffic generation)- (Optional) Wireshark
git clone https://github.com/noxrepo/pox.git
cd pox- Copy
traffic_monitoring.pyinto thepox/extdirectory
cp /path/to/traffic_monitoring.py ext/- Save
topology.pyinto your working directory (outside thepox/directory)
cp /path/to/topology.py ~/mininet_topo/- The custom topology simulates multiple hosts and switches as defined in
topology.py. - Use Mininet CLI commands to verify connectivity and test network behavior.
sudo python3 ~/mininet_topo/topology.py- Verify connectivity using:
pingallcd pox
./pox.py traffic_monitoring- For detailed debugging logs, run:
./pox.py log.level --DEBUG traffic_monitoring- Open terminal windows for hosts using
xterm:
xterm h3
python3 -m http.server 80 # Start HTTP server on h3xterm h1
iperf -c <h3_IP> -u -b 10M -t 60 # Normal traffic from h1 to h3xterm h2
hping3 -S --flood -V -p 80 <h3_IP> # Simulate SYN flood DoS attack from h2 to h3- Watch POX controller logs for anomaly detection and blocking notifications.
- Confirm blocking by pinging h3 from h2 (ping should fail if blocked).
- Validate that legitimate traffic from other hosts continues normally.
- Start POX controller and verify switch connections and traffic stats.
- Look for log entries indicating anomalies and blocked IPs.
- Use
iperffor normal traffic andhping3for malicious traffic. - Confirm POX logs detect anomalies and block attackers.
- Confirm malicious IPs are blocked with flow mods.
- Check legitimate hosts maintain connectivity.
sudo apt-get install wireshark
sudo wireshark- Capture traffic on Mininet virtual interfaces.
- Use filters like
tcp.port == 80to observe HTTP traffic and attack patterns.
- Measure server response time and throughput under normal conditions (e.g., ~20ms response, 10MB/s throughput).
- During attacks, expect degraded performance (response time >50ms, throughput <5MB/s).
- After mitigation, confirm server performance returns to baseline.
- Contributions, issues, and feature requests are welcome!
- Feel free to fork the repository and submit pull requests.
This project is licensed under the MIT License.
For questions or help, please open an issue.