Dynamic Offloading Algorithm in Intermittently ... - Semantic Scholar

12 downloads 226 Views 351KB Size Report
Cloud providers are not necessarily to be business-level providers such as Amazon. Instead, a .... 10−2 s [12]. The RTT of WiFi networks are in the order of.
Dynamic Offloading Algorithm in Intermittently Connected Mobile Cloudlet Systems Yang Zhang1 , Dusit Niyato1 , Ping Wang1 and Chen-Khong Tham2 School of Computer Engineering, Nanyang Technological University (NTU), Singapore Department of Electrical and Computer Engineering, National University of Singapore (NUS), Singapore 1

2

Abstract—The emergence of mobile cloud computing enables mobile users to dynamically offload applications to nearby mobile resource-rich devices (i.e., cloudlets) to reduce energy consumption and improve execution efficiency. However, due to mobility, the connections between a mobile user and mobile cloudlets can be intermittent. As a result, offloading actions taken by a mobile user may fail (e.g., the user moves out of transmission range of cloudlets). In this paper, we model and develop an optimal offloading algorithm for the mobile user, considering the users’ local load and availability of cloudlets. We formulate and solve a Markov decision process (MDP) model to obtain an optimal policy for the mobile user with an objective to minimize the computation and offloading cost. The numerical results show that the proposed dynamic offloading algorithm outperforms conventional baseline schemes. Keywords—Mobile cloud, offloading, offloading failure, Markov decision process.

I.

I NTRODUCTION

The concept of cloud computing has been extended to a mobile paradigm [1]. Cloud providers are not necessarily to be business-level providers such as Amazon. Instead, a resource-rich and trusted device connected to Internet [2], e.g., a cluster or a vehicular base station, namely cloudlet [3], can also provide cloud-like services to nearby mobile devices via a WiFi connection. A mobile device (i.e., user) and cloudlets can form a small-scaled cloudlet-based cloud system autonomously [4]. With such a system, a mobile user can access and offload jobs [5] to the nearby cloudlets to improve the performance and reduce cost. The benefits of accessing the mobile cloudlets is the ability to meet users’ demands with low latency, low energy-consumption and high bandwidth connection [6]. However, as typical in a mobile cloud environment, offloading may not achieve the lowest cost. Therefore, the mobile user has to make a decision whether to execute an application locally on the mobile device or offload to the mobile cloudlets. The problem becomes more complicated due to user’s and cloudlets’ mobility, which leads to intermittent connection between a mobile user and cloudlets [6]. Previous literature on dynamic offloading, such as [5] and [7], did not focus on this intermittent connection issue. Although there are some works which consider the connection failure in mobile cloud computing environments, they did not optimize offloading decisions of a mobile user. For example, Shi et. al. [8] proposed a technique to efficiently set application migration points considering the vulnerability of connection. Only the ideal case was discussed that the present and future intermittent connectivity patterns are known. Hoang et. al. [9] studied the situation where cloudlets (namely hotspots) may

reject users’ offloading requests, e.g., due to limited resources. However, given the possible rejection, the optimal offloading decision of the mobile user was not discussed. In this paper, we propose a Markov decision process (MDP) based offloading algorithm for a mobile user in a cloudlet system. The mobile user has an application to be executed. As the application is divided into phases, the mobile user can make a decision to execute application phases locally on the mobile device or offload to nearby cloudlets. We formulate and solve the MDP model to obtain an optimal policy to minimize the computation and communication costs. The model considers a stochastic mobility model to describe an intermittent connection between the mobile user and cloudlets (i.e., the cloudlet accessibility and availability). The numerical results show that, the proposed MDP offloading algorithm outperforms conventional baseline schemes in terms of average cost. To the best of our knowledge, there is no existing work on stochastic modeling and dynamic optimization of fine-grained offloading decision considering offloading failure caused by the mobility of a user and cloudlets. II.

S YSTEM M ODEL

In this section, we describe a general model of the cloudlet system under our consideration. A. Mobile User’s Offloading Model WŚĂƐĞƐ ϭ

ϯ Ϯ ϰ ůŽƵĚůĞƚ

YƵĞƵĞ DŽďŝůĞƵƐĞƌ

ůŽƵĚůĞƚ

Fig. 1: System model of the cloudlet system. In the cloudlet system, we consider a particular mobile user which can be served by several mobile cloudlets (Fig. 1). The user is modeled as a single-server queue. An arriving job (e.g., a request from a user to run an application and process data) is stored in the queue. Then, the job is retrieved to be processed by an application. The application is divided into a sequence of fine-grained code sections [5], defined as application phases. The code sections can be either pre-determined or decided by the mobile user (e.g., setting break points) dynamically.

