Optimization of mobile device energy consumption in a fog-based mobile computing offloading mechanism

The offloading of computing tasks to the fog computing system is a promising approach to reduce the response time of resource-greedy real-time mobile applications. Besides the decreasing of the response time, the offloading mechanisms may reduce the energy consumption of mobile devices. In the paper, we focused on the analysis of the energy consumption of mobile devices that use fog computing infrastructure to increase the overall system performance and to improve the battery life. We consider a three-layer computing architecture, which consists of the mobile device itself, a fog node, and a remote cloud. The tasks are processed locally or offloaded according to the threshold-based offloading criterion. We have formulated an optimization problem that minimizes the energy consumption under the constraints on the average response time and the probability that the response time is lower than a certain threshold. We also provide the numerical solution to the optimization problem and discuss the numerical results.


Introduction
In recent years, fog computing has received attention from the scientific and industrial community. Many papers were related to opportunities and challenges of fog, focusing primarily on the networking context of the Internet of Things (IoT) [1]. Another one of the most popular topics and pressing research issue is the compromise between the energy-efficiency and the response time in offloading of mobile application tasks to fog computing infrastructure. The paper [2] presents the results of a study on energy consumption, execution delay and payment cost of offloading processes in a fog computing network in terms of queuing theory. Research in [3] focuses on energy-efficient task offloading, whose main idea is taking into account both energy consumption and schedule delay under fog devices. Energy efficient offloading is also a vital task in the context of the Internet of Things concept [4].
In our previous paper [5], we developed an analytical framework for response time analysis that takes into account the variation of tasks in terms of processing volume. Then in the paper [6], we analyze the two-parameter offloading mechanism that takes into account both the computing complexity and the data size to be transferred in case of offloading. In [7] we derived the cumulative distribution function of the response time in terms of Laplace-Stieltjes Transform. In the current work, we solve the optimization problem by minimizing energy efficiency, subject to the average time constraint and taking into account the probability that the time exceeds a given threshold.

Mathematical model
We consider a distributed computing system that consist of mobile devices (MDs), a fog node and a remote cloud. MDs run real-time applications that require significant amount of computational resources. For each task, a MD makes a decision, whether it will be offloaded to the fog node or processed locally. The capacity of the fog node is limited, which means if there are too many tasks offloaded, then some of the offloaded tasks are redirected to the remote cloud to prevent the fog node congestion. In terms of queuing theory, the considered system can be represented as shown in the figure 1. MDs, each of them generating a flow of tasks with exponentially distributed interarrival times according to Poisson's law with intensity , = 1, … , . Each task is characterized by the amount of processing volume required and the data size to be transferred in case of offloading. We assume that the processing volume (measured in millions of instructions, MI) and the data size (measured in MB) are independent random variables with CDFs ( ) and ( ), probability density functions (PDF) ( ) and ( ) respectively. MDs process locally served tasks in the FCFS mode with constant serving rate , = 1, … , (measured in MIPS).
We propose the offloading mechanism that implies offloading tasks that are "heavy" in terms of processing volume and "light" in terms of data size. Splitting to "heavy" and "light" tasks are done by the threshold on the processing volume and the threshold on the data size. Hence, the offloading probability , on the -th MD is evaluated [6], [7] according to the following formula If a task is processed locally, then the response time consists of processing time on an MD only. If a task is offloaded to the fog node, then the total response time is the sum of task transmission time to the fog node through wireless network, the processing time on the fog node and the transmission time back to the MD. If the fog node is overloaded and an offloaded task is sent to the remote cloud, then the processing time at the fog is replaced by the transmission time between the fog node and the remote cloud, the processing time on the cloud and the transmission time back to the fog node.
We assume that the wireless network provides total bitrate , which is used to transmit the data of tasks one-by-one in FCFS order, so the transmission time is obtained as the fraction of the data size of a task and total bitrate . On the other side, the transmission time between the fog node and the cloud is assumed constant.
The fog node provide computational resources by means of virtual machines (VMs), each of them having the constant serving rate . The total number of VMs at the fog node is . The constant serving rate of VMs at the cloud is greater than , and amount of computational resources (VMs) at the remote cloud is assumed to be large enough, so that it cannot be overloaded.

