# Modeling and Simulation Tools for Fog Computing--A Comprehensive Survey from a Cost Perspective
## 1 Introduction  
Fog computing is a new architecture which bridges the cloud and the Internet-of-Things (IoT) world, acting as a a layer between them in order to provide services directly to the network edge. As per Reference [1], fog computing is as _\"a scenario where a huge number of heterogeneous (wireless and sometimes autonomous) ubiquitous and decentralized devices communicate and potentially cooperate among them and with the network to perform storage and processing tasks without the intervention of third-parties. These tasks can be for supporting basic network functions or new services and applications that run in a sandboxed environment\"_. It provides a promising approach for processing the huge data volume produced and consumed by applications, machines and their users. Complex processing and distributed computing is placed on clouds and devices around us, respectively [2]. Fog is an alternative technology to the cloud aiming to meet user requirements for SCALE [3]--Security, Cognition, Agility, Latency, Efficiency. Nowadays, IoT devices are used for storing, processing, collecting and exchanging data that are generated in huge volumes from emerging applications. IoT interacts with applications that are time-sensitive and have demands for location-aware, high-speed data processing and low energy consumption [4], while having to handle the large scale of produced data. However, in most cases IoT devices do not have the capabilities to perform all these tasks, so instead they rely on cloud computing facilities [5]. The choice to move data and computation from the edges to the cloud can become inefficient and costly while posing security issues related to privacy. Moreover, the centralized nature of cloud, the location dependency in terms of distance, and the cost of services provided by the cloud are important shortcomings of the cloud-IoT integration [5]. Fog computing comes toovercome these limitations. It works complementary to cloud computing and improves on it in terms of latency reduction, bandwidth savings, mobility support, geographically distributed and decentralized deployment, heterogeneity, interoperability, data security and privacy protection, and energy consumption [6; 7]. These factors affect the cost and the performance of communication, computation and storage. In order to reduce traffic load and latency the fog architecture tries to process data or to provide services closer to end devices. Traditionally IoT applications which exploit cloud computing facilities need to deal with heterogeneity, high latency, and large scale issues. In contrast, fog computing establishes a decentralized framework and shifts parts of applications, management, and data analytics to the network edge. However, moving computation from cloud centers closer to network edges requires decisions on where to place data and applications within the cloud-to-end-point continuum and how to address the issues of heterogeneity, geographic distribution, low latency, low power, low bandwidth, security and privacy in cost-effective manner. Researchers and practitioners in the fog computing area have to deal with the system complexity arising from the large number of participating objects and their interactions, different technologies and disparate applications. In order to overcome these issues, they typically employ models and simulation tools to approximate the actual fog system. A model is a representation of a real or a planned system or part of it, in an ideal form. It is used to gain understanding of the system under study, to interpret the various phenomena and the interactions among the components, to make predictions about the behavior of the whole system or some of its subsystems, and finally to act on them. Simulation frameworks provide solutions in cases where mathematical modeling techniques are difficult or impossible to apply due to the scale, complexity and heterogeneity of a fog computing system [8].