Processing a job means executing application phases in a certain sequence. The job processing is finished when the application transits to the exit phase. Fig. 2 shows typical phases and the corresponding data size of a face recognition application (similar to [7], [10]). Note that the data size indicates the amount of data to be processed.

number of jobs in the queue) is denoted by Q. We assume that the job arrival follows the Poisson process. •

Cloudlets: We assume that the geographical distribution of cloudlets follows an independent Homogeneous Poisson Point Process (HPPP) [11]. At the beginning of a decision period, the user may observe N cloudlets nearby. This number N is referred to as a cloudlet accessibility state. Specifically, accessibility determines the maximum possible number of cloudlets that the user can offload application phases to.



However, accessing the cloudlet does not guarantee successful offloading because of failure (e.g., the user moves and loses a connection to the cloudlet). We define the probability of a successful offloading to a cloudlet to be cloudlet availability ηa .

ϰ ΕϭϬ Q ⎪ ⎪ ⎪ Po(Q − Q), Q ≤ Q and Q < Q ⎨   −Q−1 PQ (Q, Q ) = 1− Q Po(k), Q < Q and Q = Q k=0 ⎪ ⎪ Q = Q = Q ⎪ ⎩ 1, 0,

otherwise.

(9) For simplicity, conditional parameters G (which is ∈ / GEP or ∈ GEP ) and A = 0 are omitted in the function parameter list of PQ (Q, Q |G, A) in (9), as well as (10) in the following. Only after the current application has finished exit phases (e.g., phases G = 3 and G = 4 in Fig. 2), the queue state may decrease by one, if there is no new job arrival, e.g., (G = 4, Q = 2) to (G = 1, Q = 1). The queue size may also increase, as shown by state (G = 3, Q = 2) in Fig. 4. Given the current phase is an exit phase, i.e., G ∈ GEP , the queue state transition probability is ⎧ Po(0), Q = Q − 1 ⎪ ⎨ Po(Q − (Q − 1)), Q ≤ Q and Q < Q Q −Q PQ (Q, Q ) =  ⎪ ⎩ 1 − k=0 Po(k), Q = Q 0,

otherwise.

(10) The first line of (10) is the case that Q decreases by one. 4) System State Transition Matrix: The overall transition matrix for an application phase G denoted as PG = {PG (G, G|N , A)} is shown in (11), where F G (i, j) = Pηa (N , A) · PG (i, j) and Pηa = Pηa (N , A). The function Iconditions returns the value of one if the conditions hold. Otherwise, the function returns zero. For example, IQ=1,Q =0 = 1 when Q = 1 and Q = 0 hold, and IQ=1,Q =0 = 0 otherwise. The transition matrix for a queue state Q denoted as PQ = {P (Q, Q )|G, A} is shown in (12), with elements 0 in the matrix omitted. In (12), we denote that Q

I0 = 1 − I0− = IG∈GEP ,G  =0 I1 = 1 − I1− = IG∈GEP ,G  =1 F0Q (i, j) = Po(j − i + 1) · I0 + Po(j − i) · I0− F1Q (i, j) = Po(j − i + 1) · I1 + Po(j − i) · I1− .

Then the combined transition probability of G and Q G,Q = [P((G, Q), (G  , Q )|N , A)] = is obtained from P

PG PQ , where is the Kronecker product. Combined with the cloudlet accessibility state transitions, the transition probability PS (S) of the system state S = (G, Q, N ) is then given by PS (S, S  |A) = PG,Q ((G, Q), (G  , Q )|N , A) · PN (N , N  ). (13) C. Markov Decision Process for Cost Optimization We formulate the MDP and use a value iteration algorithm to obtain the optimal policy. The policy is to minimize the cost of mobile user.

There could be two costs incurred when a user makes a decision, i.e., the cost of local execution and offloading. We denote CL (S, A) as a function of local cost and CR (S, A) as a function of offloading cost. A policy is defined as Φ(S, A), which is the probability of taking an action A at state S. The optimized total cost value Vt (S) at the beginning of decision period t is expressed as a Bellman equation as follows: Vt (S) = min Ht (S, A) Φ(S,A)

(14)

where S = (G, Q, N ). Also, the optimal policy (i.e., the function that returns an optimal action for the user) given the current state S denoted as φ∗t (S) is given by φ∗t (S)

=

arg min Ht (S, A) Φ(S,A)

(15)

where Ht (S, A) = C(S, A) + γ



PS (S, S  |A)Vt+1 (S  ).

S  ∈S