CDFs of the response time components
The service process at MD is modeled in terms of a queuing system / /1 with arrival intensity , ∑ =1 = . The distribution function of the processing volume on a MD can be determined by conditional CDF , ( ) as follows Having obtained the distribution function of the processing volume , ( ), we can find the serving time at a MD. By virtue of the fact that the serving rate on the -th MD is constant and being , its CDF is easily obtained as , ( ) = , ( ). The average serving time at MD can be found through integration using the CDF , . If a task is offloaded to the distributed computing infrastructure, it is first transferred through the wireless network to the fog node. The delays in wireless networks are obtained analogously, by employing / /1 queue. The arrival intensity is the sum of the offloading intensities from all MDs , . The CDF , ( ) of the file size to be transmitted is and the service time distribution in the wireless network is , ( ) = , ( ). At the fog node, there are VMs to serve offloaded tasks, so the service process may be modeled by / / /0 queue, where the blocked customers are redirected to the next layer -remote cloud. The arrival intensity is the same as for wireless network -. The service time is determined by The service time is simply processing volume divided by the service rate , so the CDF of the service time at the fog node is The probability that a task is redirected to the remote cloud is obtained from Erlang formula for / / /0 queues as where is the average serving time at the fog node, which can be easily evaluated from the CDF ( ). The service time distribution ( ) at the cloud is

The average response time
The total response time is the conditional sum of processing and transmission delays. A task from -th MD is processed locally with probability 1 − , on the fog node with probability , (1 − ) and on the cloud with probability , . In [7], we derived the Laplace-Stieltjes Transforms (LST) for all delay components for the case of Gamma distribution of both processing volume and data size, and obtain the LST of the total response time.
First, we derived the LST̃, ( ) of the service time at the MD as with the the LST of , the sojourn time distribution on mobile device After this we used numerical Reverse LST( ) to evaluate the CDF ( ) of the response time.
Actually, the average response time can be calculated as The resulting expressions allow to get the probability Π( ) that the response time is lower than a threshold Π( ) = ( ). (16)

The energy consumption analysis
In this section, we present the formulas for the average power consumption of MDs obtained at an earlier stage of research [6].
The energy consumption for tasks processed on MD is proportional to the processing volumes of tasks, therefore the average energy consumption , during locally executing on -th MD can be evaluated as follows: where , is the power consumption (W) during the processing of the -th MD, which is considered constant for simplicity of calculations.
The average file size transmitted by -th MD, can be calculated through integration using CDF , ( ) from the previous section. The energy consumption during transmitting is also proportional to the transmission time, so the average energy consumption , of the -th VD during task transmission is Then the average energy consumption for any -th MD is the weighted sum of processing and transmission energies: At the end, we can evaluate the average energy consumption for a task from an arbitrary MD as follows ) . (20)

Optimization problem
In order to find the minimum energy consumption under constraints on the average response time and the probability Π( ) that the response time is lower than a threshold , we formulate the optimization problem as follows: (21)

Numerical results
In this section, we presented the numerical results of our study. The main metric of interest here is the minimum power consumption for a task from an arbitrary MD under the constraints from the optimization problem.
We consider a system with = 20 homogeneous MDs that run the same applications, so the distributions of processing volume and data size of tasks are also the same. The fog nodes can run maximum = 8 VMs. All values of parameters used in the section are gathered in table 1.  Figure 2 shows the probability Π( ) as a function of processing volume threshold with the response time threshold = 0.5. The power consumption graph begins to descend only at values of Π * = 0.94 and above. This shows that only with a very high threshold value of the probability Π( ) that the response time is lower than a threshold , there will be a gain in terms of energy costs.