State-of-the-Art Review on IoT Threats and Attacks: Taxonomy, Challenges and Solutions

: The Internet of Things (IoT) plays a vital role in interconnecting physical and virtual objects that are embedded with sensors, software, and other technologies intending to connect and exchange data with devices and systems around the globe over the Internet. With a multitude of features to offer, IoT is a boon to mankind, but just as two sides of a coin, the technology, with its lack of securing information, may result in a big bane. It is estimated that by the year 2030, there will be nearly 25.44 billion IoT devices connected worldwide. Due to the unprecedented growth, IoT is endangered by numerous attacks, impairments, and misuses due to challenges such as resource limitations, heterogeneity, lack of standardization, architecture, etc. It is known that almost 98% of IoT trafﬁc is not encrypted, exposing conﬁdential and personal information on the network. To implement such a technology in the near future, a comprehensive implementation of security, privacy, authentication, and recovery is required. Therefore, in this paper, the comprehensive taxonomy of security and threats within the IoT paradigm is discussed. We also provide insightful ﬁndings, presumptions, and outcomes of the challenges to assist IoT developers to address risks and security ﬂaws for better protection. A ﬁve-layer and a seven-layer IoT architecture are presented in addition to the existing three-layer architecture. The communication standards and the protocols, along with the threats and attacks corresponding to these three architectures, are discussed. In addition, the impact of different threats and attacks along with their detection, mitigation, and prevention are comprehensively presented. The state-of-the-art solutions to enhance security features in IoT devices are proposed based on Blockchain (BC) technology, Fog Computing (FC), Edge Computing (EC), and Machine Learning (ML), along with some open research problems.


Introduction
We live in a time when technology is an essential requirement for all humans, and the evidence is the increased dependence on technology in almost every aspect of our lives. Today's world is evolving with the rapidly growing Internet of Things (IoT)-based application [1]. The rise of the IoT has been a glorious phenomenon in recent years. The physical and virtual objects implanted with sensors, software, and other technologies are interlinked together in IoT [2]. It envisages communicating and sharing data with other devices and systems worldwide over the Internet. Further, IoT is like an array of network-enabled devices that exclude traditional computers such as laptops and servers.
IoT has sprawled everywhere, starting from the healthcare sector to the big industries. It is now implantable, wearable, and portable, resulting in a pervasive and interactive devices and systems worldwide over the Internet. Further, IoT is like an array of networkenabled devices that exclude traditional computers such as laptops and servers.
IoT has sprawled everywhere, starting from the healthcare sector to the big industries. It is now implantable, wearable, and portable, resulting in a pervasive and interactive world [3]. It modifies the physical objects around us into smart objects, creating an information environment that increasingly changes human living standards. For instance, IoT devices track and collect essential measurements (such as blood pressure, blood sugar level, pulse rate, etc.) in real time, allowing emergency alerts to improve the odds of a patient's survival [4]. Moreover, autonomous and self-driving vehicles prevent drivers from deviating from paths or accidents while providing them assistance to reach their destinations. In addition, those definitions are expanded to provide automatic emergency alerts of the closest road and medical assistance in the event of an accident. IoT also covers many aspects of modern industries, including manufacturing, assembly, packing, logistics, smart cities, and aviation industries [5]. Some of the essential IoT-based application domains in health, commerce, communication, and entertainment are shown in Figure 1. To implement IoT, the traditional technology had to undergo some major modifications. For example, to convert an isolated device into a transmitting device, there is a need to increase small computing devices' memory and processing capacity while dramatically reducing their size [6]. Further, the creation of various lightweight, secure protocols for communication between different IoT devices is equally important. The improvements to the conventional networks to help the operation of the IoT ecosystem have their own set To implement IoT, the traditional technology had to undergo some major modifications. For example, to convert an isolated device into a transmitting device, there is a need to increase small computing devices' memory and processing capacity while dramatically reducing their size [6]. Further, the creation of various lightweight, secure protocols for communication between different IoT devices is equally important. The improvements to the conventional networks to help the operation of the IoT ecosystem have their own set of consequences. However, the unprecedented growth of interconnected devices has crippled the IoT ecosystem. Consequently, there exists enough scope for threats and attacks in IoT-based applications.
A similar trend can be seen with respect to the protocols and standards in the IoT paradigm. The publication statistics obtained from the SCOPUS database for the articles on IoT protocols, IoT protocols and threats, and IoT protocols and attacks are shown in Figure 3. The plotted statistics reveal that the threats and attacks analysis in IoT protocols were sparsely explored in the past 10 years. Nevertheless, these aspects are gaining rapid momentum, which can be corroborated from the published articles on threats and attacks analysis in IoT protocols, which were six and five, respectively, in 2010, and have increased to 160 and 254, respectively, by the third quarter of 2021 (approximately). In a nutshell, the increasing interests of the researchers in the paradigm of IoT architecture and A similar trend can be seen with respect to the protocols and standards in the IoT paradigm. The publication statistics obtained from the SCOPUS database for the articles on IoT protocols, IoT protocols and threats, and IoT protocols and attacks are shown in Figure 3. The plotted statistics reveal that the threats and attacks analysis in IoT protocols were sparsely explored in the past 10 years. Nevertheless, these aspects are gaining rapid momentum, which can be corroborated from the published articles on threats and attacks analysis in IoT protocols, which were six and five, respectively, in 2010, and have increased to 160 and 254, respectively, by the third quarter of 2021 (approximately). In a nutshell, the increasing interests of the researchers in the paradigm of IoT architecture and protocols, Sustainability 2021, 13, 9463 5 of 45 which are sparsely explored from threats and attacks point-of-view, is the motivating factor for the present work.
Sustainability 2021, 13, x FOR PEER REVIEW 5 of 47 protocols, which are sparsely explored from threats and attacks point-of-view, is the motivating factor for the present work. The other motivating factor for the present work is the threats and attacks analysis and possible solutions using ubiquitous technologies, such as BC, Fog Computing (FC), Edge Computing (EC), and Machine Learning (ML). The threats and attacks analysis and possible solutions in architecture, protocols, and standards have gained significant momentum in the past few years, corroborating the upwards trend in the published articles as per the SCOPUS database statistics shown in Figure 4.  The other motivating factor for the present work is the threats and attacks analysis and possible solutions using ubiquitous technologies, such as BC, Fog Computing (FC), Edge Computing (EC), and Machine Learning (ML). The threats and attacks analysis and possible solutions in architecture, protocols, and standards have gained significant momentum in the past few years, corroborating the upwards trend in the published articles as per the SCOPUS database statistics shown in Figure 4. protocols, which are sparsely explored from threats and attacks point-of-view, is the motivating factor for the present work. The other motivating factor for the present work is the threats and attacks analysis and possible solutions using ubiquitous technologies, such as BC, Fog Computing (FC), Edge Computing (EC), and Machine Learning (ML). The threats and attacks analysis and possible solutions in architecture, protocols, and standards have gained significant momentum in the past few years, corroborating the upwards trend in the published articles as per the SCOPUS database statistics shown in Figure 4.  IoT is far behind in realizing its true potential due to the lack of interoperability. The most comprehensive review on security standards and interoperability goals is presented by Lee et al. [19]. To comprehensively review the existing architectures, protocols, and standards is one of the promising means to address the interoperability issues in IoT and other challenges. If we look at the trend of the type of documents in the SCOPUS database, it can be seen that researchers are significantly contributing with Review articles (12.2%) being the third most in number behind Articles (50.8%) and Conference papers (29.1%). These statistics obtained from the SCOPUS database are shown in Figure 5. Conclusively, the present work is a review that comprehensively surveys the existing work and presents the possible solution in the context of threats and attacks pertaining to the architecture, protocols, and standards in the IoT paradigm. IoT is far behind in realizing its true potential due to the lack of interoperability. The most comprehensive review on security standards and interoperability goals is presented by Lee et al. [19]. To comprehensively review the existing architectures, protocols, and standards is one of the promising means to address the interoperability issues in IoT and other challenges. If we look at the trend of the type of documents in the SCOPUS database, it can be seen that researchers are significantly contributing with Review articles (12.2%) being the third most in number behind Articles (50.8%) and Conference papers (29.1%). These statistics obtained from the SCOPUS database are shown in Figure 5. Conclusively, the present work is a review that comprehensively surveys the existing work and presents the possible solution in the context of threats and attacks pertaining to the architecture, protocols, and standards in the IoT paradigm.

Comparison with Existing Surveys
Several works have surveyed IoT, its architecture, its reference model, communication protocols, etc., from the perspective of security, threats, and vulnerabilities with possible countermeasure methodologies. In this section, some of the existing surveys are discussed and compared with the present work.
Many works in the literature cover the various aspects of the threats and attacks in IoT. Authors in [20][21][22][23][24][25][26] cover the taxonomy of the threats and attacks pertaining to the IoT. These works mainly focus on two broad categories: the architecture of IoT and protocols/standards in IoT. Despite covering the threats and attacks taxonomy, only a few of these works present the possible countermeasures. However, none of these works present countermeasures of threats and attacks based on ubiquitous technology such as BC, FC, EC, and ML. Such ubiquitous technologies in analyzing the threats and attacks have been surveyed in scattered ways by the authors in [27][28][29][30][31][32][33][34][35][36][37]. A comprehensive review of all these technologies to combat IoT threats and attacks is not available.
The comprehensive survey on security and attacks with possible countermeasures solutions has been presented by Abosata et al. in [20], where authors consider the application-specific IoT architecture belonging to industrial IoT. Mann et al. in [21] presented the classification of attacks pertaining to the IoT environment. For attack classification, authors have considered a three-layer architecture comprising devices, gateway, and cloud with respect to the possible attack type. The countermeasures have also been discussed. Ogonji has comprehensively presented a threat taxonomy for the IoT environment in [22], including two broad categories: security threat and privacy threat. The authors of this survey presented taxonomy and countermeasures for the three-layer domain-specific IoT architecture. The state-of-the-art survey on intrusion detection for mitigating the impact of threats and attacks on IoT systems has been presented by Zarpelão et al. [23]. The authors proposed four attributes in the survey: intrusion detection placement strategy, detection method, security threats, and validation. A similar extensive survey by Hajiheidari et al. discusses the state-of-the-art intrusion detection system for IoT environment

