I. Introduction
By the advent of the Internet of Things (IoT), billions of smart devices will be sensing and generating data continuously as they are communicating data together as well as remote servers through the Internet. Processing the massive generated raw data by the IoT based applications is possible by using Cloud computing as it offers storage and processing services through a shared pool of capable computing resources accessible through the Internet. However, using Cloud computing is not the best solution as there are some limitations regarding using Cloud for processing the massive raw data produced by the IoT devices. As an example, transferring the generated data to remote servers increases bandwidth utilization significantly and consequently the problem of lack of enough bandwidth will emerge. Moreover, the Cloud resources are only accessible through the Internet and having stable high-speed Internet connectivity is not always possible for any user. In addition, as Cloud resources are far from the users, any network or technical failure increases the response time which is not tolerable by delay-sensitive applications. The aforementioned problems increased the need for a new approach capable of providing the processing and storage services between the users (data providers) and servers, somewhere nearer to the user. Therefore, in 2012 Fog Computing emerged as a solution by industry [1]. Fog computing is a decentralized computing structure in which processing and storage of data could be done by Fog Servers, which are lightweight servers located between the data source and the Cloud. Technically, Fog computing extends the Cloud services closer to the users by providing a platform where huge numbers of heterogeneous, ubiquitous and decentralized devices communicate and cooperate to perform storage and processing tasks without intervention of third parties [2]. Therefore, in Fog computing the capabilities of the under-utilized electronic devices around the data providers could be used for processing, communicating and storage of the produced data by the IoT devices. Deploying services in the vicinity of users provides different advantages such as reduction in congestion, jitter, response time, elimination of data communication in Internet infrastructure and reassuring the security of communications [3]. The aforementioned advantages make Fog computing a great technology for applications which: