Efficient Computation Offloading Decision in Mobile Cloud ... · [email protected] Md. Abdur...

16
Mobile Netw Appl DOI 10.1007/s11036-016-0688-6 Efficient Computation Offloading Decision in Mobile Cloud Computing over 5G Network Mahbub E Khoda 1 · Md. Abdur Razzaque 1 · Ahmad Almogren 2 · Mohammad Mehedi Hassan 2 · Atif Alamri 2 · Abdulhameed Alelaiwi 2 © Springer Science+Business Media New York 2016 Abstract Due to the significant advancement of Smart- phone technology, the applications targeted for these devices are getting more and more complex and demand- ing 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 applica- tion 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 appli- cations. Currently, 5th generation mobile network (5G) is getting much attention, which can support increased net- work 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 computa- tion 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 mak- ing 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 out- performs 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 commu- nication technologies, mobile devices such as smartphones, tablets and laptops are gaining enormous popularity in our everyday life [1, 2]. These devices are equipped with var- ious 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 interest- ingly, 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, par- ticipatory sensing, real-time monitoring, social networking,

Transcript of Efficient Computation Offloading Decision in Mobile Cloud ... · [email protected] Md. Abdur...

Page 1: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw ApplDOI 10.1007/s11036-016-0688-6

Efficient Computation Offloading Decision in Mobile CloudComputing 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 Smart-phone technology, the applications targeted for thesedevices are getting more and more complex and demand-ing of high power and resources. Mobile cloud computing(MCC) allows the Smart phones to perform these highlydemanding tasks with the help of powerful cloud servers.However, to decide whether a given part of an applica-tion is cost-effective to execute in local mobile device orin the cloud server is a difficult problem in MCC. It isdue to the trade-off between saving energy consumption

� Mohammad Mehedi [email protected]

Mahbub E. [email protected]

Md. Abdur [email protected]

Ahmad [email protected]

Atif [email protected]

Abdulhameed [email protected]

1 Green Networking Research Group, Department of ComputerScience and Engineering, Univeristy of Dhaka, Dhaka,1000, Bangladesh

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

while maintaining the strict latency requirements of appli-cations. Currently, 5th generation mobile network (5G) isgetting much attention, which can support increased net-work capacity, high data rate and low latency and can pavethe way for solving the computation offloading problemin MCC. In this paper, we design an intelligent computa-tion offloading system that takes tradeoff decisions for codeoffloading from a mobile device to cloud server over the 5Gnetwork. We develop a metric for tradeoff decision mak-ing that can maximize energy saving while maintain strictlatency requirements of user applications in the 5G system.We evaluate the performances of the proposed system in atest-bed implementation, and the results show that it out-performs the state-of-the-art methods in terms of accuracy,computation and energy saving.

Keywords Mobile cloud computing · Computationoffloading · 5G network · Intelligent decision making

1 Introduction

Due to recent advancement in mobile and wireless commu-nication technologies, mobile devices such as smartphones,tablets and laptops are gaining enormous popularity in oureveryday life [1, 2]. These devices are equipped with var-ious functionalities such as GPS, WiFi, cameras, sensors,good level of storage and processing speeds that lead theminstalled with a wide range of applications. More interest-ingly, the applications targeted for these devices are gettingmore and more complex with the number of users andthe increasing capabilities of the devices. And in recentyears, these applications have started becoming abundant invarious categories such as image processing, gaming, par-ticipatory sensing, real-time monitoring, social networking,

Page 2: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

travel and news, etc. [3]. These sophisticated and resource-hungry applications are increasingly posing requirements,especially for more energy and computation power onmobile devices, which are in general resource-constrained,having limited computation resources and limited batterylife [4, 5], .

In recent years, Mobile Cloud Computing (MCC), isenvisioned as a promising approach to overcome such anobstacle [6, 7]. It can allow users to access the cloud ser-vices through their mobile devices and thus, enables themobile devices to offload their most energy-consumingtasks via wireless access to the powerful cloud infrastruc-ture. To decide whether a given part of an application iscost-effective to execute in local mobile device or in a cloudserver is a difficult problem in MCC. It needs to measureon-time the amount of energy and time saving from codeoffloading for various kinds of applications. Furthermore,the latency experienced in reaching a cloud provider througha wide area network (WAN) is highly time-varying, and thetime required to execute a certain code at the cloud servermay vary over time depending on the computation load ofthe server.

Currently, 5th generation mobile network (5G) is gettingmuch attention, which can support increased network capac-ity, high data rate and low latency for MCC [8, 9]. Due tofaster interaction time in 5G systems, a strict latency con-trol can be incorporated in MCC, which can improve thecurrent computation offloading decision problem. Althougha good number of methods have been studied in the litera-ture regarding the offloading process of code from mobiledevices to cloud [4, 10–17], however, none of them con-sider the 5G scenario, and its feature to address the optimalcomputation offloading decision making considering strictlatency and energy constraints.

In this paper, we propose a design of an intelligent com-putation offloading system in MCC over 5G, ExTrade, thataims at jointly optimizing the communication and computa-tion resources. In particular, we develop a metric for tradeoffdecision making that can maximize energy saving whilemaintaining strict latency requirements of user applicationsin the 5G system. We try to use those features of 5G systemsthat can enable to guarantee the strict latency requirementswith minimum energy consumption. We implement a threadlevel offloading technique to study the improvement thatcould be achieved by utilizing the power of mobile cloudcomputing keeping the consistency with the recent mobileapplication development practices.

The rest of the paper is organized as follows. The state-of-the-art related works are presented in Section 2. Wediscuss our design goals, system architecture and codearchitecture in Section 3. Then, we describe the methodof defining decision regions, exact and tradeoff decisionmaking and estimating task execution time in Section 4. In

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

2 Related works

The technique of code offloading from a resource-constrained device to a resource-rich architecture, oftenknown as surrogates, have been studied in various works inthe literature. Several frameworks [18, 19] have been pro-posed and a number of techniques have been introduced forthe offloading process [20]. Mainly two approaches of theoffloading processes are found in the literature, describedbelow.

1. VM migration: Virtual machine method migrates thewhole state of the virtual machine to the cloud server[16]. The server then loads this virtual machine and exe-cutes the code. A modified version of it was introducedby Satyanarayanan [14] which transferred a smallerstate of VM to the server. Since transferring the VMstates to the cloud server requires a huge amount ofdata transfer, the paper worked on the issue to mini-mize the amount data to be transferred from the mobiledevice for executing the code on the remote virtualmachine.

2. Code partitioning: This approach partitions the appli-cation code and executes one part on the device and theother on the server. The major goal of this approach isto define which code sections should be offloaded andthe time when it is cost-effective to offload.