Comparison with Existing Surveys
Several works have surveyed IoT, its architecture, its reference model, communication protocols, etc., from the perspective of security, threats, and vulnerabilities with possible countermeasure methodologies. In this section, some of the existing surveys are discussed and compared with the present work.
Many works in the literature cover the various aspects of the threats and attacks in IoT. Authors in [20][21][22][23][24][25][26] cover the taxonomy of the threats and attacks pertaining to the IoT. These works mainly focus on two broad categories: the architecture of IoT and protocols/standards in IoT. Despite covering the threats and attacks taxonomy, only a few of these works present the possible countermeasures. However, none of these works present countermeasures of threats and attacks based on ubiquitous technology such as BC, FC, EC, and ML. Such ubiquitous technologies in analyzing the threats and attacks have been surveyed in scattered ways by the authors in [27][28][29][30][31][32][33][34][35][36][37]. A comprehensive review of all these technologies to combat IoT threats and attacks is not available.
The comprehensive survey on security and attacks with possible countermeasures solutions has been presented by Abosata et al. in [20], where authors consider the applicationspecific IoT architecture belonging to industrial IoT. Mann et al. in [21] presented the classification of attacks pertaining to the IoT environment. For attack classification, authors have considered a three-layer architecture comprising devices, gateway, and cloud with respect to the possible attack type. The countermeasures have also been discussed. Ogonji has comprehensively presented a threat taxonomy for the IoT environment in [22], including two broad categories: security threat and privacy threat. The authors of this survey presented taxonomy and countermeasures for the three-layer domain-specific IoT architecture. The state-of-the-art survey on intrusion detection for mitigating the impact of threats and attacks on IoT systems has been presented by Zarpelão et al. [23]. The authors proposed four attributes in the survey: intrusion detection placement strategy, detection method, security threats, and validation. A similar extensive survey by Hajiheidari et al. discusses the state-of-the-art intrusion detection system for IoT environment with a detailed Sustainability 2021, 13, 9463 7 of 45 taxonomy of the attacks responsible for intrusion in IoT at various layers [24]. The seminal survey using the top-down approach on various aspects of security in the IoT environment from application-specific IoT architecture has been presented by Kouicem et al. [25]. The authors have also presented the detailed taxonomy of security solutions covering several application-specific IoT architectures, and they also proposed software-defined networkingbased solutions to the security in IoT. Sun et al.,in [26], focused on the physical layer of the IoT and presented a rich survey covering various security aspects of the protocols and standards, including the countermeasure methodologies. All these surveys are rich in content covering various aspects of threats and attacks in the context of IoT architectures or protocols. Despite presenting the possible countermeasures of threats and attacks, the countermeasures based on rapidly evolving technologies such as BC, FC, EC, ML, etc., have not been discussed to the authors' best knowledge. However, the concluding remarks of all these surveys identified some of the research gaps and provided a hint towards utilizing these technologies.
Elazhary [27] has presented an extensive survey on such computing technologies in the paradigm of IoT. Despite handling various aspects of IoT, particularly computation, processing, and analysis of voluminous IoT data, the security aspects of these data from the architecture point of view are not extensively covered in this survey. Taylor, P.J. et al., in [28], presents a seminal survey of using BC technology for providing the security countermeasures in IoT environment with some open challenges to incorporate other such technologies in the IoT for improving cybersecurity. BC as an infrastructure for IoT architecture with enhanced performance and security has been proposed by Memon et al. in [29]. In this survey, the authors have presented a comparative survey on cloud-based vs BC-based IoT architecture and identified some research gaps with some other similar technologies such as EC and FC. From the point of design objectives, a systematic survey on BC envisioning secure IoT infrastructure has been presented by Tran et al. in [30].
Fersi et al. developed a comprehensive survey in [31] about the scope of FC from the various aspects of the IoT, including enhanced data computing, network management, interoperability issues, security, etc. A similar review on FC from several perspectives, including threats and attacks countermeasures, has been presented by Atlam et al. [32]. Hamdan et al.,in [33], comprehensively review the architecture of IoT based on EC. The survey is very rich from the architectural point of view; however, the threats and attacks analysis of such EC-based architecture is narrowly covered in this survey. Another pragmatic survey with EC-based architecture in IoT covering physical layer aspects is presented by Capra et al. in [34]. In this survey, the authors also cover the security aspects of hardware-based IoT architecture. Knowing the extraordinary effectiveness of the EC in IoT, the most seminal survey on the various simulator that can be used to validate the IoT model has been presented by Ashouri et al. in [35]. This survey is one of the best in its field, covering the EC-based simulation tools in IoT, which can even be exploited for modeling and analysis of threats and attacks in the IoT environment.
One of the most comprehensive surveys in the paradigm of ML to enable security and privacy in the IoT data ecosystem has been presented by Amiri et al. in [36]. This survey considers an ML-based approach for enhancing privacy in the IoT data ecosystem where a three-layer architecture comprising perception, network, and application layers of IoT has been considered. The authors also propose a similar approach of using BC with ML to enhance security on the IoT data ecosystem. The state-of-the-art review on the application of ML for intrusion detection in IoT environment has been presented by Adnan in [37]. The authors consider the three dominant attributes, namely, computational complexity, concept drift, and dimensionality, which are mitigated by integrating ML in IoT, envisioning the security of the IoT-based applications.

Scope of the Present Survey and Contributions
As discussed in the previous sections, the threats and attacks analysis in IoT is scattered and none of the surveys so far, to the best knowledge of the authors, covers the threats and attacks taxonomy covering architecture, protocols, and standards of IoT with possible countermeasures using rapidly evolving ubiquitous technologies, such as BC, FC, EC, and Sustainability 2021, 13, 9463 9 of 45 ML, simultaneously. The threats and attacks were discussed in general without focusing on architecture and protocols [38][39][40]. Security concerns were addressed in [38] using EC and in [40] using BC. The research gaps were identified, and some open research problems were proposed in [38,40]. The analysis on threats and attacks based on protocols and standards without addressing security solutions was shown in [41]. On the other hand, [42] neither covers the architecture nor protocols for analyzing the threats and attacks. However, security countermeasures were discussed using BC with open research problems in [42]. In [43], threats and attacks were analyzed based on architecture without any security countermeasures. In [44], threats and attacks were discussed based on architectures with possible security countermeasures using FC and EC, but it does not identify the research gaps. Similar observations can be made throughout the seminal existing surveys discussed in Table 1. A comparative analysis reveals that none of these surveys analyze the threats and attacks covering all aspects, i.e., architecture as well as protocols and standards. In addition, the security countermeasures have not been discussed in any one of the existing surveys using all four ubiquitous technologies, i.e., BC, FC, EC, and ML, simultaneously. An extensive survey on threats and attacks analysis in the context of IoT, its challenges, taxonomy, and possible technological solutions covering the most important aspects of the IoT, such as architecture, protocols, and standards, is presented in this work. The vital contributions of the paper are highlighted below:

•
This survey envisages providing a deeper insight into the IoT from the perspective of threats and attacks. • An information-rich survey on various aspects of IoT, including threats and attacks from the literature, is presented. • This survey presents a five-layer IoT architecture and seven-layer IoT architecture, along with the existing three-layer architecture. • A comprehensive survey on the communication standards and protocols corresponding to three-layer, five-layer, and seven-layer IoT architectures is presented.

•
The multidimensional taxonomy of threats and attacks in IoT is proposed with impact assessment on its architecture.

•
With respect to communication standards and protocols, the threats and attacks corresponding to each of the proposed architectures, i.e., three-layer, five-layer, and seven-layer IoT architectures, are comprehensively reviewed.

•
The potential use of ubiquitous technologies, such as BC, FC, EC, and ML, are presented in the context of security enhancement in IoT.

•
The research gap, challenges, and some open problems are presented which can be further explored in the IoT paradigm.

Elementary Overview of an IoT System
The IoT is an evolving notion as a vast network of interconnected devices and services that store, share, and process data to dynamically adapt to the environment. IoT offers an ocean of opportunities, and so, many organizations aim to have IoT services integrated into their business processes. Before discussing the security threats, vulnerabilities, attacks, etc., it is pertinent to have a keen understanding of the layout of IoT. The emerging IoT technology typically consists of three levels of hardware which are integrated using software [76]. IoT devices, controllers, and peripherals constitute the first level of IoT, gateways and networks are associated with the second level, whereas cloud servers and control devices are part of the third level of IoT. Such a typical IoT system is depicted in Figure 6, followed by a brief discussion of each level. Sustainability 2021, 13, x FOR PEER REVIEW

Send Data
Gateway Internet Network

Cloud Server
Control Devices Figure 6. Elementary overview of an IoT system.

IoT Devices, Controllers, and Peripherals
The first level consists of IoT devices, controllers, and peripherals consistin sors, actuators, transducers, etc. Their basic function is to capture real-time da outer world and convert them into information for further analysis. These devic connected to or implanted in any device that needs to be tracked or mounted in ronment to control the device indirectly.
The IoT devices are embedded devices capable of transmitting information network to improve interactions with people and with other smart objects. The devices make up the bottom layer of the basic IoT architecture. One of the most im features of IoT devices is their ability to use multiple sensors for different app Sensors in IoT gadgets are generally coordinated through the sensor hubs. A se is a single point of connection that gathers and sends data from multiple senso system processing unit. Gathering data is the foremost step [77]. A sensor hub u ous transport mechanisms such as Inter-Integrated Circuit (I2C) or Serial Perip terface (SPI) to transfer data between the sensors and the applications. A commu channel between sensors and applications is established by these transmitting nisms that accumulate sensor data through IoT devices [78].
The vulnerabilities associated with some of the sensors in the IoT paradigm scribed in Table 2.

