## 2 Related Work  
Various techniques have been described in the literature to enhance the efficiency and security of IoT-enabled systems by utilizing appropriate protocols and algorithms. [PERSON] et al. [31] introduced an intrusion detection technique with an appropriate algorithm to detect the hybrid DoS attack in a wireless network. Experiment results showed that the proposed algorithm could enhance the detection rate of attacking nodes, increase the network's lifetime, and reduce the attack's impacts on network traffic. However, this method is based on the very high precision of nodes for controlling their energy consumption. If the attacker controls the node fully and copes with the energy information, the malicious node escapes from protection. [PERSON] et al. [32] developed an algorithm based on the hidden Markov model (HMM) to tackle the black hole attack in a wireless network by providing the optimal path. The NS2 simulator is used under the AODV protocol to evaluate metrics such as the packet delivery ratio (PDR), end-to-end (E2E) delay, and packet drop ratio. The simulation has shown efficient results for a secure network. [PERSON] et al. [33] introduced a lightweight and secure technique to tackle the sinkhole attack in the wireless network. A sinkhole attack is a network layer attack where an attacking node attracts other nodes and deceives them by showing itself as the optimal path to the corresponding station. The proposed technique shows better results while considering the performances of the following: the packet delivery ratio, delay, energy consumption, and throughput. [PERSON] et al. [34] proposed the intrusion detection system (IDS) to detect the network layer attack called the wormhole attack in IoT networks using the RPL protocol. The scheme was implemented in Cooja and Contiki simulators. The results identified the attacker node and attack in the network. The limitation of this work was the limited node numbers, i.e., 24 nodes. [PERSON] et al. [35] developed an algorithm to inspect selective forwarding attacks in the wireless network. This attack dropped many packets when the data were received at the destination. The algorithm also reduced useless steps in density peak clustering to enable better detection accuracy. The simulation showed that the false detection rate lies below 1%, which is tremendous for the algorithm's accuracy. [PERSON] et al. [36] proposed the backdoor technique to enable penetration testing. Penetration testing is beneficial for locating IoT backdoors, detecting hacker action, preventing hackers from gaining permanent, concealed, and unauthorized access, penetrating testing aids in the detection of IoT backdoors, detecting attacker activity, and preventing them from gaining unauthorized access. [PERSON] et al. [37] secured the IoT networks from multiple network layer attacks using fuzzy- and feed-forward neural networks. Experimental results showed that the scheme has an average detection rate of 97.8%. The performance of this scheme is better than others but computation times are high compared to machine learning techniques. [PERSON] et al. [38] researched and analyzed the privacy difficulties involving data owners, untrustworthy third-party cloud servers, and data consumers under the IoT, and suggested a lightweight privacy-preserving technique based on homomorphic encryption. Meanwhile, computationally efficient homomorphic methods protect data consumer privacy. According to experimental results, the suggested system successfully prevents privacy intrusions in IoT. [PERSON] et al. [39] developed a data-driven framework to present a clear demarcation of IoT configurations and assess different IoT threats. It has much importance regarding security concerns and is collectively called the IoT checker. [PERSON] et al. [40] proposed a secure technique to manage and distribute the keys for IoT-based wireless sensor networks.