1. Introduction
Distributed denial of service (DDoS) attack is a highly damaging distributed and large-scale coordinated network attack [
1]. The attacker uses many puppet machines under its control to launch a denial of service (DoS) attack on the target simultaneously, which eventually causes the target system to run out of resources or even crash, making the target system unable to provide the required services to normal users. Since the first DDoS attack occurred in 1999, DDoS attack has become one of the most widespread and deadly cyber threats [
2]. According to a survey report by Radware, DDoS attacks are currently the biggest network security threat faced by Internet-related organizations [
3].
As a new network architecture, Software Defined Networking (SDN) [
4,
5] has the core idea of separating the data forwarding function of network equipment from the decision control function to realize the centralized control of the hardware. SDN provides sharing, flexibility, and fine-grained control over switches at a lower cost than traditional IP networks. SDN consists of a central controller with global visibility of the network state, and the communication between the controller and the switches is usually handled using the open and standard protocol OpenFlow [
6], which allows the controller to update the flow rules in any switch directly once there is a demand. This simplified network architecture makes network control more flexible and enables SDN to be widely used in cloud data center network [
7,
8], wireless LANs [
9,
10], and cloud computing [
11,
12]. However, the centralized topology of SDN is vulnerable to DDoS attacks. DDoS attacks on traditional networks are generally initiated by botnets controlled by attackers. A large number of controlled endpoints consume the bandwidth and computational resources of the target resources by launching flooded application requests to the designated victims, forcing the target servers to stop normal application services [
13]. In addition to this, researchers have also identified new DDoS attack techniques for SDN itself, such as packet_in flooding attacks against controllers [
14], CrossPath attacks against southbound channels [
15], and flow table overflow attacks against switches [
16], etc. Both traditional DDoS attacks and new DDoS attacks targeting SDN architecture will seriously affect the performance of SDN. In recent years, many researchers have proposed many anomaly detection methods for DDoS attacks in SDNs [
17,
18,
19]. These methods differ from traditional network anomaly detection methods by using the centralized deployment of Intrusion Detection Systems (IDS), which not only reduces the cost of adding additional detection devices but also improves the detection effectiveness.
At present, methods for anomaly detection of DDoS attacks in SDN are mainly divided into the following three categories: methods based on information statistics, methods based on machine learning, and methods based on deep learning [
20]. Among the methods based on information statistics, the classical method is to use information entropy to calculate the changes in some characteristics of packets (such as the source/destination IP address of packets) to evaluate the abnormal situation of network traffic [
21]. On the one hand, the detection accuracy of this method depends on the threshold value of entropy, but the selection of the threshold value depends on expert experience and the subjective judgment directly affects the detection accuracy. On the other hand, the method of information statistics is suitable for considering a small number of features; thus, it can easily lead to false detection. Subsequently, many researchers tried to use machine learning methods to detect DDoS attacks [
22], such as support vector machines, decision trees, random forests, and other methods. Their performance is better than information statistical methods, but they have good results for processing low-dimensional features and small-sample data and are not suitable for high-dimensional and large-sample data detection. However, deep learning provides a good solution to the limitations of traditional machine learning. Deep learning methods (such as convolutional neural network, recurrent neural network, and graph neural network) can learn features and represent high-dimensional features into abstract data features, which can quickly and effectively process high-dimensional and large-sample data. At present, most of the anomaly detection methods based on deep learning use a single model, which cannot be well detected according to the characteristics of anomalous traffic and cannot guarantee real-time detection and detection accuracy. More importantly, existing DDoS attack defense methods only emphasize attack identification, with less research on mitigation strategies. On the one hand, some researchers migrate excessive anomalous traffic to other controllers for processing [
23], which not only increases the workload of controllers in other domains but also increases the time delay, which is not beneficial for defending against DDoS attacks. On the other hand, other researchers put the normal traffic detected in the previous step into the self-built whitelist [
24] and clear the abnormal traffic detected in the database that does not conform to the whitelist. However, none of the above mitigation methods consider the source of the attack, and eliminate the abnormal traffic from the source.
To solve the above problems, we propose a new defense mechanism for DDoS attacks based on SDN. The mechanism consists of a detection module and a mitigation module. The contributions of this paper are summarized as follows.
The novelty of this paper is that it proposes an SDN defense system for online real-time detection and mitigation based on SDN for DDoS attacks. It combines the intrusion detection system of CNN-ELM with the IP traceback mechanism based on SDN architecture.
The CNN-ELM intrusion detection method achieves higher detection accuracy compared to other methods, as shown in Figures 7–9.
To effectively trace the source of attacks, a blacklist of abnormal traffic is established. Only abnormal packets detected by IDS are recorded, which saves memory space.
The blacklist is designed to allow efficient IP traceback using the timestamp field of the packet/flow.
To effectively mitigate DDoS attacks, anomalous flows are completely removed from the root cause by issuing flow table commands.
The rest of this article is structured as follows.
Section 2 briefly introduces the research status;
Section 3 presents the architecture and implementation details of our designed system.
Section 4 describes the experimental steps and analyzes the experimental results.
Section 5 provides conclusions and future work.
2. Related Work
With the development of Internet technology applications, the number of DDoS attacks is increasing greatly, one of the main reasons is the emergence of botnets. Attackers use malware to attack multiple hosts in the network and continuously send malicious traffic to the target hosts or servers, causing legitimate users to fail to access the network. As a new network architecture, SDN’s data plane and control plane are decoupled, which makes network control centralized and easy to manage, and provides a new idea for network security defense architecture. Therefore, SDN is widely used in cloud data center networks, wireless LANs, and cloud computing environments. In this section, we first introduce several DDoS attack detection methods in SDN, including statistical analysis, machine learning, and deep learning methods. Finally, the limitations of the above methods are analyzed, and our approach is proposed.
In recent years, many experts and scholars have proposed various detection methods for DDoS attacks in SDN, and the most common method is the statistical analysis-based anomaly detection method. The detection methods of statistical analysis take advantage of the property that normal traffic in the network follows certain statistical laws on certain characteristics [
25,
26], which can effectively distinguish all the traffic that does not conform to the law and treat this traffic as attack traffic. Commonly used statistical analysis detection methods include information entropy, principal component analysis, cardinality statistics, etc. Mousavi et al. [
27] proposed an intrusion detection system that detects DDOS attacks by calculating entropy values in an SDN controller. Kalkan et al. [
28] proposed a joint entropy-based DDoS attack detection method using SDN architecture features, which can mitigate not only known attack types but also unknown attack types. Salaria et al. [
29] used an improved principal component analysis method to detect anomalous traffic in different classified regions. The experimental results showed that the detection accuracy reached 95.24%, which is 2.94% higher compared to the improved method. However, the statistical analysis method relies on a single fixed threshold, so it is easy to cause misjudgments of DDoS attacks. In addition, the threshold is different in different environments. Threshold adjustment needs rich experience. otherwise, it will directly affect the accuracy of detection. Based on the above two reasons, it is not reliable to use the statistical analysis method to judge the abnormal traffic on the actual network.
Machine learning is a typical traffic detection method, which can be divided into unsupervised learning and supervised learning. The difference between the two is whether the data samples used for model training contain classification labels or not. Commonly used unsupervised learning methods mainly include self-organizing mapping (SOM) [
30] and K-means clustering [
31]. To accurately detect DDoS attacks, Liu et al. [
32] proposed a detection model Growing Hierarchical Self-Organizing Maps (GHSOM) with good adaptability and scalability, which can effectively identify unknown types of DDoS attacks. Unsupervised learning algorithms do not require a large number of samples to be labeled when training data, thus reducing the high cost of manual labeling. Therefore, it is suitable for classifying, analyzing, and mining potential relationships between large amounts of unlabeled data. In the field of anomaly detection, supervised learning has been widely deployed. Commonly used supervised machine learning methods include k-nearest neighbor (KNN) [
33], support vector machine (SVM) [
34], BP neural network [
35], and so on. Wang et al. [
36] proposed a DDoS attack detection method based on the BP neural network, which used the average number of bytes, the percentage of symmetric flows, the rate of change of asymmetric flows, and the percentage of small packets to training the classifier. However, the traditional machine learning methods described above are only suitable for the processing of low-dimensional and small-sample data, but not for the processing of high-dimensional and large-sample data.
In recent years, deep learning has developed rapidly and has achieved outstanding performance in computer vision and natural language processing. Therefore, researchers have started to apply it to the field of anomaly detection. Lin et al. [
37] combined Let-Net5 with the softmax function for network anomaly classification. The authors used eight cross-validation techniques and successfully obtained an accuracy of 99.65%. Zhang et al. [
38] proposed a two-stage anomaly traffic detection method for DDoS attack detection in SDN. The first stage uses the information entropy method to make coarse-grained judgments on abnormal traffic, and the second stage uses the deep learning hybrid model stacked sparse autoencoder (SSAE)—Support Vector Machine (SVM) to make fine-grained judgments on abnormal traffic. Through experimental verification, the method can identify more than 98% of DDoS traffic and the computational complexity and training time are reduced. Li et al. [
39] proposed a deep-learning-based DDoS attack detection method Deep Convolution Neural Network (DCNN)—Deep Stacked Autoencoder (DSAE). The input features of this detection method consist of flow table features of the SDN switch and self-constructed flow table statistical features. Since it is a lightweight detection method, it can be deployed directly on the controller. Through experimental verification, this method has higher detection accuracy and a lower false alarm rate compared with the traditional machine learning methods of SVM and Deep Neural Network (DNN) methods. Yuan et al. [
40] proposed a recurrent neural network (RNN) based DDoS attack detection method, DeepDefense. The detection model consists of CNN, RNN, and fully connected layers. Compared to traditional machine learning methods, DeepDefense reduced the error rate from 7.517% to 2.103% in Data15 and 39.69% in Data14. The Convolutional neural network (CNN) is a special feed-forward neural network that combines convolution and pooling operations to extract effective feature vectors from input data and improve the accuracy of classification, demonstrating the powerful potential of deep learning in anomalous traffic detection. Mahmoud et al. [
41] took advantage of CNN feature extraction and proposed a new regularized adaptive method, SD-Reg, to solve the CNN overfitting problem. Additionally, the improved CNN model combined with the RF model is applied to the anomalous traffic detection of SDN, and the method improves the detection capability of the Network Intrusion Detection System (NIDS) for unknown events.
In summary, researchers have successfully applied different approaches in the field of anomaly detection. A large number of achievements have been made in DDoS attack detection, but there are still some pressing issues in this area. First, the current detection accuracy is not high enough for many practical application scenarios. Most approaches only emphasize improving accuracy or detection efficiency without optimizing both aspects at the same time. Then, in the research of DDoS attack defense in SDN, most methods only emphasize detection methods without considering how to mitigate abnormal traffic after it is detected. Therefore, in the next step, we will further explore how to effectively improve and optimize detection algorithms and abnormal traffic mitigation methods.
4. Experimental Evaluation in the Detection and Mitigation of DDoS Attacks
4.1. Enviroment
To verify the detection model in this paper, we set up a simulation experiment environment. The Keras 2.2.4 [
44] deep learning framework of TensorFlow-CPU 1.13 was used for simulation experiments. The operating system was Window 10, the Intel I5-6300HQ4 core processor was used, and the memory size was 8 G. It also uses an NVIDIA GTX960 graphics card to speed up the GPU. For the implementation of the attack traceback in this paper, we used Mininet 2.2.1 and OpenFlow 1.3, OpenvSwitch 2.7.0, and RYU 4.22. Mininet [
45] is a network emulation orchestration system that runs a collection of switches, end hosts, routers, and network links. These network components are emulated on a single Linux kernel. The OpenFlow protocol is a network communication protocol that belongs to the data link layer and can control the forwarding plane of a network switch or router, thereby changing the network path taken by network packets. Open vSwitch [
46] is a virtual switch capable of providing large-scale network automation using programmatic extensions. For the controller, we use RYU [
47], a component-based SDN controller that provides well-defined APIs for software components, thus making it very easy for developers to create and test new network management and control applications.
4.2. Datasets
Intrusion detection system (IDS) performance relies heavily on the quality of the training dataset. However, the availability of benchmark datasets for intrusion detection is one of the main issues that will interrupt the development of anomaly detection systems. We can find a large number of datasets to evaluate different machine-learning techniques in different fields such as biomedicine, language translation, etc. However, privacy and security issues are the main reasons for the lack of network intrusion detection datasets. Network intrusion datasets are sensitive information, and once these datasets are made public, they will lose the credit of customers, so few network intrusion detection datasets are publicly available. In addition, most of the available datasets (such as the classic KDDCUP99, NSLKDD, etc.) are outdated and do not reflect the current network traffic trends. Additionally, some other datasets do not cover various known attack types and lack traffic diversity.
The CICIDS-2017 dataset [
48] is one of the latest datasets available for intrusion detection. CICIDS-2017 dataset contains benign and latest common attacks such as brute force FTP, brute force SSH, DoS, Hearbleed, web attacks, infiltration, botnet, and DDoS attacks with data similar to real-world data (PCAPs) and the dataset has been processed into CSV format for easy use in intrusion detection. To effectively demonstrate the goodness of our proposed model, another dataset InSDN dataset (Elsayed et al.) [
49] is also used in this paper to test the performance of the deep learning model proposed in this paper. This dataset covers recent common types of attacks such as DoS, DDoS, Brute Force Attacks, Malware, Probe, Exploitation, and Web attacks. In addition, the normal traffic in the InSDN dataset covers popular application services such as HTTPS, HTTP, DNS, Email, FTP, and SSH. The dataset simulates real attack scenarios, simulating SDN internal attacks with external attacks, using the CICFlowMeter open-source tool to extract more than 80 statistical features, containing 343,939 normal traffic and attack traffic, so the dataset is very similar to the attack data in the real network environment.
In this paper, to verify the performance of the proposed hybrid model CNN-ELM model for DDoS attack anomaly detection, the DDoS attack data collected on the fifth day in the dataset CICIDS-2017 is used to verify the goodness of the model. Additionally, DDoS attack data from the InSDN dataset are used to validate the hybrid CNN-ELM model. The dataset includes both DDoS attack traffic and legitimate traffic, and their distribution is shown in
Table 5.
4.3. Feature Selection
The use of too many (useless) features in deep learning-based intrusion detection models may result in excessive computational costs and overfitting the training model to widely apply multiple attack detection. The use of fewer features cannot capture the attack characteristics, and the obtained intrusion detection models have low accuracy and a high false alarm rate, which can easily cause false positives. Therefore, the selection of features will directly affect the goodness of model training, and it is important to choose the appropriate features. In this paper, we minimize the cost and memory requirement of the hybrid intrusion detection model, and ensure high accuracy and running speed. In the experiments, this paper selects a subset of 12 features in the CICIDS-2017 and InSDN datasets concerning the features given in
Section 3.3 to evaluate our model, as shown in
Table 6. Additionally, compared with the 48 feature subsets proposed by Krishnan et al. [
50] (50 feature subsets suggested in the original paper), the source IP and destination IP are removed because IP addresses can be forged, which will affect the training accuracy of the model, as shown in
Table 7.
4.4. Data Pre-Processing
To build a real-time and effective intrusion detection system, we need to pre-process the data and reduce the complexity of the system operation before feeding them into the learning classifier. The specific work is as follows.
For the experimental data, the data set is divided into 80% for training and 20% for testing using the train_test_split method of the Scikit-learn library.
The labeled category uses the unique heat encoding technique to convert the label to a unique integer. The anomaly detection technology mentioned in this paper refers to binary classification technology. Therefore, in binary classification detection, the normal category is represented by binary 0, and the abnormal category is represented by binary 1.
4.5. Evaluation Metrics
To evaluate our proposed method, we used standard evaluation metrics to measure performance, namely confusion matrix, accuracy, precision, recall, and F1 value. These metrics are calculated using four different measures in turn; true positive (TP), true negative (TN), false positive (FP), and false positive (FN), which are defined as follows.
TP: The number of samples whose actual type is DDoS attack, and the number of samples correctly judged by the detection model.
TN: The number of samples whose actual type is normal and correctly judged by the detection model.
FP: The actual type of samples is normal, the number of samples misjudged by the detection model as DDoS attack type.
FN: The actual type of samples for DDoS attack, the number of samples misjudged as normal type by the detection model.
Confusion matrix: The confusion matrix gives a matrix as output and describes the complete performance of the model. It can be shown as a table with two dimensions, “actual” and “predicted”, and both dimensions have “true positive (
TP)”, “true negative (
TN)”, “false positive (
FP)”, and “false negative (
FN)”, as shown in
Table 8.
4.6. Results and Analysis
4.6.1. Analysis of Detection Mechanism Results
We used two datasets for testing: first, we trained and tested our model CNN-ELM using 12 feature subsets and 48 feature subsets from the CICIDS-2017 dataset, respectively, and the results obtained are compared with the results of other models as shown in
Table 9 and
Table 10. The accuracy comparison is shown in
Figure 7 and
Figure 8.
As can be seen from
Table 9 and
Table 10, the results for accuracy, recall, precision, and F1-score of the resulting CNN-ELM hybrid model outperformed the other machine learning models, both for the 12-feature subset and the 48-feature subset. In
Table 10, although the accuracy improvement of the CNN-ELM model compared to the CNN, CNN-LSTM, and CNN-SVM models is not significant at 0.01–0.02%, the execution time of the CNN-ELM model is far better than the other models in terms of testing time.
From
Figure 7 and
Figure 8, we can see that the results of Accuracy of the resulting CNN-ELM hybrid model outperform other machine learning models for both the 12-feature subset and the 48-feature subset, indicating that the 12-feature subset selected in this paper can well reflect the characteristics of the attack traffic and is more concise and faster than the 48-feature subset in training the model.
To better reflect the wide applicability of the model proposed in this paper, we trained and tested the CNN-ELM model using the InSDN dataset with the 12 feature subsets proposed in this paper, and the experimental results compared with other machine learning models are shown in
Table 11 and
Figure 9.
From
Table 11 and
Figure 9, we can see that the CNN-ELM hybrid model outperforms the other machine learning models in terms of accuracy, recall, precision, F1-score and test time results for the InSDN dataset.
In summary, from the five aspects of detection accuracy, recall, accuracy, F1-score and testing time, CNN-ELM can quickly complete intrusion detection tasks when facing massive network data, and has high detection accuracy.
To compare our models more intuitively, we compare the CNN, CNN-LSTM, and CNN-SVM models with the CNN-ELM hybrid model, respectively, and their confusion matrix plots are shown in
Figure 10. Although the result of the CNN-SVM model is better than that of the CNN-ELM model proposed in this paper, the parameter setting of the CNN-SVM model is complex, it relies too much on expert experience and the training time of the model is long, so it is inferior to CNN-ELM model. On the whole, the CNN-ELM detection model proposed by us has a high detection rate and a low false positive rate, which is suitable for deploying in SDN for real-time DDoS attack detection.
4.6.2. Analysis of Mitigation Mechanism Results
Based on the traceability method in
Section 3.5 and topology
Figure 5, we can initially determine that the attacker comes from switch S5 in control domain C3 and switch S1 in control domain C1 and then send flow rules commands to the attack source switch under this control domain to stop the malicious flow and observe the trend of traffic changes of the victim host h3. From
Figure 11, we can see that at around 15:21:37, the attacker launches an attack on h3, and at around 15:22:00, the number of h3 packets drops and the traffic gradually returns to normal, indicating that the defense effect is successful.
5. Conclusions
This paper addresses the poor detection of DDoS attacks in SDN and proposes a deep learning hybrid model, CNN-ELM, which takes advantage of CNN to extract network traffic features and then uses the ELM algorithm for classification, which not only improves detection accuracy but also improves detection efficiency. To alleviate abnormal traffic, this paper uses the advantages of SDN global centralized control and management to trace the IP source of abnormal traffic, find the source of the attack, and inform the nearest controller to the victim to clear abnormal traffic, to curb DDoS attacks at the root. To verify the effectiveness of the SDN defense system, we conducted simulation experiments on the Mininet platform. The experimental results show that the proposed CNN-ELM model has good detection performance, and the accuracy obtained by hypothesis testing is 98.92% in the CICIDS-2017 dataset and 99.91% in the InSDN dataset. Meanwhile, the proposed SDN-based IP traceback method can effectively trace the source of attacks and mitigate DDoS attacks.
However, the anomalous traffic detection method proposed in this paper is based on a supervised learning method, which has the disadvantage that the cost of labeling the required data is very high. In future work, we hope to use unsupervised learning methods for anomaly detection of DDoS attacks in real network environments and explore the use of graph neural network [
51] based method for attack traceback.