Our work takes on the second approach since offloadingVM to the server requires a huge amount of data and statetransfer and therefore, is not a practical solution. Offloadinga portion of the code, that requires more computation powerand energy, can overcome the problem of huge data transferand achieve a fair amount of savings in time and energy ofmobile devices.

Cloudlet [4] introduced a technique where a nearbyresource-rich computer, which might be disposed on anearby coffee shop, acts as mini cloud provider and a smart-phone connect to it over a wireless LAN. The rationale forthis technique, as described in the paper, is that connectingwith an actual cloud provider from the Smartphone suf-fers from a higher latency and lower bandwidth because anactual provider is likely to be situated far away from thelocation of the Smartphone. Connecting through a cloudletlocated nearby mitigates those problems.

MAUI [11] uses a global optimization technique tooffload methods to cloud for optimizing the energy con-sumption of a mobile device. The authors consider a methodcall graph and state that by considering an individualmethod for offloading might yield non optimal results. By

Page 3: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

analyzing the tradeoff between the energy consumed bythe remote execution and local execution, MAUI makes theoffloading decision. Although in many cases, offloading inthis technique often leads to performance improvement butignoring the computational aspects of the task could lead tosituations where the performance of the application mightsuffer.

CloneCloud [12] introduces a technique where the codeis partitioned prior to the execution based on some ran-domly generated input set and solving a linear optimizer.The partition information for randomly generated input issaved to a database, and the application input is matchedwith this database for code offloading. Though the pro-cess does not need any involvement from the applicationdeveloper, the process depends heavily on the generatedinput set prior to the execution. These random generatedinput sets often fail to capture all the execution statesof a task since the application user behavior is generallydynamic.

ThinkAir [13] further improves the techniques by adopt-ing online method level offloading. The technique adopteda global averaging technique on some previous set of obser-vations of the execution time of a task to estimate thenext execution time. This estimation technique fails whenthe behavior of the application user as well as the tran-sit delays in between the mobile device, and the cloudserver highly fluctuates over time. COFA [15] introducesthread level offloading going into the argument that thecompute intensive part of the application is executed in aseparate thread often known as worker thread. It imple-mented a hard coded partitioning for android platform,but did not discuss in detail the code offloading decision-making process.

CADA [10] studied a context-aware approach foroffloading tasks to cloud server assuming that a mobile usermoves within a certain set of locations, and the environ-ment of a location remains similar. While this argument istrue to some extent, the work ignores dynamic behavior ofthe network environment and application users. The methodmight fail when the expected context is not preserved, forexample, on a certain time of a day, the application userwould be at a different place, the characteristic of thetask may not remain the same, and the network conditionmay vary, etc.

Another important aspect of decision making is the esti-mation of the task execution time [21]. Some of the previousworks assumed that this information is already present in thesystem, which is not practical. Other works keep historicaldata and use simple time average to predict the executiontime. But regarding different types of applications targetedfor today’s smartphones and the dynamic usage behaviorof those applications, this technique might lead to a non-optimal decision. We use statistical regression technique

[22] to estimate the task execution time that can capture wellthe dynamic behavior of the working environment. Iver-son et al. [23] introduced the model where the executiontime of a task could be predicted using both non-parametricand parametric regression technique. The parametric partwas used for scheduling a task among several machines.Our work deals with the problem using the non-parametricregression technique. The analysis of trade-off betweenenergy and computation time saving was introduced in [24],where three regions for making offloading decisions areidentified. The combined metric designed for the trade-offregion is misleading for real valued variables due to thepower function used in the metric.

Partitioning the application code by solving linear opti-mizer based on randomly generated input sets fails to givean optimal decision in practical scenarios. Because, captur-ing all of the different situations that could occur in thecourse of application usage by randomly generated inputsets is an impractical solution. Besides, the cost of execut-ing a task on the remote server does not depend on theexecution time of the task linearly because of other factorsaffecting the offloading costs such as, current computationload of the cloud server, current network bandwidth, the sizeof the data to be transferred to and from the cloud server,etc. Therefore, the control variables - the time and energycosts are nonlinear. Moreover, a proper technique for esti-mating the task execution time that plays an important rolein decision making is absent in the previous works. Someprevious works assume the execution time information isalready known to the system [11, 12, 25–28], which is notalways true. Other works use a time average to estimate theexecution time of a task which is not always optimal becauseof the dynamic usage behavior of applications. Furthermore,the current trend of Smartphone application developmentis to keep the user interface responsive to the applica-tion, and it is considered as a quality metric for mobileapplication [15]. In fact, the android programming guide-line [29] encourages the application developers to executecompute intensive tasks in a separate worker thread andkeep the main thread or user interface responsive to the user.Therefore, instead of method offloading, we go for threadlevel code offloading in this work, which is more practical.In the following, we use the terms code, task, and threadinterchangeably.

3 Design goals and architecture

We assume that the intensive part of mobile applications isexecuted in a worker thread [29]. For simplicity, we alsoassume that upon completion of a thread, a callback methodis invoked. We also assume that the Smartphones are con-nected to the Internet by WiFi or 5G or 3G technology.

Page 4: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

The design goals, system architecture and code architec-ture for our proposed code offloading system, ExTrade, aredescribed bellow.

3.1 Design goals

The following is the design goals of our proposed exactand tradeoff decision making system, ExTrade, for codeoffloading in MCC:

– Performance improvement: Our system aims toimprove on both the aspects of computational perfor-mance and energy-efficiency of the mobile device byusing the power of cloud servers. When improvementis possible only for one aspect, the system looks foran acceptable compromise in between the computationtime and energy expenditures.

– Adaptation to dynamic network changes: Mobilenetwork is used to send the remote execution request tothe cloud server and rapid and dynamic change is oneof the main characteristics of the mobile network. Ourporposed ExTrade aims to adapt quickly and effectivelyto the changes in mobile network environment.

– Adaption to dynamic computation load of cloudserver: The cloud server response time for a task isaffected by the current computation load on a cloudserver. The less the load of the cloud server, the better isthe response time. So, the offloading decision could bemade more effectively by considering the dynamic loadof the cloud server.

– Enhancing QoE: The Quality of Experience (QoE) ofa mobile application user can be enhanced by utiliz-ing the power of mobile cloud computing. The responsetime of an application could be improved dramaticallyby offloading a heavy computation task to a fast cloudserver, which in turn improves the QoE. Furthermore,

saving power by executing a task in the cloud serverenables us to extend the battery life of a mobile device.Today’s Smartphone users suffer mostly from the poorbattery lifetime. By extending the battery lifetime ofSmartphones a better QoE for the mobile applicationusers can be achieved.

