# TETES: Trust Based Efficient Task Execution Scheme for Fog Enabled Smart Cities
## 5 Results and Analysis
### Task Execution of Legitimate Nodes  
In this section, several executed offloaded tasks of legitimate nodes along with their percentages are calculated for varying numbers of incoming offloaded task requests as well as for varying processing capacity of fog nodes. Results in Figures 4 and 5 show the number of offloaded tasks that have been offloaded by legitimate nodes for varying processing capacity of fog nodes and varying numbers of offloaded tasks respectively. In Figure 4, results are obtained for a fixed number of offloaded tasks by all its associated nodes with varying processing capacity of fog node. The results show that the number of executed tasks increases with the increase in the processing capacity of fog nodes. It is evident from the results that the proposed TETES executes more offloaded tasks of legitimate nodes as compared to the other three algorithms for all different capacities of fog nodes. The tasks executed by STF are more than FCFS and LTF, because it executes smaller tasks first and more tasks will be executed. LTF executes the least number of tasks because it executes heavy tasks first and when processing capacity is low it executes less number of offloaded tasks. However, TETES by applying the knapsack algorithm optimally executes a maximum number of offloaded tasks within the processing capacity of the fog node. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Fog Computing Node coverage area & 150 m \\ \hline Distance between fog mining node and task requesting nodes & 50 to 150 \\ \hline Number of intermediate nodes between fog and IoT nodes & 0 to 2 \\ \hline Number of simultaneous offloaded tasks for each fog node & 10 to 20 \\ \hline Data size of each offloaded task (kB) & 50 to 100 \\ \hline Processing capacity of fog node (Processing Cycles) & 10 \\ \hline Task deadline (Processing Cycles) & 10 \\ \hline Task Processing time of offloaded tasks (Processing cycles) & 1 to 2 \\ \hline Number of clusters connected with a fog node & 2 to 3 \\ \hline Number of Malicious nodes & 2 to 4 \\ \hline Number of legitimate nodes & 10 to 18 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation Parameters. Figure 5 shows the number of executed tasks of legitimate nodes for varying numbers of offloaded tasks with a fixed processing capacity of fog node. The results show that TETES executes more tasks with the increase in the number of offloaded tasks as compared to the other three schemes. Because TETES optimally scrutinizes the offloaded tasks that can be executed within the processing cycle of the fog node. The same increasing trend is observed in STF, as with an increased number of tasks, it executes smaller tasks within the processing capacity. However, the number of tasks executed in FCFS and LTF are almost the same for all increasing numbers of offloaded tasks. Figure 4: Number of Nodes Served for Varying Capacity of Fog Node. Figure 5: Number of Nodes Served for Varying Number of Requested Tasks. Results in Figures 6 and 7 show the percentage of executed tasks offloaded by trusted nodes for varying processing capacity of fog node and varying number of offloaded tasks respectively. The results shown in Figure 6 verify that TETES executes more offloaded tasks as compared to the other three schemes for 15 offloaded tasks. TETES executes more than 32% of the total offloaded tasks when the processing capacity of the fog node is 10 and increases to 48% when the processing capacity of the fog node increases to 18. However, STF, LTF, and FCFS execute 24%, 12.6%, and 18% offloaded tasks, when the processing capacity is 10 and executes 35%, 22%, and 30% offloaded tasks respectively when the processing capacity of the fog node increases to 18 Processing cycles. Figure 6: Percentage of Executed Trusted Tasks for Varying Processing Capacity of Fog Node. Figure 7: Percentage of Executed Trusted Tasks for Varying Number of Requested Tasks.