A DDoS Detection Method Based on Feature Engineering and Machine Learning in Software-Defined Networks
Abstract
:1. Introduction
- Perform a series of feature engineering on the dataset, including data cleaning, transformation, and feature extraction and selection using an improved binary grey wolf optimization algorithm to obtain the optimal feature subset.
- Train and test five different machine learning classifiers with the optimal feature subset and compare the results of this work with the classification results using the original dataset.
- Deploy the optimal classifier in the SDN controller for DDoS detection and take appropriate action if an attack is detected.
- Evaluate, validate, and compare the proposed approach with existing research.
2. Related Work
3. Relevant Knowledge
3.1. Standard Grey Wolf Optimization Algorithm
3.2. Binary Grey Wolf Optimization Algorithm
4. Methodology
4.1. Data Preprocessing and Feature Extraction
4.1.1. Selection of the Dataset
4.1.2. Data Cleaning for the Dataset
4.1.3. Data Transformation
4.1.4. Feature Extraction
- 1.
- Initialization based on chaotic mapping algorithm
- 2.
- Setting of Nonlinear Search Parameters
- 3.
- Improve position updating method
Algorithm 1: Improved binary grey wolf optimization algorithm. |
Input: n Number of grey wolves in the pack, Iter Number of iterations for optimization. Output: Optimal grey wolf binary position, Best fitness value. 1: Begin 2: Initialize the population according to Equation (13). 3: Calculate the fitness value of the group and find and . 4: While (t < Iter): 5: For each population: 6: Update position to a binary position according to Equations (9) and (17) 7: end for 8: Update a according to Equations (14)–(16). 9: Update A and C according to Equations (3) and (4). 10: Evaluate the positions of individual wolves according to Equation (11). 11: Update , and according to Equations (7) and (8) 12: t = t + 1 13: end while 14: return 15: End |
4.2. Classifiers Used
4.2.1. Support Vector Machines (SVMs)
4.2.2. Random Forest (RF)
4.2.3. Decision Trees
4.2.4. XGBoost
4.2.5. K-Nearest Neighbors (k-NN)
- Calculate the distance between the sample to be classified and each sample in the training set (usually using the Euclidean distance or Manhattan distance).
- Select the K available class samples closest to the sample to be classified in ascending order of distance.
- Determine the category of the sample to be classified based on the categories of these K samples through majority voting. It is usually preferred to select an odd number for K to avoid tied votes.
4.3. Mitigation Strategies
Algorithm 2: Mitigation procedure. |
1: Begin 2: get corresponding Datapath 3: set matching criteria with respect to 4: send a flow modification message to switch 5: drop packets corresponding to of 6: End |
5. Experiments and Analysis of Results
5.1. Experimental Environment
5.2. Evaluation Criteria
- 1.
- Accuracy: Accuracy refers to the proportion of correctly predicted samples compared with the total number of samples in the prediction process.
- 2.
- Precision: Precision is defined as the percentage of samples correctly predicted as positive out of all samples predicted as positive.
- 3.
- Recall: Recall is the proportion of true positive samples to all positive samples.
- 4.
- F1 score: F1 score is a metric used to evaluate the accuracy of optimistic class predictions. It represents the ratio of correctly identified positive samples to all samples predicted as positive.
- 5.
- ROC curve: The ROC curve is a graphical representation of a model’s classification performance, with better-performing models having higher curves and larger areas underneath. Typically, the AUCROC is used to evaluate model performance based on the area under the ROC curve. A value of one indicates near-perfect classification, while lower values indicate poorer model performance.
5.3. Analysis of Results
5.3.1. Performance of Each Classification Model
5.3.2. Performance in DDoS Attack Detection
5.3.3. Comparison with Other Work
6. Conclusions and Future Work
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Varghese, J.E.; Muniyal, B. An Efficient IDS Framework for DDoS Attacks in SDN Environment. IEEE Access 2021, 9, 69680–69699. [Google Scholar] [CrossRef]
- Wu, Q.; Shi, S.; Wan, Z.; Fan, Q.; Fan, P.; Zhang, C. Towards V2I Age-aware Fairness Access: A DQN Based Intelligent Vehicular Node Training and Test Method. Chin. J. Electr. 2023, in press. [Google Scholar]
- Ashraf, J.; Moustafa, N.; Bukhshi, A.D.; Javed, A. Intrusion Detection System for SDN-enabled IoT Networks using Machine Learning Techniques. In Proceedings of the 2021 IEEE 25th International Enterprise Distributed Object Computing Workshop (EDOCW), Gold Coast, Australia, 25–29 October 2021. [Google Scholar]
- Liu, Y.; Zhao, B.; Zhao, P.; Fan, P.; Liu, H. A Survey: Typical Security Issues of Software-Defined Networking. China Commun. 2019, 16, 13–31. [Google Scholar] [CrossRef]
- Alzahrani, A.O.; Alenazi, M.J.F. Designing a Network Intrusion Detection System Based on Machine Learning for Software Defined Networks. Future Internet 2021, 13, 111. [Google Scholar] [CrossRef]
- Mona, A.; Waqas, K.Q.; Muhammad, T.; Muhammad, S.; Mai, A.; Fazila, M. Machine-Learning-Based DDoS Attack Detection Using Mutual Information and Random Forest Feature Importance Method. Symmetry 2022, 14, 1095. [Google Scholar]
- Catak, F.O.; Mustacoglu, A.F. Distributed denial of service attack detection using autoencoder and deep neural networks. J. Intell. Fuzzy Syst. 2019, 37, 3969–3979. [Google Scholar] [CrossRef]
- Ali, T.E.; Chong, Y.-W.; Manickam, S. Machine Learning Techniques to Detect a DDoS Attack in SDN: A Systematic Review. Appl. Sci. 2023, 13, 3183. [Google Scholar] [CrossRef]
- Rashid, M.; Kamruzzaman, J.; Imam, T.; Wibowo, S.; Gordon, S. A tree-based stacking ensemble technique with feature selection for network intrusion detection. Appl. Intell. 2022, 52, 9768–9781. [Google Scholar] [CrossRef]
- Dora, V.R.S.; Lakshmi, V.N. Optimal feature selection with CNN-feature learning for DDoS attack detection using meta-heuristic-based LSTM. Int. J. Intell. Robot. Appl. 2022, 6, 323–349. [Google Scholar] [CrossRef]
- Sharma, B.; Sharma, L.; Lal, C. Feature Selection and Deep Learning Technique for Intrusion Detection System in IoT. In Proceedings of the International Conference on Computational Intelligence, Pune, India, 29–30 December 2022. [Google Scholar]
- Mestres, A.; Rodriguez-Natal, A.; Carner, J.; Barlet-Ros, P.; Alarcón, E.; Solé, M.; Muntés-Mulero, V.; Meyer, D.; Barkai, S.; Hibbett, M.J.; et al. Knowledge-Defined Networking. SIGCOMM Comput. Commun. Rev. 2017, 47, 2–10. [Google Scholar] [CrossRef] [Green Version]
- Janiesch, C.; Zschech, P.; Heinrich, K. Machine learning and deep learning. Electron. Mark. 2021, 31, 685–695. [Google Scholar] [CrossRef]
- Polat, H.; Polat, O.; Cetin, A. Detecting DDoS Attacks in Software-Defined Networks Through Feature Selection Methods and Machine Learning Models. Sustainability 2020, 12, 1035. [Google Scholar] [CrossRef] [Green Version]
- Beitollahi, H.; Sharif, D.M.; Fazeli, M. Application Layer DDoS Attack Detection Using Cuckoo Search Algorithm-Trained Radial Basis Function. IEEE Access 2022, 10, 63844–63854. [Google Scholar] [CrossRef]
- Mishra, A.; Gupta, N.; Gupta, B.B. Defensive mechanism against DDoS attack based on feature selection and multi-classifier algorithms. Telecommun. Syst. 2023, 82, 229–244. [Google Scholar] [CrossRef]
- Aamir, M.; Zaidi, S.M.A. DDoS attack detection with feature engineering and machine learning: The framework and performance evaluation. Int. J. Inf. Secur. 2019, 18, 761–785. [Google Scholar] [CrossRef]
- Maheshwari, A.; Mehraj, B.; Khan, M.S.; Idrisi, M.S. An optimized weighted voting based ensemble model for DDoS attack detection and mitigation in SDN environment. Microprocess. Microsyst. 2022, 89, 104412. [Google Scholar] [CrossRef]
- Akgun, D.; Hizal, S.; Cavusoglu, U. A new DDoS attacks intrusion detection model based on deep learning for cybersecurity. Comput. Secur. 2022, 118, 102748. [Google Scholar] [CrossRef]
- Karatas, G.; Demir, O.; Sahingoz, O.K. Increasing the Performance of Machine Learning-Based IDSs on an Imbalanced and Up-to-Date Dataset. IEEE Access 2020, 8, 32150–32162. [Google Scholar] [CrossRef]
- Polat, H.; Türkoğlu, M.; Polat, O.; Şengür, A. A novel approach for accurate detection of the DDoS attacks in SDN-based SCADA systems based on deep recurrent neural networks. Expert Syst. Appl. 2022, 197, 116748. [Google Scholar] [CrossRef]
- Thangasamy, A.; Sundan, B.; Govindaraj, L. A Novel Framework for DDoS Attacks Detection Using Hybrid LSTM Techniques. Comput. Syst. Sci. Eng. 2023, 45, 2553–2567. [Google Scholar] [CrossRef]
- Zhou, L.; Zhu, Y.; Xiang, Y.; Zong, T. A novel feature-based framework enabling multi-type DDoS attacks detection. World Wide Web 2023, 26, 163–185. [Google Scholar] [CrossRef]
- Chouhan, R.K.; Atulkar, M.; Nagwani, N.K. A framework to detect DDoS attack in Ryu controller based software defined networks using feature extraction and classification. Appl. Intell. 2023, 53, 4268–4288. [Google Scholar] [CrossRef]
- Shi, D.; Mudar, S. DDoS Attack Detection Method Based on Improved KNN With the Degree of DDoS Attack in Software-Defined Networks. IEEE Access 2019, 8, 5039–5048. [Google Scholar]
- Ahuja, N.; Singal, G.; Mukhopadhyay, D.; Kumar, N. Automated DDOS attack detection in software defined networking. J. Netw. Comput. Appl. 2021, 187, 103108. [Google Scholar] [CrossRef]
- Mirjalili, S.; Mirjalili, S.M.; Lewis, A. Grey Wolf Optimizer. Adv. Eng. Softw. 2014, 69, 46–61. [Google Scholar] [CrossRef] [Green Version]
- Al-Tashi, Q.; Kadir, S.J.A.; Rais, H.M.; Mirjalili, S.; Alhussian, H. Binary Optimization Using Hybrid Grey Wolf Optimization for Feature Selection. IEEE Access 2019, 7, 39496–39508. [Google Scholar] [CrossRef]
- Emary, E.; Zawbaa, H.M.; Hassanien, A.E. Binary grey wolf optimization approaches for feature selection. Neurocomputing 2016, 172, 371–381. [Google Scholar] [CrossRef]
- Wang, Z.; Zeng, Y.; Liu, Y.; Li, D. Deep Belief Network Integrating Improved Kernel-Based Extreme Learning Machine for Network Intrusion Detection. IEEE Access 2021, 9, 16062–16091. [Google Scholar] [CrossRef]
- Singh, G.; Khare, N. A survey of intrusion detection from the perspective of intrusion datasets and machine learning techniques. Int. J. Comput. Appl. 2022, 44, 659–669. [Google Scholar] [CrossRef]
- Yu, Y.; Gao, S.; Cheng, S.; Wang, Y.; Song, S.; Yuan, F. CBSO: A memetic brain storm optimization with chaotic local search. Memetic Comput. 2018, 10, 353–367. [Google Scholar] [CrossRef]
- Pan, H.; Chen, S.; Xiong, H. A high-dimensional feature selection method based on modified Gray Wolf Optimization. Appl. Soft Comput. 2023, 135, 110031. [Google Scholar] [CrossRef]
- Alhijawi, B.; Almajali, S.; Elgala, H.; Bany Salameh, H.; Ayyash, M. A survey on DoS/DDoS mitigation techniques in SDNs: Classification, comparison, solutions, testing tools and datasets. Comput. Electr. Eng. 2022, 99, 107706. [Google Scholar] [CrossRef]
- Idris, S.; Ishaq, O.O.; Juliana, N.N. Intrusion Detection System Based on Support Vector Machine Optimised with Cat Swarm Optimization Algorithm. In Proceedings of the 2019 2nd International Conference of the IEEE Nigeria Computer Chapter (NigeriaComputConf), Zaria, Nigeria, 14–17 October 2019. [Google Scholar]
- Gu, J.; Wang, L.; Wang, H.; Wang, S. A novel approach to intrusion detection using SVM ensemble with feature augmentation. Comput. Secur. 2019, 86, 53–62. [Google Scholar] [CrossRef]
- Manghnani, T.; Thirumaran, T. Computational CBGSA—SVM Model for Network Based Intrusion Detection System. In Proceedings of the International Conference on Applications and Techniques in Information Security, Tamil Nadu, India, 22–24 November 2019. [Google Scholar]
- Anyanwu, G.O.; Nwakanma, C.I.; Lee, J.-M.; Kim, D.-S. RBF-SVM kernel-based model for detecting DDoS attacks in SDN integrated vehicular network. Ad Hoc Netw. 2023, 140, 103026. [Google Scholar] [CrossRef]
- Najar, A.A.; Manohar Naik, S. DDoS attack detection using MLP and Random Forest Algorithms. J. Inf. Technol. 2022, 14, 2317–2327. [Google Scholar] [CrossRef]
- Mohsin, M.A.; Hamad, A.H. Performance Evaluation of SDN DDoS Attack Detection and Mitigation Based Random Forest and K-Nearest Neighbors Machine Learning Algorithms. Revue Intell. Artif. 2022, 36, 233–240. [Google Scholar] [CrossRef]
- Gaur, V.; Kumar, R. Analysis of Machine Learning Classifiers for Early Detection of DDoS Attacks on IoT Devices. Arab. J. Sci. Eng. 2022, 47, 1353–1374. [Google Scholar] [CrossRef]
- Sridaran, R. An SDN-based Decision Tree Detection (DTD) Model for Detecting DDoS Attacks in Cloud Environment. Int. J. Adv. Comput. Sci. Appl. 2022, 13. [Google Scholar] [CrossRef]
- Santos, R.; Souza, D.; Santo, W.; Ribeiro, A.; Moreno, E. Machine learning algorithms to detect DDoS attacks in SDN. Concurr. Comput. 2020, 32, e5402. [Google Scholar] [CrossRef]
- Alamri, H.A.; Thayananthan, V. Bandwidth Control Mechanism and Extreme Gradient Boosting Algorithm for Protecting Software-Defined Networks Against DDoS Attacks. IEEE Access 2020, 8, 194269–194288. [Google Scholar] [CrossRef]
- Mohmand, M.I.; Hussain, H.; Ayaz, A.; Ullah, U.; Zakarya, M.; Ahmed, A.; Raza, M.; Rahman, I.U.; Haleem, M. A Machine Learning-Based Classification and Prediction Technique for DDoS Attacks. IEEE Access 2022, 10, 21443–21454. [Google Scholar]
- Ma, Z.; Li, B. A DDoS attack detection method based on SVM and K-nearest neighbour in SDN environment. Int. J. Comput. Sci. Eng. 2020, 23, 224–234. [Google Scholar] [CrossRef]
- Liu, L.; Wang, H.Y.; Wu, Z.J.; Yue, M. The detection method of low-rate DoS attack based on multi-feature fusion. Digit. Commun. Netw. 2020, 6, 504–513. [Google Scholar] [CrossRef]
- Chouhan, R.K.; Atulkar, M.; Nagwani, N.K. Performance Comparison of Ryu and Floodlight Controllers in Different SDN Topologies. In Proceedings of the 2019 1st International Conference on Advanced Technologies in Intelligent Control, Environment, Computing & Communication Engineering (ICATIECE), Bangalore, India, 19–20 March 2019. [Google Scholar]
- Wang, Z.; Cao, C.; Zhu, Y. Entropy and Confidence-Based Undersampling Boosting Random Forests for Imbalanced Problems. IEEE Trans. Neural Netw. Learn. Syst. 2020, 31, 5178–5191. (In English) [Google Scholar] [CrossRef] [PubMed]
- Almomani, O. A Feature Selection Model for Network Intrusion Detection System Based on PSO, GWO, FFA and GA Algorithms. Symmetry 2020, 12, 1046. [Google Scholar] [CrossRef]
References | Dataset | Feature Selection Methods | Class Method |
---|---|---|---|
[14] | Synthetic | Filter-Based, Wrapper-Based, Embedded-Based | SVM, NB, ANN, k-NN |
[15] | NSL-KDD | Genetic Algorithm | RBF neural network optimized by cuckoo search |
[16] | CIC-DDoS2019 | Extra Tree Classifier | RF, SVM, NB, Decision Tree, XGBoost, AdaBoost |
[17] | DS00_Full | p-value (t-statistic test), Chi-square test, and Information gain test | k-NN, NB, SVM, RF, ANN |
[18] | CIC-DDoS2019 | A novel hybrid metaheuristic optimization algorithm (BHO) | Ensemble employs six base classifiers (two SVMs, two RF, and two Gradient Boosted Machines) |
[19] | CIC-DDoS2019 | The info gain attribute evaluation algorithm | Based on Deep Neural Networks (DNN), Convolutional Neural Networks (CNN), and Long Short-Term Memory (LSTM) |
[20] | CSE-CIC-IDS2018 | Synthetic Minority Oversampling Technique | k-NN, RF, Gradient Boosting, AdaBoost, Decision Tree, and Linear Discriminant Analysis algorithms |
[21] | Synthetic | LSTM and GRU | SVM |
[22] | NSL-KDD | Deep belief network feature extraction | PSO-LSTM model |
[10] | Synthetic | Grey wolf optimization algorithm and CNN | Optimized LSTM |
[23] | Synthetic | 5 features are extracted from the dataset | Decision Tree, Deep Learning (DL), k-NN, Logistic Regression (LR), RF, and SVM |
[24] | Synthetic | 7 features are extracted from the dataset | SVM, RF, k-NN, XGBoost, NB |
[25] | Synthetic | 4 features are extracted from the dataset | One method adopts the degree of DDoS attack and improved k-NN |
[26] | Synthetic | 23 features extracted, 8 selected from the extracted features | SVC |
Feature | Explanation |
---|---|
Dst Port | Destination Port |
Init Fwd Win Byts | Number of bytes sent in initial window forward direction |
Init Bwd Win Byts | Number of bytes sent in initial window backward direction |
Fwd Header Len | Total length for forward headers in bytes |
Pkt Len Max | Maximum length of a packet |
Bwd Pkt Len Max | Maximum size of backward packets |
Fwd Pkt Len Mean | Mean size of packet in forward direction |
Bwd Seg Size Avg | Average size observed backward direction |
Fwd Seg Size Avg | Average size observed forward direction |
Subflow Bwd Pkts | The average number of packets in a sub flow in the backward direction |
Fwd Pkt Len Min | Minimum size of packet in forward direction |
Flow Duration | Duration of the flow (microsecs) |
ECE Flag Cnt | Number of packet switch ECE flags |
Bwd IAT Min | Minimum time between two packets sent in the backward direction |
RST Flag Cnt | Number of packet switch RST flags |
Flow IAT Mean | Mean time between two packets sent in the flow |
Fwd IAT Tot | Total time between two packets sent in the forward direction |
PSH Flag Cnt | Number of packet switch PSH flags |
Flow IAT Min | Minimum time between two packets sent in the flow |
Idle Max | Maximum time a flow was idle before becoming active |
URG Flag Cnt | Number of packet switch URG flags |
Flow IAT Std | Standard deviation time between two packets sent in the forward direction |
Fwd IAT Std | Standard deviation time between two packets sent in the forward direction |
Active Min | Minimum time a flow was active before becoming idle |
Active Std | Standard deviation time a flow was active before becoming idle |
FIN Flag Cnt | Number of packet switch FIN flags |
Dataset before Feature Extraction | Dataset after Feature Extraction | |||||||
---|---|---|---|---|---|---|---|---|
Accuracy | Precision | Recall | F1 | Accuracy | Precision | Recall | F1 | |
RF | 0.9635 | 0.951 | 0.9723 | 0.9616 | 0.9913 | 0.9843 | 0.9992 | 0.9913 |
SVM | 0.9487 | 0.9082 | 0.9913 | 0.9479 | 0.9689 | 0.9583 | 0.9812 | 0.9685 |
XGBoost | 0.969 | 0.9432 | 0.9942 | 0.968 | 0.9894 | 0.9806 | 0.9994 | 0.9894 |
k-NN | 0.9655 | 0.9466 | 0.9821 | 0.964 | 0.9886 | 0.9801 | 0.9982 | 0.9885 |
Decision Tree | 0.9554 | 0.9537 | 0.9511 | 0.9525 | 0.9895 | 0.9847 | 0.9947 | 0.9875 |
References | Year | Model | Accuracy | Precision | Recall | F1_Score |
---|---|---|---|---|---|---|
[14] | 2020 | Wrapper-Based and k-NN | 0.983 | 0.9772 | 0.9773 | 0.9770 |
[17] | 2019 | Chi2 and k-NN | 0.9351 | NA | NA | NA |
[21] | 2022 | Parallel RNN-based SVM Model | 0.9762 | 0.9772 | 0.9679 | 0.9719 |
[22] | 2023 | Deep belief network feature extraction and PSO-LSTM | 0.98 | 0.97 | 0.95 | 0.96 |
[26] | 2021 | SVC-RF | 0.988 | 0.9827 | 0.979 | 0.9765 |
Our study | 2023 | Improved binary grey wolf optimization algorithm and RF | 0.9913 | 0.9843 | 0.9992 | 0.9913 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Liu, Z.; Wang, Y.; Feng, F.; Liu, Y.; Li, Z.; Shan, Y. A DDoS Detection Method Based on Feature Engineering and Machine Learning in Software-Defined Networks. Sensors 2023, 23, 6176. https://doi.org/10.3390/s23136176
Liu Z, Wang Y, Feng F, Liu Y, Li Z, Shan Y. A DDoS Detection Method Based on Feature Engineering and Machine Learning in Software-Defined Networks. Sensors. 2023; 23(13):6176. https://doi.org/10.3390/s23136176
Chicago/Turabian StyleLiu, Zhenpeng, Yihang Wang, Fan Feng, Yifan Liu, Zelin Li, and Yawei Shan. 2023. "A DDoS Detection Method Based on Feature Engineering and Machine Learning in Software-Defined Networks" Sensors 23, no. 13: 6176. https://doi.org/10.3390/s23136176
APA StyleLiu, Z., Wang, Y., Feng, F., Liu, Y., Li, Z., & Shan, Y. (2023). A DDoS Detection Method Based on Feature Engineering and Machine Learning in Software-Defined Networks. Sensors, 23(13), 6176. https://doi.org/10.3390/s23136176