3.2 ExTrade system architecture

Figure 1 depicts the system architecture for our work. Onthe Smartphone, along with the application code and data,the different components of offloading decision making arepresent. On the cloud server, where the requested task isexecuted, along with the clone of the Smartphone, a clienthandler is present to handle a request from the Smart-phone. What follows next, we describe each of the majorcomponents of the Smartphone and the cloud server.

3.2.1 Execution handler

Execution handler or the decision maker makes the decisionabout local or remote execution of a thread. When a thread isabout to be executed, its eligibility for offloading is checkedfirst. If the thread is offloadable, the control is handed overto the execution handler. The execution handler then obtainsinformation from the profiler, statistical regression modeland the lagrange solver. Considering all the available infor-mation the execution handler decides whether offloading thetask would be profitable or not. Should the task be executedremotely, the remote execution request is made; otherwise,normal execution is resumed.

3.2.2 Profiler

Profiler keeps updated information about the dynamic cloudserver and environmental conditions. It periodically com-

Fig. 1 ExTrade systemarchitecture

Page 5: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

municates with the cloud server for connectivity informa-tion along with that it obtains other necessary updates fromthe cloud server. Following are the major information thatthe profiler keeps track of:

– Transit delay: Profiler provides with the informa-tion of data transmission delay between the mobile,and the cloud server based on the available networkbandwidth and data size. Since the available band-width of a mobile network is highly time-varying,the updated information is crucial when calculatingthe remote execution cost that drives the offloadingdecision.

– Computation load of cloud server: The response timeof the cloud server for a task depends highly on the cur-rent load of the cloud server. When calculating the costof remote execution, speed factor of the cloud servercompared to the mobile device is considered to obtainthe amount of improvements at the computation timeand energy consumption. But, the load of the cloudserver changes from time to time based on the job sizeson its queue, the number of requests from the clients,etc. Therefore, accurate measurement of the speed fac-tors is needed to make the optimal offloading decision.In our proposed ExTrade, when periodically commu-nicating with the cloud server the profiler obtains thecurrent server load information.

3.2.3 Lagrange solver

TheLagrangesolverprovideswith thebasis formaking theoffload-ing decision based on the estimated execution time of the taskeligible for offloading by calculating the maxima and minima ofthe time and energy cost for remote execution.Whether offloadinga task to the cloud server would save computation time andenergy is determined using these maxima and minimavalues.

3.2.4 Statistical regression model

The decision of offloading a task is mainly dependent on theestimated time for the task to execute. The statistical regres-sion model estimates the task execution time by modelingthe dynamic usage behavior and environmental conditions.This model gives better estimation than the global averag-ing, 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 cloudserver is a pre-requisite for code offloading process to work.

This device clone on the cloud server is capable of execut-ing the task that is eligible for offloading from the mobiledevice. The device clone is loaded with the necessary appli-cation codes and data. When a Smartphone generates somenew data that affect the execution of a task, the device cloneshould be updated with the new data through a suitable syn-chronization mechanism. On the other hand, when a newapplication is installed in a Smartphone, the cloud servershould be able to obtain that new application clone eitherfrom the mobile device itself or from the Internet using othermechanisms.

3.2.6 Client handler

Client handler in the cloud side is responsible for handlingrequests from Smartphones. It continuously listens on theport where a client makes a request, and it first looks forthe type of the request: Control request or Task executionrequest.

– Control request: The Smartphone periodically com-municates with the cloud server by sending controlrequest with a fake 10KB data [11]. This request issent to the ExTrade server to obtain the connectivityinformation. When the client handler receives a controlrequest from the client, it replies with similar data withone additional information about the current load ofthe cloud server. From this additional information, theclient can calculate the speed factor. The significance ofthe speed factor is described in later sections.

– Task execution request: When a task is decided tobe offloaded, the Smartphone sends a task executionrequest with application id and thread id to the cloudserver. Upon receiving the task execution request, theclient handler issues the execution of that task. Aftercompletion of the task, the client handler obtains theresult of the execution and replies to the client with theresult. Along with the result, it sends the current serverload information so that the profiler of the Smartphonecan update the server speed factor.

3.3 Code architecture

Our method requires the application developer to annotatethe threads that are eligible for offloading (this is done inour implementation by setting a Boolean variable). This isa better choice than annotating the local threads since athread annotated mistakenly can sacrifice the program cor-rectness, although in some scenarios, it might require fewerannotations. When a thread is about to execute the systemchecks whether the thread is eligible for offloading. If it is,and it meets the computation and energy criteria, the threadis executed remotely; otherwise, the local execution is per-

Page 6: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

formed. The following constraints need to be consideredwhen annotating a thread for offloading:

– Threads that update the user interface cannot beoffloaded and

– Threads that access local device resources, that wouldhamper the remote execution of the thread, cannot beoffloaded.

Examples for the second case are reading data fromphone audio input, GPS or taking picture in a facial recog-nition application, etc.

3.4 Work flow

Figure 2 shows the work flow of our proposed ExTrade sys-tem. At first, it is checked that whether a task is annotatedfor offloading or not. If the task is eligible for offload-ing, the control is handed over to the execution handler.As described in Section 3.2, the execution handler thenmakes the decision, whether the task should be offloadedor not based on the information obtained from the profiler,Lagrange solver and statistical regression model. After com-pletion of the thread execution, either at local or remote, thecallback is called and the normal subsequent execution isresumed.

4 Decision making for code offloadingusing Lagrange multiplier

The control parameters in the code offloading decision mak-ings are the costs of computation time, energy requirement,speed factor of the cloud server, and data transmission

time; and, they are not linearly related. For exmaple, thetime cost saving, from a remote execution cost, doesn’talways increase or decrease with speed factor of the cloudserver. Rather, it shows different values depending on theinstantaneous network performance. Therefore, the con-trol variables are not linearly related to each other andthus solving the problem of decision making using a lin-ear optimization solver is not applicable in this scenario.We opt for a nonlinear optimization method using Lagrangemultipliers.

In this section, we describe the process of decision mak-ing for code offloading to the cloud server using Lagrangemultiplier method. For code offloading decision, we firstcalculate the time cost function, ft , required for task execu-tion 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 theSmartphone and the cloud and B is the available networkbandwidth. The first part of the cost function is the actualtime needed for the cloud server processor to execute thetask and the second part is the time needed to send andreceive data to and from the cloud server. Now, if the taskexecution time in the mobile device is tm and the cloudserver is Sf times faster than the mobile device, then theexecution time of the task in the cloud server, tc, is calcu-lated as, tc = tm

