# A Survey from Real-Time to Near Real-Time Applications in Fog Computing Environments
## 2 Material and Methods
### Material
#### 2.1.2 Fog Computing  
Fog Computing is a platform that provides processing, storage, and networking resources between edge devices and cloud computing data-centers [11]. Thus, fog computing can be seen as an extension that complements cloud computing and not as a replacement.  
The main goal of fog computing is to support applications and services that are not serviced by cloud computing [10], which are:  
* Applications that require predictable and low latency;
* Geographically distributed applications;
* Mobile applications that require fast responses;
* Large scale distributed control systems.  
The three main layers (Edge Computing, Fog Computing, and Cloud Computing) of an IoT environment, presented in Figure 1, can be seen as a hierarchical organization of network resources, computing, and storage [12].  
According to [PERSON] et al. [10], the interaction between the edge computing, fog computing, and cloud computing layers begins when the edge computing layer sends the data generated by the sensor and device grid to the fog computing layer. The first layer of fog, designed for interaction machine-to-machine (M2M), processes the data and sends commands to the actuators belonging to the Edge layer. This layer also filters the data to be used locally and sent to the upper layers. The second layer includes both system  
Figure 1: Hierarchical organization between edge, fog, and cloud computing.  
processes and data delivery to the machine-to-machine cloud as well as human-to-machine interaction (H2M), which deals with visualization and reporting.  
The time scale between these interactions are: from milliseconds to seconds between the edge and fog layer; seconds to minutes in the first and second layers of the fog; and minutes to days to send data to the cloud computing and transactional analysis [10].  
Applications such as Smart Home, Smart Grid, Smart Vehicle, and Healthcare benefit from the advantages fog offers, namely low latency and fast response [12].  
* Smart Home: the variety and heterogeneity of the devices and sensors connected in the house make connecting them difficult. In this case, fog can be used to integrate devices into a single platform and enable applications to handle the elasticity of resources;
* Smart Grid: it is an electricity distribution network, with smart meters deployed at various locations to measure state information instantly. A centralized server called the SCADA system gathers and analyzes state information and sends commands to respond to changing demand or emergencies to stabilize the power grid;
* Smart Vehicle: fog computing can be integrated into the vehicle network and can be categorized into two types: based on infrastructure and autonomous. The first is based on fog nodes deployed along the road; the nodes are responsible for sending/receiving information to/from the vehicle steering. The second uses moving vehicles to form the fog to support ad hoc events; each fog can communicate with clients and other fogs;
* Healthcare: health data are considered sensitive as it is valuable and private data. With fog computing, the storage and processing of this data are done locally, which makes it safer, faster to view, and allows the user to have their health information;  
The temporal requirements of the applications may vary according to the characteristics they present. For example, smart vehicles and healthcare are applications with greater sensitivity to time, compared to smart home and smart grid, due to the immediate need for decision-making.