γ ∈ [0, 1] is a discount factor of future cost. In the expression of Ht (S, A), the function C(S, A) is the immediate cost in the state A when action A is taken. In this work, we define the immediate cost to be  A=0 CL (S, A) = [a(G) + Q Q ]b(G), C(S, A) = CR (S, A) = [1 + (1 − ηa )N cpen ]b(G), A = 1 (16) where b(G) is the base cost positively related to the code size of phase G. CL (S, A) is the cost of local execution, with the coefficient α(G) depending on the current application size (e.g., α(G) = 1 ∼ 10 in [2]), and Q Q indicating the cost due to the job waiting in the queue. cpen is the penalty caused by offloading failure of a job, e.g., the overhead of rescheduling.

IV.

N UMERICAL R ESULTS

A. Experiment Settings and Performance Criteria In our experiments, we use the following scenario and parameter settings. We consider a mobile user running a face recognition application. The application is divided into phases as shown in Fig. 2. The queue can receive and store 6 jobs (i.e., Q = 6). The cloudlets all have the coverage radius of 10 meters. Unless otherwise stated, the rate of generating new job in the mobile user is λq = 0.25 jobs per minute. The density of cloudlets is λc = 0.0001 per m2 . The cloudlet availability coefficient is set to be ε = 0.8. The discount factor in the value iteration is γ = 0.8. The penalty value is cpen = 20.0. The system stops when the user has no job waiting in the queue. 1) Performance Criteria: We evaluate performance in terms of average cost and offloading rate. Suppose V (S) is the cost of a user when the user starts with state S, the average cost is the expected cost with any starting state S ∈ S. The user aims to minimize the cost. The offloading rate is defined as the proportion of the user’s decisions to offload amongst all the decisions made by the user.

G = 0 ⎡ IQ=0,Q =0

G=0 G=1 .. . G=i . .. G=j .. . G = g(∈ GEP )

Q=0

⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣

0 .. . 0 . .. 0 .. .

Pηa IQ=1,Q =0

Q = 0 ⎡ Po(0)

⎢ Q=1 ⎢Po(0) · I0 ⎢ ⎢ ⎢ ⎢ Q=2 ⎢ ⎢ . ⎢ . ⎢ . ⎢ Q=i ⎢ ⎢ . ⎢ . ⎢ . ⎢ Q=Q−1 ⎢ ⎢ ⎣ Q=Q

G = 1

···

G = i

···

G = j

···

IQ=0,Q =1

···

0

···

0

···

1 − Pηa (N , A) .. . G F (i, 1) . .. G F (j, 1) .. . Pηa IQ≥1,Q =Q−1

··· .. . ··· . .. ··· .. . 0

F G (1, i) .. . 1 − Pηa (N , A) . .. G F (j, i) .. . 0

··· .. . ··· .. . ··· .. . 0

F G (1, j) .. . G F (i, j) . .. 1 − Pηa (N , A) .. . 0

··· .. . ··· . .. ··· .. .

Q = 1 Po(1)

Q = 2 Po(2)

··· ···

Q = i Po(i)

F0Q (1, 1)

F0Q (1, 2)

···

F0Q (1, i)

···

Po(0) · I1

F1Q (2, 2) .. .

··· .. . Po(0) · I1

F1Q (2, i) . . . F1Q (i, i) .. .

··· . . . ··· .. . Po(0) · I1

0

Q = Q − 1 Po(Q − 1)

··· ···

F0Q (1, Q

− 1)

Po(0) · I1

0



F G (1, g) ⎥ ⎥ .. ⎥ ⎥ . ⎥ G F (i, g) ⎥ ⎥ . ⎥ .. ⎥ G F (j, g) ⎦ .. . 1 − Pηa (N , A)

Q = Q ∞ k=Q Po(k) ∞ ∞   Po(k) + I0−

(11)



⎥ ⎥ ⎥ ⎥ ⎥ ⎥ I1 Po(k) + ⎥ k=Q−1 ⎥ . ⎥ . ∞ ∞ ⎥ .   − I1 Po(k) + I1 Po(k)⎥ ⎥ ⎥ k=Q−i+1 k=Q−i . ⎥ . ⎥ ∞ ∞ .  ⎥ −  I1 Po(k) + I1 Po(k) ⎥ ⎥ k=2 k=1 ⎦ ∞  − I1 Po(k) + I1 I0

F1Q (2, Q − 1) . . . F1Q (i, Q − 1) . . . Q F1 (Q − 1, Q − 1)

G  = g(∈ GEP )

k=Q ∞ 

Po(k)

k=Q−1 ∞  I1− Po(k) k=Q−2

