Efficient Computation Offloading Decision in Mobile Cloud Computing ...

28 downloads 154865 Views 1MB Size Report
Springer Science+Business Media New York 2016. Abstract Due to the ... tablets and laptops are gaining enormous popularity in our everyday life [1, 2]. ...... Samsung galaxy s2 Smartphone and an HP Pavilion g series commodity laptop (as ...
Mobile Netw Appl DOI 10.1007/s11036-016-0688-6

Efficient Computation Offloading Decision in Mobile Cloud Computing over 5G Network Mahbub E Khoda1 · Md. Abdur Razzaque1 · Ahmad Almogren2 · Mohammad Mehedi Hassan2 · Atif Alamri2 · Abdulhameed Alelaiwi2

© Springer Science+Business Media New York 2016

Abstract Due to the significant advancement of Smartphone technology, the applications targeted for these devices are getting more and more complex and demanding of high power and resources. Mobile cloud computing (MCC) allows the Smart phones to perform these highly demanding tasks with the help of powerful cloud servers. However, to decide whether a given part of an application is cost-effective to execute in local mobile device or in the cloud server is a difficult problem in MCC. It is due to the trade-off between saving energy consumption

 Mohammad Mehedi Hassan

[email protected] Mahbub E. Khoda [email protected] Md. Abdur Razzaque [email protected] Ahmad Almogren [email protected] Atif Alamri [email protected] Abdulhameed Alelaiwi [email protected] 1

Green Networking Research Group, Department of Computer Science and Engineering, Univeristy of Dhaka, Dhaka, 1000, Bangladesh

2

College of Computer and Information Sciences, Chair of Pervasive and Mobile Computing, King Saud University, Riyadh 11543, Saudi Arabia

while maintaining the strict latency requirements of applications. Currently, 5th generation mobile network (5G) is getting much attention, which can support increased network capacity, high data rate and low latency and can pave the way for solving the computation offloading problem in MCC. In this paper, we design an intelligent computation offloading system that takes tradeoff decisions for code offloading from a mobile device to cloud server over the 5G network. We develop a metric for tradeoff decision making that can maximize energy saving while maintain strict latency requirements of user applications in the 5G system. We evaluate the performances of the proposed system in a test-bed implementation, and the results show that it outperforms the state-of-the-art methods in terms of accuracy, computation and energy saving. Keywords Mobile cloud computing · Computation offloading · 5G network · Intelligent decision making

1 Introduction Due to recent advancement in mobile and wireless communication technologies, mobile devices such as smartphones, tablets and laptops are gaining enormous popularity in our everyday life [1, 2]. These devices are equipped with various functionalities such as GPS, WiFi, cameras, sensors, good level of storage and processing speeds that lead them installed with a wide range of applications. More interestingly, the applications targeted for these devices are getting more and more complex with the number of users and the increasing capabilities of the devices. And in recent years, these applications have started becoming abundant in various categories such as image processing, gaming, participatory sensing, real-time monitoring, social networking,

Mobile Netw Appl

travel and news, etc. [3]. These sophisticated and resourcehungry applications are increasingly posing requirements, especially for more energy and computation power on mobile devices, which are in general resource-constrained, having limited computation resources and limited battery life [4, 5], . In recent years, Mobile Cloud Computing (MCC), is envisioned as a promising approach to overcome such an obstacle [6, 7]. It can allow users to access the cloud services through their mobile devices and thus, enables the mobile devices to offload their most energy-consuming tasks via wireless access to the powerful cloud infrastructure. To decide whether a given part of an application is cost-effective to execute in local mobile device or in a cloud server is a difficult problem in MCC. It needs to measure on-time the amount of energy and time saving from code offloading for various kinds of applications. Furthermore, the latency experienced in reaching a cloud provider through a wide area network (WAN) is highly time-varying, and the time required to execute a certain code at the cloud server may vary over time depending on the computation load of the server. Currently, 5th generation mobile network (5G) is getting much attention, which can support increased network capacity, high data rate and low latency for MCC [8, 9]. Due to faster interaction time in 5G systems, a strict latency control can be incorporated in MCC, which can improve the current computation offloading decision problem. Although a good number of methods have been studied in the literature regarding the offloading process of code from mobile devices to cloud [4, 10–17], however, none of them consider the 5G scenario, and its feature to address the optimal computation offloading decision making considering strict latency and energy constraints. In this paper, we propose a design of an intelligent computation offloading system in MCC over 5G, ExTrade, that aims at jointly optimizing the communication and computation resources. In particular, we develop a metric for tradeoff decision making that can maximize energy saving while maintaining strict latency requirements of user applications in the 5G system. We try to use those features of 5G systems that can enable to guarantee the strict latency requirements with minimum energy consumption. We implement a thread level offloading technique to study the improvement that could be achieved by utilizing the power of mobile cloud computing keeping the consistency with the recent mobile application development practices. The rest of the paper is organized as follows. The stateof-the-art related works are presented in Section 2. We discuss our design goals, system architecture and code architecture in Section 3. Then, we describe the method of defining decision regions, exact and tradeoff decision making and estimating task execution time in Section 4. In

Section 5, we present experimental environments and the results and conclude the paper in Section 6.

2 Related works The technique of code offloading from a resourceconstrained device to a resource-rich architecture, often known as surrogates, have been studied in various works in the literature. Several frameworks [18, 19] have been proposed and a number of techniques have been introduced for the offloading process [20]. Mainly two approaches of the offloading processes are found in the literature, described below. 1. VM migration: Virtual machine method migrates the whole state of the virtual machine to the cloud server [16]. The server then loads this virtual machine and executes the code. A modified version of it was introduced by Satyanarayanan [14] which transferred a smaller state of VM to the server. Since transferring the VM states to the cloud server requires a huge amount of data transfer, the paper worked on the issue to minimize the amount data to be transferred from the mobile device for executing the code on the remote virtual machine. 2. Code partitioning: This approach partitions the application code and executes one part on the device and the other on the server. The major goal of this approach is to define which code sections should be offloaded and the time when it is cost-effective to offload. Our work takes on the second approach since offloading VM to the server requires a huge amount of data and state transfer and therefore, is not a practical solution. Offloading a portion of the code, that requires more computation power and energy, can overcome the problem of huge data transfer and achieve a fair amount of savings in time and energy of mobile devices. Cloudlet [4] introduced a technique where a nearby resource-rich computer, which might be disposed on a nearby coffee shop, acts as mini cloud provider and a smartphone connect to it over a wireless LAN. The rationale for this technique, as described in the paper, is that connecting with an actual cloud provider from the Smartphone suffers from a higher latency and lower bandwidth because an actual provider is likely to be situated far away from the location of the Smartphone. Connecting through a cloudlet located nearby mitigates those problems. MAUI [11] uses a global optimization technique to offload methods to cloud for optimizing the energy consumption of a mobile device. The authors consider a method call graph and state that by considering an individual method for offloading might yield non optimal results. By

Mobile Netw Appl

analyzing the tradeoff between the energy consumed by the remote execution and local execution, MAUI makes the offloading decision. Although in many cases, offloading in this technique often leads to performance improvement but ignoring the computational aspects of the task could lead to situations where the performance of the application might suffer. CloneCloud [12] introduces a technique where the code is partitioned prior to the execution based on some randomly generated input set and solving a linear optimizer. The partition information for randomly generated input is saved to a database, and the application input is matched with this database for code offloading. Though the process does not need any involvement from the application developer, the process depends heavily on the generated input set prior to the execution. These random generated input sets often fail to capture all the execution states of a task since the application user behavior is generally dynamic. ThinkAir [13] further improves the techniques by adopting online method level offloading. The technique adopted a global averaging technique on some previous set of observations of the execution time of a task to estimate the next execution time. This estimation technique fails when the behavior of the application user as well as the transit delays in between the mobile device, and the cloud server highly fluctuates over time. COFA [15] introduces thread level offloading going into the argument that the compute intensive part of the application is executed in a separate thread often known as worker thread. It implemented a hard coded partitioning for android platform, but did not discuss in detail the code offloading decisionmaking process. CADA [10] studied a context-aware approach for offloading tasks to cloud server assuming that a mobile user moves within a certain set of locations, and the environment of a location remains similar. While this argument is true to some extent, the work ignores dynamic behavior of the network environment and application users. The method might fail when the expected context is not preserved, for example, on a certain time of a day, the application user would be at a different place, the characteristic of the task may not remain the same, and the network condition may vary, etc. Another important aspect of decision making is the estimation of the task execution time [21]. Some of the previous works assumed that this information is already present in the system, which is not practical. Other works keep historical data and use simple time average to predict the execution time. But regarding different types of applications targeted for today’s smartphones and the dynamic usage behavior of those applications, this technique might lead to a nonoptimal decision. We use statistical regression technique

[22] to estimate the task execution time that can capture well the dynamic behavior of the working environment. Iverson et al. [23] introduced the model where the execution time of a task could be predicted using both non-parametric and parametric regression technique. The parametric part was used for scheduling a task among several machines. Our work deals with the problem using the non-parametric regression technique. The analysis of trade-off between energy and computation time saving was introduced in [24], where three regions for making offloading decisions are identified. The combined metric designed for the trade-off region is misleading for real valued variables due to the power function used in the metric. Partitioning the application code by solving linear optimizer based on randomly generated input sets fails to give an optimal decision in practical scenarios. Because, capturing all of the different situations that could occur in the course of application usage by randomly generated input sets is an impractical solution. Besides, the cost of executing a task on the remote server does not depend on the execution time of the task linearly because of other factors affecting the offloading costs such as, current computation load of the cloud server, current network bandwidth, the size of the data to be transferred to and from the cloud server, etc. Therefore, the control variables - the time and energy costs are nonlinear. Moreover, a proper technique for estimating the task execution time that plays an important role in decision making is absent in the previous works. Some previous works assume the execution time information is already known to the system [11, 12, 25–28], which is not always true. Other works use a time average to estimate the execution time of a task which is not always optimal because of the dynamic usage behavior of applications. Furthermore, the current trend of Smartphone application development is to keep the user interface responsive to the application, and it is considered as a quality metric for mobile application [15]. In fact, the android programming guideline [29] encourages the application developers to execute compute intensive tasks in a separate worker thread and keep the main thread or user interface responsive to the user. Therefore, instead of method offloading, we go for thread level code offloading in this work, which is more practical. In the following, we use the terms code, task, and thread interchangeably.

3 Design goals and architecture We assume that the intensive part of mobile applications is executed in a worker thread [29]. For simplicity, we also assume that upon completion of a thread, a callback method is invoked. We also assume that the Smartphones are connected to the Internet by WiFi or 5G or 3G technology.

Mobile Netw Appl

The design goals, system architecture and code architecture for our proposed code offloading system, ExTrade, are described bellow. 3.1 Design goals The following is the design goals of our proposed exact and tradeoff decision making system, ExTrade, for code offloading in MCC: –







Performance improvement: Our system aims to improve on both the aspects of computational performance and energy-efficiency of the mobile device by using the power of cloud servers. When improvement is possible only for one aspect, the system looks for an acceptable compromise in between the computation time and energy expenditures. Adaptation to dynamic network changes: Mobile network is used to send the remote execution request to the cloud server and rapid and dynamic change is one of the main characteristics of the mobile network. Our porposed ExTrade aims to adapt quickly and effectively to the changes in mobile network environment. Adaption to dynamic computation load of cloud server: The cloud server response time for a task is affected by the current computation load on a cloud server. The less the load of the cloud server, the better is the response time. So, the offloading decision could be made more effectively by considering the dynamic load of the cloud server. Enhancing QoE: The Quality of Experience (QoE) of a mobile application user can be enhanced by utilizing the power of mobile cloud computing. The response time of an application could be improved dramatically by offloading a heavy computation task to a fast cloud server, which in turn improves the QoE. Furthermore,

Fig. 1 ExTrade system architecture

saving power by executing a task in the cloud server enables us to extend the battery life of a mobile device. Today’s Smartphone users suffer mostly from the poor battery lifetime. By extending the battery lifetime of Smartphones a better QoE for the mobile application users can be achieved. 3.2 ExTrade system architecture Figure 1 depicts the system architecture for our work. On the Smartphone, along with the application code and data, the different components of offloading decision making are present. On the cloud server, where the requested task is executed, along with the clone of the Smartphone, a client handler is present to handle a request from the Smartphone. What follows next, we describe each of the major components of the Smartphone and the cloud server. 3.2.1 Execution handler Execution handler or the decision maker makes the decision about local or remote execution of a thread. When a thread is about to be executed, its eligibility for offloading is checked first. If the thread is offloadable, the control is handed over to the execution handler. The execution handler then obtains information from the profiler, statistical regression model and the lagrange solver. Considering all the available information the execution handler decides whether offloading the task would be profitable or not. Should the task be executed remotely, the remote execution request is made; otherwise, normal execution is resumed. 3.2.2 Profiler Profiler keeps updated information about the dynamic cloud server and environmental conditions. It periodically com-

Mobile Netw Appl

municates with the cloud server for connectivity information along with that it obtains other necessary updates from the cloud server. Following are the major information that the profiler keeps track of: –



Transit delay: Profiler provides with the information of data transmission delay between the mobile, and the cloud server based on the available network bandwidth and data size. Since the available bandwidth of a mobile network is highly time-varying, the updated information is crucial when calculating the remote execution cost that drives the offloading decision. Computation load of cloud server: The response time of the cloud server for a task depends highly on the current load of the cloud server. When calculating the cost of remote execution, speed factor of the cloud server compared to the mobile device is considered to obtain the amount of improvements at the computation time and energy consumption. But, the load of the cloud server changes from time to time based on the job sizes on its queue, the number of requests from the clients, etc. Therefore, accurate measurement of the speed factors is needed to make the optimal offloading decision. In our proposed ExTrade, when periodically communicating with the cloud server the profiler obtains the current server load information.

This device clone on the cloud server is capable of executing the task that is eligible for offloading from the mobile device. The device clone is loaded with the necessary application codes and data. When a Smartphone generates some new data that affect the execution of a task, the device clone should be updated with the new data through a suitable synchronization mechanism. On the other hand, when a new application is installed in a Smartphone, the cloud server should be able to obtain that new application clone either from the mobile device itself or from the Internet using other mechanisms. 3.2.6 Client handler Client handler in the cloud side is responsible for handling requests from Smartphones. It continuously listens on the port where a client makes a request, and it first looks for the type of the request: Control request or Task execution request. –

3.2.3 Lagrange solver The Lagrange solver provides with the basis for making the offloading decision based on the estimated execution time of the task eligible for offloading by calculating the maxima and minima of the time and energy cost for remote execution. Whether offloading a task to the cloud server would save computation time and energy is determined using these maxima and minima values. 3.2.4 Statistical regression model The decision of offloading a task is mainly dependent on the estimated time for the task to execute. The statistical regression model estimates the task execution time by modeling the dynamic usage behavior and environmental conditions. This model gives better estimation than the global averaging, and the time and location based averaging techniques. The details are found in Section 4.3. 3.2.5 Device clone The clone of the Smartphone to be present at the cloud server is a pre-requisite for code offloading process to work.



Control request: The Smartphone periodically communicates with the cloud server by sending control request with a fake 10KB data [11]. This request is sent to the ExTrade server to obtain the connectivity information. When the client handler receives a control request from the client, it replies with similar data with one additional information about the current load of the cloud server. From this additional information, the client can calculate the speed factor. The significance of the speed factor is described in later sections. Task execution request: When a task is decided to be offloaded, the Smartphone sends a task execution request with application id and thread id to the cloud server. Upon receiving the task execution request, the client handler issues the execution of that task. After completion of the task, the client handler obtains the result of the execution and replies to the client with the result. Along with the result, it sends the current server load information so that the profiler of the Smartphone can update the server speed factor.

3.3 Code architecture Our method requires the application developer to annotate the threads that are eligible for offloading (this is done in our implementation by setting a Boolean variable). This is a better choice than annotating the local threads since a thread annotated mistakenly can sacrifice the program correctness, although in some scenarios, it might require fewer annotations. When a thread is about to execute the system checks whether the thread is eligible for offloading. If it is, and it meets the computation and energy criteria, the thread is executed remotely; otherwise, the local execution is per-

Mobile Netw Appl

formed. The following constraints need to be considered when annotating a thread for offloading: – –

Threads that update the user interface cannot be offloaded and Threads that access local device resources, that would hamper the remote execution of the thread, cannot be offloaded.

Examples for the second case are reading data from phone audio input, GPS or taking picture in a facial recognition application, etc. 3.4 Work flow Figure 2 shows the work flow of our proposed ExTrade system. At first, it is checked that whether a task is annotated for offloading or not. If the task is eligible for offloading, the control is handed over to the execution handler. As described in Section 3.2, the execution handler then makes the decision, whether the task should be offloaded or not based on the information obtained from the profiler, Lagrange solver and statistical regression model. After completion of the thread execution, either at local or remote, the callback is called and the normal subsequent execution is resumed.

4 Decision making for code offloading using Lagrange multiplier The control parameters in the code offloading decision makings are the costs of computation time, energy requirement, speed factor of the cloud server, and data transmission Fig. 2 Work flow of ExTrade

time; and, they are not linearly related. For exmaple, the time cost saving, from a remote execution cost, doesn’t always increase or decrease with speed factor of the cloud server. Rather, it shows different values depending on the instantaneous network performance. Therefore, the control variables are not linearly related to each other and thus solving the problem of decision making using a linear optimization solver is not applicable in this scenario. We opt for a nonlinear optimization method using Lagrange multipliers. In this section, we describe the process of decision making for code offloading to the cloud server using Lagrange multiplier method. For code offloading decision, we first calculate the time cost function, ft , required for task execution on a cloud server, ft (tc ) = tc +

D B

(1)

where, tc is the task execution time in the cloud server, D is the amount of data to be exchanged in between the Smartphone and the cloud and B is the available network bandwidth. The first part of the cost function is the actual time needed for the cloud server processor to execute the task and the second part is the time needed to send and receive data to and from the cloud server. Now, if the task execution time in the mobile device is tm and the cloud server is Sf times faster than the mobile device, then the execution time of the task in the cloud server, tc , is calculated as, tc = Stmf . Therefore, the above cost function can be rewritten as ft (tm ) =

tm D + . Sf B

(2)

Mobile Netw Appl

We want to find the minima and maxima, using the Lagrange multiplier method, of the function defined bellow that is used to calculate the computation time saved by offloading a task to the cloud server Ft (tm ) = tm −

tm D − Sf B

(3)

t , respectively, of t the maxima and minima, tmax and tmin the computation time saving function. Similarly, we could e , of the e solve for the maxima and minima, tmax and tmin energy-saving function Fe (tm ) as described bellow:

Fe (tm ) = pm × tm − pi ×

satisfying the following constraints: tm D < tm + Sf B D + < Dmax B tm > 0

ft (tm )
0

(4d)

Sf ≥ 1

(4e)

(11)

where, pm is the average power consumed by the mobile device while doing computation, pi is the average power consumed by the mobile device while being in the idle mode and pt is average transmission and reception power of the mobile device. The process for decision making using these minima and maxima values is described in the following subsections. 4.1 Decision making policies

Here, the first constraint (4a) states that the cost of task execution at mobile device should be greater than that of cloud server. This constraint ensures that offloading a task, whose execution time falls in between the minima and maxima range of the function, would save computation time. Constraint (4b) is the maximum delay constraint that makes sure that the response time of an application, when a task is offloaded to the cloud server, does not exceed the maximum tolerable delay. The constraints (4c) and (4d) are nonnegativity constraints and constraint (4e) ensures that the cloud server is faster (or similar) than the mobile device. When solving for the minima and maxima for the cost function using Lagrange’s multiplier method, the (4a) and the (4b) constraints are integrated in the system of differential equations. Since, we have inequality constraints in our optimization problem, we use the KarushKuhn-Tucker (KKT) extension of the Lagrange multiplier method. Using the above mentioned constraints the KKT equations can be written as: ∇Ft (tm ) − λ1 × ∇(tm −

tm D − pt × Sf B

tm D tm D − ) − λ2 × ∇(Dmax − − ) = 0 (5) Sf B Sf B tm D − ) = 0 (6) λ1 × (tm − Sf B tm D − ) = 0 (7) λ2 × (Dmax − Sf B tm D < tm (8) ft (tm ) < + Sf B tm D + < Dmax (9) Sf B λ1 , λ2 ≥ 0(10)

where, λ1 and λ2 are two constants known as Lagrange multipliers and ∇ is the derivative with respect to the independent variable tm . Solving these quations would give us

After calculating the maxima and minima of the time and energy cost functions, we introduce two types of decision making policies: exact and tradeoff code offloading. –



Exact decision making policy: In this policy, whether to offload a task to the cloud server or not can be decided deterministically. That is, it can be exactly stated that, offloading a task either would save both computation time and energy or neither. When offloading a task to the cloud server saves both computation time and energy, we always decide to offload; if it does not save any of those, we never offload. Tradeoff decision making policy: In this policy, it cannot be stated exactly that whether offloading a task to the cloud server would save both computation time and energy or not. On the contrary, in this policy, offloading, a task results in saving one of the factors (i.e. computation or energy) while compromising other. Therefore, in this scenario, a tradeoff metric is required; if the value of the metric is acceptable, the task is offloaded; otherwise, the task is executed locally. The calculation of the tradeoff metric is described in detail in Section 4.4 and its acceptability are typically determined by the QoS requirements of the underlying applications. This policy is suited for various practical applications. For example, in a game application, it is enough to perform necessary computations to render 30 frames per second (fps) to meet the user QoS requirements. While most of these computations are heavy and require a fairly large amount of power from the mobile device, today’s Smartphones can perform up to render 60-120 fps. If offloading such a task in the tradeoff region cuts down the response time to even half of the local response time, it would still not violate the user QoS require-

Mobile Netw Appl

ments. Therefore, in such situations, code offloading could save a significant amount of energy from the mobile device. 4.2 Decision making regions For making decision using the results obtained from the previous subsection let us at first classify the tasks eligible for offloading into the following categories: –



Compute intensive: This type of tasks needs heavy computation with relatively fewer amounts of data transfers. Solving N-Queen problem is a standard example for this class of tasks, where the number of queens to be placed in the chess board needs to be transferred to the ExTrade server for computing the result. While this requires a small amount of data transfers, the computation needed for solving the problem is fairly large. The decision of whether offloading these tasks would be beneficiary or not are mainly dependent on the amount of required computations. Data intensive: This type of tasks needs large amount of data transfers. For example, a face detection application might require to transfer a large image from mobile to the cloud. Generally, the tasks require the dynamic user inputs fall under this category, such as; matrix operation based computation tasks, sorting huge data records, etc. To offload this type of tasks to cloud server the network condition plays a very important role since a poor network would require more time to transfer the data and in turn would consume more transmission energy from the mobile device.

Figure 3 shows the offload and tradeoff regions for different scenarios based on the maxima and minima values of the time and energy cost functions, discussed in the previous section. In Fig. 3a, the maxima-minima range of one function is fully contained in another, i.e., there is a full overlap, which indicates that the execution time belonging to that region would provide savings in both computation

and energy by code offloading. The non overlapping region in the figure indicates that offloading the task would save either energy or computation time (in the figure, it’s energy), but not both, hence a tradeoff calculation is required to make the code offloading decision. In Fig. 3b, we observe partial overlapping of the time and energy costs. The tradeoff region on the left side indicates energy saving while compromising the computation time, and vice-versa on the right side. Similarly, Fig. 3c shows the scenario where only the case of improvement on either energy or computation is possible because fully nonoverlapping of the costs. In all the cases, the region outside the minima-maxima values is the region where offloading would neither save computation nor energy. When an offloadable task is about to execute, the system will determine the expected time of execution of the task (to be described in Section 4.3) and compare it with the maxima and minima values of tm of the cost functions. Depending on the value falling in the regions indicated by Fig. 3, the code offloading decision is made. 4.3 Estimating task execution time To make the decision of whether to offload a task or not, it is important to determine the estimated execution time, tm , of the task at mobile, especially for the compute intensive tasks. We use statistical regression technique [22] to estimate tm . To describe the process, let us first model the execution time of the task, tm , as a random variable, represented as follows,

tm = m(X) + ,

(12)

where, m(X) is the function of modeled parameters such as user inputs, current environmental situation, etc. and  is a residue factor due to the unmodeled parameters affecting the task execution time such as page faults, cache hit, etc.

Fig. 3 Tradeoff and offload regions

(a) Full overlap

(b) Partial overlap

(c) No overlap

Mobile Netw Appl

In this model, the goal of the task execution time prediction technique is to obtain estimates of m(X) and  given some parameter vector X. To estimate the value of m(X) and  represented by m(X) and , respectively, our technique uses a set of previous observations of the execution time {t, Xi }ni=1 . The statistical regression technique computes m(X) using the following equation, n 

m(X) =

Wi (X) × ti

i=1 n 

,

(13)

Wi (X)

i=1

where, Wi (X) is the weighting function or kernel [22] and ti is the execution time of the i th observation. The weight function is designed in such a way that it assigns higher weights to the observations closer to the current situation and lower weights to the observations that are further away. In our implementation, we have used 7 closest previous observations in terms of the modeled parameters (user inputs and current CPU load) and given weight 0.5 for the first two observations, 0.3 for the next two, 0.2 for the next three observations. These weights are obtained by numerous experimentation giving larger weights to the closer observations. For example, let’s assume that the last 7 observed execution times for a particular task are 825, 855, 887, 814, 961, 868, and 904 milliseconds; and, following Eq. 13, we get m(X) = 862.23. Similarly,  is calculated using the statistical regression technique for the closest seven residue factors, as follows, n 

=

Wi (X) × i

i=1 n 

Fig. 4 Prediction accuracy

4.4 Tradeoff metric and code offloading decision Note that, as indicated in Fig. 3, the value of estimated computation time tm might fall in the tradeoff region, where either computation time or energy could be saved while compromising the other. Given an acceptable amount of compromise is applicable, offloading a task might still be of benefit to the tradeoff region. Deciding what compromise is acceptable is dependant on the QoS requirement of the application and the class of users using those applications. Therefore, we derive a tradeoff metric that helps to determine the decision. Let G1 and G2 represent the gains/loss achieved in time and energy, respectively, by offloading a task to the cloud, computed as follows, tm − ft (tm ) , tm + ft (tm ) em − fe (tm ) , G2 = em + fe (tm ) G1 =

.

(14)

Wi (X)

i=1

The Fig. 4 shows how well the statistical regression based measurements for the estimated computation time of a task can predict the required amount of computation time compared to time-average based historical estimation techniques used in ThinkAir [13] and CADA [10]. The latter techniques work well only when the task computation time does not very highly. However, if the characteristic of the task is dynamic, for example, the user input to the task is dynamically varying or the network condition is not stable, the time-average based prediction technique cannot capture the required time accurately. On the other hand, the statistical regression based model is quite capable of capturing the dynamic application usage behavior and the other environmental conditions when estimating the task execution time and thus, it makes the code offloading decisions more precise.

(15) (16)

where, em is the energy consumed by the device when executing the task locally, and it is defined as, em = pm × tm , and fe (tm ) is the energy cost of a task when it is offloaded to the cloud server; it is defined as, fe (tm ) = pi × Stmf −pt × D B. Combining the above two factors, we get the tradeoff metric as follows, G = (1 − α) × G1 + α × G2 ,

(17)

where, 0 ≤ α ≤ 1, which is the weight factor to tradeoff between the energy and computation savings. The value of α depends upon the remaining battery power of the mobile device. Therefore, the maximum weight is given to saving the computation time when the battery of the mobile device is full and the value of α is reduced as the remaining battery power of the mobile device decreases. Now, the location

Mobile Netw Appl

of task exectuion in the tradeoff region, denoted by Dloc , would be determined as follows  remote, G ≥ Gth Dloc = (18) local, G < Gth where, Gth is a predefined threshold which depends upon the QoS requirement of an application. Notice here that the value of α and Gth determine the acceptable compromise. 4.5 Setting the value of α Setting up a fixed value for α regardless of the situation (i.e. the remaining battery power of the mobile device) is not much of a practical use since the need of saving energy may change as the battery power of the mobile device goes down. Considering an adaptive policy for determining the value of alpha would be useful in practical scenario as this would give an opportunity to adapt the value of α as the residual energy of the mobile device changes with time and use. To obtain the value of α adaptively, we first define two variables b and cf . Here, 0 ≤ b ≤ 1 is the percent value representing the remaining energy of the mobile device and cf is the criticality factor denoting when the mobile device is in the critical state in terms of remaining battery power. For example, when the mobile has 25 percent battery remaining the mobile enters the critical state and the value for cf is 0.25. We obtain the value of α using the following function:  1 − βb, b ≥ cf (19) α = f (b) = 1 − bγ , b < cf where, β and γ are two constants, we set their values as β = 1 and γ = 2 for evaluation. Essentially, the Eq. 19 increases the value of α, i.e, the weight given to the energy factor of the tradeoff metric is increased linearly as the battery power of the mobile device decreases when the remaining battery of the mobile device is not in the critical state. Once the battery enters the critical state, the value of α increases exponentially with the reduction of the battery power, giving more importance to be energy-saving of the mobile device.

detailed device specification is given in Table 1. The WiFi network connection between the Smartphone and the server is used for communication. We considered two classes of target applications: Heavy Computation and Less Data transfer (HCLD) and Heavy Computation and Heavy Data transfer (HCHD) for performance study. We developed a simple mobile application in each class and deployed to the device for performance analysis. The rest of the two classes, defined in CADA [10], that require low computation low data transfer and low computation high data transfers are not considered here because, the applications that do not need heavy computations are not likely to get the benefit from code offloading. For HCLD class of applications, we implemented an NQueen application that requires back tracking and consumes a significant amount of time from the mobile device for relatively fewer numbers of queens (e.g., 5, 6 etc.). The data to be transferred for this application is fairly small. For HCHD class of applications, we implemented a face detection application that takes an image as the input and tries to find faces in that image if present. This application not only performs complex and heavy computations but also requires a large amount of data transfers, if it is offloaded to the cloud server. For calculating the amount of energy consumption, we used power tutor [30], an android application for monitoring energy usage for different applications that could estimate the energy usage with a fair amount of accuracy level. 5.2 Performance metrics We define the following performance metrics for analyzing the performance of the system. –



Average execution time - Execution time of an individual task is measured as the time difference between the instant at which the task starts its execution and the instant at which the result of the task is obtained. Execution times of individual tasks are averaged over the total number of executions of the task. Average energy consumption - Energy consumed by an individual task is measured as the difference between the residual energy at the start of the execution of the

5 Performance evaluation Table 1 Device specifications

In this section, we describe the results obtained by real experiments of our proposed ExTrade system. 5.1 Experimental setup We implemented our proposed ExTrade system using a Samsung galaxy s2 Smartphone and an HP Pavilion g series commodity laptop (as server) with core 2 duo processor. The

CPU Clock Speed Memory Turbo Boost Operating System

Mobile

Server

Dual-core 1.2 GHz 1GB No Android 4.0.2

Core 2 Duo 2.1 GHz 4GB No Windows 7 64bit

Mobile Netw Appl



task and that at the end of the execution. Energy consumed by an individual task is averaged over the total number of execution of the task. Prediction accuracy - of a task is measured by comparing the expected task execution time predicted by the decision making mechanism with the actual time of the task execution. Suppose, the predicted execution time of a task is tp , and the actual time of the task execution is ta . Then, the prediction accuracy is calculated using the following equation,   |tp − ta | × 100 %. Accuracy = 1 − max(tp , ta )



(20)

Here, the max(tp , ta ) has been taken to avoid negative outcomes. The accuracy of an individual task is averaged over the total number of task execution times. Saving on computation time - of a task is measured by subtracting the time needed for a task to execute on the remote server from the time the task needs to execute on the mobile device.

(a) Execution time

(c) Prediction accuracy

5.3 Result 5.3.1 Impact of queen size In this section, we discuss the impact of queen size on NQueens applications. The results of the experiments were obtained by running the application 10 times in each scenario, and the average value is used for data points in the graphs. The graphs in Fig. 5 shows the comparison of the execution time and energy consumption, saving on computation time and prediction accuracy of ThinkAir, ExTrade and CADA approach of the N-Queens application with respect to the different queen sizes. As the application is running over a certain course of time, the application user feeds the input to the application dynamically. The impact of the dynamic input at the task execution time is significant. The offloading technique, that is highly dependent on the task execution time, must consider this dynamic behavior of the application user for making correct decision. Figure 5a indicates that our proposed ExTrade saves more computation time than the other techniques due to considering the

(b) Energy consumption

(d) Execution time saving

Fig. 5 Impact of queen size in N-Queens application on performances of the studied code offloading methods

Mobile Netw Appl

dynamic behavior of the users through statistical regression, opposing to time-average based estimations in ThinkAir [13] and CADA [10], as discussed in Section 4.3. Figure 5b shows the comparison of energy consumption for the N-Queens application. The mobile device consumes most of its energy when it is performing some compute intensive task. Therefore, offloading a compute intensive task to the cloud server would result in less energy consumption on the mobile device. But offloading a task that not so compute intensive as compared to the data-transfer time, may, in reality, increase the amount of energy consumed due to the transmission energy. We observe in the graphs of Fig. 5b that our proposed ExTrade system generally saves more energy from the mobile device since it can accurately predict the execution time of the task considering the dynamic behavior of the user. In addition to that, since the Lagrange Multiplier optimization technique in ExTrade goes for a tradeoff decision for saving energy as much as possible while maintaining the user QoS requirement, the proposed system gives much better performance in energy saving. But our in-depth analysis of the experimental data shows that, in some random execution events, the CADA approach saves energy from the mobile device more than our technique. This is due to some inaccurate prediction of the CADA approach that offloads a task even when the offloading would not have been the right choice. But since the computation is offloaded, the computation energy needed from the mobile device is saved. It is noteworthy here that, some of the least accurate decision making techniques show the least amount of energy consumption regarding fewer extreme cases of a compute intensive task. For example, ThinkAir in Fig. 5b consumes less energy than even CADA in many of the cases. This is because, ThinkAir wrongfully offloads most of the tasks to the cloud server thus, saves the energy required for computation. However, this saving in the energy consumption, resulting from poor decision making, comes with the cost of poor response time from the application, violating the QoS requirement of the user. This justification is verifiable by checking the corresponding execution time and prediction accuracy. And the penalty incurred due to inaccurate decision making, for more extreme cases, is enormous as it is seen in the figure when the number of queens is 13. Figure 5c shows prediction accuracy of the studied code offloading techniques for the N-Queens applications with respect to the number of queens. The global averaging technique predicts the task execution time by averaging over a set of previous observation of the task regardless of other conditions. This technique fails to adapt to the dynamic user behavior since it does not consider anything else other than the previous observation history. The local averaging technique adopted by CADA approach takes the device location and the time of the day, when the task is

being executed, into consideration. While this technique can decide on the execution location of the task more correctly for certain scenarios, their increased accuracy is only obtained when the usage behavior or other environmental conditions does not vary highly for a particular task on a particular time and location. But this assumption does not persist in most of the application scenarios and the technique cannot capture the environment dynamics well. For a compute intensive application that depends on the user input, modelling user behavior in our proposed ExTrade system helps it to take more accurate decision for code offloading. Figure 5d shows the saving on computation time for the N-Queens application. In some cases, the computation time savings for ExTrade and CADA approaches are similar. This is due to the scenarios where both the approach make the correct code offloading decisions. For example, if a higher number of queens is input to the application, and both approaches choose to offload the code to the cloud server, they can save similar amount of computation time. This generally happens for this particular application if a series of execution of the task is performed with higher number of queens. Then averaging the task execution time would give higher value as the estimated execution time and the code is likely to be offloaded. 5.3.2 Impact of image size In this section, we study the impact of image size of a face detection application on its computation time, energy consumption and prediction accuracy. The experimental results, as shown in Fig. 6, show the comparison of the execution time, energy consumption, saving on computation time and prediction accuracy of the face detection application with respect to different image sizes, dynamically input by the application user. Considering this dynamic input size, when making the code offloading decision, is a must for making the offloading process effective. Figure 6a indicates that ExTrade saves more computation time than the other techniques for considering the dynamic temporal behavior of the user through statistical regression model. Figure 6b shows the comparison of energy consumption of the face detection application. For data intensive applications like face detection, transmission energy plays an important role in the overall energy consumption of the application. The application will still consume most of its energy when it is in the computing state but since offloading such a task needs a high amount of data transfer, the transmission energy cannot be ignored. Therefore, the offloading mechanism must make the code offloading decision taking into consideration both the transmission time and the computation time. Since, the data needed to be transferred is

Mobile Netw Appl

(a) Execution time

(b) Energy consumption

(c) Prediction accuracy

(d) Execution time saving

Fig. 6 Impact of image size in Face Detection application on performances of the studied code offloading methods

generally known prior to the actual transmission, the prediction of the task execution time needs to be as accurate as possible. Because, the offloading decision would then be made by ensuring that the saving on the computation time would mitigate the required transmission time. As it is seen in the figure, ExTrade saves more energy from the mobile device as it can estimate the task execution time more accurately by considering dynamic user input and maximizes energy saving while maintaining user QoS requirement through taking tradeoff decision using Lagrange Multiplier. Figure 6c shows prediction accuracy of the face detection application with respect to image size. As stated earlier, the global averaging technique predicts the task execution time by averaging over a set of previous observations of the task regardless of other conditions while the local averaging technique considers the device location and the time of the day when making the task execution time estimation. And, because the application usage behavior generally does not remain the same over time, these techniques often fail to predict the execution time of a task accurately. By modelling the dynamic user input, our proposed ExTrade system makes more accurate prediction of the task execution time. Figure 6d shows the amount of computation time saving for the face detection application. Though, on an average, ExTrade saves more computation time, in many of the

cases other approaches give similar performance. Our indepth analysis on the experimental data shows that when the application is run under similar condition (i.e. similar input and network condition), other averaging techniques can predict the nature of the task quite accurately. For this reason, other approaches can perform at a similar level as the ExTrade approach; hence, the saving on computation time can become similar for some execution events. 5.3.3 Impact of dynamic network condition In this section, we discuss the impact of a dynamic network conditions on the performance of our offloading technique. The dynamic behavior of the mobile network plays an important role when determining whether offloading a certain task from the mobile device to the cloud would be the beneficiary to the application user. Poor network condition would result in more retransmission, which adds to the application response time and energy consumption. In CADA, the time and location of the device were considered when making the offloading decision assuming that the task execution condition would remain the same at a given location and at a given time of the day. But, it would be a naive approach to consider the mobile network to remain the same

Mobile Netw Appl

or behave predictably at a certain location on everyday at a certain time. ExTrade profiler syncs with the cloud server periodically and keeps the updated information about the network condition; with help of which, we could calculate the transfer time of remote execution request and make a decision accordingly. Figure 7a shows the impact of network bandwidth on computation time saving of the face detection application. Offloading a face detection task requires an image to be transferred to and from the cloud server; thus, the available network bandwidth plays a key part on offloading such tasks. We have studied the impact of network bandwidth on various image sizes and as shown in the figure; the impact of available network bandwidth becomes more critical as the image size increases because bigger images need more time to transfer. In the figure, it is seen that the application with smaller images suffers from a lower amount of penalty on computation time than the application with bigger images when the network condition is poor. On the other hand, when the network condition is better, an application with larger images enjoys more computation time saving than the application with smaller images. This is due to the reason that the amount of savings on computation time are calculated by subtracting the time the task needs to execute remotely from the time the task needs to execute locally. As a large image takes significantly more amounts of time on the mobile device to process than a small image, the amount of savings for larger images are more. And when the network condition is better, the impact of transfer time on the overall application response time becomes less significant. Figure 7b shows the impact of network bandwidth on computation time saving of the N-Queens application. As it is seen in the figure the impact of bandwidth on performance improvement of this application is not as much as compared to the previous application; since, the data needed to be transferred for this application is not of a high amount. As long as the network bandwidth is not so poor that the transfer time takes more than the computation time

(a) Face detection application Fig. 7 Impact of network bandwidth

in the mobile device, this sort of computes intensive applications can be benefited from code offloading. The figure also reveals that the computation time saving is higher for a larger number of queens than that of for a lower number of queens; while, in reality, the time it takes to complete the calculation for a larger number of queens is greater. But since the computation saving is calculated by subtracting the remote computation time value from the local computation time value and local computation time gets even larger for a higher number of queens, the amount of time saved gets larger. 5.3.4 Impact of cloud server load In this section, we discuss the impact of cloud server load on saving computation time when offloading a code from the mobile device to the cloud server. For varying the computation load of the cloud server, we randomly executed different legacy applications on the server for some random amount of time. When more applications are running on the cloud server, the CPU allocated for serving the Smartphone clients becomes less and vice-versa. Dynamic computation load of the cloud server has a significant impact on the response time of an offloaded task. The less the load on the cloud server, which is indicated by higher values for the speed factor (Sf ), the better is the response time for the application. ExTrade profiler keeps updated information on the cloud server load when it sends periodic requests to the cloud server and makes the offloading decision considering the current computation load of the cloud server. Figure 8a shows the impact of different cloud server load on computation time saving for the face detection application. Since, a face detection application needs to send a picture to the cloud server, a significant amount of time spent on sending and receiving the data to and from the cloud server. Therefore, the speed factor needs to be of at least some minimum value that could mitigate the required

(b) N-Queens application

Mobile Netw Appl

(a) Face detection application

(b) N-Queens application

Fig. 8 Impact of cloud server load

transfer time. In most of the cases, as it is seen in the figure, this minimum value is 2. Our in-depth look on the experimental data values further reveals that the penalty acquired due to the data-transfer time is higher when the image size is bigger, and it is lower when the image size is smaller. This is due to the reason that bigger images need more time to be transferred and in those cases, the speed factor needs to be of higher value (generally greater than 2) to save computation time. The figure also shows that the saving of the computation time gets larger as the image size gets bigger while the experimental data reveals that the time needed by the cloud server to complete the task for a larger image is more than the time needed for a smaller image. However, as a Smartphone usually takes relatively more computation time than the cloud server, the amount of time-saving increases with image size. Figure 8b shows the impact of cloud server load on computation time saving for N-Queens application, where a very small amount of data exchanges between the mobile device and cloud server is required, and thus the time needed to send the request and receive the result does not affect the overall response time of the application. The figure shows that, the computation time saving amount is larger for the large number of queens. However, our in-depth analysis of the experimental data reveals that the amount of savings in computation time increases with the number of queens since the gap between the required computation time at mobile and at the cloud server increases. 5.4 Discussion In summary, the more accurate estimation of computation time and energy-using statistical regression model and exact and tradeoff code offloading decision making through the Lagrange Multiplier, a nonlinear optimization solver, in our proposed ExTrade system makes it more intelligent to capture the system environment and compute the application codes efficiently. However, the nice performances of our

proposed ExTrade system do not come out of cost. The extra overhead incurred in ExTrade system is due to the control information exchanges in between the Smartphone profiler and the cloud server for keeping updated information about the available network bandwidth and current computation load of the server. Furthermore, value of the tradeoff threshold Gth , used in ExTrade, were determined through numerous simulation experiments. If we could build an analytical model for it, we would be able to dynamically obtain the optimal value to adapt to the changing computation environments. We left it as a future work.

6 Conclusion In this paper, we have developed an intelligent code offloading decision making system, ExTrade that improves application response time as well as saves more energy of the mobile devices. Our code offloading decision is made by Lagrange Multiplier, a nonlinear optimization solver, that gets rid off the burden of solving a heavyweight linear optimizion problem, opposing to earlier works. We introduced a statistical regression based model for more accurately estimating the task execution time by considering the dynamic behavior of the environment and application usage. Our experimental results show that the ExTrade system achieves better performances in terms of computation time saving, prediction accuracy, and energy-saving metrics compared to the state-of-the-art approaches. In ExTrade, we have considered only one cloud service provider for a mobile device in the 5G system. In future, we hope to extend this work further to consider the cases where multiple cloud servers might be available for onmobile device. Having multiple options available, a mobile device can choose the best cloud server for offloading a task, regarding various performance improvement criteria such as, smallest latency, highest speed factor, etc. Furthermore, if more than one task could be executed in parallel, the availability of multiple

Mobile Netw Appl

cloud servers could be exploited to execute multiple tasks simultaneously in the 5G system. Acknowledgments The authors would like to extend their sincere appreciation to the Deanship of Scientific Research at King Saud University for its funding of this research through the Research Group Project no. RGP-VPP-281.

14.

15.

16.

References 1. Smith A (2013) Smartphone ownership–2013 update. Pew Research Center, Washington DC 2. Survey reveals more smartphones activated each day than babies born (accessed on april 12, 2014). http://www.netgenie.net/blog/ survey-reveals-more-smartphones-activated-each-day-than-babiesborn 3. Fernando N, Loke SW, Rahayu W (2013) Mobile cloud computing: a survey. Futur Gener Comput Syst 29(1):84–106 4. Verbelen T, Simoens P, De Turck F, Dhoedt B (2012) Cloudlets: bringing the cloud to the mobile user. In: Proceedings of the third ACM workshop on Mobile cloud computing and services, MCS ’12. ACM, New York, pp 29–36 5. Satyanarayanan M (1996) Fundamental challenges in mobile computing. In: Proceedings of the fifteenth annual ACM symposium on Principles of distributed computing. ACM, pp 1–7 6. Armbrust M, Fox A, Griffith R, Joseph AD, Katz R, Konwinski A, Lee G, Patterson D, Rabkin A, Stoica I et al (2010) A view of cloud computing. Commun ACM 53(4):50–58 7. Ma X, Zhao Y, Zhang L, Wang H, Peng L (2013) When mobile terminals meet the cloud Computation offloading as the bridge. IEEE NETWORK 27(5):28–33 8. Barbarossa S, Sardellitti S, Di Lorenzo P (2014) Communicating while computing: distributed mobile cloud computing over 5g heterogeneous networks. IEEE Signal Proc Mag 31(6):45–55 9. Conti M, Mascitti D, Passarella A (2015) Offloading service provisioning on mobile devices in mobile cloud computing environments. In: Euro-Par 2015: parallel processing workshops, p 2015 10. Lin T-Y, Lin T-A, Hsu C-H, King C-T (2013) Context-aware decision engine for mobile cloud offloading. In: Proceedings of IEEE wireless communications and networking conference workshops (WCNCW), pp 111–116 11. Cuervo E, Balasubramanian A, Cho D-k, Wolman A, Saroiu S, Chandra R, Bahl P (2010) Maui: making smartphones last longer with code offload. In: Proceedings of the 8th international conference on Mobile systems, applications, and services, MobiSys ’10. ACM, New York, pp 49–62 12. Chun B-G, Ihm S, Maniatis P, Naik M, Patti A (2011) Clonecloud: elastic execution between mobile device and cloud. In: Proceedings of the sixth conference on Computer systems, EuroSys ’11. ACM, New York, pp 301–314 13. Kosta S, Aucinas A, Hui P, Mortier R, Zhang X (2012) ThinkAir: Dynamic resource allocation and parallel execution in the cloud

17.

18.

19.

20.

21.

22. 23.

24.

25. 26.

27. 28.

29. 30.

for mobile code offloading. In: International conference on computer communications (INFOCOM). IEEE, pp 945–953 Satyanarayanan M, Bahl P, Caceres R, Davies N (2009) The case for vm-based cloudlets in mobile computing. IEEE Pervasive Computing 8(4):14–23 Shivarudrappa D, Chen ML, Bharadwaj S (2012) Cofa: automatic and dynamic code offload for android. Technical report, University of Colorado, Boulder Wolbach A, Harkes J, Chellappa S, Satyanarayanan M (2008) Transient customization of mobile computing infrastructure. In: Proceedings of the first workshop on virtualization in mobile computing. ACM, pp 37–41 Lai C-F, Hwang R-H, Chao H-C, Hassan M, Alamri A (2015) A buffer-aware http live streaming approach for sdn-enabled 5g wireless networks. IEEE Netw 29(1):49–55 Yang L, Cao J, Yuan Y, Li T, Han A, Chan A (2013) A framework for partitioning and execution of data stream applications in mobile cloud computing. ACM SIGMETRICS Perform Eval Rev 40(4):23–32 Kovachev D, Klamma R (2012) Framework for computation offloading in mobile cloud computing. Int J Interact Multimedia Artif Intell 1(7) Su W-T, Ng KS (2013) Mobile cloud with smart offloading system. In: 2013 IEEE/CIC international conference on communications in China (ICCC). IEEE, p 2013 Luo L, John BE (2005) Predicting task execution time on handheld devices using the keystroke-level model. In: CHI’05 extended abstracts on Human factors in computing systems. ACM, pp 1605–1608 Hardle W (1990) Applied nonparametric regression, vol 27. Cambridge Univ Press ¨ uner F, Potter L (1999) Statistical predicIverson MA, Ozg¨ tion of task execution times through analytic benchmarking for scheduling in a heterogeneous environment. IEEE Trans Comput 48(12):1374–1379 Liu J, Kumar K, Lu Y-H (2010) Tradeoff between energy savings and privacy protection in computation offloading. In: Proceedings of the 16th ACM/IEEE International Symposium on Low Power Electronics and Design, ISLPED ’10. ACM, New York, pp 213– 218 Hassan MM (2014) Cost-effectiveresourceprovisioningfor multimedia cloud-based e-health systems. Multimedia Tools Appl:1–17 Chen M, Hao Y, Li Y, Lai C-F, Wu D (2015) On the computation offloading at ad hoc cloudlet: architecture and service modes. IEEE Commun Mag 53(6):18–24 Chen M, Zhang Y, Li Y, Mao S, Emc VL (2015) Emotion-aware mobile cloud computing in 5g. IEEE Netw 29(2):32–38 Song B, Hassan MM, Alamri A, Alelaiwi A, Tian Y, Pathan M, Almogren A (2014) A two-stage approach for task and resource management in multimedia cloud environment. Computing:1– 27 http://developer.android.com/guide/components/ processes-and-threads.html, accessed on Dec 20, 2015 PowerTutor (accessed on Nov 25, 2015). http://ziyang.eecs.umich. edu/projects/powertutor/