How ash0545/sdn-ml-ids works
This repository is a research project for emulating an SDN, collecting labeled network-flow data, processing it, and training and evaluating intrusion-detection models. The main workflow runs an emulated topology with generated normal or attack traffic, collects flow/port/table statistics through Ryu, stores CSV datasets, then preprocesses data and compares models. The IDS controller also classifies live flows using a scaler, PCA, and Random Forest. README documents additional processing and model-analysis capabilities; their implementations are not shown in the excerpts, so those links are documented rather than inferred from source calls.
Main entry points: mininet_topology.py Mininet topology · ofctl_collector_controller.py Statistics collector · controller.py Live IDS controller · Collected Dataset Collected flow CSVs
Components 17
Network topology
- Mininet topology
Network Topology/mininet_topology.py
Traffic generation
- Attack traffic
Dataset Collection/Attack Traffic Generation - Normal traffic
Dataset Collection/Normal Traffic Generation
Collection and IDS
- Learning switch
Dataset Collection/Ryu Controller/modified_simple_switch_13.py - Statistics collector
Dataset Collection/Ryu Controller/ofctl_collector_controller.py - Live IDS controller
Dataset Collection/Ryu Controller/IDS/controller.py - Flow classifier
Dataset Collection/Ryu Controller/IDS/ml_alg.py - IDS model artifacts
Dataset Collection/Ryu Controller/IDS
Dataset and processing
- Collected flow CSVs
Dataset Collection/Collected Dataset - Dataset processing
Data Processing/data_processing.ipynb - Feature selection
Data Processing/data_processing.ipynb - Scaling and reduction
Data Processing/data_processing.ipynb
Modeling and analysis
- Model comparison
Model Training & Analysis - Model evaluation
Model Training & Analysis - Earlier IP1202 work
Previous Work - IP1202
Other components
- Experiment operator
- Ryu ofctl REST
Connections 19
- Experiment operator → Mininet topology: starts emulation
README.md - Experiment operator → Attack traffic: generates attacks
README.md - Experiment operator → Normal traffic: generates normal
README.md - Mininet topology → Learning switch: connects controller
- Attack traffic → Mininet topology: sends traffic
README.md - Normal traffic → Mininet topology: sends traffic
README.md - Statistics collector → Learning switch: inherits from
Dataset Collection/Ryu Controller/ofctl_collector_controller.py - Statistics collector → Ryu ofctl REST: requests statistics
Dataset Collection/Ryu Controller/ofctl_collector_controller.py - Statistics collector → Collected flow CSVs: appends rows
Dataset Collection/Ryu Controller/ofctl_collector_controller.py - Live IDS controller → Learning switch: inherits from
Dataset Collection/Ryu Controller/IDS/controller.py - Live IDS controller → Ryu ofctl REST: requests statistics
Dataset Collection/Ryu Controller/IDS/controller.py - Live IDS controller → Flow classifier: classifies flows
Dataset Collection/Ryu Controller/IDS/controller.py - Flow classifier → IDS model artifacts: loads models
Dataset Collection/Ryu Controller/IDS/ml_alg.py - Collected flow CSVs → Dataset processing: provides data
- Dataset processing → Feature selection: prepares features
README.md - Feature selection → Scaling and reduction: selects then reduces
README.md - Scaling and reduction → Model comparison: transformed data
README.md - Model comparison → Model evaluation: compares performance
README.md - Earlier IP1202 work → Collected flow CSVs: includes prior datasets
Previous Work - IP1202/Model Training and Analysis/final_model_export.py