IoT Devices, Controllers, and Peripherals
The first level consists of IoT devices, controllers, and peripherals consisting of sensors, actuators, transducers, etc. Their basic function is to capture real-time data of the outer world and convert them into information for further analysis. These devices can be connected to or implanted in any device that needs to be tracked or mounted in the environment to control the device indirectly.
The IoT devices are embedded devices capable of transmitting information across a network to improve interactions with people and with other smart objects. These smart devices make up the bottom layer of the basic IoT architecture. One of the most important features of IoT devices is their ability to use multiple sensors for different applications. Sensors in IoT gadgets are generally coordinated through the sensor hubs. A sensor hub is a single point of connection that gathers and sends data from multiple sensors to the system processing unit. Gathering data is the foremost step [77]. A sensor hub uses various transport mechanisms such as Inter-Integrated Circuit (I2C) or Serial Peripheral Interface (SPI) to transfer data between the sensors and the applications. A communication channel between sensors and applications is established by these transmitting mechanisms that accumulate sensor data through IoT devices [78].
The vulnerabilities associated with some of the sensors in the IoT paradigm are described in Table 2. Sensors are vulnerable to numerous security attacks and threats which might be internal or external depending upon their features [79]. To name a few, information tampering, Man-In-The-Middle Attack (MITM), Distributed Denial of Service (DDoS), jamming, etc., are some of the notable threats to the IoT sensors.

Gateways and Networks
A gateway for IoT is a system or software program that connects the cloud to controller development boards, actuators, and smart devices [80]. It builds a bridge between the cloud and IoT devices. It systematically connects the field to the cloud. An IoT gateway, either a software application or a hardware appliance, is responsible for transmitting data between the cloud and IoT devices. It serves as a network router, connecting IoT devices to the cloud. It is capable of handling both inbound and outbound traffic. Inbound traffic is used for system management tasks, including upgrading device firmware, while outbound traffic is used to transfer IoT data to the cloud. The IoT gateway provides services to safely accumulate, operate, and filter data for analysis. It aids in the secure and safe transport of confederated data produced by the systems and the devices from the edge to the cloud. Ethernet, Wi-Fi, or a 4G/3G modem are used to link the IoT gateway to the cloud [81]. For data exchange and command transfer, a two-way communication channel is developed with the cloud. In an IoT environment, sensors and devices must logically communicate with other devices through the gateway or redirect the necessary data to the cloud. Some of the key functionalities of the IoT gateway are enumerated below.

