# An Analysis of Methods and Metrics for Task Scheduling in Fog Computing
## 2 Fog Computing: Architecture and Characteristics  
The fog computing architecture consists of three layers [6]: the Edge layer, the Fog layer, and the cloud layer (cf. Figure 1).  
At the Edge layer are the edge nodes, devices such as mobile phones, sensors, smart vehicles, smart watches, etc. Edge nodes sense and capture data in diverse geographical locations, eventually pre-process data, and finally send data to the Fog layer for processing or storage.  
In the Fog Layer are located the Fog nodes, which can be routers, access points, switches, gateways, firewalls, or dedicated servers [7]. Fog nodes provide computation and storage services and are organized into fog colonies. A Fog Colony is managed by a control node, which is in charge of distributing the colony's workload among the Fog nodes, checking the Fog nodes' health state, and exchanging colony status information with other controllers to eventually use computing and storage services in remote colonies, e.g., when the colony capacity is exhausted or for moving edge nodes. A Fog controller can also use cloud computing and storage services. A Fog colony serves a set of edge nodes that can change over time.  
The cloud layer offers scalable computational services and highly available, durable, and large-scale storage solutions. A fog controller uses the cloud layer for storing data that is not needed close to users or performing intensive computations not requiring low latency [8].  
In this paper, we assume the fog nodes execute IoT applications providing services to the edge nodes. We consider an IoT application composed of multiple software components (tasks) that can be executed at the edge, in the fog, or on the cloud layers. When deploying an IoT application to cater to a single edge node or a group of edge nodes, the control node of the closest Fog colony takes scheduling decisions for the application's tasks. Scheduling decisions are based on the computational demand and available resources, and on functional and non-functional requirements.  
The architecture described above generalizes what has been proposed in the literature. According to [3], the fog computing architecture is a heterogeneous environment containing multiple fog layers and the cloud; fog and cloud servers are collaborative, and tasks are dependent.  
The authors of [9] depict the architecture integrated with mobile edge computing (MEC). The model consists of user level, edge level, and remote level. At the edge level, devices are multiple, and requested tasks are heterogeneous. MEC contains virtualization technology that provides computing, storage, and network resources. The edge layer comprises a homogeneous environment and a single layer. According to the model, an application has dependent tasks. One main drawback is that it is not robust in case of broken network connections or insufficient power.  
A three-layer network architecture consisting of an IoT device layer, a fog layer, and a cloud layer has also been proposed in [10]. The IoT layer routes requests from IoT devices to the fog layer using intelligent gateways. The fog layer consists of a collection of fog nodes with a fog controller or broker. The fog controller distributes tasks between the fog and cloud layers. The fog controller also manages the scheduling of tasks across the fog nodes and coordinates their available resources. The cloud layer consists of data centers with significant computing power. The tasks are characterized by the fact that they are indivisible, non-preemptible, and independent, which makes them unsuitable for being divided into sub-tasks. Fog nodes are heterogeneous, meaning each node differs from others.