# Minimum-Cost-Based Neighbour Node Discovery Scheme for Fault Tolerance under IoT-Fog Networks
## 3 Materials and Methods
### Problem Formulation and Objective Function
In both scenarios, a better performance is achieved with the help of the prior availability of Fog access nodes for task-offloading when nodes are in a state of failure, as well as the proper information tracking of source Fog access nodes via replication and pre-emptive forwarding methods. Figure 8: Task completion rate vs. failure rate for the task count of 1500 (**a**) with and without replicas; (**b**) for various algorithms. Figure 7: Task completion rate vs. failure rate for the task count of 250 (**a**) with and without replicas; (**b**) for various algorithms. ### Task Acceptance Ratio and Completion Time

The task acceptance ratio of the proposed PTFT algorithm is compared with the existing fault-tolerance method without replication and forwarding in Fog networks. From Figure 9, it is observed that the proposed method outperformed the other methods, and achieved a higher acceptance of tasks with an increase in the number of Fog access nodes. This can be obtained with the help of efficient task-offloading activities in Fog networks, using replication and pre-emptive forwarding mechanisms, to candidates in the same Fog server or a neighbouring Fog server. In this, the acceptance rate of tasks was increased by 24% compared with existing methods without FT. The task completion time is measured for the proposed PTFT method, and it is compared to methods without replicas and fault-tolerance methods. Figure 10 shows that the proposed method has a minimum task completion time, and this can only be achieved because of the task-offloading in distributed Fog networks. In contrast, the other methods use a hierarchical placement for task-offloading in Fog access nodes, using the controlling function of the cloud data centres. Here, the task completion time is measured for various Fog access nodes, keeping the task size constant. The proposed method outperforms other methods, with a higher performance of 16.27% compared to those without fault tolerance and 29.84% compared to those without replicas. Figure 10: Task completion time vs. number of Fog access nodes. Figure 9: Task acceptance ratio vs. number of Fog access nodes. ### Residual Energy

The residual energy of the proposed PTFT algorithm is compared with other methods, and the results are illustrated in Figure 11; the proposed method outperformed other methods and achieved task-offloading activities with lower energy consumption. Initially, each Fog node joins, with an initial residual energy level of 5 J, during the task-offloading process. As time increases, the number of tasks arriving from the user device will increase, and this will directly reduce the residual energy of the Fog access nodes after task-processing. The level of residual energy will be monitored continuously after and during task-processing by the respective Fog control nodes. Here, it is identified that the proposed PTFT method uses less energy for task-offloading and achieves a residual energy saving of 1.55 J compared to methods without replicas and 0.85 J compared to methods without the fault-tolerance method. Because the Fog access nodes select tasks based on priority and their remaining residual energy, this will directly reflect the inefficient energy utilization that occurs during offloading activities in Fog networks compared with other methods. ## 6 Conclusions

The importance of fault-tolerance mechanisms in a Fog environment during task-offloading activities was studied, and a relevant PTFT algorithm was proposed, which includes the identification of faulty Fog nodes and priority-based task assignment in Fog networks. Fault-free task assignment is necessary for the efficient and reliable utilization of Fog access nodes in a Fog environment. Considering this, a new MCNCND algorithm was proposed for task-offloading, and the obtained results were validated.