## 1 Introduction  
Intrusion is an activity of meddling in an information system to perform an action that is not legally allowed. An intrusion-detection system (IDS) is a system for identifyingintrusions and notifying them correctly to the proper authorities. With the proliferation of network devices, the size of network traffic is growing, which has led to an increase in the number of network attacks. Thus, the current network traffic situation has highlighted the importance of intrusion-detection systems [1; 2]. As the Internet of Things (IoT) allows numerous and a variety of devices to connect, interact, and exchange data, security remains a big concern in IoT environments. Because of its distributed nature, IoT is prone to attacks and vulnerable to intruders. Due to the pervasiveness of IoT devices and the heterogeneity of protocols, it is easy for intruders to break into data and frustrate its integrity [3]. Presently, intrusion-detection systems (IDSs) have become indispensable to keep networks safe and secure. Such intrusion-detection systems (IDS) are meant to protect the network by spotting anomalous behaviors or illicit uses. Network intrusion-detection systems notice deliberate and successful attacks at the endpoints or within the networks. Currently, machine-learning algorithms have proved a promising approach to detecting intrusion. By applying supervised and unsupervised machine-learning algorithms to real-time datasets, we can detect the pattern of attacks, the nature of attackers, and the type and source of malicious data packets [4]. To date, many researchers have proposed different network intrusion-detection systems. Some of these proposed systems successfully detect network intrusions, but only a few of them have based their research on IoT scenarios, and only a few of them have performed their research experiments on real-time IoT datasets. The datasets used in current research have not actually originated from actual IoT networks. For attack analysis and developing intrusion-detection systems, a number of datasets have been produced that are applicable in different research scenarios [5]. However, most of the existing intrusion-detection systems (IDS) have been designed using commonly available DARPA 98, KDD Cup 99, UNSW15, and NSL-KDD datasets. A comparison of these datasets has been given in Table 1. The problem is that none of these datasets genuinely resembles an IoT network. Moreover, these datasets were designed years ago. These outdated datasets no longer reflect the current network behaviors and have not undergone modern cyber-attacks. In our research, we have used a realistic BoT-IoT dataset [6]. This real-time dataset contains the most modern data attacks and offers us the ease to use it for the purpose of intrusion-detection system design and analysis using machine-learning techniques. With a huge training dataset, the machine-learning predictors have been trained thoroughly. Also, we have selected more and better features of malicious datasets. Moreover, along with other supervised machine-learning algorithms, we have also tried the K-means nearest \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Dataset** & \begin{tabular}{c} **Year of** \\ **Creation** \\ \end{tabular} & **Realistic Traffic** & **IoT Traces** & \
\begin{tabular}{c} **Full Packet** \\ **Captured** \\ \end{tabular} &
\begin{tabular}{c} **Diverse Attack** \\ **Scenarios** \\ \end{tabular} & **Labeled Data** \\ \hline DARPA98 & 1998 & No & No & Yes & Yes & No \\ KDDCUP99 & 1999 & No & No & Yes & Yes & Yes \\ CAIDA & 2007 & Yes & No & No & No & No \\ UNIBS & 2009 & Yes & No & Yes & No & No \\ ISCX & 2012 & Yes & No & Yes & Yes & Yes \\ UNSWNB15 & 2015 & Yes & No & Yes & Yes & Yes \\ CICIDS-17 & 2017 & Yes & No & Yes & Yes & Yes \\ BoT–IoT & 2018 & Yes & Yes & Yes & Yes & Yes \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of datasets and advantage of Bot–IoT.