# An IoT-Based Fog Computing Model
## 7 Conclusions and Future Work  
Combining the internet of things and fog computing, this paper proposed an IoT-based fog computing model and described the model in layers. The model, called IoT-FCM, is made up of two parts, in the fog computing layer part, a modified genetic algorithm was used that comprehensively considers the delay, the distance between the fog nodes and the users, as well as the energy consumption of the fog nodes to match and allocate tasks to nodes. Experimental simulations were carried out to show the effectiveness of the approach. Obtained results were compared with a fog-oriented max-min algorithm and traditional max-min algorithm. The IoT-FCM moved users 38% closer to the fog node for fog-oriented max-min and 55% for the traditional max-min. While with respect to energy, IoT-FCM conserved an average of 150 KWh more energy versus the other algorithms. For the other part of the model, which is the terminal layer; IoT-FCM modified the LIBP protocol  
\begin{table}
\begin{tabular}{l l l l l l l} \hline \hline  & **Energy** & **Energy** & **Energy** & **Energy** & **Energy** \\  & **Consumption** & **Consumption** & **Consumption** & **Consumption** & **Consumption** \\  & **of 5 Sink Nodes** & **of 5 Sink Nodes** & **of Three Sink Nodes** & **of Two Sink Nodes** & **of One Sink Node** \\ \hline Sink node 1: & 4.55\% & 5.71\% & 3.18\% & 5.86\% & 6.60\% \\ Sink node 2: & 5.84\% & 3.86\% & 6.00\% & 4.27\% & none \\ Sink node 3: & 3.48\% & 3.40\% & 3.96\% & none & none \\ Sink node 4: & 3.35\% & 3.28\% & none & none & none \\ Sink node 5: & 3.93\% & none & none & none & none \\ Average: & 4.23\% & 3.92\% & 4.38\% & 5.07\% & 6.6\% \\ \hline \hline \end{tabular}
\end{table}
Table 4: Energy consumption.  
\begin{table}
\begin{tabular}{l l l l l l l l l l l l l l l} \hline \hline  & \multicolumn{4}{c}{**5 Sink Nodes**} & \multicolumn{4}{c}{**4 Sink Nodes**} & \multicolumn{4}{c}{**3 Sink Nodes**} & \multicolumn{2}{c}{**2 Sink Nodes**} & \multicolumn{2}{c}{**1 Sink Nodes**} \\ \hline Sink node & 1 & 2 & 3 & 4 & 5 & 1 & 2 & 3 & 4 & 1 & 2 & 3 & 1 & 2 & 1 \\ number & & & & & & & & & & & & & & & \\ \hline Distance & 2 & 3 & 0 & 2 & 2 & 2 & 1 & 3 & 2 & 1 & 3 & 0 & 2 & 2 & 3 \\ \hline Recovery & 15.18 s & none & & 18.76 s & none & & 27.32 s & none & 34.81 s & none & infinity \\ time & & & & & & & & & & & & & & \\ \hline Number & 6 & 2 & 0 & 19 & 23 & 6 & 7 & 17 & 20 & 5 & 0 & 45 & 11 & 39 & 50 \\ of nodes & & & & & & & & & & & & & & \\ \hline \hline \end{tabular}
\end{table}
Table 5: Fault-tolerance and robustness.  
by adding multiple sinks. Performance evaluations were done using Cooja on Contiki and obtained results show that the modified LIBP with its use of multiple sink nodes, was more robust and tolerant to node failure and was also more energy conservatory. Of significant note in this work is that the two layers were simulated on different environments; therefore, the authors of this work, did not upload tasks/data directly from the terminal layer to the fog layer of the IoT-FCM model during testing. This could however be considered in future works.  
Conceptualization, K.M. and A.B.; methodology, K.M.; software, K.M.; validation, A.B., C.N. and O.A.; formal analysis, K.M. and A.B.; investigation, K.M. and A.B.; resources, K.M. and A.B.; data curation, K.M. and A.B.; writing-original draft preparation, K.M.; writing-review and editing, O.A. and C.N.; supervision, A.B.; project administration, A.B.; funding acquisition, A.B. This research received no external funding.  
We declare no conflict of interest.