•
Facilitating contact with non-Internet linked or legacy devices. Glancing over the number of functions and responsibilities of the IoT gateway, one can easily quote that it is essential to have a secure gateway network to carry out all the enlisted functions safely and efficiently. The gateway is prone to several different kinds of attacks which can be classified into five categories [ The state-of-the-art discussion on these attacks is comprehensively discussed later in this article.

Cloud Servers and Control Device
Smart devices of the IoT are being deployed at a rapid rate. However, the amount of data they produce makes it difficult to store and process in the local platforms. The unstructured IoT data can be easily stored in a public cloud infrastructure [83]. The scalability provided by cloud computing offers a solution to this problem. Cloud computing provides flexible computing and storage tools that can be used to assist in data management. As a result, this technology can be used to analyze data generated by sensors and IoT devices. Many of the major cloud providers use object storage technology to offer low-cost, scalable storage systems. Cloud computing allows businesses to store and analyze data easily and in real time, enabling them to get the most out of their data. According to a survey conducted by Information Week [84], 65% of respondents said that "the opportunity to satisfy business demands easily" was one of the most significant factors for a company to migrate to the cloud. Since they have high-speed networks with no data ingress fees, the public cloud is an excellent place to store the vast quantities of IoT data generated by businesses. However, the public cloud has plenty to do. Big data analysis applications that consume and process vast amounts of unstructured content have been added to the product offerings of cloud service providers. This enables companies that can potentially process data more efficiently than a private data center to build highly scalable IoT applications. Depending on the device's networking features, devices can connect to the cloud in a variety of ways. Some of these are cellular, satellite, Wi-Fi, Low Power Wide Area Networks (LPWAN) such as NB-IoT, and direct access to the Internet through Ethernet.
While the cloud has acquired universal popularity, and most IoT applications use cloud services for data storage and retrieval. However, questions about whether cloud technologies are genuinely safe and reliable are continuing to be debated. Nevertheless, cloud risks should also be addressed. The cloud is a public platform used by many people, and there could be malicious users on the cloud who pose a risk to IoT data. The cloud is vulnerable to several attacks such as SQL injection, DDoS, weak authentication, malicious applications, back doors, exploits, etc. [85]. An extensive survey on these aspects is discussed later in this survey.

Three-Layer Reference Model
The mitigation of security threats and attacks in IoT can be achieved by understanding the IoT reference model and protocol stack in-depth. There is no widely agreed-upon framework for the IoT [86]. However, different architectures have been suggested by different researchers [87]. The most basic architecture being followed widely is the threelayer reference model consisting of perception layer, network layer, and the application layer, which is illustrated in Figure 7a. The functionality of each of these layers is briefly summarized below.

•
Perception Layer: The perception layer is also often known as the physical layer. The layer deals with the various sensors affixed to the IoT devices. Sensor nodes, RFID Sensors, and other sensory technologies are provided by this layer [88]. The sensors in this layer gather data and transfer it to the network layer. Physical quantities such as temperature, humidity, light intensity, sound, etc., are measured by the sensors, which are pre-processed before they send the information to the network layer. The perception layer is primarily responsible for the data collection and its transmission to the network layer. Devices linked in short-range networks can collaborate with the help of the perception layer. • Network Layer: The network layer is made up of network components that enable communication to take place. It facilitates the data exchanged between the IoT devices. The network layer serves as a connection between the perception layer and the application layer. It is in charge of IoT networking, which involves connecting and translating IoT devices over a network. The network layer's job is to route and relay the data obtained by the perception layer over the network. The data are sent over the Internet to other computers or IoT hubs. Wi-Fi, Bluetooth, 3G/LTE, Zigbee, Lora, and other network technologies are examples of commonly used network technologies [89]. • Application Layer: The application layer is the topmost layer of the IoT architecture, and it is responsible for accomplishing the final purpose of community service. The application layer collects data from the network layer and uses them to accomplish the ultimate objective of delivering the IoT infrastructure's intended service. The application layer is liable for offering types of assistance and decides a bunch of conventions for message passing at the application level. The application layer serves as a bridge between applications and end clients, allowing them to communicate. It defines the allocation of resources and computation in data production, processing, screening, and feature selection. The application layer is a client-driven layer that performs various tasks for the clients and offers customized assistance as per a client's pertinent requirements [90]. This IoT layer brings together the industries to create highlevel intelligent application solutions such as disaster monitoring, health monitoring, translation, fortune, medical, environmental monitoring, and global management for all intelligent applications.

Five-Layer Reference Model
The architecture of IoT has been further improved by decomposing the responsibilities and functionalities of the existing three-layer architecture, resulting in a five-layer architecture [91]. A five-layer architecture consisting of a perception layer, network layer, service layer, operation layer, and application layer is proposed, which is different from that proposed by [92]. The pictorial representation of the five-layer reference model is as shown in Figure 7b. It is worthy to note that the application layer is segregated into three layers, namely, service layer, operation layer, and application layer. The functionalities of the service, operation, and application layers are briefly summarized below, whereas the perception layer and network layer hold the same responsibilities.

•
Service layer: This layer envisages facilitating the use of heterogeneous IoT devices, tools, testbeds, platforms, etc., for a wide range of IoT applications. The processing of the data from the network layers is also its responsibility. Generally, the data at this layer are voluminous, for which processing, computing, and analyzing are some key challenges to be handled by this layer.

•
Operation layer: This is an important layer, especially from the business point of view in IoT. The supervision of services offered by IoT, creating business models, visualization of the data, decision-making, etc., are some of the key responsibilities of this layer. Ensuring QoS across all layers is one of the vital responsibilities associated with this layer. This layer is also responsible for real-time monitoring, control, and evaluation of various application-specific parameters in an IoT environment. • Application layer: This layer is primarily responsible for providing service to the end-users related to particular applications. There exists a wide range of applications envisaged using IoT, viz., smart city, smart home, smart agriculture, industry 4.0, healthcare, environmental monitoring, etc. This is the layer through which end users usually interact and pay for the service provided to them.
Sustainability 2021, 13, x FOR PEER REVIEW 13 of 47 the ultimate objective of delivering the IoT infrastructure's intended service. The application layer is liable for offering types of assistance and decides a bunch of conventions for message passing at the application level. The application layer serves as a bridge between applications and end clients, allowing them to communicate. It defines the allocation of resources and computation in data production, processing screening, and feature selection. The application layer is a client-driven layer that performs various tasks for the clients and offers customized assistance as per a client's pertinent requirements [90]. This IoT layer brings together the industries to create high-level intelligent application solutions such as disaster monitoring, health monitoring, translation, fortune, medical, environmental monitoring, and global management for all intelligent applications.

Five-Layer Reference Model
The architecture of IoT has been further improved by decomposing the responsibilities and functionalities of the existing three-layer architecture, resulting in a five-layer architecture [91]. A five-layer architecture consisting of a perception layer, network layer service layer, operation layer, and application layer is proposed, which is different from that proposed by [92]. The pictorial representation of the five-layer reference model is as shown in Figure 7b. It is worthy to note that the application layer is segregated into three layers, namely, service layer, operation layer, and application layer. The functionalities of the service, operation, and application layers are briefly summarized below, whereas the perception layer and network layer hold the same responsibilities.

Seven-Layer Reference Model
Even though the architectures of IoT are either application-specific or domain-specific, we propose a more generic IoT architecture that comprises seven layers. The seven-layer generic IoT reference model comprises a perception layer, abstraction layer, network layer, transport layer, computing layer, operation layer, and application layer. The representation of the seven-layer reference model is as shown in Figure 8. Further, the functionality of each of the layers is briefly described below.

IoT Protocols and Standards
In the Internet of Things, the communication protocol is a bunch of rules set down for exchanging information between electronic gadgets. Since IoT devices are more resource-limited/dependent than traditional network devices, the protocol stack in an IoT network must be different from the traditional OSI model. IoT protocols are supposed to be small and compact. The IoT protocol stack can be considered as an augmented version of the layered TCP/IP protocol stack [93]. In recent times, many standardization efforts have been seen to reduce the efforts of all stakeholders of the burgeoning IoT, such as service providers, developers, manufacturers, programmers, operators, etc. To this extent, although there are numerous players, some of the prominent organizations involved are EPC global, the European Telecommunications Standards Institute (ETSI), Internet Engineering Task Force (IETF), World Wide Web Consortium (W3C), and Institute of Electrical and Electronics Engineers (IEEE). The protocols can be broadly grouped into four categories: application protocol, service discovery protocol, connectivity and networking protocol, and other dominant protocols [94]. Some of the widely explored protocols under these categories are summarized in Table 3, whereas a detailed discussion can be found in the seminal work carried out in [41] and [57], of which we briefly describe some of the key protocols in the following subsections.  • Perception layer: This is the first level which consists of different IoT sensing and actuating devices such as sensors, actuators, RFID tags, controllers, etc. Being the first layer, the devices at this layer must adhere to the security protocols and standards to ensure they mitigate security threats to other layers originating from the perception layer. • Abstraction layer: The IoT is based on a large and diverse set of items, each with specialized functionalities accessible through its dialect. Thus, this layer envisages harmonizing the potentials of other devices by providing a common language, protocol, and standard-based solutions. • Network layer: This layer is responsible for providing various networking-related solutions to IoT devices. Routing, forwarding, security, etc., are some of the key responsibilities of this layer. • Transport layer: This layer is responsible for transmitting the data from one service to other services within the application. The security at the transport layer is one of the key responsibilities in IoT in addition to the QoS.

•
Computing layer: Voluminous data are generated and shared in IoT-based applications. The computing, processing, and analysis of such voluminous data is very cumbersome in general. Thus, this layer is associated to deal with such challenges in IoT. The integration of several burgeoning technologies such as cloud computing, big data, FC, EC, deep learning, machine learning, etc., is seen as promising at this layer for improving performance and security in IoT-based applications.

•
Operation layer: This is an important layer, especially from the business point of view in IoT. The supervision of services offered by IoT, creating business models, visualization of the data, decision-making, etc., are some of the key responsibilities of this layer. Ensuring QoS in all layers is one of the vital responsibilities associated with this layer. This layer is also responsible for real-time monitoring, control, and evaluation of various application-specific parameters in an IoT environment. • Application layer: This layer is primarily responsible for providing service to the end-users related to particular applications. There exists a wide range of applications envisaged using IoT, viz., smart city, smart home, smart agriculture, industry 4.0, healthcare, environmental monitoring, etc. This is the layer through which end users usually interact and pay for the service provided to them.

IoT Protocols and Standards
In the Internet of Things, the communication protocol is a bunch of rules set down for exchanging information between electronic gadgets. Since IoT devices are more resourcelimited/dependent than traditional network devices, the protocol stack in an IoT network must be different from the traditional OSI model. IoT protocols are supposed to be small and compact. The IoT protocol stack can be considered as an augmented version of the layered TCP/IP protocol stack [93]. In recent times, many standardization efforts have been seen to reduce the efforts of all stakeholders of the burgeoning IoT, such as service providers, developers, manufacturers, programmers, operators, etc. To this extent, although there are numerous players, some of the prominent organizations involved are EPC global, the European Telecommunications Standards Institute (ETSI), Internet Engineering Task Force (IETF), World Wide Web Consortium (W3C), and Institute of Electrical and Electronics Engineers (IEEE). The protocols can be broadly grouped into four categories: application protocol, service discovery protocol, connectivity and networking protocol, and other dominant protocols [94]. Some of the widely explored protocols under these categories are summarized in Table 3, whereas a detailed discussion can be found in the seminal work carried out in [41,57], of which we briefly describe some of the key protocols in the following subsections.  [95]. This protocol is used to communicate between low-resource IoT devices and high-resource Internet-connected devices. CoAP is a binary protocol that communicates using UDP. The semantics of CoAP are designed to be very similar to those of HTTP [96]. It has less data overhead because it is a binary protocol, and because it uses UDP, it has more flexibility in communication models and can minimize latency. One of the advantages of using HTTP semantics on top of CoAP UDP rather than HTTP TCP is that a computer can easily communicate with the cloud and other devices on the local network using the same protocol language. One of the benefits of using HTTP semantics on top of CoAP UDP rather than HTTP TCP is that a machine can communicate with the cloud and other local network devices using the same protocol language [97]. UDP: UDP is a connectionless protocol; here, the sender sends data without waiting for the receiver to establish a link. They are connectionless datagrams that allow for the transmission of smaller packets and cycles with less overhead and a faster wake-up time [106].
• EXI: Efficient XML Interchange is abbreviated as EXI. This is an XML representation in a small package. To support XML applications on resource-constrained devices, EXI is described as a technique that uses less bandwidth and improves encoding/decoding efficiency. EXI compression aids in the reduction of document content by creating small tags internally based on the current XML schema, processing level, and context. It assures the tags are optimized for data representation. The document is in binary format, with all of the document's data tags encoded using event codes. Event codes are binary tags that keep their value only in the EXI stream where they are allocated.

IoT Vulnerabilities, Security Threats, and Attacks
With the unprecedented growth in IoT devices with rapidly evolving technologies, the new generation IoT-based applications are at risk. Nevertheless, there is an increasing consciousness that the new age of cell phones, computers, and other gadgets might be powerless against malware and assault. Thus, the vulnerabilities, security, and attacks must be comprehensively analyzed to make envisioned IoT a reality.

Vulnerability
Vulnerabilities are the defects in a framework's design or usefulness that permits the attacker to execute orders, access unapproved information, and launch distributed denial-of-service (DDoS) attack [107]. Attackers can utilize IoT gadgets with existing issues to infiltrate the networks. DNS rebinding attacks, which allow for the processing and ex-filtration of data from internal networks to new side-channel attacks, such as infrared laser inducted attacks against smart devices in homes and workplaces, are among the risks. In IoT systems, vulnerabilities can be found in several places [108].
Hardware and software systems are two central components of IoT frameworks, vulnerable to design flaws. Regardless of whether bugs are identified due to compatibility and interoperability of the equipment or efforts to remedy them, hardware flaws are very difficult to detect and even more difficult to repair. Computer bugs may exist in operating systems, programming software, and control software. Human elements and programming complexity are two factors that contribute to software configuration defects. Human flaws are normally the source of technical vulnerabilities [109]. Miscommunication between the developer and clients, lack of resources, skills, and experience, and a failure to manage and monitor the system can result from a poor understanding of the specifications introducing vulnerabilities in the IoT framework. Thus, vulnerability poses indispensable threats and attacks in the IoT environment. What follows next is the taxonomy of threats and attacks in IoT.

Taxonomy of Threats and Attacks in IoT
A threat is an activity that exploits a system's security flaws and has a negative effect on it. Humans and the environment are the two main sources of security threats [110,111]. As an example, seismic tremors, typhoons, floods, and fires are all natural hazards that can cause serious damage to computer systems. Few shields can be used to protect against traumatic events since these naturally occurring events cannot be prevented. Backup and contingency planning, for example, are the best ways to protect stable infrastructures from common threats. Human threats are those that humans create, such as malicious threats that are either internal (someone has allowed access) or external (individuals or organizations operating outside the network) in nature and seek to damage or disrupt a system. Following are the different types of human threats:

•
Unstructured threats: These are made up mainly of novice people who use the readily available hacking software. • Structured threats: People aware of system vulnerabilities and can comprehend, build, and exploit code and scripts are known as structured risks. • Advanced Persistent Threats (APT): A coordinated assault is an example of advanced persistent threats. APT is a sophisticated network attack that seeks to steal data from high-value information in industries such as manufacturing, banking, and national defense [112].
A taxonomy of threats posing a big concern from a security perspective in the IoT environment is shown in Figure 9.
Compared to the threat that can be intentional or unintentional, the attack is always intentional and malicious to cause damage. Several security attacks persist in the IoT framework, which can be analyzed with respect to the proposed IoT reference model. A taxonomy of attacks in IoT has been presented in Figure 10. These threats and attacks pose severe challenges to the IoT environment from a security perspective. The security concern due to various threats and attacks are categorically described in the following subsections.

Security Concern at Perception Layer
Since current sensor management systems and protection schemes are insufficient to protect the sensors, an attacker may use them in various ways. In general, sensor-based threats refer to passive and active malicious actions that are attempted by the manipulation of sensors for their malicious purposes. Different kinds of threats and attacks which cause serious security challenges at the perception layer are eavesdropping, battery drainages, hardware failure, malicious data injection, Sybil threat, disclosure of critical information, device compromise, node cloning, node capture, side-channel attack (SCA), tag cloning, Radio Frequency (RF) jamming, node injection, exhaustion, node outage, etc. Some of these security threats and attacks are briefly discussed below. Further, a detailed discussion on these threats and attacks is comprehensively covered in [49,57,65,67].

•
Eavesdropping: Attackers can sniff the traffic generated by IoT data flow to gather users' critical information by setting similar IoT devices. • Malicious Data Injection: False sensor data injection is a form of attack in which the sensor data used in IoT applications are forged or modified for malicious purposes. False sensor data may be injected into devices by physical access or clandestine use of different networking mediums such as Bluetooth, Wi-Fi, GPS, etc. For instance, a spoof attack in a vehicle equipped with a GPS system. To change the location of the car, the attacker sends a forged GPS signal to the system. This conceals the vehicle's true location, allowing the attacker to attack the targeted vehicle with any physical attack [113]. • Sybil Attack: The malicious nodes in this can have multiple identities of a genuine node by either impersonating it or with a fake identity through duplication. One such malicious node may have several identities simultaneously or at different instances. • Disclosure of Critical Information: Sensors used in IoT gadgets can disclose sensitive information such as passwords, secret keys, credit card credentials, and so on. These details may be used to violate user privacy or to build a database for future attacks. One such example of this attack is eavesdropping. It is a kind of attack where a pernicious application records a discussion subtly by misusing sound sensors and extracts data from the discussion. An attacker can save the recorded discussion on a gadget or tune in to the discussion continuously. Soundcomber is one of the current instances of eavesdropping over the receiver of a cell phone. In this model, a pernicious application secretively records when a discussion is initiated from the gadget. Since the recording is carried out behind the scenes, a client is completely unaware of the chronicle [114].
tracts data from the discussion. An attacker can save the recorded discussion on a gadget or tune in to the discussion continuously. Soundcomber is one of the current instances of eavesdropping over the receiver of a cell phone. In this model, a pernicious application secretively records when a discussion is initiated from the gadget. Since the recording is carried out behind the scenes, a client is completely unaware of the chronicle [114].  • Side-Channel Attacks: The assailant gathers information and performs the reverse engineering process to collect the encryption credentials of an IoT device while the encryption process is under way. This information cannot be collected from plaintext or ciphertext during the encryption process, but from the encryption devices. Side- Figure 10. Taxonomy of attacks in IoT.
• Side-Channel Attacks: The assailant gathers information and performs the reverse engineering process to collect the encryption credentials of an IoT device while the encryption process is under way. This information cannot be collected from plaintext or ciphertext during the encryption process, but from the encryption devices. Sidechannel attacks the use of certain or all data to acquire the key the device uses. Some instances of such attacks include timing attacks, power or failure analysis, and electromagnetic attacks. The opponent uses data leaks and collects block cipher keys.
In the event of the attacks, an intrusion prevention system such as Boolean masking can be directed. • Malicious Data Injection: Attackers take advantage of flaws in communication protocols to insert data into the network [115]. The intruder will tamper with the information required to control the device if the protocol does not verify the integrity of the data. The injection attack may result in code execution or system control from afar. • Node cloning: In most cases, IoT devices such as sensor nodes and CCTV cameras are developed without hardware defects, given the lack of standardization of the IoT device design. Therefore, for unauthorized purposes, these devices can be easily forged and replicated. This is also known as the cloning of nodes. It can take place in either of the two phases, i.e., production and during operations. An internal attacker can replace an original device with an unauthorized, pre-programmed object in the former case. A node can be captured and cloned during the operational phase. Capturing nodes could further remove security parameters and substitute firmware replacement attacks. • Exhaustion attack: Jamming or DoS attacks that have been mentioned before could lead to attacks of exhaustion. In particular, energy consumption can affect the batteryoperated devices if an assailant attacks the network continuously. Repeated retransmission attempts could cause collisions with IoT MAC protocols leading to high-energy depletion. Exhaustion is a dot attack and is connected with deactivation assaults, reducing the size of the network and removing nodes permanently from the network.

Security Concern at Abstraction Layer
Different kinds of threats and attacks which cause serious security challenges at the abstraction layer are node replication, illegal access, device compromise, MITM, eavesdropping, spoofing, insertion of rogue devices, information theft, a threat to the communication protocols, data manipulation, device tampering, tag cloning, DoS, DDoS, SCA, traffic analysis, and sleep deprivation. Some of these security threats and attacks are briefly discussed below. Further, a detailed discussion on these threats and attacks is comprehensively covered in [49,57,65,67].

•
Illegal access: IoT equipment often operates without any physical protection in an untrusted environment, such as traffic light sensors, environmentally friendly sensors, agricultural sensors, smart city sensors, and much more. Problems such as illegal access and malicious change of data may arise during the processing of sensitive data. • MITM: Man-in-the-Middle (MITM) is a system that listens in on traffic between a smart device and a gateway [116]. All traffic will be routed via the attacker's computer using the ARP poisoning technique. This attack can be avoided if the attacker is unable to see the traffic in progress. As a result, encryption is required in the protocol [117]. • Spoofing: To initiate a spoofing attack, an attacker can mimic a node. Due to its manner of assault, a spoofing attack is one of the high-risk attacks. A transmission could be recorded using a compatible portable reader. Because the attacker is impersonating the node, the retransmission may appear to be coming from a legitimate node. This threat could exist in all three layers of the IoT. Spoofing attacks that impersonate nodes are classified as authentication attacks, and they also breach the privacy principle.

•
Threat to communication protocols: The fact that most current wireless communication protocols adhere to the OSI layered protocol architecture and the physical layer encryption is not reinforced with additional security methods in the upper layers of the communication presents additional issues in IoT/CPS security design. Cellular technologies such as UMTS, GSM, and LTE, on the other hand, have their own set of security challenges. Because radio baseband stacks are implemented openly, mobile networks are vulnerable to hacking and cyber-attacks. Furthermore, aggressive attackers can use "IMSI Catching" to compromise GSM and UMTS networks. • Tag cloning: An opponent can readily clone RFID tags by gaining direct access to a device or via reverse engineering to obtain the essential information. A tag cloning attack was described in the literature, in which an RFID scanner was unable to discriminate between legitimate and compromised tags. • Denial-of-Service (DoS): It is a type of attack in which a device or application is maliciously denied normal operation. DoS attacks can be active attacks where an application or task is strongly denied or where passive attacks can stop another ongoing task on the device by attacking one application [118]. • DDoS: Any IoT device, network, or software program could be shut down by a distributed denial-of-service (DoS) attack, rendering the service inaccessible to its consumers. These attacks can take many different shapes. One method of attack is to generate a large amount of network traffic and send a massive request to the victim. The main goal of this attack is to make the target consumers' devices, software, network services, and resources unavailable. Furthermore, the attacker may be able to obtain sensitive information from users. DDoS attacks are more harmful than DoS attacks, which use many attacking platforms to infiltrate one or more systems • Traffic analysis: For attackers, a network's traffic pattern may be as useful as the substance of data packets. Analyzing traffic patterns can provide valuable information about the networking topology. In WSNs, the sink nodes closer to the base station generate more transmissions than the other nodes because they relay more packets than the nodes further away. Similarly, clustering is a key scaling strategy in WSNs, and cluster heads are busier than the rest of the network's nodes. For adversaries, detection of the base station, nearby nodes, or cluster heads may be very beneficial since a denial-of-service attack or packet eavesdropping against these nodes might be very useful • Sleep deprivation: The denial of a sleep attack on a battery-powered device will result in energy depletion. Collision attacks or repetitive handshaking, i.e., repeatedly shaking hands, can be used to carry out this attack. Request to Send (RTS) and Clear to Send (CTS) manipulate flow control signals, stopping the node from entering the stage of sleep.

Security Concern at Network Layer
Gateways and networking systems assist in the routing and networking of data packets to their intended destinations. If the gateway communicates using wireless protocols, the attacker will use wireless attacks to link to the gateway or internal network. As a result, the attacker will be able to carry out further attacks, such as ARP poisoning, MITM, packet injection, and sniffing. Different kinds of threats and attacks which cause serious security challenges at the network layer are illegal access, MITM, eavesdropping, spoofing, fragmentation, hello flood, network intrusion, device compromise, node replication, insertion of rogue devices, sinkhole attack, Sybil attack, clone ID attack, selective forwarding attack, blackhole attack, wormhole attack, traffic attack, and RPL exploits. Some of these security threats and attacks are briefly discussed below. Further, a detailed discussion on these threats and attacks is presented in [49,57,65,67].

•
Hello flood: Message flooding is amongst the biggest network layer threats. By sending multiple route establishment requests to a network or node. The nodes in the network interpret a hello message as coming from within and mark it as a communication route. • Sinkhole: By using this approach, an attacker compromises a network's central node and overrides it in a bid to render it unavailable. An attack that uses sinkholes is more likely to cause a major incident than a tempering attack, which involves a few affected nodes. As a result of sinkhole attacks, the whole infrastructure base could be controlled. • Blackhole: If the malicious node experiences a Blackhole attack, it will drop all packets encountered and the entire network will be affected. Since it absorbs all routing data, it is considered a high-impact attack. By flooding malicious routing information, an intruder tries to hijack the most efficient route to a destination. Upon transmission through the malicious route, the source node continues to send packets, and the attacker drops all packets, preventing any traffic from being forwarded to the destination. • Traffic Analysis: The attacker analyses the traffic and saves a copy for later use in this attack. As a result, the interface can be managed using the traffic that was previously communicating with the gateway. The traffic or data that have been checked are reused in a different context [119]. • Wormhole: This network attack would intercept traffic in one location and redirect it to another. As a result, it causes network congestion and efficiency problems. • Selective forwarding: An attacker launches an SF attack by entering a network and dropping packets. Some packets are dropped casually, while others are selectively forwarded. Consequently, packet dropping can be difficult to figure out in IoT networks due to their lossy nature. As a consequence, the entire network may suffer bandwidth degradation and delay. • RPL exploit: The IoT is made up of devices with limited resources, such as battery power, memory, and computational power. RPL is a new network layer routing protocol developed for these types of networks (routing protocol for low power and lossy networks). RPL is a lightweight routing protocol that does not contain all of the features of typical routing protocols. RPL was developed specifically for data sinks (multi-point to point communications) and has lately been adopted by the IoT. In such attacks, spiteful nodes can seek to redirect paths when data are transferred. Sinkhole attacks are a kind of routing attack in which an opponent advertises and hire a node to drive traffic [120]. Wormhole attacks can also pose a serious threat to IoT systems if associated with other attacks such as sinkhole attacks [121]. A wormhole is an out-of-band link that allows easy packet transfer between two nodes. An attacker will try to circumvent the basic security protocols in an IoT application by creating a wormhole between a compromised node and a computer on the Internet.

Security Concern at Transport Layer
Different kinds of threats and attacks which cause serious security challenges at the transport layer are jamming, eavesdropping, false data injection, unfair access, congestion, hello flood, DoS, DDoS, SCA, desynchronization, MQTT exploit, session hijacking, SYQflooding, timing attack, etc. Some of these security threats and attacks are briefly discussed below. Further, a detailed discussion on these threats and attacks is comprehensively covered in [49,57,65,67].

•
Desynchronization: De-synchronizing the transmissions between two nodes allows an attacker to break actual links between them. Trying to send fabricated messages to both sides of communication, such as false flag types of messages, is an example of this type of attack. By forcing them to lose their synchronization, they will lose their ability to communicate. • Session hijacking: In session hijacking, an attacker steals the session ID and pretends to be the legitimate user to take over a user's online session. The attacker can spoof the user's session ID and do anything the authorized user can do on the network once the attacker obtains it.

Security Concern at Computing Layer
This part of the IoT infrastructure supports data storage and computer remote control. If cloud servers are not properly configured, they can then lead to the server and smart devices being exploited. Different kinds of threats and attacks which cause serious security challenges at the computing layer are malicious attack, SQL injection, data integrity, virtualization, software modification, illegal access, identity theft, flooding attack in cloud, cloud malware injection, access attack, false data injection, path-based DoS, hole attack, exhaustion attack, cloud outage, signature wrapping, storage attack, etc. Some of these security threats and attacks are briefly discussed below. Further, a detailed discussion on these threats and attacks is comprehensively covered in [49,57,65,67].

•
Malicious Attack: As workers in the company download untrustworthy malicious software programs from the Internet, there is a good chance that the machine will be hacked. The malware would spread across the internal network, putting the whole company under its influence. The attacker would use the compromised machine to hack the IoT system connected to the network. As a result, it may result in economic loss and abasement of the company's reputation. • SQL injection: SQL injection is a web security flaw that permits an attacker to meddle with a web application's database queries. It permits an attacker to access the information that they would not usually be able to reclaim. This may incorporate information belonging to different clients or whatever other information the application can access. An attacker may alter or erase these data, resulting in the application's content being permanently altered. In certain circumstances, an attacker can improvise a SQL injection attack to alter the basic server or other back-end foundation or carry out a distributed denial-of-service (DDoS) attack [122]. • Illegal Access: It is one of the major challenges faced by companies providing cloud services. Most enterprise proprietors are unfamiliar with cloud-based technology, which opens them to a variety of data breaks that can affect their tasks. Since cloud computing is built to be simple to use and share, it is difficult for businesses to ensure that data are only available to legal parties. On the off chance that IoT gadgets do not properly configure, the entire network will be damaged. Additionally, companies using cloud-based computing lack complete control over their networks, which requires configuring and protecting their cloud deployments on security controls provided by their cloud service providers (CSP). • Storage Attack: It can be very difficult to detect and deal with cryptojacking. The main problem here is that hackers will slow down the activity of the device as they use the cloud storage resources, but it will continue to operate. This means it may seem that nothing is malicious and that the machines are probably just struggling with their processing capacity. Many teams in IT experience the symptoms of cryptojacking as an upgrade fault or as a sluggish Internet link, so the real issue is much longer to be resolved. • Access Attack: Advanced persistent threat is another term for an access attack. An unauthorized individual or adversary gains access to the IoT network in this form of attack. The intruder will remain undetected in the network for an extended period. Rather than causing network harm, the ultimate goal of such a type of attack is to steal valuable information. IoT applications receive and transmit valuable data regularly, making them particularly vulnerable to such attacks. • Software modification: An IoT device can be compromised by modifying its software or firmware by using physical or remote access to take unauthorized actions. By patching or substituting code, or by making code extensions, the vulnerability can be exploited further.

Security Concern at Operation Layer
Different kinds of threats and attacks which cause serious security challenges at the operation layer are fake information, badmouthing, unauthorized access, users' privacy Sustainability 2021, 13, 9463 24 of 45 compromise, stealing users' critical information, MITM, secure on-boarding, firmware attack, software attack, illegal intervention, end-to-end encryption attack, interrogation attack, DoS, etc. Some of these security threats and attacks are briefly discussed below. Further, a detailed discussion on these threats and attacks is comprehensively covered in [49,57,65,67].

•
Illegal Intervention: Cloud services are typically provided, monitored, and managed through APIs and software user interfaces. Although, cloud service providers are engaged diligently to improve APIs and interfaces, this boom has additionally extended safety dangers related to them. Cloud specialist organizations utilize a particular structure to give APIs to developers, making their frameworks more endangered against an attacker. In 2018, the social media platform Facebook suffered a security breach that affected around 50 million users due to a flaw [123]. API flaws, particularly when linked to user interfaces, may provide the attacker a direct path to steal employee or client credentials. • Unauthorized Access: Access control is an approval system that permits authentic clients to acquire information. Multi-client access and simultaneous altering of design systems ought to be vigorous against multi-client access. When numerous clients can alter the designs of different segments of the IoT frameworks, simultaneous execution of setup changes and simultaneous altering of arrangement records effectively leads to temperamental framework status. In IoT applications, access control is important because if access is compromised, the entire IoT framework becomes susceptible to attacks.

Security Concern at Application Layer
The application layer manages the services offered to the clients. This layer serves applications such as telehealth, industrial automation, smart metering, and so on. This layer has its own set of security concerns that are unique to each program. Different kinds of threats and attacks which cause serious security challenges at the application layer are malicious code, software modification, data tampering, SQL injection, disclosure of critical information, cross-site script, identity theft, virus attack, malware attack, spyware attack, flooding, spoofing, code injection, intersection, message forging, DDoS attack, brute force attack, etc. Some of these security threats and attacks are briefly discussed below. Further, a detailed discussion on these threats and attacks is comprehensively covered in [49,57,65,67].

•
Malicious code: Malicious codes or targeted malware can easily exploit the vulnerabilities of IoT devices through the Internet, which allows hackers to compromise those devices. Further attacks can be launched on other endpoints/networking apps via the infected devices. • Software Modification: Minor changes can lead to more complicated problems. Unexpected environment changes along with minor framework alterations and system changes may have unanticipated consequences. As the arrangement of framework develops, these results can spread to more concerning issues. If the programming mechanism is not secured, the attacker will be able to reprogram IoT devices remotely. This could result in the IoT network being hacked. • Data tampering: During an attack of this type, the information on the end device is misrepresented by an attacker. Invaders retrieve data format and type, then insert tamper detection measures and recreate the original data. Due to this, there is considerable doubt about the precision of data collected over the network. • Cross-site script: XSS (cross-site script) is a technique attackers use to insert malicious code into a website that is otherwise trusted. If an XSS attack is successful, the IoT system will be under the complete influence of the attacker. • Identity Thefts: IoT systems deal with plenty of personal and sensitive information.
Clients will hesitate to enlist their personal information on IoT applications if these applications are helpless against information burglary. Some of the protocols and methodologies used to protect IoT applications from information burglary include data isolation, data encryption, privacy management, user and network authentication, etc. • Virus attack: The objective of these attacks is to breach the confidentiality of the system. The risk of these attacks is significantly higher for smartphones, sinks, or gateways in IoT networks. Hence, IoT applications must seriously consider mitigating viruses and malware. • Spyware attack: Installed on IoT devices without consent, spyware is an installation program that collects information. Using this type of attack, attackers are looking to gather sensitive information about users by monitoring their behavior. Signature, behavior, and specification-based techniques are some common approaches to spyware detection.

•
Code Injection: Attackers usually use the simplest or easiest way to break into a device or network. If the device is endangered to spiteful scripts and misdirection as a result of inadequate code tests, it will be the first point of entry for an attacker. • Intersection: System integrity is a critical feature of the IoT framework. When a system's integrity is compromised, there is a high risk of safety and security threats. High activity stress or irregular process conditions, network or device failures, multiple warnings, executing previously unexecuted error path code or system recovery code, or wrongly executed commands do not cause the system to crash. This necessitates extensive research. • Brute force attack: A brute force attack involves systematically trying and guessing every possible passphrase or password combination to gain access to the system. Crypto-analysts are ultimately able to identify the correct one which allows them access to the system.
To summarize, the different threats and attacks are reported in Table 4, along with their scope in IoT architecture and protocols, their impact, and references focusing on different detection, prevention, and mitigation strategies. With reference to this table,   Hardware failure PL NLP, CP Affect the service due to failure causing unreliability [127,128] Malicious data injection PL, AP, SDP, ODP Can harm applications services [129] Sybil threat PL, NL SDP, CP Enhances packet drop probability [130,131] Disclosure of critical information PL, AL AP, SDP, Affect user's privacy [132] Node cloning PL SDP, DLLP, NP, CP Can copy the functions, data, etc., of a particular node or even capture a node [133,134]

Security Goals and Roadmap in IoT
There are certain security objectives that IoT must essentially meet to provide undisputed services. For smooth functioning, IoT applications require secure connections with proper authentication mechanisms and data confidentiality. To ensure information security, one needs to implement the CIA triad-data Confidentiality, Integrity, and Availability.
Threats and violations in any of these areas can result in substantial damage to the system, compromise its integrity, and disrupt its activity. To be efficient in implementing effective IoT security, the following primary security objectives must be considered. These security objectives can be achieved with effective methodologies for detection, prevention, and mitigation of threats and attacks pertaining to the IoT ecosystem, described in the next section.

•
Confidentiality: Confidentiality is an important security feature in the Internet of Things, but it is not always required, for example, in cases where data are exchanged with the public. In the vast majority of situations and cases, sensitive data must not be disclosed or read by unauthorized persons [180]. Sensitive information about patient data, company information, and possibly military information, as well as security accreditations, should all be kept private from unauthorized users. Confidentiality should be granted such that the information gathered or distributed is safe and only accessible to approved users. Data collected by a computer or a sensor should not be sent to other devices unless they are properly encrypted. To prevent malicious actors from accessing the collected data, only encrypted messages should be sent to neighboring devices. A data encryption system transforms each bit of data into ciphertext, followed by a two-step verification process in which two devices/components permit access only if the authentication test is passed by both the devices, and a biometric verification in which the user is uniquely identifiable and biometric authentication in which the person can be identified by his or her fingerprints. • Integrity: Integrity should be offered to ensure data validity. Data integrity is critical since data recipients must be able to verify whether data obtained from other devices are authentic. In most cases, integrity is a necessary security property for IoT users to receive reliable services [181]. Different IoT systems have different levels of trustworthiness. As an example, because of data sensitivities, a patient observation framework would have high trustworthiness testing against arbitrary mistakes. It is integrated into the network to protect cybercrimes data in the communication process so that data manipulation cannot be carried out without the danger detected by the device. Two error detection methods are used to ensure data integrity in the inspection and cyclic redundancy search. For continuous data sync for backup purposes, a version control system is used. • Authentication and authorization: Authenticity is related to credibility, and it means that each system in the network should be able to recognize and authenticate other devices. Since the IoT is made up of so many devices, it is critical to be able to recognize them; otherwise, malicious devices might use spoofing to target IoT networks. Due to the design of IoT settings, the possible communication between the device and device (M2M) is exacerbated by the problem of authentication in IoT connectivity. Different authentication criteria in different systems require different solutions. Some solutions, such as bank card or bank device authentication, require a high level of reliability. However, others will need to be foreign, such as e-Passport, while others will need to be local. Only approved entities (any authenticated entity) can conduct such network operations using the authorization property [182]. • Availability: The primary aim of every IoT protection system is to make data available to users promptly. The consumer should be able to obtain data from the resources right away, not only in usual circumstances but also in emergencies. Firewalls are installed in the network to protect against attacks on services such as denial-of-service attacks, which prevent data from reaching the end-user [183]. • Accountability: Accountability provides redundancy and responsibility for some activities, tasks, and the preparation of the execution of network security policies while designing security strategies to be used in a safe network [184]. Accountability cannot prevent attacks on its own, but it does help ensure that other security measures are functioning properly. Integrity and confidentiality, for example, can be rendered worthless if they are not subjected to transparency. Often, in a disapproved event, an entity's behavior can also be traced through an accountability system, which can help determine the inside story of what occurred and who was ultimately responsible.

Scope of Security Enhancements in IoT with Burgeoning Technologies
Now, we review the state-of-the-art methodology to enhance security and privacy in an IoT environment using a few of the ubiquitous technologies such as BC, FC, EC, and ML. Despite some other technologies such as cloud computing, Big Data, embedded system, digital twin, etc., the trend in the literature unanimously shows that BC, FC, EC, and ML have huge potential to answer the security concern in the IoT ecosystem. Further, these technologies are indispensable for the IoT ecosystem, which motivates researchers to address the security concern based on these ubiquitous technologies.

BC for IoT
BC technology is a network of peer-to-peer nodes that stores transactional records, known as blocks; these blocks consisting of numerous public databases are known as the "chain". The fundamental principle of BC is based on a distributed ledger. IoT devices collect real-time data from sensors, and BC ensures the security of data by deploying a decentralized, distributed, and shared ledger [185]. Any transaction in this ledger is signed with the owner's digital signature, which verifies the transaction and protects it from tampering. As a result, the data in the digital ledger are extremely stable. The BC entries are both chronological and time-stamped. In the ledger, each entry is linked to the previous entry by applying cryptographic hash keys. Individual transactions are stored in a Merkle tree, and the tree's root hash is stored in the BC. Individual transactions are represented by T1, T2, T3, and Tn in the diagram. The cryptographically hashed transactions are stored on the leaf node represented as H1, H2, H3, and so on. The hashes of the child nodes are combined to create a new root hash. The BC stores the final root hash (i.e., Ha and Hb). It can be confirmed whether the transactions associated with the root hash are secure or not, by just verifying the root node. If a single transaction is modified, all hash values on that side of the tree will be affected. The miners verify all the transactions and then a key is produced that allows the most recent transaction to be included in the ledger. This procedure renders the most recent transaction available to all network nodes. It is very difficult and time-consuming for the attackers to hack the blocks as each block is secured using cryptographic hash keys [186]. The miners are only mining to gain their bonuses and have no personal stake in the transactions. The identity of the transaction's owners is unknown to the miners. Furthermore, several miners are working on the same collection of transactions, and they are in fierce competition to link the transactions to the BC. These characteristics enable the BC to serve as a safe, distributed, tamper-proof, and open data system for IoT data. The entire process of a transaction from its inception to its commitment to the distributed chain is elucidated in Figure 11.
In academia and industry, various platforms and frameworks are being built to support the development and maintenance of BC. Ethereum, Hyperledger Cloth, Ripple, and other platforms are examples of this kind [187]. Nevertheless, the simplified general architecture of the BC is as shown in Figure 12.
The following are the key characteristics of the BC that can be exploited to enhance security and privacy in IoT.

•
To create blocks, a consensus algorithm is used; involved individuals (typically miners) verify the transactions' coherence and validity. There is no third party to rely on; each individual produces his or her own keys.

•
All ledger elements, such as blocks, and transactions are stored in the database.
owners is unknown to the miners. Furthermore, several miners are working on the same collection of transactions, and they are in fierce competition to link the transactions to the BC. These characteristics enable the BC to serve as a safe, distributed, tamper-proof, and open data system for IoT data. The entire process of a transaction from its inception to its commitment to the distributed chain is elucidated in Figure 11. The miners start to solve mathematical problems to find the random value such that hash of the new block has certain predefined complexity.
Each node updates its local copy of blockchain P2 P1 Block P1 wants to send data to P2 Figure 11. Basics of BC for enhancing security and privacy in IoT.
In academia and industry, various platforms and frameworks are being built to support the development and maintenance of BC. Ethereum, Hyperledger Cloth, Ripple, and other platforms are examples of this kind [187]. Nevertheless, the simplified general architecture of the BC is as shown in Figure 12.  T1  T2  T3  T4  T5  T6 T7  T8  T9 T10 T11 T12   H1   The following are the key characteristics of the BC that can be exploited to enhance security and privacy in IoT.

•
To create blocks, a consensus algorithm is used; involved individuals (typically miners) verify the transactions' coherence and validity. There is no third party to rely on; each individual produces his or her own keys.

•
All ledger elements, such as blocks, and transactions are stored in the database. The use of BC in IoT applications has several benefits. The followings are a summary of the main advantages of using BC in IoT applications.
• BC can be used to store the data from IoT devices: The IoT technologies incorporate a wide range of devices that are all interconnected. This arrangement is additionally associated with the cloud to empower IoT applications to be accessed from anywhere. BC is a promising method for storing and protecting such an enormous The use of BC in IoT applications has several benefits. The followings are a summary of the main advantages of using BC in IoT applications.
• BC can be used to store the data from IoT devices: The IoT technologies incorporate a wide range of devices that are all interconnected. This arrangement is additionally associated with the cloud to empower IoT applications to be accessed from anywhere. BC is a promising method for storing and protecting such an enormous amount of data. BC is an apt solution for storing and transmitting data regardless of the layer in an IoT application.

•
Terminating the centralized cloud server system: BC boosts the security of IoT frameworks by removing the centralized cloud server and establishing a peer-to-peer net-work framework. Data pirates are mostly interested in centralized cloud servers. BC enables the distribution of data across all the nodes of the network and encrypts them. • Forestalling illegal access: Several IoT applications necessitate a lot of contact between different nodes on a regular basis. Since BC communication is based on public and private keys, data can only be accessed by the intended party or node. If an unintended person accesses the data, the content will be nonsensical because it is protected with keys. As a result, the BC data system attempts to address a variety of security problems that IoT applications face. • A solution for resource-constrained devices: Because of the limited resources, IoT devices are unable to store large ledgers. There have been different works toward this path to work with the assistance of BC. One of the potential solutions for IoT devices to use BC is proxy-based architecture. By setting up the proxy servers, the data can be stored in an encrypted format and the encrypted resources can be downloaded via proxy servers. • Forestalling spoofing attack: Spoofing is a type of attack where a foreign node enters the IoT ecosystem and tries to emulate the existing nodes to be seen as a member of the original framework. This foreign node can monitor or inject malicious data into the network. The BC technology appears to be a potential solution for preventing such attacks. Each genuine client or gadget is enlisted on BC, and gadgets can undoubtedly recognize and validate each other. • Forestalling data loss: IoT devices acquire the danger of losing information. There is a possibility that the data are lost by the sender and the recipient due to natural environmental causes. The utilization of BC can forestall such losses as it is impossible to eliminate a block once it is included in the chain.

FC for IoT
The Internet infrastructure is being challenged by an unprecedented amount of data generated by IoT. The integration of IoT and the cloud has led to the development of numerous new possibilities on how to process, store, manage, and secure data. These benefits do not fully address all of the problems associated with the IoT. Cloud computing and FC complement each other rather than replace each other [188].
Computing in the fog enables processing, storage, and intelligence control to come within the proximity of the data devices. It uses two frameworks, namely Fog-Device Framework and Fog Cloud Framework [189]. With the Fog-Devices framework, different services can be delivered to a user without involving any cloud servers. Whereas the simple decisions in the Fog-Cloud-Device framework occur at the fog layer, the complex ones occur at the cloud level [190]. The architecture of the Fog-Cloud-Device framework is shown in Figure 13.
The convenience and flexibility of this structure make it possible to offer cloud computing at the network edge. The result is a reduction in distance and improved efficiency while decreasing the amount of data required to be transported into the cloud for processing, analysis, and storage. Comparing the FC with cloud-only models, data traffic between the cloud and network edge is reduced by 90%, and response times for users are cut by 20% [191]. This flexible structure extends cloud computing services to the edge of the network. Thus, it reduces the distance across the network, improves efficiency, and decreases the amount of data needed to transport to the cloud for processing, analysis, and storage.
Using fog technology, data are collected at nodes referred to as fog nodes, and the nodes can process 40 percent [192]. It reduces the latency of IoT devices by offloading traffic from the core network. According to its time sensitivity, data are directed to the cloud, fog, or aggregation nodes. By providing cryptographic computations to IoT applications, fog nodes help secure communication [193].
within the proximity of the data devices. It uses two frameworks, namely Fog-Device Framework and Fog Cloud Framework [189]. With the Fog-Devices framework, different services can be delivered to a user without involving any cloud servers. Whereas the simple decisions in the Fog-Cloud-Device framework occur at the fog layer, the complex ones occur at the cloud level [190]. The architecture of the Fog-Cloud-Device framework is shown in Figure 13.  The convenience and flexibility of this structure make it possible to offer cloud computing at the network edge. The result is a reduction in distance and improved efficiency while decreasing the amount of data required to be transported into the cloud for pro- FC can provide some solutions to counteract certain security threats and attacks as discussed in the earlier section. More details are provided below to demonstrate how FC can counteract these threats.

•
Incident response services: Some critical applications cannot be stopped completely to resolve malware issues. When the system is running, fog nodes can help with such resolutions. It is possible to program fog nodes to provide incident response services in real time. As soon as the fog nodes detect suspicious data or requests, they can generate a warning flag for the end-user or the IoT system. Using FC, malware can be detected and problems resolved in transit. Some of the real-time services include identity recognition, intrusion detection, access management, etc. • Resource-constraint issues: IoT devices are typically resource-constrained, which makes them an ideal target for attackers. By damaging edge devices, attackers try to exploit weak points and worm their way in. Fog nodes can support edge devices so those devices will not be attacked. For protection, fog nodes can provide more sophisticated security functions, as well. • Eavesdropping: Rather than routing the information throughout the network, usage of fog nodes enables communication with only the end-user and fog nodes. Because the network traffic is reduced, there is less opportunity for adversaries to eavesdrop. • Data transit attacks: Data management and storage are much more efficient when using secure fog nodes instead of IoT devices. Fog nodes provide a greater level of protection for data than end-user devices for storing data. • Man-in-the-middle attack: A fog serves as a layer of security between the cloud and the end-user. A fog layer stands in between all threats or attacks on IoT systems, and in this layer, unusual activity can be identified and mitigated before it reaches the system.

EC for IoT
Both FC and EC share similar responsibilities, such as reducing latency, reducing the volume of the data sent to the cloud, enhancing computational efficacy, incorporating heterogeneity, etc., with a common objective to bring intelligence and computing possibly as close as to the data source. However, they are not the same. They differ in the way they operate and handle the data. For example, usually, FC takes place on the devices to which sensors are connected, such as switches, routers, gateways, access points, etc. On the other hand, EC takes place at the sensors themselves or devices which are at a one-hop distance from the sensor. Thus, the FC nodes are at more distance than the EC nodes.
Contrary to the EC, the data are transmitted from sensors to the FC nodes for processing and then sent back to the edge nodes for appropriate actions. Nevertheless, EC and FC are widely used by many companies as an extension of cloud computing. The main difference between cloud, fog, and edge stems from the location where intelligence and power computation are conducted. In the cloud, more data are processed, and users are comparatively located at a greater distance, requiring a much higher level of data processing [194]. EC uses a small edge server to overcome the problems associated with cloud computing, placed between the user and the cloud. Figure 14 shows the EC architecture's device components, which include edge devices, fog nodes, and cloud data centers [195]. The processing power and analytical capability are provided at the edge itself in an EC framework. An application comprises devices that communicate among themselves and collaborate to calculate data [196]. The IoT application can then minimize the amount of data sent to the outside, whether to cloud or fog nodes, and this will improve the application's security.EC reduces communication costs, as all the data do not have to be moved to the cloud. are comparatively located at a greater distance, requiring a much higher level of data processing [194]. EC uses a small edge server to overcome the problems associated with cloud computing, placed between the user and the cloud. Figure 14 shows the EC architecture's device components, which include edge devices, fog nodes, and cloud data centers [195]. The processing power and analytical capability are provided at the edge itself in an EC framework. An application comprises devices that communicate among themselves and collaborate to calculate data [196]. The IoT application can then minimize the amount of data sent to the outside, whether to cloud or fog nodes, and this will improve the application's security.EC reduces communication costs, as all the data do not have to be moved to the cloud. Looking at the threats and attacks causing serious security concerns to the IoT system, the following are possible solutions that can be achieved by incorporating EC with IoT.
• Data Compliance Issues: Data movement outside of borders is prohibited by many countries due to their restrictive regulatory acts, such as the GDPR (General Data Protection Regulation) of the European Union. Data sovereignty laws can be followed through EC, which keeps the data inside organizations [197] • Data Breaches: Data are stored and processed entirely within local networks or devices in EC. In this case, no data are transferred from the source to the processor. Therefore, there is no risk of data theft or data breaches since the data are not in transit [198].

•
Bandwidth Issues: Most of the data generated by IoT applications are raw and relatively of low value. As well as having a high bandwidth cost, the process of moving all the data to the cloud is also very hard in terms of security. The use of EC can enable data processing to be conducted at the edge nodes rather than sending the data to a cloud service [199]. • Safety issues: Physical safety can be compromised even if there is just a slight delay in responses. In the case of sensors that send all of their data and wait for the cloud to act, it may be too late to prevent injuries or deaths. Therefore, to achieve faster responses, devices can be deployed with EC to examine the abnormalities, process Looking at the threats and attacks causing serious security concerns to the IoT system, the following are possible solutions that can be achieved by incorporating EC with IoT.

•
Data Compliance Issues: Data movement outside of borders is prohibited by many countries due to their restrictive regulatory acts, such as the GDPR (General Data Protection Regulation) of the European Union. Data sovereignty laws can be followed through EC, which keeps the data inside organizations [197] • Data Breaches: Data are stored and processed entirely within local networks or devices in EC. In this case, no data are transferred from the source to the processor. Therefore, there is no risk of data theft or data breaches since the data are not in transit [198]. • Bandwidth Issues: Most of the data generated by IoT applications are raw and relatively of low value. As well as having a high bandwidth cost, the process of moving all the data to the cloud is also very hard in terms of security. The use of EC can enable data processing to be conducted at the edge nodes rather than sending the data to a cloud service [199].
• Safety issues: Physical safety can be compromised even if there is just a slight delay in responses. In the case of sensors that send all of their data and wait for the cloud to act, it may be too late to prevent injuries or deaths. Therefore, to achieve faster responses, devices can be deployed with EC to examine the abnormalities, process the data, and send them to the data center.

ML for IoT
In recent years, the field of ML has been of major interest. For their development, many domains use ML, and it is also used for IoT security. ML seems to be an excellent way of protecting IoT devices against cyber assaults by offering an approach other than traditional methods to defend against attacks. ML refers to intelligent approaches that use example data or previous experience through learning to optimize performance criteria. Different ML algorithms have been developed to provide some non-traditional solutions to these challenges.
The basic requirement in IoT is the securing of all network-connected systems and devices. The role of ML is to use, train, and prevent data loss in IoT equipment to detect anomalies or to detect any unwanted activity in IoT systems. Consequently, ML provides a promising platform to overcome the problems in securing IoT devices.
Looking at the threats and attacks causing serious security concerns to the IoT system, the following are possible solutions that can be achieved by incorporating ML with IoT.

•
DoS Attack: DoS attacks on IoT or IoT devices are a major concern. A multilayer perceptron (MLP) protocol to secure networks against DoS attacks serves as an approach for preventing such attacks [200]. Pavani, K. et al. proposed to create an MLP to improve the safety of wireless networks through particle swarm optimization and a backpropagation algorithm [201]. ML technologies help increase the accuracy of deductions and secure IoT devices vulnerable to DoS attacks. • Eavesdropping: Attackers can sweep messages while data are being transmitted. ML techniques such as Q learning-based offloading strategy [202] or Bayesian nonparametric techniques [203] can be used to protect against such attacks. ML techniques such as Q-learn and Dyna-Q can be used to protect devices from eavesdropping, as well. Experimental evaluation and strengthening education of those schemes are presented in [204]. • Digital Fingerprinting: Digital fingerprinting is a promising solution for safe IoT systems and for the end-user to have enough confidence in applications. Digital fingerprints are widely used for smartphones, payments, car and home doors, etc. Digital fingerprinting is a dominant bio-metric identification method thanks to its low cost, reliability, acceptability, and high level of safety [205]. Aside from the advantages of digital fingerprinting, the efficiency of using this technology in IoT is varied, including fingerprint classification, improved image, and functional matching.
So far, from the discussion, it can be inferred that there is a huge potential for security enhancement in IoT using burgeoning technologies such as BC, FC, EC, and ML. The scope of possible security enhancements in IoT through the integration of these ubiquitous burgeoning technologies sprawling the appropriate layers is summarized in Table 5. Some of the research papers in literature focusing on security solutions in different capacities covering various aspects of IoT based on BC, FC, EC, and ML are shown in Figure 15. In this figure, three applications of IoT are considered, namely, healthcare, smart devices, and smart grid, for which some of the papers are presented from the literature which covers the security solutions in different capacities based on BC, FC, EC, and ML.  Figure 15. Some of the application domains of IoT and related work focusing scope for the security enhancement using burgeoning technologies. Figure 15. Some of the application domains of IoT and related work focusing scope for the security enhancement using burgeoning technologies [196,.

Open Research Problems
Despite a successful journey so far, the IoT has many technological challenges and research issues that are yet to be explored. Some of the prominent research challenges are enumerated below.

•
There is no generic validated architecture of IoT so far, i.e., most of the architectures are either domain-specific or application-specific. Thus, the security enhancement methodology may not fit the most generic architecture.

•
The detailed protocols stack and its interoperability are still being explored. Due to immaturity, the exhaustive security aspects for protocols and the standards are far behind the actual realization.

•
The amount of abstraction in security, the formal language to be utilized for policy encoding, and contextual IoT features to be considered for optimal usage of softwaredefined networking-based security mechanisms in a secure IoT framework is still an open problem. • Given the inherent trade-off between flexibility, performance, and cost, the granularity of protection methods poses an open challenge in the provision of network slices specialized for IoT applications.

•
The implementation methods and utilization of software and hardware are critical factors in BC to enhance security in IoT using BC. Being public in nature, the transactions of IoT data are still a problem of security concern that can be revealed to the public in general [238].

•
Since FC is an extension to cloud computing, some of the serious concerns of cloud computing such as security and privacy are inherent to the FC, which are being extensively explored in the literature. • EC poses serious security and privacy concerns since most of the computations are generally performed at the edge devices. However, most of the edge devices are resource-constrained in an IoT system, which may not be able to compute, analyze, and process the data securely.

•
There are enormous ML algorithms. The selection of suitable algorithms is of vital importance, because choosing the incorrect algorithm will result in "garbage" output and a loss of effort, effectiveness, and accuracy. Similarly, selecting the incorrect data set will result in "garbage" input and inaccurate results. Thus, the correct data sets and appropriate algorithms are critically important, which can be explored for securing IoT environment using machine learning.

•
The systematic review on vulnerabilities of BC, FC, EC, and ML and their mapping with impact on IoT are some of the research problems which can be further explored.

•
The optimum resource sharing in FC is another research area that can be explored to avoid the burden on the cloud for processing the voluminous data during heavy traffic conditions. • Further, the scope of other technologies such as artificial intelligence, big data, etc., must be also analyzed, which were shown to have great potential in IoT-based applications [239].

Conclusions
The introduction of smart computing devices using IoT has made day-to-day lives more convenient. Data analytics, automation, and smart devices have all benefited from the introduction of IoT into human life. Nevertheless, the unprecedented growth in IoT has also been crippled with many vulnerabilities and challenges. Further, the IoT's heterogeneous design expands the attack surface and adds new challenges to an already vulnerable IoT network. The successful compromise of the system's security may have fatal consequences for users. The overall security of the device must be considered to ensure that critical vulnerabilities are mitigated. Policies and protocols must be enforced as much as possible to deter threats and attacks. In this paper, we have presented a most comprehensive survey on IoT from the perspective of security threats and attacks. Further, modern threats and attacks on the emerging IoT infrastructure, security flaws, and countermeasures are discussed in this paper. In addition, a roadmap of using ubiquitous technologies, viz., BC, FC, EC, and ML, for enhancing security in IoT are comprehensively discussed in this paper.
However, due to IoT devices' heterogeneous existence and limitations, any resolution would be ineffective and obsolete. Consequently, due to the evolving nature of technology, it is estimated that more countermeasures and vulnerabilities will be revealed in the near future. As future work, the authors are working on ML and IoT integration to enhance IoT-based applications' security under dynamically varying conditions. Funding: There is no funding available for this research.