Intrusion Detection System For IoT Environments Using Machine Learning Techniques
Intrusion Detection System For IoT Environments Using Machine Learning Techniques
Abstract—The Internet of Things (IoT) is fast becoming the Network security is a prevalent topic and a widespread
new normal in our everyday lives. The communication of concern as the IoT ecosystem gets bigger. As such, smart
connected devices without requiring human intervention has led to ecosystems based on the IoT paradigm must address and
the advent of smart ecosystems or environments. Smart ecosystems
emphasize security and privacy[1]. The diversity of IoT
are an environment where smart devices or ‘things” are trying to
protocols and device resource limitations make IoT security
improve the quality of life for their inhabitants by determining the
inhabitant's intent without explicit input. This technological
a difficult challenge. IoT security systems that actively
advancement brings with it security concerns concerning detect attacks such as Intrusion Detection Systems (IDS)
confidentiality, integrity, and availability as large data volumes are would be ideal. An intrusion detection system analyses
processed by smart devices. Mainstream security solutions may not network traffic data to identify and defend against intrusions
work in IoT environments due to their unique nature that jeopardize an information system's confidentiality,
, whereby IoT has different protocols, and they have integrity, and availability [2].
computational resource limitations. This project seeks to
develop an intrusion detection system for IoT environments in
an IoT network utilizing a machine learning technique
Confronted with such a challenge there is a need for an
whereby a user is alerted if an anomaly has been detected.
effective security solution that can aid us in the hostile cyber
Keywords— IoT, Intrusion Detection System, Smart terrain that we find ourselves in today. The advancement of
environments, Machine Learning Artificial Intelligence technology brings an opportunity for
its incorporation into the cybersecurity sector. The ability of
[1] INTRODUCTION machine learning algorithms to learn and infer from data
The Internet of Things environment is made up of web- and then accurately make predictions from the data without
enabled devices that employ embedded systems needing explicit human input makes it ideal as an anomaly
, such as processors, sensors, and actuators to gather certain detector in IDSs.
data which will be used in their s surroundings. IoT devices
exchange the sensor data they gather with other similar
gadgets and take action based on the data they exchange.
Aims and Objectives
Humans may engage in the setting up of these devices by
giving them instructions or retrieving data. However, these
devices conduct most of the tasks without human The project aims to create an intrusion detection system
intervention. model for IoT contexts using machine learning.
Authorized licensed use limited to: FLORIDA INTERNATIONAL UNIVERSITY. Downloaded on August 18,2023 at 18:33:12 UTC from IEEE Xplore. Restrictions apply.
• To simulate an IoT environment via an IoT test bed king the source. Considering the advantages of the system,
we noted a few drawbacks concerning the high number of
• To identify anomalies in the IoT environment. false positives recorded and resource consumption.
• To categorize attacks on the IoT environment
• To issue an alert when an intrusion is discovered. Mohamed et al. [8] developed a cloud-based intrusion
detection system (IDS) utilizing Raspberry Pi 3 to gather
traffic from smart devices and send it to a cloud-based
analyzer. Random Forests and neural networks are used by
[2] LITERATURE REVIEW
the intrusion detection system to find intrusions. Data
A. Related Works gathering, data processing, and detection and alerting are the
Physical or cyber-related assaults are common in IoT three divisions of the system. The gadget in question is used
environments, however, for this study, we focused on cyber or to gather IoT communication, extract features, and then
network risks. According to Pa tel and Aggarwal [3], IoT classify the collected characteristics. The UNSWB dataset,
ecosystems antagonize security risks from several dimensions produced by the CAAA, was used by the authors. The
due to the IoT architecture, which includes the application system's biggest flaw, however, is that it has a high rate of
false positives, demands a lot more resources, and is highly
, network, and perception layers. The most common IoT
cyber-attacks according to Asharf et al, [4] are: expensive to use cloud technology.
• Distributed Denial of Service which results in Nwafor, Campbell, and Bloom [9] proposed an origin
service unavailability. graph-based anomaly detection method for detecting
• Worm Attacks - software that spreads via a unexpected instances of sensor-based incidents in an IoT
network and targets host systems with harmful device. They tested their proposed solution by conducting
malware. investigations on an IoT system that mimics a temperature
• Hello flood attacks management system. However, we discovered that their
current anomaly detection system only supports offline data
and does not allow real-time detection.
Nugroho et al. [5] classify IoT security and privacy needs
under client privacy, data authentication, access control, and
resistance to attacks Summerville et al. [10] developed a deep-packet
. They further state that several approaches are employed in anomaly detection-based IDS that uses bit-pattern matching
IDSs and they are categorized by the detection method to choose feature selection. Intersecting groups of bytes, or
which includes anomaly, signature method, specification network packets, are used in the feature selection process to
method, and a hybrid approach, and the placement strategy choose features. If bits match in every aspect, the re is a
which is either on the network or based on the host device. pattern match. They achieved minimal false-positive rates
based on their testing.
We noted that several datasets are used in the study of IDSs
Bakhsh et al. [7] developed a system for dubbed IDPIoT for IoT environments. Popular examples are KDD 99CUP,
which takes in packets from the network interface and decodes NSL- KDD, CICIDS 2017, and the UNSW-NB 15 datasets.
them before processing and delivering them to the detector The benchmark datasets are a requirement for the testing and
agent. To detect anomalies in the packet header, the detector validation of an intrusion detection system, according to
agent examines every packet header for a specific kind of Khraisat and Alazab [6] Furthermore, the use of offline systems
behavior. The system analyzer inspects every packet to and popular aged datasets, for example, NSL-KDD, and KDD
preestablished detection rules such as matching when the cup’99 presents research gaps. The old datasets do not truly
alerting and logging system is turned on. Messages are then reflect the nature of IoT network environments nowadays
sent to the output module, which logs alerts and triggers an which are characterized by large data volumes transmitted and
alarm. The program stores the alarm system's output data in a new attack vectors and anomalies.
pre-set location, like a log file or database. Additionally,
prevention agents isolate the servers and offer real-time attack
mitigation by dropping suspicious packets and bloc
Authorized licensed use limited to: FLORIDA INTERNATIONAL UNIVERSITY. Downloaded on August 18,2023 at 18:33:12 UTC from IEEE Xplore. Restrictions apply.
Thus the complex nature and vast range of IoT devices
and protocols, and their resource limitations made IoT In this stage, we designed the artifact based on our
security a difficult task [2]. In light of this problem, the objectives and the research gaps. Unified Modeling
motivation was to come up with an effective IoT security Language diagrams were used to achieve this. Below is the
solution for Io T environments. use case diagram showing the actors and how they interact
with the system.
[3] OBJECTIVES
In this phase, we deduced the objectives from the
identified problem and research gaps presented by existing
systems. Thus the objectives of the system are :
• To simulate an IoT environment via an IoT testbed
• To identify anomalies in the IoT environment
• To categorize attacks on the IoT environment
[4] METHODOLOGY
Authorized licensed use limited to: FLORIDA INTERNATIONAL UNIVERSITY. Downloaded on August 18,2023 at 18:33:12 UTC from IEEE Xplore. Restrictions apply.
showed how well the model has been trained by using the
training data given a set of hyperparameters in the ML
model.
The user will enter the system, and the database will
authenticate and respond to the user. The I DS and the IoT The metrics for evaluating our model include:
network will create a handshaking connection, and once that
connection is formed, the IoT network will transfer data to
the IDS module. If the IDS module detects an intrusion, the
Accuracy =
Web app will display a notification and provide details
Precision =
Recall =
F1 Score = 2 ∗ ∗
Where:
• TP – True Positive
• TP – True Negative
• FP – False Positive
Fig. 3. Sequence Diagram
• FN – False Negative
The network traffic is monitored using Tshark and dumped Network Logs - The network logs module is used to show
into a CSV file. TShark is a command line network packet the IoT network's traffic in real time. Similar to the
analyzer used to capture packets from a live network and notification module, the web connection is set up and used
dump the traffic data into file.csv which is later read by the to start the consumers.py lo op that retrieves real-time traffic
backend Python script. The code snippet below illustrates statistics from file.csv. This information is transmitted to the
the packet information the Tshark script will collect. front end, where it is shown. The user can track IoT network
traffic since it updates in real-t ime.
Authorized licensed use limited to: FLORIDA INTERNATIONAL UNIVERSITY. Downloaded on August 18,2023 at 18:33:12 UTC from IEEE Xplore. Restrictions apply.
Fig. 5. Notifications Page
Authorized licensed use limited to: FLORIDA INTERNATIONAL UNIVERSITY. Downloaded on August 18,2023 at 18:33:12 UTC from IEEE Xplore. Restrictions apply.
esses to save time and financial resources in responding to REFERENCES
incidents they did not anticipate.
[1] M. F. Elrawy, A. I. Awad, and H. F. A. Hamed, “Intrusion detection
Users can also use the information they gather from the systems for IoT-based smart environments: a survey,” Journal of
Cloud Computing, vol. 7, no. 1. Springer Verlag, Dec. 01, 2018. doi:
detected anomalies to implement more effective controls in 10.1186/s13677-018-012 3-6.
their IoT environments. The detected anomalies will show [2] K. V. V. N. L. Sai Kiran, R. N. K. Devisetty, N. P. Kaly an, K.
Mukundini, and R. Karthi, “Building a Intrusion Detection System for
any weaknesses in the IoT environment. Effectively users IoT Environment using Machine Learning Techniques,” in Procedia
can take a leading role in dealing with the weaknesses other Computer Science, 2020, vol. 171, pp. 2372–2379. doi:
than responding late when the network is already down. 10.1016/j.procs.2020.04.257.
[3] M. M. Patel and A. Aggarwal, “Security attacks in wirel ess sensor
networks: A survey,” in 2013 International Conference on Intelligent
IoT devices collect huge amounts of data. Dat that Systems and Signal Processing ( ISSP), 2013, pp. 329–333. doi:
10.1109/ISSP.2013.6526929
privacy is paramount in today’s world. Such technology will [4] J. Asharf, N. Moustafa, H. Khurshid, E. Debie, W. Haider , and A.
aid in data protection and privacy. This in turn will save a Wahab, “A review of intrusion detection systems using machine and
business from losing confidential data that their IoT deep learning in internet of things: Challenges, solutions and future
directions,” Electroni cs (Switzerland), vol. 9, no. 7. MDPI AG, Jul.
environment collects and exchanges. 01, 2020. doi: 10.3390/electronics9071177.
[5] E. P. Nugroho, T. Djatna, I. S. Sitanggang, A. Buono, an d I.
[7] CONCLUSION Hermadi, “A Review of Intrusion Detection System in IoT with
Machine Learning Approach: Current and Future Research,” in 2020
6th International Conference on Scie nce in Information Technology:
Embracing Industry 4.0: Towards Innovation in Disaster
The intended solution was successful in achieving the Management, ICSITech 2020, Oct. 2020, pp. 138–143. doi:
predetermined goals. The use of an Arduino Uno board, Node 10.1109/ICSITech49800.2020. 9392075.
MCU module, ultrasonic sensor, and temperature and [6] A. Khraisat and A. Alazab, “A critical review of intrusion detection
systems in the internet of things: techniq ues, deployment strategy,
humidity sensors allowed for the successful simulation of an validation strategy, attacks, public datasets and challenges”, doi:
IoT ecosystem I n the development of an IoT testbed. Using 10.1186/s42400-02 1-00077-7.
[7] S. T. Bakhsh, S. Alghamdi, R. A. Alsemmeari, and S. R. Hassan, “An
the scikit learn to package, a machine learning classifier was
adaptive intrusion detection and prevention system for Internet of
trained and evaluated, and random forest performed better, Things,” Int J Distrib Sens Netw, vol. 15, no. 11, Nov. 2019, doi:
with an accuracy of 87%. To identify intrusions and notify the 10.1177/1550147719888 109.
[8] T. A. Mohamed, T. Otsuka, and T. Ito, “Towards machine learning
user when an anomaly has been discovered in the IoT network based IoT intrusion detection service,” in Lecture Notes in Computer
simulation environment, Random Forest was selected as the Science (including subseries Lecture Notes in Artificial Intelligence
classifier, and the implementation of a web application with and Lecture Notes in Bioinformatics), 2018, vol. 10868 LNAI, pp.
580–585. d oi: 10.1007/978-3-319-92058-0_56
the classifier functioning in the backend was successfully [9] E. Nwafor, A. Campbell, and G. Bloom, “Anomaly-based Intrusion
constructed. Detection of IoT Device Sensor Data using Proven ance Graphs.”
Computing and Communications Conference (IPCCC), 2015 IE
EE 34th International Performance. IEE
[10] J. vom Brocke, A. Hevner, and A. Maedche, “Introduction to Design
Recommendations Science Research,” 2020, pp. 1–13. doi: 10.10 07/978-3-030-46781-4_1. I.
Sommerville, Software engineering.
For future work, researchers can look at catering to more [11] N. Moustafa and J. Slay, “UNSW-NB15: A Comprehensive Data sfor
attack vectors since new and deadly attacks against IoT Network Intrusion Detection systems (UNSW-NB1 5 Network Data Set).”
[Online]. Available: https://cve. mitre.org/
environments are evolving with time. An active IDS which
will have a prevention module can be added so that it can
detect and then take measures to prevent the anomaly from
causing damage. Currently, the system is web-based,
however, to cater to everyone, a mobile application can also
be produced to include Android and iOS.
Authorized licensed use limited to: FLORIDA INTERNATIONAL UNIVERSITY. Downloaded on August 18,2023 at 18:33:12 UTC from IEEE Xplore. Restrictions apply.