Sf. Therefore, the above cost function can be

rewritten as

ft (tm) = tm

Sf

+ D

B. (2)

Fig. 2 Work flow of ExTrade

Page 7: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

We want to find the minima and maxima, using theLagrange multiplier method, of the function defined bel-low that is used to calculate the computation time saved byoffloading a task to the cloud server

Ft(tm) = tm − tm

Sf

− D

B(3)

satisfying the following constraints:

ft (tm) <tm

Sf

+ D

B< tm (4a)

tm

Sf

+ D

B< Dmax (4b)

tm > 0 (4c)

D > 0 (4d)

Sf ≥ 1 (4e)

Here, the first constraint (4a) states that the cost oftask execution at mobile device should be greater than thatof cloud server. This constraint ensures that offloading atask, whose execution time falls in between the minimaand maxima range of the function, would save computa-tion time. Constraint (4b) is the maximum delay constraintthat makes sure that the response time of an application,when a task is offloaded to the cloud server, does notexceed 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 themobile device. When solving for the minima and maximafor the cost function using Lagrange’s multiplier method,the (4a) and the (4b) constraints are integrated in the sys-tem of differential equations. Since, we have inequalityconstraints in our optimization problem, we use the Karush-Kuhn-Tucker (KKT) extension of the Lagrange multipliermethod. Using the above mentioned constraints the KKTequations can be written as:

∇Ft (tm) − λ1 × ∇(tm − tm

Sf

− D

B) − λ2 × ∇(Dmax − tm

Sf

− D

B) = 0 (5)

λ1 × (tm − tm

Sf

− D

B) = 0 (6)

λ2 × (Dmax − tm

Sf

− D

B) = 0 (7)

ft (tm) <tm

Sf

+ D

B< tm (8)

tm

Sf

+ D

B< Dmax (9)

λ1, λ2 ≥ 0(10)

where, λ1 and λ2 are two constants known as Lagrangemultipliers and ∇ is the derivative with respect to the inde-pendent variable tm. Solving these quations would give us

the maxima and minima, t tmax and t tmin, respectively, ofthe computation time saving function. Similarly, we couldsolve for the maxima and minima, temax and temin, of theenergy-saving function Fe(tm) as described bellow:

Fe(tm) = pm × tm − pi × tm

Sf

− pt × D

B(11)

where, pm is the average power consumed by the mobiledevice while doing computation, pi is the average powerconsumed by the mobile device while being in the idle modeand pt is average transmission and reception power of themobile device. The process for decision making using theseminima and maxima values is described in the followingsubsections.

4.1 Decision making policies

After calculating the maxima and minima of the time andenergy cost functions, we introduce two types of decisionmaking policies: exact and tradeoff code offloading.

– Exact decision making policy: In this policy, whetherto offload a task to the cloud server or not can bedecided deterministically. That is, it can be exactlystated that, offloading a task either would save bothcomputation time and energy or neither. When offload-ing a task to the cloud server saves both computationtime and energy, we always decide to offload; if it doesnot save any of those, we never offload.

– Tradeoff decision making policy: In this policy, it can-not be stated exactly that whether offloading a task tothe cloud server would save both computation time andenergy or not. On the contrary, in this policy, offloading,a task results in saving one of the factors (i.e. computa-tion or energy) while compromising other. Therefore, inthis scenario, a tradeoff metric is required; if the valueof the metric is acceptable, the task is offloaded; oth-erwise, the task is executed locally. The calculation ofthe tradeoff metric is described in detail in Section 4.4and its acceptability are typically determined by theQoS requirements of the underlying applications. Thispolicy is suited for various practical applications. Forexample, in a game application, it is enough to performnecessary computations to render 30 frames per second(fps) to meet the user QoS requirements. While mostof these computations are heavy and require a fairlylarge amount of power from the mobile device, today’sSmartphones can perform up to render 60-120 fps. Ifoffloading such a task in the tradeoff region cuts downthe response time to even half of the local responsetime, it would still not violate the user QoS require-

Page 8: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

ments. Therefore, in such situations, code offloadingcould save a significant amount of energy from themobile device.

4.2 Decision making regions

For making decision using the results obtained from the pre-vious subsection let us at first classify the tasks eligible foroffloading into the following categories:

– Compute intensive: This type of tasks needs heavycomputation with relatively fewer amounts of datatransfers. Solving N-Queen problem is a standardexample for this class of tasks, where the number ofqueens to be placed in the chess board needs to be trans-ferred to the ExTrade server for computing the result.While this requires a small amount of data transfers, thecomputation needed for solving the problem is fairlylarge. The decision of whether offloading these taskswould be beneficiary or not are mainly dependent onthe amount of required computations.

– Data intensive: This type of tasks needs large amountof data transfers. For example, a face detection applica-tion might require to transfer a large image from mobileto the cloud. Generally, the tasks require the dynamicuser inputs fall under this category, such as; matrixoperation based computation tasks, sorting huge datarecords, etc. To offload this type of tasks to cloud serverthe network condition plays a very important role sincea poor network would require more time to transferthe data and in turn would consume more transmissionenergy from the mobile device.

Figure 3 shows the offload and tradeoff regions for dif-ferent scenarios based on the maxima and minima valuesof the time and energy cost functions, discussed in the pre-vious section. In Fig. 3a, the maxima-minima range of onefunction is fully contained in another, i.e., there is a fulloverlap, which indicates that the execution time belongingto that region would provide savings in both computation

and energy by code offloading. The non overlapping regionin the figure indicates that offloading the task would saveeither energy or computation time (in the figure, it’s energy),but not both, hence a tradeoff calculation is required to makethe code offloading decision.

In Fig. 3b, we observe partial overlapping of the timeand energy costs. The tradeoff region on the left side indi-cates energy saving while compromising the computationtime, and vice-versa on the right side. Similarly, Fig. 3cshows the scenario where only the case of improvement oneither energy or computation is possible because fully non-overlapping of the costs. In all the cases, the region outsidethe minima-maxima values is the region where offloadingwould neither save computation nor energy.

When an offloadable task is about to execute, the systemwill determine the expected time of execution of the task (tobe described in Section 4.3) and compare it with the maximaand minima values of tm of the cost functions. Dependingon the value falling in the regions indicated by Fig. 3, thecode 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 inten-sive tasks. We use statistical regression technique [22] toestimate tm. To describe the process, let us first modelthe 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 suchas user inputs, current environmental situation, etc. and ε isa residue factor due to the unmodeled parameters affectingthe task execution time such as page faults, cache hit, etc.

Fig. 3 Tradeoff and offloadregions

(a) Full overlap (b) Partial overlap (c) No overlap

Page 9: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

In this model, the goal of the task execution time predictiontechnique is to obtain estimates of m(X) and ε given someparameter vector X.

To estimate the value ofm(X) and ε represented bym(X)

and ε, respectively, our technique uses a set of previousobservations of the execution time {t, Xi}ni=1. The statisticalregression technique computes m(X) using the followingequation,

m(X) =

n∑

i=1Wi(X) × ti

n∑

i=1Wi(X)

, (13)

where, Wi(X) is the weighting function or kernel [22] andti is the execution time of the ith observation. The weightfunction is designed in such a way that it assigns higherweights to the observations closer to the current situa-tion and lower weights to the observations that are furtheraway. In our implementation, we have used 7 closest previ-ous observations in terms of the modeled parameters (userinputs and current CPU load) and given weight 0.5 for thefirst two observations, 0.3 for the next two, 0.2 for the nextthree observations. These weights are obtained by numerousexperimentation giving larger weights to the closer obser-vations. For example, let’s assume that the last 7 observedexecution times for a particular task are 825, 855, 887, 814,961, 868, and 904 milliseconds; and, following Eq. 13, weget m(X) = 862.23. Similarly, ε is calculated using thestatistical regression technique for the closest seven residuefactors, as follows,

ε =

n∑

i=1Wi(X) × εi

n∑

i=1Wi(X)

. (14)

The Fig. 4 shows howwell the statistical regression basedmeasurements for the estimated computation time of a taskcan predict the required amount of computation time com-pared to time-average based historical estimation techniquesused in ThinkAir [13] and CADA [10]. The latter tech-niques work well only when the task computation timedoes not very highly. However, if the characteristic of thetask is dynamic, for example, the user input to the task isdynamically varying or the network condition is not stable,the time-average based prediction technique cannot cap-ture the required time accurately. On the other hand, thestatistical regression based model is quite capable of cap-turing the dynamic application usage behavior and the otherenvironmental conditions when estimating the task execu-tion time and thus, it makes the code offloading decisionsmore precise.

Fig. 4 Prediction accuracy

4.4 Tradeoff metric and code offloading decision

Note that, as indicated in Fig. 3, the value of estimated com-putation time tm might fall in the tradeoff region, whereeither computation time or energy could be saved whilecompromising the other. Given an acceptable amount ofcompromise is applicable, offloading a task might still be ofbenefit to the tradeoff region. Deciding what compromiseis acceptable is dependant on the QoS requirement of theapplication and the class of users using those applications.Therefore, we derive a tradeoff metric that helps to deter-mine the decision. Let G1 and G2 represent the gains/lossachieved in time and energy, respectively, by offloading atask to the cloud, computed as follows,

G1 = tm − ft (tm)

tm + ft (tm), (15)

G2 = em − fe(tm)

em + fe(tm), (16)

where, em is the energy consumed by the device when exe-cuting 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 tothe cloud server; it is defined as, fe(tm) = pi × tm

Sf−pt × D

B.

Combining the above two factors, we get the tradeoff metricas follows,

G = (1 − α) × G1 + α × G2, (17)

where, 0 ≤ α ≤ 1, which is the weight factor to tradeoffbetween the energy and computation savings. The value ofα depends upon the remaining battery power of the mobiledevice. Therefore, the maximum weight is given to savingthe computation time when the battery of the mobile deviceis full and the value of α is reduced as the remaining bat-tery power of the mobile device decreases. Now, the location

Page 10: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

of task exectuion in the tradeoff region, denoted by Dloc,would be determined as follows

Dloc ={remote, G ≥ Gth

local, G < Gth(18)

where, Gth is a predefined threshold which dependsupon the QoS requirement of an application. Notice herethat the value of α and Gth determine the acceptablecompromise.

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) isnot much of a practical use since the need of saving energymay change as the battery power of the mobile device goesdown. Considering an adaptive policy for determining thevalue of alpha would be useful in practical scenario as thiswould give an opportunity to adapt the value of α as theresidual energy of the mobile device changes with time anduse. To obtain the value of α adaptively, we first define twovariables b and cf . Here, 0 ≤ b ≤ 1 is the percent value rep-resenting the remaining energy of the mobile device and cf

is the criticality factor denoting when the mobile device isin the critical state in terms of remaining battery power. Forexample, when the mobile has 25 percent battery remainingthe mobile enters the critical state and the value for cf is0.25. We obtain the value of α using the following function:

