## 2 Related Work
### Fuzzy Logic and Load Balancing
(2021) proposed an algorithm called the feedback-based optimized fuzzy scheduling approach (FOFSA) to enhance power efficiency, execution time, and makespan in IoT networks while meeting quality of service (QoS) requirements. The algorithm intelligently allocates appropriate resources from Cloud resources, including virtual machines, applications, and data centres, to compute tasks. Resource estimation for Cloud computation takes place at the Fog layer. The proposed algorithm was evaluated using MATLAB 2017b, with a focus on applying it to a rainfall prediction mechanism. The algorithm takes five inputs: clouds, tasks, expected completion time, user set priority, and decision making, and generates rainfall predictions by estimating suitable VMs. Simulation results demonstrated that the FOFSA approach effectively reduced power consumption, execution time, and makespan compared to existing algorithms such as the optimized fuzzy bee-based scheduling algorithm (OFBSA); dynamic duty scheduling for green sensor Cloud applications (DDSA), an adaptive tasks distribution method for green Cloud computing; and the osmosis load balancing algorithm (OLB). However, one limitation of the FOFSA algorithm is the lack of criteria and measurements to determine input values. For example, when considering the time to complete a task, there is no standard measurement to classify it as low or high, which may impact the accuracy of the algorithm. Additionally, the computing capacity of resources was not explicitly considered in the algorithm. [PERSON] et al. (2016) 2018 proposed two fuzzy logic algorithms to select IoT devices in opportunistic networks for task computing. The challenges that opportunistic networks face are considered to determine the inputs for the two fuzzy logic algorithms, namely FBS1 and FBS2. In FBS1, there are three inputs: the waiting time, the storage, and the remaining energy to assist in generating an output for the IoT device to process in an opportunistic network. In FBS2, one new parameter is added to the three inputs in the FBS1 to achieve the same objective. The FBS1 is less complex than the FBS2; however, the simulation results demonstrated that the FBS2 achieved better results than the FBS1 in selecting IoT devices. One drawback of this approach is that the authors primarily focused on selecting a suitable source for data computation without considering the characteristics of the data itself. In their work, [PERSON] et al. (2019) [PERSON] et al. (2019) [PERSON] et al. (2021) introduced a lightweight fuzzy logic algorithm called Secure-MQTT to enhance the security of IoT applications, specifically in healthcare monitoring, by utilizing the MQTT communication protocol. The algorithm incorporates an efficient intrusion detection system to safeguard IoT applications against denial of service (DoS) attacks. The Secure-MQTT algorithm takes two inputs, namely the connection message ratio (CMR) and connection acknowledgment message ratio (CAMR), to detect anomalous behaviours and generate an output indicating whether the behaviour is normal, abnormal, or indicative of an attack. To evaluate the proposed approach, the Contiki simulator COOJA was employed. The simulation results demonstrated that Secure-MQTT exhibited superior performance in detecting attacks compared to existing methods, thereby enhancing the overall security of IoT applications. In their study, [PERSON] et al. (2019) [PERSON] et al. (2019) presented a fuzzy logic algorithm designed to assess the trust level of nodes for data collection purposes. The algorithm's evaluation of node trust is based on three inputs: device physical security, device security level, and device ownership trust. These inputs are processed by the fuzzy logic system to generate an output, which represents the trust rating of a node on a scale from one to ten. A rating of one indicates the lowest level of security, while a rating of ten indicates the highest level of security.