k=1

(12)

2) Comparison: We compare the performances of the proposed MDP offloading algorithm with other three baseline schemes, i.e., a myopic scheme (MYO), an always executing locally scheme (LOC), and an always offloading scheme (OFF). For the myopic scheme, the mobile user makes shortsighted decisions only based on the costs of local execution and offloading (i.e., CL (·) and CR (·)) at the current state. Specifically, the user makes an offloading decision only based on valuation function with the discount factor γ = 0. In the always executing locally scheme and always offloading scheme, the user always executes application phases locally on the mobile device and always offloads to cloudlets, respectively.

user increases as λq increases, which means the user is more likely to offload when λq becomes larger. As the job arrival rate increases, the cost of local execution increases because of detrimental performance (e.g., longer waiting time). This is shown in Fig. 5(b). This Fig. 5(b) also shows that the proposed MDP offloading algorithm outperforms the other schemes in terms of lower average cost. C. Impact of Cloudlet Density Next, we discuss how the parameters of mobile cloudlets affect the offloading decision and performance.

110 100

MDP LOC OFF MYO

5

10

15

20

25

R

35

0

5

10

15

20

25

Cloudlet coverage radius

30

R

35

75

Cloudlet coverage radius

30

95

0

105

User's avg. cost

0.6

MYO

0.530

0.525 0.0

0.5

95

OFF

80

0.535

LOC

0.4

0.540

MDP

0.3

0.545

90

0.550

85

User's avg. cost

100

0.555

Offloading rate

105

0.560

Offloading rate

115

0.7

120

B. Impacts of Job Arrival Rate

0.5

1.0

1.5

Queue arrival rate

(a)

λq

2.0

0.0

0.5

1.0

1.5

Queue arrival rate

λq

2.0

(b)

Fig. 5: (a) User’s offloading rate to local queue arrival rate λq , and (b) user’s average cost to λq . (γ = 0.7, cpen = 150)

We vary the job arrival rate λq from 0.01 to 2.0. We observe that as λq increases, the number of jobs waiting in the queue increases, which consequently increases the cost of local execution. As Fig. 5(a) shows that the offloading rate of the

(a)

(b)

Fig. 6: (a) User’s offloading rate to cloudlet radius R, and (b) user’s average cost to R. (ηa ≡ 0.6)

1) Cloudlet Accessibility - Coverage Radius and Density: We examine the impacts of mobile cloudlets’ coverage radius R and density λc to the offloading decision rate and cost. From Fig. 6(a) and Fig. 7(a), as either R or λc increases, the user’s offloading rate grows. This is because with a larger cloudlet radius R or higher cloudlet density λc , the user has an access

120 115 110 105

User's avg. cost

0.6 0.5 0.4

MDP LOC

100

Offloading rate

0.7

lines in 8(b)) are smaller as ηa increases since the probability of offloading failure decreases. In addition, Fig. 8(b) shows that, when ηa is low (e.g., ηa < 0.7), the proposed MDP algorithm achieves lower cost than that of myopic and always offloading schemes. When ηa is high (e.g., ηa ≥ 0.7), the probability of successful offloading is high enough. As a result, the performances of MDP, OFF and MYO schemes become close to each other.

OFF MYO

0.3 0.0000

0.0002

0.0004

0.0006

Cloudlet density

0.0008

λc

0.0010

0.0000

0.0002

0.0004

0.0006

Cloudlet density

(a)

0.0008

λc

0.0010

(b)

Fig. 7: (a) User’s offloading rate to cloudlet density λc , and (b) user’s average cost to λc . (ηa ≡ 0.6)

0.1

cpen=25 0.2

0.3

0.4

0.5

0.6

0.7

Cloudlet availability

(a)

0.8

ηa

0.9

130

cpen=0

MDP,

cpen=15

MDP,

cpen=25

1.0

LOC,cpen=25 OFF,cpen=25 MYO,cpen=25

120 0.1

0.2

0.3

0.4

0.5

0.6

0.7

Cloudlet availability

0.8

ηa

0.9

C ONCLUSION

We have proposed a Markov decision process (MDP) based dynamic offloading algorithm for a mobile user in a mobile cloudlet system. Consider that the mobile application can be divided into multiple phases, the user can make a decision to run each phase locally or offload to nearby cloudlets. In addition, the random failure of the cloudlets has been considered. The decision is optimized to achieve the lowest cost (e.g., computation and communication costs) by solving the MDP model using the value iteration algorithm. The performance evaluation has shown that the proposed MDPbased dynamic offloading algorithm outperforms other baseline schemes, which do not take the state of the system into account. For the future work, an efficient solution method with reduced computational complexity for MDP will be developed for the users to obtain an optimal policy. R EFERENCES