α = f (b) ={1 − βb, b ≥ cf

1 − bγ , b < cf(19)

where, β and γ are two constants, we set their values as β =1 and γ = 2 for evaluation. Essentially, the Eq. 19 increasesthe value of α, i.e, the weight given to the energy factorof the tradeoff metric is increased linearly as the batterypower of the mobile device decreases when the remainingbattery of the mobile device is not in the critical state. Oncethe battery enters the critical state, the value of α increasesexponentially with the reduction of the battery power, giv-ing more importance to be energy-saving of the mobiledevice.

5 Performance evaluation

In this section, we describe the results obtained by realexperiments of our proposed ExTrade system.

5.1 Experimental setup

We implemented our proposed ExTrade system using aSamsung galaxy s2 Smartphone and an HP Pavilion g seriescommodity laptop (as server) with core 2 duo processor. The

detailed device specification is given in Table 1. The WiFinetwork connection between the Smartphone and the serveris used for communication.

We considered two classes of target applications: HeavyComputation and Less Data transfer (HCLD) and HeavyComputation and Heavy Data transfer (HCHD) for perfor-mance study. We developed a simple mobile application ineach class and deployed to the device for performance anal-ysis. The rest of the two classes, defined in CADA [10], thatrequire low computation low data transfer and low compu-tation high data transfers are not considered here because,the applications that do not need heavy computations are notlikely to get the benefit from code offloading.

For HCLD class of applications, we implemented an N-Queen application that requires back tracking and consumesa significant amount of time from the mobile device for rel-atively fewer numbers of queens (e.g., 5, 6 etc.). The data tobe transferred for this application is fairly small.

For HCHD class of applications, we implemented a facedetection application that takes an image as the input andtries to find faces in that image if present. This applicationnot only performs complex and heavy computations but alsorequires a large amount of data transfers, if it is offloaded tothe cloud server.

For calculating the amount of energy consumption, weused power tutor [30], an android application for monitoringenergy usage for different applications that could estimatethe energy usage with a fair amount of accuracy level.

5.2 Performance metrics

We define the following performance metrics for analyzingthe performance of the system.

– Average execution time - Execution time of an individ-ual task is measured as the time difference between theinstant at which the task starts its execution and theinstant at which the result of the task is obtained. Exe-cution times of individual tasks are averaged over thetotal number of executions of the task.

– Average energy consumption - Energy consumed by anindividual task is measured as the difference betweenthe residual energy at the start of the execution of the

Table 1 Device specifications

Mobile Server

CPU Dual-core Core 2 Duo

Clock Speed 1.2 GHz 2.1 GHz

Memory 1GB 4GB

Turbo Boost No No

Operating System Android 4.0.2 Windows 7 64bit

Page 11: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

task and that at the end of the execution. Energy con-sumed by an individual task is averaged over the totalnumber of execution of the task.

– Prediction accuracy - of a task is measured by compar-ing the expected task execution time predicted by thedecision making mechanism with the actual time of thetask execution. Suppose, the predicted execution timeof a task is tp, and the actual time of the task executionis ta . Then, the prediction accuracy is calculated usingthe following equation,

Accuracy ={

1 − |tp − ta|max(tp, ta)

}

× 100 %. (20)

Here, the max(tp, ta) has been taken to avoid nega-tive outcomes. The accuracy of an individual task isaveraged over the total number of task execution times.

– Saving on computation time - of a task is measured bysubtracting the time needed for a task to execute on theremote server from the time the task needs to executeon the mobile device.

5.3 Result

5.3.1 Impact of queen size

In this section, we discuss the impact of queen size on N-Queens applications. The results of the experiments wereobtained by running the application 10 times in each sce-nario, and the average value is used for data points in thegraphs.

The graphs in Fig. 5 shows the comparison of the execu-tion time and energy consumption, saving on computationtime and prediction accuracy of ThinkAir, ExTrade andCADA approach of the N-Queens application with respectto the different queen sizes. As the application is runningover a certain course of time, the application user feedsthe input to the application dynamically. The impact ofthe dynamic input at the task execution time is significant.The offloading technique, that is highly dependent on thetask execution time, must consider this dynamic behavior ofthe application user for making correct decision. Figure 5aindicates that our proposed ExTrade saves more computa-tion time than the other techniques due to considering the

(a) Execution time (b) Energy consumption

(c) Prediction accuracy (d) Execution time saving

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

Page 12: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

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 consumptionfor the N-Queens application. The mobile device consumesmost of its energy when it is performing some computeintensive task. Therefore, offloading a compute intensivetask to the cloud server would result in less energy con-sumption on the mobile device. But offloading a task thatnot so compute intensive as compared to the data-transfertime, may, in reality, increase the amount of energy con-sumed due to the transmission energy. We observe in thegraphs of Fig. 5b that our proposed ExTrade system gen-erally saves more energy from the mobile device since itcan accurately predict the execution time of the task con-sidering the dynamic behavior of the user. In addition tothat, since the Lagrange Multiplier optimization techniquein ExTrade goes for a tradeoff decision for saving energy asmuch as possible while maintaining the user QoS require-ment, the proposed system gives much better performancein energy saving. But our in-depth analysis of the experi-mental data shows that, in some random execution events,the CADA approach saves energy from the mobile devicemore than our technique. This is due to some inaccurateprediction of the CADA approach that offloads a task evenwhen the offloading would not have been the right choice.But since the computation is offloaded, the computationenergy needed from the mobile device is saved. It is note-worthy here that, some of the least accurate decision makingtechniques show the least amount of energy consumptionregarding fewer extreme cases of a compute intensive task.For example, ThinkAir in Fig. 5b consumes less energy thaneven CADA in many of the cases. This is because, ThinkAirwrongfully offloads most of the tasks to the cloud serverthus, saves the energy required for computation. However,this saving in the energy consumption, resulting from poordecision making, comes with the cost of poor response timefrom the application, violating the QoS requirement of theuser. This justification is verifiable by checking the cor-responding execution time and prediction accuracy. Andthe penalty incurred due to inaccurate decision making, formore extreme cases, is enormous as it is seen in the figurewhen the number of queens is 13.

Figure 5c shows prediction accuracy of the studied codeoffloading techniques for the N-Queens applications withrespect to the number of queens. The global averagingtechnique predicts the task execution time by averagingover a set of previous observation of the task regardlessof other conditions. This technique fails to adapt to thedynamic user behavior since it does not consider anythingelse other than the previous observation history. The localaveraging technique adopted by CADA approach takes thedevice location and the time of the day, when the task is

being executed, into consideration. While this techniquecan decide on the execution location of the task more cor-rectly for certain scenarios, their increased accuracy is onlyobtained when the usage behavior or other environmentalconditions does not vary highly for a particular task ona particular time and location. But this assumption doesnot persist in most of the application scenarios and thetechnique cannot capture the environment dynamics well.For a compute intensive application that depends on the userinput, modelling user behavior in our proposed ExTradesystem helps it to take more accurate decision for codeoffloading.

Figure 5d shows the saving on computation time forthe N-Queens application. In some cases, the computationtime savings for ExTrade and CADA approaches are sim-ilar. This is due to the scenarios where both the approachmake the correct code offloading decisions. For example, ifa higher number of queens is input to the application, andboth approaches choose to offload the code to the cloudserver, they can save similar amount of computation time.This generally happens for this particular application if aseries of execution of the task is performed with higher num-ber of queens. Then averaging the task execution time wouldgive higher value as the estimated execution time and thecode is likely to be offloaded.

5.3.2 Impact of image size

In this section, we study the impact of image size of aface detection application on its computation time, energyconsumption and prediction accuracy.

The experimental results, as shown in Fig. 6, show thecomparison of the execution time, energy consumption, sav-ing on computation time and prediction accuracy of the facedetection application with respect to different image sizes,dynamically input by the application user. Considering thisdynamic input size, when making the code offloading deci-sion, is a must for making the offloading process effective.Figure 6a indicates that ExTrade saves more computationtime than the other techniques for considering the dynamictemporal behavior of the user through statistical regressionmodel.

Figure 6b shows the comparison of energy consumptionof the face detection application. For data intensive appli-cations like face detection, transmission energy plays animportant role in the overall energy consumption of theapplication. The application will still consume most of itsenergy when it is in the computing state but since offloadingsuch a task needs a high amount of data transfer, the trans-mission energy cannot be ignored. Therefore, the offloadingmechanism must make the code offloading decision takinginto consideration both the transmission time and the com-putation time. Since, the data needed to be transferred is

Page 13: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

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 pre-diction of the task execution time needs to be as accurateas possible. Because, the offloading decision would then bemade by ensuring that the saving on the computation timewould mitigate the required transmission time. As it is seenin the figure, ExTrade saves more energy from the mobiledevice as it can estimate the task execution time more accu-rately by considering dynamic user input and maximizesenergy saving while maintaining user QoS requirementthrough taking tradeoff decision using Lagrange Multiplier.

Figure 6c shows prediction accuracy of the face detec-tion application with respect to image size. As stated earlier,the global averaging technique predicts the task executiontime by averaging over a set of previous observations of thetask regardless of other conditions while the local averag-ing technique considers the device location and the time ofthe day when making the task execution time estimation.And, because the application usage behavior generally doesnot remain the same over time, these techniques often failto predict the execution time of a task accurately. By mod-elling the dynamic user input, our proposed ExTrade systemmakes more accurate prediction of the task execution time.

Figure 6d shows the amount of computation time savingfor the face detection application. Though, on an aver-age, ExTrade saves more computation time, in many of the

cases other approaches give similar performance. Our in-depth analysis on the experimental data shows that whenthe application is run under similar condition (i.e. similarinput and network condition), other averaging techniquescan predict the nature of the task quite accurately. For thisreason, other approaches can perform at a similar level asthe ExTrade approach; hence, the saving on computationtime 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 net-work conditions on the performance of our offloadingtechnique.

The dynamic behavior of the mobile network plays animportant role when determining whether offloading a cer-tain task from the mobile device to the cloud would bethe beneficiary to the application user. Poor network con-dition would result in more retransmission, which adds tothe application response time and energy consumption. InCADA, the time and location of the device were consideredwhen making the offloading decision assuming that the taskexecution condition would remain the same at a given loca-tion and at a given time of the day. But, it would be a naiveapproach to consider the mobile network to remain the same

Page 14: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

or behave predictably at a certain location on everyday at acertain time. ExTrade profiler syncs with the cloud serverperiodically and keeps the updated information about thenetwork condition; with help of which, we could calculatethe transfer time of remote execution request and make adecision accordingly.

Figure 7a shows the impact of network bandwidth oncomputation time saving of the face detection application.Offloading a face detection task requires an image to betransferred to and from the cloud server; thus, the avail-able network bandwidth plays a key part on offloading suchtasks. We have studied the impact of network bandwidth onvarious image sizes and as shown in the figure; the impactof available network bandwidth becomes more critical asthe image size increases because bigger images need moretime to transfer. In the figure, it is seen that the applica-tion with smaller images suffers from a lower amount ofpenalty on computation time than the application with big-ger images when the network condition is poor. On the otherhand, when the network condition is better, an applicationwith larger images enjoys more computation time savingthan the application with smaller images. This is due to thereason that the amount of savings on computation time arecalculated by subtracting the time the task needs to executeremotely from the time the task needs to execute locally. Asa large image takes significantly more amounts of time onthe mobile device to process than a small image, the amountof savings for larger images are more. And when the net-work condition is better, the impact of transfer time on theoverall application response time becomes less significant.

Figure 7b shows the impact of network bandwidth oncomputation time saving of the N-Queens application. Asit is seen in the figure the impact of bandwidth on per-formance improvement of this application is not as muchas compared to the previous application; since, the dataneeded to be transferred for this application is not of a highamount. As long as the network bandwidth is not so poorthat the transfer time takes more than the computation time

in the mobile device, this sort of computes intensive appli-cations can be benefited from code offloading. The figurealso reveals that the computation time saving is higher fora larger number of queens than that of for a lower numberof queens; while, in reality, the time it takes to completethe calculation for a larger number of queens is greater. Butsince the computation saving is calculated by subtracting theremote computation time value from the local computationtime value and local computation time gets even larger fora higher number of queens, the amount of time saved getslarger.

5.3.4 Impact of cloud server load

In this section, we discuss the impact of cloud server loadon saving computation time when offloading a code fromthe mobile device to the cloud server. For varying the com-putation load of the cloud server, we randomly executeddifferent legacy applications on the server for some randomamount of time. When more applications are running on thecloud server, the CPU allocated for serving the Smartphoneclients becomes less and vice-versa.

Dynamic computation load of the cloud server has a sig-nificant impact on the response time of an offloaded task.The less the load on the cloud server, which is indicatedby higher values for the speed factor (Sf ), the better is theresponse time for the application. ExTrade profiler keepsupdated information on the cloud server load when it sendsperiodic requests to the cloud server and makes the offload-ing decision considering the current computation load of thecloud server.

Figure 8a shows the impact of different cloud server loadon computation time saving for the face detection appli-cation. Since, a face detection application needs to send apicture to the cloud server, a significant amount of timespent on sending and receiving the data to and from thecloud server. Therefore, the speed factor needs to be of atleast some minimum value that could mitigate the required

(a) Face detection application (b) N-Queens application

Fig. 7 Impact of network bandwidth

Page 15: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

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 experi-mental data values further reveals that the penalty acquireddue to the data-transfer time is higher when the image sizeis bigger, and it is lower when the image size is smaller. Thisis due to the reason that bigger images need more time to betransferred and in those cases, the speed factor needs to be ofhigher value (generally greater than 2) to save computationtime. The figure also shows that the saving of the computa-tion time gets larger as the image size gets bigger while theexperimental data reveals that the time needed by the cloudserver to complete the task for a larger image is more thanthe time needed for a smaller image. However, as a Smart-phone usually takes relatively more computation time thanthe cloud server, the amount of time-saving increases withimage size.

Figure 8b shows the impact of cloud server load on com-putation time saving for N-Queens application, where a verysmall amount of data exchanges between the mobile deviceand cloud server is required, and thus the time needed tosend the request and receive the result does not affect theoverall response time of the application. The figure showsthat, the computation time saving amount is larger for thelarge number of queens. However, our in-depth analysis ofthe experimental data reveals that the amount of savings incomputation time increases with the number of queens sincethe gap between the required computation time at mobileand at the cloud server increases.

5.4 Discussion

In summary, the more accurate estimation of computationtime and energy-using statistical regression model and exactand tradeoff code offloading decision making through theLagrange Multiplier, a nonlinear optimization solver, in ourproposed ExTrade system makes it more intelligent to cap-ture the system environment and compute the applicationcodes efficiently. However, the nice performances of our

proposed ExTrade system do not come out of cost. The extraoverhead incurred in ExTrade system is due to the controlinformation exchanges in between the Smartphone pro-filer and the cloud server for keeping updated informationabout the available network bandwidth and current compu-tation load of the server. Furthermore, value of the tradeoffthreshold Gth, used in ExTrade, were determined throughnumerous simulation experiments. If we could build an ana-lytical model for it, we would be able to dynamically obtainthe optimal value to adapt to the changing computationenvironments. We left it as a future work.

6 Conclusion

In this paper, we have developed an intelligent code offload-ing decision making system, ExTrade that improves appli-cation response time as well as saves more energy of themobile devices. Our code offloading decision is made byLagrange Multiplier, a nonlinear optimization solver, thatgets rid off the burden of solving a heavyweight linear opti-mizion problem, opposing to earlier works. We introduced astatistical regression based model for more accurately esti-mating the task execution time by considering the dynamicbehavior of the environment and application usage. Ourexperimental results show that the ExTrade system achievesbetter performances in terms of computation time saving,prediction accuracy, and energy-saving metrics comparedto the state-of-the-art approaches. In ExTrade, we haveconsidered only one cloud service provider for a mobiledevice in the 5G system. In future, we hope to extend thiswork further to consider the cases where multiple cloudservers might be available for onmobile device. Having mul-tiple options available, a mobile device can choose the bestcloud server for offloading a task, regarding various per-formance improvement criteria such as, smallest latency,highest speed factor, etc. Furthermore, if more than one taskcould be executed in parallel, the availability of multiple

Page 16: Efficient Computation Offloading Decision in Mobile Cloud ... · turjo7@yahoo.com Md. Abdur Razzaque razzaque@du.ac.bd Ahmad Almogren ahalmogren@ksu.edu.sa Atif Alamri atif@ksu.edu.sa

Mobile Netw Appl

cloud servers could be exploited to execute multiple taskssimultaneously in the 5G system.

Acknowledgments The authors would like to extend their sincereappreciation to the Deanship of Scientific Research at King Saud Uni-versity for its funding of this research through the Research GroupProject no. RGP-VPP-281.

References

1. Smith A (2013) Smartphone ownership–2013 update. PewResearch Center, Washington DC

2. Survey reveals more smartphones activated each day than babiesborn (accessed on april 12, 2014). http://www.netgenie.net/blog/survey-reveals-more-smartphones-activated-each-day-than-babies-born

3. Fernando N, Loke SW, Rahayu W (2013) Mobile cloud comput-ing: 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 thethird ACM workshop on Mobile cloud computing and services,MCS ’12. ACM, New York, pp 29–36

5. SatyanarayananM (1996) Fundamental challenges in mobile com-puting. In: Proceedings of the fifteenth annual ACM symposiumon Principles of distributed computing. ACM, pp 1–7

6. Armbrust M, Fox A, Griffith R, Joseph AD, Katz R, KonwinskiA, Lee G, Patterson D, Rabkin A, Stoica I et al (2010) A view ofcloud computing. Commun ACM 53(4):50–58

7. Ma X, Zhao Y, Zhang L, Wang H, Peng L (2013) When mobileterminals meet the cloud Computation offloading as the bridge.IEEE NETWORK 27(5):28–33

8. Barbarossa S, Sardellitti S, Di Lorenzo P (2014) Communicat-ing while computing: distributed mobile cloud computing over 5gheterogeneous networks. IEEE Signal Proc Mag 31(6):45–55

9. Conti M, Mascitti D, Passarella A (2015) Offloading serviceprovisioning on mobile devices in mobile cloud computing envi-ronments. 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 deci-sion engine for mobile cloud offloading. In: Proceedings of IEEEwireless 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 longerwith code offload. In: Proceedings of the 8th international confer-ence 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: Proceed-ings 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

for mobile code offloading. In: International conference on com-puter communications (INFOCOM). IEEE, pp 945–953

14. Satyanarayanan M, Bahl P, Caceres R, Davies N (2009) Thecase for vm-based cloudlets in mobile computing. IEEE PervasiveComputing 8(4):14–23

15. Shivarudrappa D, Chen ML, Bharadwaj S (2012) Cofa: auto-matic and dynamic code offload for android. Technical report,University of Colorado, Boulder

16. Wolbach A, Harkes J, Chellappa S, Satyanarayanan M (2008)Transient customization of mobile computing infrastructure. In:Proceedings of the first workshop on virtualization in mobilecomputing. ACM, pp 37–41

17. Lai C-F, Hwang R-H, Chao H-C, Hassan M, Alamri A (2015)A buffer-aware http live streaming approach for sdn-enabled 5gwireless networks. IEEE Netw 29(1):49–55

18. Yang L, Cao J, Yuan Y, Li T, Han A, Chan A (2013) A frame-work for partitioning and execution of data stream applications inmobile cloud computing. ACM SIGMETRICS Perform Eval Rev40(4):23–32

19. Kovachev D, Klamma R (2012) Framework for computationoffloading in mobile cloud computing. Int J Interact MultimediaArtif Intell 1(7)

20. Su W-T, Ng KS (2013) Mobile cloud with smart offloadingsystem. In: 2013 IEEE/CIC international conference on commu-nications in China (ICCC). IEEE, p 2013

21. Luo L, John BE (2005) Predicting task execution time onhandheld devices using the keystroke-level model. In: CHI’05extended abstracts on Human factors in computing systems. ACM,pp 1605–1608

22. Hardle W (1990) Applied nonparametric regression, vol 27. Cam-bridge Univ Press

23. Iverson MA, Ozguner F, Potter L (1999) Statistical predic-tion of task execution times through analytic benchmarking forscheduling in a heterogeneous environment. IEEE Trans Comput48(12):1374–1379

24. Liu J, Kumar K, Lu Y-H (2010) Tradeoff between energy savingsand privacy protection in computation offloading. In: Proceedingsof the 16th ACM/IEEE International Symposium on Low PowerElectronics and Design, ISLPED ’10. ACM, New York, pp 213–218

25. HassanMM (2014) Cost-effectiveresourceprovisioningfor multimediacloud-based e-health systems. Multimedia Tools Appl:1–17

26. Chen M, Hao Y, Li Y, Lai C-F, Wu D (2015) On the computa-tion offloading at ad hoc cloudlet: architecture and service modes.IEEE Commun Mag 53(6):18–24

27. Chen M, Zhang Y, Li Y, Mao S, Emc VL (2015) Emotion-awaremobile cloud computing in 5g. IEEE Netw 29(2):32–38

28. Song B, Hassan MM, Alamri A, Alelaiwi A, Tian Y, Pathan M,Almogren A (2014) A two-stage approach for task and resourcemanagement in multimedia cloud environment. Computing:1–27

29. http://developer.android.com/guide/components/processes-and-threads.html, accessed on Dec 20, 2015

30. PowerTutor (accessed on Nov 25, 2015). http://ziyang.eecs.umich.edu/projects/powertutor/