1. Introduction
Traditional network architectures [
1], where switches and routers combine control and data planes, rely on distributed control and static configurations, often require manual configurations, and lack the agility to swiftly adapt to evolving IoT network demands. SDN [
2] is a network concept that revolutionizes traditional network architectures for managing and securing computer networks, smart grids, data centers, and, especially, IoT devices by decoupling the control plane from the data plane. In an SDN for IoT, a centralized controller orchestrates IoT network devices, allowing dynamic configuration and adaptability through software-defined policies. It also offers unparalleled flexibility and scalability. This separation of control enables rapid innovation, vendor independence, and efficient resource utilization tailored for IoT environments; automation is intrinsic to SDNs for IoT, streamlining tasks such as provisioning and optimization. In this context, we used an SDN as an approach to make IoT networks more adaptable and flexible by improving network control, management, and security. We combined an SDN with ML [
3,
4,
5] to enhance the security of IoT devices in a smart home. We used an SDN control plane, SDN data plane, and ML model as an approach to building IoT network security. The SDN control plane centralizes network intelligence and management, making it more flexible and programmable. The SDN data plane, often implemented in network switches and routers, is responsible for forwarding data packets based on instructions received from the SDN controller in the control plane. It follows the policies and rules set by the controller. The ML model, after training data, can predict potential threats and vulnerabilities in the IoT network. It can also adapt and learn from new data to improve prediction accuracy. When a security threat is detected, the SDN controller, in collaboration with the ML model, can trigger automated responses. This helps mitigate the impact on the affected IoT device and alerts network administrators. The OpenFlow (OF) protocol [
6] enables the OF Controller to instruct the OF switch on how to handle incoming data packets; it adds flow entries from the switch’s flow tables [
7], specifying the criteria to perform an action, which is, in our case, dropping the packet. Upon receiving the flow modification message, the OF switch installs the flow entry into its flow table, and it will start blocking traffic that matches the specified criteria. The objective of this paper is to achieve the real-time detection and mitigation of DDoS attacks [
8,
9] originating from smart home IoT devices within a Software-Defined Networking (SDN) environment. This is accomplished through the implementation of the SDN-ML-IoT method, which is based on supervised ML and is capable of detecting multiple DDoS attacks that pose a genuine threat to IoT devices. SDN-ML-IoT utilizes diverse approaches to ensure the accuracy and suitability of data, resulting in enhanced convergence and model optimization. These approaches include Recursive Feature Elimination (RFE), cross-validation k-fold, and undersampling for balancing data. One of the major challenges in this process is distinguishing between malicious and legitimate traffic. To address this, we employ the OvR strategy, which simplifies the multiclass classification problem by breaking it down into a series of binary classification tasks. This approach facilitates the distinction between different classes, streamlining the overall classification process. Let us summarize our paper, which consists of five main sections. In the first section, we present an overview of the work related to our SDN-ML-IoT method. The second section delves into the background, which serves to provide readers with a comprehensive understanding of the context motivations and existing knowledge related to our research topic. The third section outlines the methodology employed to build the SDN-ML-IoT framework, and we present an analysis of the results obtained based on ML algorithms specializing in IDPS [
10] and the security of IoT devices [
11] utilizing evaluation metrics. These include RF [
12], LR [
13], KNN [
14] and NB [
15]. In the fourth section, we deploy our SDN framework in a live network and subject it to comprehensive testing to evaluate its performance, effectiveness, and reliability in detecting and mitigating DDoS attacks in real-world scenarios. Finally, we compare the results of SDN-ML-IoT with those achieved in the related works.
2. Related Works
The study in [
16] proposed a DDoS attack detection method that uses conditional entropy [
17] based on SDN traffic to reduce the incidence of false positives rate. The author uses Scapy [
18] to generate normal and DDoS traffic, flash Crowds, ICMP flooding and packet-in attacks. The proposed method for identifying anomalous DDoS traffic quantifies the concentration of traffic based on the mean and standard deviation and uses changes in three types of entropy values to determine the type of traffic, thereby achieving more precise attack detection. Additionally, pre-processing is performed during traffic collection, so it is not necessary to traverse all collected packets but only to process a random sample of packets to quickly obtain entropy values while maintaining a certain level of accuracy. This approach has lower false positive rates, a higher detection accuracy at 97.2%, and faster response times at 0.74 s. The limitations of this work include the need to enhance accuracy, develop effective mitigation methods for countering DDoS attacks post-detection, and validate the deployment of these methods in real traffic to assess their efficiency.
The author in [
19] introduces a novel Secured Automatic Two-level Intrusion Detection System, called SATIDS, which leverages an enhanced Long–Short-Term Memory (LSTM) network [
20]. SATIDS’s primary objective is to effectively distinguish between malicious attacks and benign network traffic, accurately identify attack categories, and specify sub-attack types with exceptional performance. The approach proposed in this paper is assessed using the ToN-IoT dataset [
21], encompassing network traffic data from various IoT devices and scenarios that simulate real-world IoT network traffic. Additionally, the InSDN dataset [
22] is utilized, which includes several types of DoS attacks across different OSI model layers. To execute various DoS attacks, Kali Linux is employed against a victim web server represented by an h4 virtual host, including TCP, UDP, and HTTP flood attacks, through the Low Orbit Ion Cannon (LOIC) tool [
23]. The experimental results reveal that when facing DDOS attacks using the ToN-IoT dataset, the SATIDS system performs optimally with 3 LSTM layers and 500 hidden layers, achieving 94.8% precision and a 92.7% detection rate. For the INSDN DATASET, utilizing 3 LSTM layers and 500 hidden layers yields a precision rate of 90% for DDOS attacks. This work has limitations, including the need for further accuracy improvements and the fact that it can only detect attacks without mitigation. Further testing and deployment of the SATIDS model in real traffic networks are necessary.
Singh, C [
24] proposed a method for detecting DDoS attacks in SDN using the Gini impurity [
25]. The approach is specifically designed for IoT networks, taking advantage of centralized control and efficient security threat management. To create a CSV dataset for normal and DDoS attacks, the author used the CICFlowMeter program [
26] to create it and selected 42 features out of 80 based on their correlation matrix score. The proposed method was evaluated on the NSL-KDD dataset [
27], which contains three types of DDoS attacks: UDP, ICMP, and TCP attacks. They applied four ML algorithms—Multilayer Perceptron (MLP) [
28], LR, kNN and Decision Tree (DT) [
29]—along with their proposed Gini-impurity-based approach to test the performance of these algorithms. The Gini impurity method achieved an impressive accuracy of 99.9%. Moreover, the proposed approach not only detects DDoS attacks but also includes effective mitigation strategies. Finally, the method was successfully deployed on an SDN network, further validating its practical applicability. The work looks promising, but it could benefit from employing feature reduction algorithms to further reduce the number of features and considering the use of a multiclass approach to detect different types of DDoS attacks.
The researcher in [
30] introduced a DDoS detection method leveraging feature engineering and ML within SDN. The CSE-CIC-IDS2018 dataset [
31] was employed, and 26 significant features were selected from an initial set of 79 using the binary grey wolf optimization algorithm [
32]. Consequently, SVM [
33], RF, Decision Tree, XGBoost [
34], and kNN were utilized to assess and determine the best classifier for both the original and feature-extracted datasets. All classifiers demonstrated improvement across various metrics. Notably, the RF classifier outperformed others in terms of accuracy (0.9913), precision (0.9843), recall (0.9992), and f1-score (0.9913). Following the deployment of the best classifier selection method based on the RF model to the controller, DDoS detection was executed using features from a subset of the most influential features. The results affirmed the capability of the proposed method to detect DDoS attacks and alert users in real time. However, the study acknowledges a limitation, indicating the need for enhancing classifier performance and accuracy, reducing features, and testing the network on various SDN topologies to assess its efficiency.
The research paper in [
35] proposed a method for detecting DDoS attacks in SDN security. This work introduces RF, kNN, NB, and LR as supervised ML algorithms for DDoS attack detection across three distinct network architectures: single topology, linear topology, and multi-controller topology. The models are trained using datasets generated in a simulated SDN environment utilizing the Mininet emulator and Ryu controller. The simulation results reveal that NB and LR exhibit low accuracy rates, generating numerous incorrect predictions. In contrast, RF and KNN demonstrate high accuracy rates and are deemed effective prediction models for this study. Observations made during the attack, based on monitoring network traffic, indicate that the assault primarily aims to exhaust the controller and induce its failure by inundating the switch flow table with requests containing spoofed IP addresses. Additionally, it leads to some disruption in normal packet flow as the controller is occupied with these falsified requests. This impact is predominantly noticeable in the single topology, as opposed to linear and multi-controller topologies, suggesting that increasing the number of switches reduces the load and facilitates rapid elimination of the attack effect. Moreover, augmenting network switches minimizes detection and mitigation times. Furthermore, an increase in the number of controllers enhances the detection and mitigation process by reducing error rates, detection times, and mitigation times. Ultimately, the proposed mitigation technique is successfully implemented to thwart the attack before causing harm to the controller by blocking the attacker port for 120 s. However, it seems like this work exhibits overfitting in accuracy results and requires the implementation of feature selection methods along with cross-validation and other approaches to mitigate overfitting in accuracy outcomes.
Karthika, P [
36] proposed architecture based on OF port statistics for implementing ML-enhanced TCP/SYN flood detection and mitigation. The author employed ML techniques, including SVM, NB, and MLP. A total of 6 features were carefully selected from 25 to effectively distinguish between regular traffic and SYN flood traffic. Additionally, the method mitigates the impacts of the attacking node on the network by utilizing the MAC address of the host. The results indicate that the MLP achieved the highest classification accuracy, reaching 99.75% for the simulation dataset. However, this work needs to focus on other protocols capable of targeting and collecting a broader range of normal and DDoS data. These protocols should have the potential to impact various ports, such as HTTP/HTTPS, Message Queuing Telemetry Transport (MQTT), and Constrained Application Protocol (CoAP).
The author in [
37] presented FMDADM, an ML-based DDoS detection and mitigation framework tailored for SDN-enabled IoT networks. The framework comprises three detection modules and a mitigation module. Notably, it employs a 32-packet window size, a novel mapping function (DCMF), and feature engineering to enhance accuracy and address overfitting. The proposed framework, evaluated with various ML models, demonstrated superior performance, particularly with the RF model. FMDADM effectively detects DDoS attacks in multi-node scenarios, showcasing strength where conventional defenses may fall short. The framework is designed to prevent local IoT Botnet-induced DDoS attacks from reaching the ISP level, offering protection to the controller and remote nodes. The experimental results show that FMDADM surpasses current solutions in terms of accuracy, precision, F-measure, recall, specificity, negative predictive value, false positive rate, false detection rate, false negative rate, and average detection time, achieving 99.79%, 99.43%, 99.77%, 99.79%, 99.95%, 0.21%, 0.91%, 0.23%, and 2.64
s, respectively.
The authors of [
38] demonstrate the effectiveness of employing deep learning methods, specifically a hybrid model combining 1D Convolutional Neural Network (CNN), Gated Recurrent Unit (GRU), and Dense Neural Network (DNN), to detect and protect against DDoS attacks in SDN environments. The proposed model outperforms traditional ML algorithms in accurately identifying DDoS attacks, especially low-rate ones, and detecting both short-term and long-term patterns in input data. However, limitations include the evaluation of a specific dataset, necessitating further testing on diverse datasets and network topologies for generalizability. Future research should focus on effective mitigation strategies post-detection. Despite these considerations, the findings underscore the importance of employing deep learning techniques for DDoS detection and defense in SDN networks. The hybrid model is identified as a valuable tool contributing to overall security and stability, with future research recommended to explore additional strategies for further enhancing detection and response to DDoS attacks in SDN networks.
The summary of related work in relation to our research is presented in
Table 1 below.
4. Implementation
In this section, we will elucidate the tools employed and the SDN-ML-IoT methods that utilize ML techniques to ensure the security and stability of IoT devices within the SDN framework.
We will discuss the process step by step and evaluate the ML performance results to make an informed decision in selecting the SDN-ML-IoT framework.
4.1. Tools Used
As shown in
Table 3, we employ a set of tools to facilitate various tasks in our project. Initially, we utilized a virtual machine (VM) with Ubuntu v20.04.1 to deploy Mininet and the Ryu controller for implementing network infrastructure. These tools aid in establishing a virtual network environment and efficiently managing network components. Additionally, we utilize Ryu controller tools to generate the dataset required for our research and analysis. We employ hping3 to simulate DDoS attacks, Mosquitto for publishing and subscribing to messages, and the Python programming language as the primary language for developing SDN applications and network control logic.
4.2. Collect Traffic Data
The Ryu controller is designed to efficiently collect network traffic data from host devices and IoT devices in a Mininet-based environment; the application monitors flow statistics in the SDN network. It collects flow statistics from OF-enabled network switches. The application periodically requests flow statistics from each switch and handles state changes in switches. When flow statistics replies are received, it extracts relevant features. The extracted data based on feature information are then written to a CSV file named “data.csv”. The application distinguishes between different IP protocols (ICMP, TCP, UDP). The monitoring interval is set to 10 s. It captures both normal and DDoS traffic. As shown in
Figure 5, the collected dataset comprises six attack types and normal traffic, including normal, SYN flood, UDP flood, ICMP flood, HTTP flood, CoAP flood, and MQTT broker DDoS attacks. The CSV dataset contains a total of 1,426,858 records, representing various attacks and normal instances.
As indicated in
Table 4, the dataset encompasses a total of 22 features, inclusive of the class label. The class label represents different types of attacks: normal, SYN flood, UDP flood, ICMP flood, HTTP/HTTPS flood, CoAP flood, and MQTT broker DDoS attacks, denoted by the values 0, 1, 2, 3, 4, 5, and 6, respectively.
4.3. Data Preprocessing
4.3.1. Drop Duplicate Values
Any duplicate rows present in the dataset were removed to avoid redundant information.
4.3.2. Label Encoding
We used the label encoding technique to transform categorical labels into numerical values. In this step, we applied label encoding to three specific features: flow_id, ip_src, and ip_dst. By employing label encoding, we converted these categorical data points into a numerical format suitable for ML algorithms. This transformation ensured that our dataset was well prepared for model training, preventing any challenges associated with handling non-numeric data. Ultimately, this process allows ML models to effectively learn from the data and make precise predictions.
4.4. Feature Selection
We utilized the Recursive Feature Elimination (RFE) [
53] module for feature selection in our work. RFE is instrumental in the identification of the most pertinent features, thereby enhancing overall model performance. Through the elimination of less significant features, the model is able to concentrate on the most informative ones, subsequently mitigating noise within the data. In our specific work, when testing the model against real-time network traffic. As shown in
Figure 6, we selected the top 10 important features, employing fewer than 10 features often results in an elevated false alarm rate. Conversely, selecting more than 10 features has the potential to induce overfitting, where the model excels in training data but struggles to generalize to novel, unseen data. RFE plays a crucial role in averting overfitting by meticulously choosing a subset of features that maximally contribute to predictive performance.
4.5. One-versus-Rest (OvR) Strategy Setup
We used the OvR strategy in multiclass classification tasks to simplify the problem and leverage binary classification algorithms. The training of binary classifiers makes it computationally efficient, especially for large datasets. This parallelization can lead to faster training times. Below is an explanation of how OvR works for our dataset label class:
For each class
, train a binary classifier
with the following labels:
For each binary classifier , the training involves learning a model to distinguish between instances of class i and instances not belonging to class i. The training process minimizes a binary classification loss function for each classifier.
Mathematically, the prediction for a binary classifier
is given by:
To predict the class for a new instance
, evaluate each binary classifier
and choose the class associated with the classifier that produces the highest score. The predicted class is given by:
4.6. Data Splitting
The transformed feature data and the target variable y were split into training and testing sets. A standard practice involves allocating 75% of the data for training and reserving 25% for testing purposes.
4.7. Balancing Data Classes
Following the data split, we employed undersampling techniques [
54] to achieve a balanced class distribution within the training set. Undersampling entails the random removal of instances from the majority class, aligning it more closely with the minority class. It is essential to emphasize that this step is exclusively applied to the training data to prevent any potential data leakage. We opted for undersampling techniques over SMOTE [
55] due to concerns of bias and false alarms. Undersampling techniques provide more accurate results.
4.8. Model Training
After collecting the dataset, as explained in
Section 4.2, we divided it into training and testing sets. The OvR strategy was applied to transform the multiclass classification problem into binary classification. To achieve a balanced binary class distribution, undersampling was employed, and only the top 10 important features were selected. The ML model, incorporating kNN, NB, LR, and RF algorithms, was then trained using the selected features from the training set. Following the training phase, the model underwent testing on the test dataset to assess its ability to make accurate predictions on new, unseen flow data. Based on grid search cross-validation (GridSearchCV) [
56] to find the optimal set of hyperparameters, the parameters employed for each ML algorithm are outlined below in
Table 5.
Our SDN-ML-IoT-based system incorporates the OvR strategy. In our specific scenario, the objective is to predict among seven classes, while numerous classification algorithms are inherently designed for binary classification, distinguishing only between normal and DDoS attacks and capable of handling two classes at a time. The OvR strategy proves to be a practical solution in addressing our multi-class classification problem.
Cross-validation using k-fold: Cross-validation was implemented using k-fold validation [
57] with k = 10 to assess the model’s robustness and generalization across different subsets of the training data. This ensures a more comprehensive evaluation of the model’s performance and helps identify potential overfitting or underfitting issues.
4.9. Model Evaluation
Finally, we evaluated the model’s performance using various metrics on the testing dataset. The key evaluation metrics included accuracy, precision, AUC-ROC, training time, and prediction time. These metrics provide a holistic view of the model’s effectiveness in making accurate predictions and its computational efficiency. The evaluation metrics are listed and defined below:
where:
N: The number of target classes in the dataset.
True Positives (TPs): The instances where the model correctly identified a rule and detected an attack.
False Positives (FPs): The instances where the model incorrectly identified a rule and classified an instance as an attack when it was not present.
True Negatives (TNs): The instances where the model correctly identified that no rule matched and correctly classified an instance as not being an attack.
False Negatives (FNs): The instances where the model incorrectly identified that no rule matched and failed to detect an attack.
The Area Under the Receiver Operating Characteristic curve (AUC-ROC): A performance metric for binary classification models. It evaluates the trade-off between sensitivity (true positive rate) and specificity (true negative rate). The ROC curve plots the true positive rate against the false positive rate at various threshold settings. AUC-ROC quantifies the classifier’s ability to distinguish between classes, with a higher AUC indicating better overall performance, considering both sensitivity and specificity.
4.10. Simulation Results
Table 6 displays the training results for RF, LR, kNN, and NB. The accuracy metric indicates strong performance for both RF and kNN. RF attains a high accuracy of 0.9999 and an AUC-ROC of 0.9999; however, it requires longer fit and testing times compared to the other algorithms. kNN demonstrates commendable accuracy at 0.9998 and a perfect AUC-ROC of 0.9999, with shorter times spent on training and testing compared to RF. In contrast, NB and LR exhibit suboptimal accuracy, suggesting that they may not be the most suitable models for this specific task.
LR and NB were omitted from our model selection in favor of RF and kNN, which produced superior results. This decision led us to proceed with RF and kNN for the subsequent simulation test in a real SDN Testbed.
We conducted tests on various network topologies—single, linear, tree, ring, and mesh structures—with different sizes—small (4 hosts), medium (16 hosts), and large (64 hosts). To initiate the deployment process for our proposed framework SDN-ML-IoT, we integrated the Ryu controller with our ML models, which are based on kNN-OvR or RF-OvR. The deployment also involved using Mininet to establish network configurations. These configurations are detailed in
Table 7.
4.10.1. Evaluating SDN Performance Based on Detection Time
We conducted comparative studies on multiple network topologies and sizes to assess the SDN performance within RF and KNN, specifically focusing on detection time.
Table 8 illustrates that kNN has a lower detection time compared to RF for all network topology types and sizes. The detection time results for RF and kNN exhibited nearly identical detection rates for DDoS attacks. Based on a comparison of the two algorithms, we conclude that across small, medium, and large configurations, the detection times are almost similar. However, the mesh topology displayed a longer detection time of more than 2 s due to its inherent complexity.
4.10.2. Evaluating SDN Performance Based on CPU Utilization and Memory Usage
Based on the last comparison, we conclude that single linear, tree, and ring topologies are similar, unlike mesh topology, owing to their complexity, redundancy, and highly interconnected switches. Therefore, we continue evaluation based on the two SDN topologies: linear topology and mesh topology.
Table 9,
Table 10 and
Table 11 present evaluations of CPU usage and memory consumption for linear and mesh topology scenarios.
Table 9 focuses on configurations with four hosts, four switches, and one controller. In
Table 10, the evaluation extends to setups with 16 hosts, 16 switches, and 1 controller. Lastly,
Table 11 examines CPU usage and memory consumption for larger networks featuring 64 hosts, 64 switches, and 1 controller. The results indicate that kNN exhibits higher memory consumption than RF, especially for large topologies and complex networks. The RF algorithms demonstrate a more significant reduction in CPU and memory usage after mitigating DDoS attacks compared to kNN.
4.10.3. Model Selection
The model selection for integration on live SDN monitoring traffic is directed toward RF due to its superior accuracy, acceptable fit and prediction times, and flexibility with multiple SDN topologies, along with lower memory consumption and CPU usage. The integration using the RF model can be scaled and adapted to different network sizes and types.
4.11. Model Integration
After demonstrating the scalability, adaptability, and reliability of our SDN-ML-IoT framework across various topology types such as single, linear, tree, ring, and mesh, as well as different sizes, including small, medium, and large, as detailed in
Section 3.4, we integrated our model using the Ryu controller along with the switching application. We employed Mininet to establish an SDN with diverse topology types, including single, linear, tree, ring, and mesh, and varying sizes from small to large. During live traffic, the switch forwards packet information to the ML classifier integrated into the Ryu controller. Our SDN-ML-IoT framework, which is based on RF-OvR, determines whether the traffic is malicious. For legitimate traffic, the controller examines the packet’s destination and makes a decision on the output port. Subsequently, it adds a new rule to the forwarding layer to permit the traffic. In the case of malicious traffic, the controller instructs the forwarding layer to block packets by sending a rule that creates a flow entry to drop the packet.
6. Results and Discussion
This section presents a comparative study of three related works closely aligned with my research and our SDN-ML-IoT method. As shown in
Table 12 below, Zhenpeng Liu, in [
30], employed an improved binary grey wolf optimization algorithm and RF. Their model achieved an accuracy of 99.13%. When compared to similar studies, the presented work demonstrated an improvement in accuracy by 0.0033. Hani Elubeyd, in their paper [
37], proposed a hybrid deep learning model that combines three algorithms: a 1D CNN, a GRU, and a DNN. They achieved an accuracy of 99.81%, improving upon other related works by 0.50%. Walid I. Khedr, in the paper [
38], utilized the FMDADM framework based on the RF algorithm, achieving an accuracy of 99.79%. This outperforms previous related works by 0.08%.
Our proposed method, SDN-ML-IoT, employs the RF algorithm on a synthetic dataset. It is essential to note that different studies use diverse datasets, models, and evaluation metrics. Consequently, making direct comparisons with the results of other studies can be challenging. Nonetheless, our proposed method exhibits outstanding accuracy, achieving 99.99%. This performance surpasses that of related studies. It adeptly detects DDoS attacks on SDNs and effectively mitigates these attacks.
7. Conclusions and Future Works
This paper introduces an enhanced IDPS framework, utilizing the RF algorithm within the SDN framework, named SDN-ML-IoT, aimed at fortifying the security of IoT devices in smart homes against DDoS attacks. The model selection process involved the collection of a synthetic dataset based on the monitoring capabilities of the Ryu controller. This dataset encompasses normal traffic and six distinct types of DDoS attacks, tailored to the specific requirements of IoT devices in smart homes. The dataset was then utilized to train and evaluate four ML algorithms specialized in IDPS: NB, LR, KNN, and RF. To address the multiclass classification challenge, we employed an OvR strategy to transform it into a binary classification problem, optimizing the detection problem for binary classification. This strategy facilitated the handling of imbalanced data, reduced computational complexity, and improved training and prediction times. Additionally, we utilized the REF method to streamline feature selection, reducing training time and enhancing accuracy. The method also incorporated a method and fold cross-validation approach to mitigate overfitting. The simulation results showed that the selection of RF as the SDN-ML-IoT framework was favorable for real-time deployment within SDN networks for smart homes, achieving an accuracy of 99.99% and a training time of 20 s. The model demonstrated adaptability and effectiveness across different network topologies and sizes, providing predictive detection times between 1 and 3 s, depending on network complexity. The SDN-ML-IoT not only identifies DDoS attacks but also mitigates them by blocking the DDoS packets based on their source ports.
In future work, we plan to implement our SDN-IoT-ML framework in real-world deployments to evaluate its results. We aim to enhance our model by incorporating multiclass classification to directly mitigate attacks based on their class, leveraging the ip_proto field. Additionally, we will focus on exploring other attack types targeting IoT devices, emphasizing threats such as man-in-the-middle attacks, Botnets, Zero-Day Exploits, and more. Employing multiple Ryu controllers will facilitate the rapid sharing of threat information, enabling controllers to respond more quickly to emerging security threats. This investigation aims to enhance the understanding of security vulnerabilities in IoT systems and develop robust countermeasures against these prevalent threats.