# Modeling and Simulation Tools for Fog Computing--A Comprehensive Survey from a Cost Perspective
## 4 Modeling Fog Computing Systems  
In this section, we present and compare typical proposed models for fog computing systems. The role of a model is two-fold; first to understand the real system under study and then to extract an applicable simulation model [52]. In the existing literature, several fog models have been used in lieu of real systems in order to evaluate or understand how those systems work. Models involve components that represent the different parts or states of the real system and the relationships between them which define the behavior of the fog system. For fog computing systems the key components include the infrastructure (i.e., the devices and the network), the platform (encompassing resources, services and their management) and applications (which execute in the fog and have certain requirements) according to Reference [2]. [PERSON] et al. [11] identify three essential dimensions involved in fog computing--system structural, services and security, while [PERSON] et al. [8] distinguish four key factors relative to fog and edge computing modeling and simulation--infrastructure, resource management, mobility and scalability. Among the proposed approaches, only a few [33,38] focus on cost modeling. Both efforts seek to quantify the cost of developing IoT applications and the resource-allocation paradigm in fog computing environments. A fog model could be a static representation of the distributed system, or a dynamic one; it may include facilities for data-processing, resource management, networking, and storage services [53]. However, it is important for the research and industrial community to evaluate all those models in terms of costs. Several types of models have been proposed to study fog system behavior or to evaluate its operation. We can classify them into two broad categories--mathematical and conceptual models. A mathematical model uses mathematical expressions, symbols and language to describe a system, while a conceptual model represents the system as a composition of components. We can further distinguish mathematical models in:  
* _Analytical models_: An analytical model uses mathematical symbols and expressions in order to describe the system evolution. Such models exploit probability theory, algebraic methods and other mathematical tools and techniques to solve a defined problem, sometimes resulting in closed-form solutions. Commonly they have relatively few parameters so as to keep the problem tractable and this can reduce their accuracy. In most cases they lead to rather simplistic representations, not well suited for representing highly complex systems [54]. Although not strictly analytical, numeric computer-based simulations can be considered in this category. Numeric simulation usually involve dividing a system into many small subsystems, model each subsystem using analytical models and test the overall system using computers. These models are relatively simple but can be useful for reproducing the behavior of complex systems. Analytical models have been used to model the system load [54], the IoT service delay [44], and other performance metrics in fog computing. Numeric computer-based simulations have been used to test resource allocation or caching schemes [55,56]. * _Petri Nets models_: Petri Nets use a graphical representation of the system under study, in combination with a mathematical formalism to model, analyze, and verify system components and their activities/interactions, and have enjoyed wide applicability [57]. In [48] Petri Nets used for the decomposition of distributed edge systems into several components. [PERSON] et al. [58] utilize Petri Nets to discover the learning process in IoT edges. [PERSON] et al [32] adopt Petri Nets to model and evaluate mobile crowdsensing services. [PERSON] et al. [47] investigate the resource allocation problem in fog computing and propose a solution based on priced timed Petri Nets. The user autonomously chooses the part of resources that satisfy her needs, out of all the available preallocated resources.