## 2 Theoretical Background
### IoT Architecture in Wireless Sensor Network  
The Internet of Things (IoT) architecture as depicted in Figure 2, consists of three domains: device or hardware, network or communication, and a layer of interfaces and services. The first layer includes sensors and actuators. For instance, an irrigation system might include individual sprinkler heads, moisture sensors, temperature sensors, and actuators, which are connected to the network using different protocols. In this layer, the end devices use a microprocessor based on the Interplanetary File System (IPFS), which is used for distributed data storage and data integrity while taking into account the problems with centralized systems [9], ARM, or X86 architectures, and a Real Time Operating System (RTOS) hardware operating system. For the application software layer, there are custom applications, cryptographic protocols, and third-party libraries and drivers. The network domain, or communication layer, presents the process of collecting and transferring data to the application domain. Different protocols are used to connect objects with the gateways and these to the internet and cloud applications. Figure 1: Conventional architecture of a wireless sensor network. The limitations of IoT sensor nodes require having a communication channel between sensors and a gateway device. The gateway translates wireless sensor network (WSN) traffic to IP protocol traffic that can travel on conventional data networks. Some wireless sensor networks can have a large number of sensor nodes. These nodes may only be able to operate on battery power and have very little computational capability. Due to power limitations, these nodes are only able to communicate across extremely limited distances. In this instance, protocols are employed to allow sensor data to pass from node to node until the data reaches the gateway. IoT wireless protocols can be formed into different wireless topologies using the IEEE 802.15.4 standard, such as hub-and-spoke, star, mesh, and cluster tree topologies. The data is forwarded from one node to another in order to reach a gateway, while if the nodes have their own IPv6 protocol stacks and messaging protocols, they can communicate directly with the cloud or data centre without requiring translation into IP by an IoT gateway. The Application Domain (interfaces and services) layer provides management services such as data processing and analytics, storage, smart energy and connectivity management, or any application that consumes the data from IoT devices [10]. Types of Possible Attacks in IoT  
The Internet of Things (IoT) paradigm involves such a wide array of devices and equipment, ranging from tiny, embedded processing chips to enormous high-end servers, that it is necessary for it to address concerns regarding security on multiple levels. 1. The first level is concerned with the security issues at the network interface layer, where adversaries try to disrupt the normal operation of the network, such as: * A jamming attack can be introduced as a high radio frequency signal that is used against wireless devices in WSN and IoT devices to disrupt the normal operation of the network. It might cause the system to fail or behave in unexpected ways [11]; * Node capturing: this type of attack is regarded as one of the most serious types of wireless network attack. This attack is launched by an adversary in order to gain partial or complete control over the sensor nodes. The adversary captures the legal sensor nodes to extract important security information regarding shared secrets and cryptographic keys and uses them to conduct additional assaults [12; 13]; * Sybil attacks are a type of attack that can be deployed by attackers on both low- and intermediate-level layers to reduce the performance of sensor and IoT networks and even violate data privacy. An adversary may eavesdrop on the information of a legitimate node and use fake identities to conduct a sybil attack [3; 14]. 2.