# An IoT-Based Fog Computing Model  
Kun Ma  
1 ISAT Laboratory, Department of Computer Science, University of the Western Cape, Bellville 7535, South Africa; [EMAIL_ADDRESS] (A.B. ); [EMAIL_ADDRESS] (C.N. ); [EMAIL_ADDRESS] (O.A. )1  
[PERSON]  
22 April 201921 June 2019214 March  
infrastructure for the internet of things (IoT) that extends computing power and data analytics applications to the \"edge\" of the network. A fog computing model is equivalent to a local cloud, where data management is done and controlled by the users themselves. Users can analyze and manage their data at any time, from anywhere and in any way. The core idea of fog computing lies in the \"smart front-end\" concepts which promotes the use of networked or dedicated devices to provide computing, storage, and network communication services between cloud servers and terminal devices. Thus, bringing data storage and computing much closer to acquisition terminal; reducing data transmission and storage overhead, improving application response speed and improving the utilization of network resources. Fog computing can be viewed as a middle layer between cloud computing and terminal computing. It is located at the edge of the network and close to the terminal. It is often combined with cloud computing to form a common network structure model, which includes the cloud computing layer, fog computing layer and terminal access layer as shown in Figure 1. In the coverage area of the fog node, various intelligent terminals access the node and achieve interconnection and intercommunication. In addition, the fog computing layer is able to complete the direct computing processing thereby reducing network transmission delay from sending/receiving from the remote cloud. Initially, the number of fog nodes was small and easily manageable, but their number has increased drastically in recent times. This increase in IoT terminals has brought the critical issue of energy consumption in fog nodes to the limelight. It is, therefore, an inevitably important research area for the development of IoT. In addition, the terminal layer is a multi-hop self-organizing sensor network, composed of a large number of nodes deployed in an area and are often interconnected wirelessly. The goal is to collaboratively perceive, collect, and process information about the perceived objects in the network coverage area and send them to the observer. A large number of nodes are randomly or deterministically deployed in or near the sensor field. We assume that each node in the terminal layer has its own battery, and there are variations in power at specific time intervals due to different factors particularly the amount of activities performed by the nodes. Parameters that may affect or contribute to the degree of node overwork may include the following: traffic that can be measured in bytes or the number of child nodes that are connected to the node, ambient temperature and humidity. All of these features may result in reduced battery life. Therefore, energy consumption is always considered as the main factor in designing and measuring protocols. Figure 1: The model of the internet of things (IoT). With the above description, this paper proposes an IoT-based fog computing model that effectively allocates tasks to fog nodes (FN) in a manner that conserves the total energy consumed. The specific contributions of this paper are as follows:  
* An IoT-based fog computing framework: this paper presents a multi-layer framework for IoT-based fog computing environments that addresses the issues related to (i) the topology of the terminal layer network and its impact on the routing of data in that layer (ii) the allocation of resources (fog nodes) in the fog layer as well as the allocation of the tasks uploaded from the terminal layer. The framework is based on a model that minimizes the overall cost (delay, distance, energy) of completing the terminal tasks using fog nodes.