# Modeling and Simulation Tools for Fog Computing--A Comprehensive Survey from a Cost Perspective
## 3 Modeling and Simulation Challenges
### Cost Considerations  
Fog computing is a complex environment, where services are provided to users, and users execute their applications. The acquisition of services or resources depends on the participating nodes and their roles as providers or users and always involves the notion of cost. Various aspects of fog computing costs have been considered and cost-aware schemes have been proposed for resource allocation [33], simulations tools [34; 35], or modeling tools [36; 37]. [PERSON] et al. [33] propose a cost model for fog computing environments which concerns both devices and applications. It is calculated per device or application and summarizes different types of cost and various cost parameters. It is expressed as a function of:  
* _Communication cost_: this cost is proportional to the number and size of messages received.
* _Processing cost_: this cost is related to user requirements for local or virtual execution. In the first case, it depends on the total number of executed tasks. In the second case, it depends on the number of required virtual resources and their time usage (CPU hours).
* _Cloud-network cost_: this is included if there are interactions with clouds. It concerns cloud integration pricing and data roundtrip times.
* _Migration cost_: it is the cost for migrating tasks from a fog node to another and is proportional to the total execution time of migrated tasks. This cost is paid by the fog node who was in charge of executing the tasks before the migration.
* _Storage cost_: it is calculated as a function of the storage size, the storage duration and the encryption cost.
* _Power cost_: this accounts for the battery costs of all sensors that are utilized during an application execution.
* _Software cost_: it is calculated according to the per-month pricing policy for each used commercial software product.
* _Sensors cost_: this expresses the cost per sensor request, summed over all served requests.
* _Operational cost_: this sums up the fog device, the sensor and the network operational cost.  
The above cost model general enough, has many advantages and can fit in other fog computing settings with some modifications (for example, power cost may be also attributed to fog and/or cloud devices). Ideally, it could be embedded in simulations tools. Examples of cost metrics listed in Table 1. As [PERSON] et al. [38] state, the inclusion of cost models in simulators may give a significant boost to the deployment of eligible fog computing applications.  
\begin{table}
\begin{tabular}{p{142.3 pt} p{142.3 pt} p{142.3 pt}} \hline \hline
**Cost Type** & **Works** & **Examples** \\ \hline Communication cost & [27; 29; 37; 39] & No. of message, message size, throughput, transmission cost, network cost. \\ \hline Processing cost & [25; 27; 29; 32; 35; 40; 41; 42; 43; 44; 45] & Computing cost, system response time CPU-memory-bandwidth utilization, failures per-connection, job loss probability, response time processing -service delay resource churn. \\ \hline Cloud-network cost & [22; 25; 32; 34; 35; 37; 39; 44; 45] & Bandwidth, latency, propagation and transmission delays, round-trip-times routing costs. \\ \hline Migration cost & - & - \\ \hline Storage cost & [45] & Storage cost. \\ \hline Power cost & [25; 35; 36; 41; 46] & Energy consumption \\ \hline Software cost & [36; 47; 48] & Price cost, billing cost. \\ \hline Sensors cost & - & - \\ \hline Operational cost & [39; 45; 46; 49; 50; 51] & Maintenance costs, operating expenses operational cost, reconfiguration, acquisition, power delivery, evacuating heat. \\ \hline \hline \end{tabular}
\end{table}
Table 1: The notion of cost in fog computing systems.