100

cpen=15

MDP,

110

User's avg. cost

0.60 0.55

cpen=0 0.50

Offloading rate

0.65

140

0.70

to more cloudlets. Consequently, as shown in Fig. 6(b) and Fig. 7(b), the user’s offloading cost decreases as either R or λc increases. As shown in Fig. 6(b) and Fig. 7(b), when adopting the proposed MDP offloading algorithm, the user achieves lower average cost comparing to other schemes. Note that the average cost of always executing locally remains constant, since the user is not affected by the cloudlet.

V.

1.0

(b)

Fig. 8: (a) User’s offloading rate to cloudlet availability ηa , and (b) user’s average cost to ηa .

2) Cloudlet Availability: Fig. 8 shows the relations between performances and cloudlet availability ηa , under different penalty cpen of failed offloading. As expected, when there is no penalty in the cost function of offloading, the user just executes the application phase again if the offloaded phase fails. If the cost of local execution is more than that of offloading, the user still wants to offload even if ηa is small. This is observed for cpen = 0 in Fig. 8(a), where the offloading rate is already higher than 0.6 for ηa = 0.1. When the penalty in the cost function is significant, offloading is no longer an optimal action to the user. For cpen = 15.0 and cpen = 25.0, the offloading rates become lower comparing to the cpen = 0 case when ηa is small (Fig. 8(a)). After ηa increases to a certain level (e.g., ηa > 0.7), the penalty term has less effects to the decisions. This is observed from Fig. 8(b), where we compare the MDP-based offloading algorithm with parameters cpen = 0, 15.0 and 25.0. Higher penalty leads to higher user’s average cost. Also, the cost gaps among MDP schemes with different penalties (solid

[1] D. T. Hoang, C. Lee, D. Niyato, and P. Wang, “A survey of mobile cloud computing: architecture, applications, and approaches,” Wireless Communications and Mobile Computing (accepted), 2011. [2] B.-G. Chun, S. Ihm, P. Maniatis, M. Naik, and A. Patti, “CloneCloud: elastic execution between mobile device and cloud,” Proceedings of the sixth conference on Computer systems (EuroSys ’11), pp. 301-304, 2011. [3] M. Satyanarayanan, P. Bahl, R. Caceres, and N. Davies, “The case for VM-based cloudlets in mobile computing,” IEEE Pervasive Computing, vol. 8, no. 4, pp. 14-23, Oct.-Dec. 2009. [4] G. Huerta-Canepa and D. Lee, “A virtual cloud computing provider for mobile devices,” in Proc. of the 1st ACM Workshop on Mobile Cloud Computing & Services: Social Networks and Beyond (MCS), no. 6, 2010. [5] H. Dong, P. Wang, and D. Niyato, “A dynamic offloading algorithm for mobile computing,” IEEE Transactions on Wireless Communications, vol. 11, no. 6, pp. 1991-1995, June 2012. [6] M. Satyanarayanan, “Mobile computing: the next decade,” in Proc. of the 1st ACM Workshop on Mobile Cloud Computing & Services: Social Networks and Beyond (MCS), June 2010. [7] E. Cuervo, A. Balasubramanian, D.-K. Cho, A. Wolman, S. Saroiu, R. Chandra, and V. Bahl, “MAUI: Making smartphones last longer with code offload,” in Proceedings of the 8th international conference on Mobile systems, applications, and services (Mobisys), pp. 49-62, June 2010. [8] C. Shi, M. H. Ammar, E. W. Zegura, and M. Naik, “Computing in cirrus clouds: the challenge of intermittent connectivity,” Proceedings of the first edition of the MCC workshop on Mobile cloud computing (MCC ’12), pp. 23-28, 2012. [9] D. T. Hoang, D. Niyato, and P. Wang, “Optimal admission control policy for mobile cloud computing hotspot with cloudlet,” in IEEE Wireless Communications and Networking Conference (WCNC), pp. 3145-3149, Apr. 2012 [10] Y.-C. Wang, K.-T. Cheng, “Energy-optimized mapping of application to smartphone platform A case study of mobile face recognition,” 2011 IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pp. 84-89, June 2011. [11] D. Moltchanov, “Distance distributions in random networks,” Ad Hoc Networks, vol. 10, pp. 1146-1166, Aug. 2012. [12] R. Bryant and D. O’Hallaron, “Computer systems: a programmer’s perspective (2nd edition),” Addison-Wesley, pp. 632, Feb. 2010.