Chapter 5

Mobile Cloud Offloading Models

A true capitalist does not have a job, because other people and other people's money work for them.

Robert Kiyosaki

Abstract

Mobile cloud offloading models are usually modeled as an application graph mapped to a surrogate network. An application is a directed acyclic graph, where vertexes are computation tasks and edges are data channels connecting tasks. The sites that run offloaded codes may be one surrogate or a network of devices. To offload the computation tasks to the surrogate network is to map the vertexes and edges from application graph to the surrogate network. In general, offloading objectives usually target saving mobile device's energy and decreasing application's execution time, and an optimal mapping may exist at a given time point. For a longer time span, a series of offloading mappings may exist to optimize an offloading objective function. In this chapter, we present a set of mobile cloud computing offloading decision models to demonstrate the mathematical construction to build one-to-one, one-to-many, and many-to-many offloading decision models. A preliminary set of evaluation results also presented to demonstrate the trade-offs of using offloading approaches with different system parameters' setup.

Keywords

Offloading mapping; One-to-one offloading; One-to-many offloading; Many-to-many offloading; Offloading objective; Surrogate; Service composition

Chapter 4 describes the mobile cloud service systems. Based on the mobile cloud system, many computation offloading strategies are developed. Yang et al. [285] studied the partitioning problem for mobile data stream applications, where the optimization focus is placed on achieving high throughput of processing the streaming data rather than minimizing the makespan (i.e., the total length of the schedule, that is when all the jobs have finished processing) of executions as in other applications. They designed a genetic algorithm for optimal computation partition. Abebe et al. [47] proposed a type of adaptation granularity which combines the efficiency of coarse level approaches with the efficacy of fine-grained adaptation. An approach for achieving this level of granularity through the dynamic decomposition of runtime class graphs was presented. Abebe et al. [48] presented a distributed approach to application representation in which each device maintains a graph consisting only of components in its memory space, while maintaining abstraction elements for components in remote devices. An extension to an existing application graph partitioning heuristic is proposed to utilize this representation approach. Giurgiu et al. [116] developed a system that dynamically adapts the application partition decisions. The system works by continuously profiling an applications performance and dynamically updating its distributed deployment to accommodate changes in the network bandwidth, devices CPU utilization, and data loads. Sinha et al. [249] and Mtibaa et al. [208] described algorithmic approaches for performing fine-grained, multisite offloading. This allows portions of an application to be offloaded in a data-centric manner, even if that data exists at multiple sites. Kovachev [170] presented Mobile Augmentation Cloud Services (MACS) middleware which enables adaptive extension of Android application execution from a mobile client into the cloud. MACS uses a dynamic partitioning scheme, and lightweight as extra profiling. Resource monitoring is performed for adaptive partitioning decision during runtime. Ra et al. [231] experimentally and analytically investigated the design considerations – which segments of the application are most efficient to be hosted on the low power processor, and how to select an appropriate low power processor using linear programming. Smit et al. [250] described an approach to partitioning a software application into components that can be run in the public cloud and components that should remain in the private data center. Static code analysis was used to automatically establish a partitioning based on low-effort input from the developer. Niu et al. [217] took the bandwidth as a variable to improve static partitioning and avoid high costs of dynamic partitioning. They proposed the Branch-and-Bound based Application Partitioning (BBAP) algorithm and Min-Cut based Greedy Application Partitioning (MCGAP) algorithm based on application Object Relation Graphs (ORGs) by combining static analysis and dynamic profiling. Verbelen et al. [266] designed graph partitioning algorithms that allocate software components to machines in the cloud while minimizing the required bandwidth. Their algorithms are not restricted to balanced partitions and take into account infrastructure heterogeneity. Besides the above work, [72][75][85][114][131][209][243][244] discussed the mobile cloud systems in specific areas.

This chapter first describes the general mobile cloud offloading setup in Section 5.1, then presents the offloading models including one-to-one case in Section 5.2 and many-to-many case in Section 5.3. Section 5.4 finally discusses the research challenges.

5.1 Mobile Cloud Offloading Setup

In mobile clouds, mobile devices and cloud resources compose a distributed mobile application running environment, where a mobile application may consume resources from both local and remote resource providers who provide computing, networking, sensing, and storage resource provisioning. Mobile devices can serve as either service consumers or service providers in the mobile cloud, in which the cloud boundaries are extended into the mobile domain [140]. Mobile applications may require a mobile device to interact with other mobile devices and cloud resource providers to achieve desired computing, storing, collaborating, or sensing features.

An ideal mobile cloud application running system should enable mobile devices to easily discover and compose cloud resources for its applications. From mobile resource providers' perspective, they may not even know what applications are using their resources and who may call their provisioned functions beforehand. In this way, the mobile application design should not be application-oriented; instead, it should be functionality-oriented (or service-oriented). For example, the video function of a mobile device should provide general interfaces that can be called by multiple local or remote functions in the runtime. To achieve this feature, we can consider these PFs as the fundamental application components in the mobile cloud, which can be composed by mobile cloud service requesters in the runtime. As a result, mobile cloud can significantly reduce the mobile application development overhead and greatly improve the agility and flexibility to build a personalized mobile cloud computing system that can be customized for each mobile user.

A simple vehicular video sensing example is used to illustrate the above described mobile cloud features. Alice is driving on the road and her smart phone, which is mounted on the front dashboard for navigation, has the basic video capture PF. Bob is driving next to Alice and is running an image processing PF on his phone and wants to utilize more video clips from the neighboring vehicles in order to reconstruct the road situations around his vicinity. Then, Bob can consume Alice's video PF to reconstruct the view of the entire road segment captured by their video cameras. Moreover, Bob wants to share his captured video clips to his friend Carol who is managing a traffic monitoring website that posts videos from smart phone users for the public to access the real-time road traffic information. As a result, Bob can share his augmented traffic view with Alice, i.e., through Carol's website. In this mobile application scenario, all participants have the basic PFs: (a) Alice, video capture; (b) Bob, video augmentation; and (c) Carol, video display. Note that a PF can be called by multiple other PFs for different application purposes, and they altogether can build several mobile cloud applications.

There are several challenges invoked by the application scenario described above. The first challenge is that knowing the status of mobile devices, e.g., online/offline and runtime information (such as battery, computing power, connectivity, etc.), is difficult due to the mobility of mobile users. The second challenge is that knowing the available PFs on each mobile device is not a trivial task. Currently, there is no such common framework allowing mobile devices for exchanging the available PFs information and running such a system in a distributed environment. The third challenge is to compose PFs crossing various hardware and software platforms, which demands a universal programming and application running environment with little compatibility issues.

5.1.1 Application-Surrogate Offloading Mapping

The mobile cloud offloading solves the partition problem to map the application components to the surrogate sites. The modular mobile applications are composed by a group of small components between which the data exchange happens. Some of the application components that can be moved to other places to run are the offloading subjects. The devices or the machines that can host these movable application components are surrogates. The offloading partition problem maps the application components to the surrogate sites as shown in Fig. 5.1.

Image
Figure 5.1 Application components – surrogate sites mapping.

The offloading mapping or the offloading topology decides code or task space distribution. Moreover, the offloading topology can change for the long time horizon. Based on the space and time attributes, we can categorize the mobile cloud offloading problem into 8 types as shown in Fig. 5.2. We will discuss the most simple category in Section 5.2 and the most complex category in Section 5.3. This section discusses the general offloading topology and offloading series.

Image
Figure 5.2 Mobile cloud offloading categories.

Offloading Topology

Application components and the surrogate sites are the two sides of the offloading topology. While there can be one or multiple application components and there can be one or multiple surrogate sites, there are four total combinations. They are 1:1Image, 1:nImage, m:1Image, and m:nImage topologies.

If a Boolean matrix named E is used to describe the mapping and the rows corresponding to application components and the columns are corresponding to surrogate sites, the four topologies are E1×1Image, E1×mImage, Em×1Image, and Em×nImage. For each row, there are at least one 1 since that application component has to find a surrogate to run. If there is more than one surrogate running an application component, that application component gets duplicate copies to be resistant to device or network failures.

Offloading Series

The execution environment changes with time, thus the impact of one time offloading may diminish. In this scenario, the subsequent offloading may be applied to adjust the offloading topology and maintain the offloading benefit. Multiple offloading forms the offloading series. For each offloading topology above, there could be a series as shown in Fig. 5.2.

5.1.2 Offloading Objectives

In our framework, a mobile application is programmed based on component-based design, where components provide functionality via interfaces and may, conversely, consume functionality provided by other components via their interfaces [125]. The application can be presented as a graph Gapp=(X,A)Image where each vertex is a component xXImage and an edge aAImage represents the interaction between components [275].

In a multisite offloading scenario, some computation workload is offloaded from an original mobile device and distributed onto candidate surrogate sites. The original site and its candidate surrogate sites form an egocentric network Gsur=(Y,B)Image, where a node is a site yYImage and a link bBImage represents a network connection between two sites.

The multisite offloading problem can be modeled to find a mapping from the application graph GappImage to the candidate network GsurImage to achieve a given optimization objective function. Let matrix E present this mapping, whose element eijImage is set to either 1 when component i is assigned to site j or 0 otherwise. Matrix E has the following properties:

1.  Let n be the order of all components n=|X|Image and m be the order of all candidate sites m=|Y|Image. Therefore, E is a matrix En×mImage. The relation of n and m is not strict, thus n>mImage, n<mImage, and n=mImage are all valid.

2.  Each component in the offloading application is assigned to exact one site, which means there is one and only one 1 in each row of E. As a result, j=1meij=1Image for every row i.

3.  In a mobile application, some components must be assigned to particular sites due to application requirements. For example, the human–machine interaction component must be put on the local mobile site. This requirement enforces that positions of some 1's in E are predefined and cannot be moved.

Based on E, four more mappings can be defined. Mapping fXYImage implements a similar function as E, which maps component i to site j: fXY(i)=jImage, eij=1Image, eijEImage. Mapping fYXImage is the reverse mapping of fXYImage, which given site j outputs a set of components {i1,i2,,ik}Image coded as a vector i. Besides, mappings can also be defined between W and U. Mapping fABImage maps edge a=(i1,i2)Image to link b=(fXY(i1),fXY(i2))Image; and similar to fYXImage, fBAImage maps a link to a vector of edges. These four mappings can easily be expended to accept vectors as well.

Execution Time

According to [269], at any time, the computation load for every component and the volume of data exchange for every edge in application graph is known based on a given task, or is predictable based on the application and user historical behavior. The workload is distributed on the application graph, which makes GappImage into a weighted graph. The computation load is presented as a weight value on each vertex: the component x is labeled with computation load wxImage and vector w is computation load of all vertexes. The data exchange amount is presented as a weight value on an edge: the edge a=(x1,x2)Image from x1Image to x2Image is labeled with data transfer load fx1x2Image and matrix Fn×nImage is data exchange load of all edges. The diagonal of F are all 0's because the component's interaction with itself does not count for intercomponent data exchange load; and fa=0Image if aAImage is false.

Meanwhile, the surrogates' capability is measurable, so the egocentric network GsurImage is transformed into a weighted graph as well. The available computation capability on a candidate site s is labeled as a vertex weight usImage and vector u is the weights of all the sites. The network throughput on link b=(y1,y2)Image from y1Image to y2Image is labeled as link weight dy1y2Image and matrix Dm×mImage is the weights of all the links. The diagonal of D are large values because data exchange in the same site can be considered negligible.

In this article, we define the operator .⁎ as array inner multiplication that multiplies arrays or matrices in an element-by-element way, which is different from matrix multiplication. Let u˜Image be the vector that satisfies u.u˜=1Image where 1 is the vector whose elements are all 1's. Then the upper bound of total time spent for computation load is the sum of workload on every site over its processing capability:

tc=wTXu˜.

Image (5.1)

Similarly, let D˜n×nImage be the matrix that satisfies D.D˜=1m×mImage where 1m×mImage is the matrix whose elements are all 1's. The transformation ETFEImage redistributes the communication load of Fn×nImage into an m×mImage matrix where element positions are corresponding to D˜m×mImage. The upper bound of total time spent on networks for data exchange load is the sum of workload on every link over its throughput:

tn=tr(ETFED˜T),

Image (5.2)

where the tr()Image function calculates matrix trace tr(Hn×n)=i=1nhiiImage. So the upper bound of total time is the sum of the computation and communication times:

t=tc+tn.

Image (5.3)

Energy Consumption

Energy consumption on mobile devices can be categorized according to hardware modules. The major categories are CPU, radio module (including WiFi and Cellular), display, audio device, GPS module, and vibration motor [153][245][286][289]. The components that involve modules, except CPU and radio, are hardware dependent components that have to run on the original mobile device and are not considered for offloading. Both CPU and radio power can be modeled as a linear model that consists of two parts: base consumption and dynamic consumption when hardware module is active [196][269]. The dynamic part of CPU power is proportional to the utilized processing capability according to [153][206][245][289]:

PCPU=1TE(u.cCPU),

Image (5.4)

where cCPUImage is the coefficient vector for all sites, and the coefficients of nonmobile sites in cCPUImage are 0's. Let's code E as e, then the dynamic part of radio module power is proportional to the outgoing packet rate [153][289]:

D=D.(1n×nI).(cradio1T),

Image (5.5)

Pradio=lfEL(e)dl,

Image (5.6)

where cradioImage is the coefficient vector for all sites, I is the identity matrix, and dlImage is the element of DImage corresponding to link l. The coefficients of nonmobile sites in cradioImage are 0's. Let PidleCPUImage be the static part of CPU power and PbaseradioImage be the static power of radio module. Then the total power is the sum of the above four parts:

P=PCPU+PidleCPU+Pradio+Pbaseradio.

Image (5.7)

5.2 One-to-One Offloading Case

A mobile cloud consists of mobile devices and cloud. There is usually one-to-one mapping between mobile devices and virtual machines in the cloud [138]. A mobile cloud application is constructed as a set of components or bundles. Some components can run on either mobile devices or virtual machines, while the other components, such as user interface and sensors, have to run on mobile devices. The major offloading objectives are saving application execution time and energy consumption on mobile devices. Notation in the following discussion is summarized in Table 5.1 for convenience.

Table 5.1

Notation

Terms Meaning Terms Meaning
B bundle set b i a bundle
e ij service dependency from biImage to bjImage Bphone, Bcloud bundle set for smart phone and cloud separately
t i execution time of bi c partition configuration
t phone application execution time in non-offloading mode p(c) offloading rate
q how faster cloud is than smart phone d ij size of data transferred over eijImage
w bandwidth t(c) total execution time
t(c) total execution time in unstable network ξ, η on state duration, off state duration
χ cycle duration, χ = ξ + η ρ network availability, ρ = ξ/χ
PCPU(c), PRF(c) energy consumption for CPU and RF separately PCPU(c)Image, PRF(c)Image energy consumption in unstable network
P(c) total energy consumption on mobile device P(c) total energy consumption in unstable network
P phone energy consumption in nonoffloading mode ρtime(c)Image, ρenergy(c)Image critical value for time and energy benefit
ρ(c) circuital value for both time and energy benefit Δt(c), ΔP(c) time benefit, energy benefit
KCPUstaImage, KCPUdynImage, KRFstaImage, KRFdynImage power of CPU and RF on smart phone

Image

5.2.1 Application Model and Ideal Network Model

The application is presented as a directed acyclic graph G={X,A}Image where every vertex is a bundle and every edge is the data exchange between bundles [117]. Each bundle has an attribute indicating whether it can be offloaded. The unmovable bundles are marked as local, which means these bundles cannot be offloaded due to application requirements. Let nImage be the total count of bundles in the application, then the initial bundle set is X={xi|i[1,2,,n]}Image and the edge set is A={aij|i,j[1,2,,n]}Image where eijImage represents directed data transfer from xiImage to xjImage. Let n be the count of movable bundles and nnImage. A configuration c [117] is defined as a tuple of partitions from the initial bundle set, <Xphone,Xcloud>Image, where Xphone={xi|i[1,2,,k]}Image has k bundles and Xcloud={xi|i[1,2,,s]}Image has s bundles. And they satisfy XphoneXcloud=Image and XphoneXcloud=XImage. The bundles that are marked as local are initially put in the set BphoneImage and cannot be moved. An example is shown in Fig. 5.3 where unmovable bundles are marked as gray and dotted line indicates configuration. The bundles on the left side are XphoneImage and the bundles on the right side are XcloudImage.

Image
Figure 5.3 Application graph example.

Execution Time

For a given task, bundle xiImage has an attribute tiImage indicating its computation time on smart phone. And edge aijImage is associated with an attribute dijImage indicating the transferred date size from bundle i to bundle j. These values can be measured or estimated from collected application and device data. Total time of running the task only on the smart phone is

tphone=xiXti

Image (5.8)

where data exchanges between bundles are not counted as they happen locally and cost little time compared to time of data exchange over the network. For a particular configuration c, offloading rate p [224] is defined as the proportion of offloaded task to all tasks in terms of computation time. The proportion of the task is the same as time proportion due to the same processing capability on the same mobile device p(c)=(xiXcloudti)/tphoneImage, and p(c)Image satisfies 0p(c)1Image. Then, the computation time on the smart phone is

tcomputationphone(c)=xiXphoneti=(xiXxiXcloud)ti=(1p(c))tphone.

Image (5.9)

Assume the cloud is q times faster than the smart phone, thus the time consumption in the cloud is q times less than the time spent on the mobile device [281], which is ticloud=ti/qImage. The computation time in the cloud is

tcomputationcloud(c)=xiXcloudticloud=1qxiXcloudti=p(c)qtphone.

Image (5.10)

Thus the total computation time is

tcomputation(c)=tcomputationphone(c)+tcomputationcloud(c)=(1(11q)p(c))tphone.

Image (5.11)

A typical offloading process works as follows: Initially, the application starts on the smart phone and all components run locally. Then, the application may offload some components to a remote virtual machine. These offloaded bundles run in the cloud remotely. However, they need to communicate with the bundles resident on the smart phone. Thus, they have to exchange data through the network. Assume that the network bandwidth is w, then the network delay is the sum of delays in both data transfer directions, namely

tnetwork(c)=xiXphonexjXclouddijw+xiXcloudxjXphonedijw.

Image (5.12)

In an ideal network environment, the total execution time for a given configuration c is the sum of computation time and network delay, that is,

t(c)=tcomputation(c)+tnetwork(c).

Image (5.13)

The offloading benefit of execution time comes from the trade of tcomputationImage and tnetworkImage. The computation part saves execution time because the cloud processing capability is greater than that of the mobile device. However, the offloading has to pay for network delay, which counteracts the computation time saving. For computation-intensive applications whose computation time saving is much larger than the network delay, the offloading benefit is obviously seen.

Energy Consumption

Two hardware modules of the mobile device are involved in the energy consumption estimation: CPU and radio frequency (RF) module. Other modules like display, audio, GPS etc., are not considered because the components that interact with these modules have to run on the mobile device locally. The energy consumption on both CPU and RF modules can be further separated into the dynamic and static parts [269]. When the hardware module is in the idle state, the energy consumption is corresponding to the static part. When the hardware module is in the active state, more energy is consumed, which is corresponding to the dynamic part. Assume that the power of CPU in the idle state is KCPUstaImage and the power of CPU in the active state is KCPUsta+KCPUdynImage. The energy consumption of CPU is then

PCPU(c)=KCPUstat(c)+KCPUdyntcomputationphone(c).

Image (5.14)

Similarly, let KRFstaImage and KRFdynImage be the power of RF module in the idle and active states separately. The energy consumption on radio frequency module is

PRF(c)=KRFstat(c)+KRFdyntnetwork(c).

Image (5.15)

Thus, the total energy consumption is

P(c)=PCPU(c)+PRF(c).

Image (5.16)

If offloading is not applied, only CPU consumes energy and its active period is the whole execution time. The total energy consumption of running tasks only on the smart phone is

Pphone=(KCPUsta+KCPUdyn)tphone.

Image (5.17)

The offloading influences energy consumption of the mobile device in two aspects. First, the mobile device may save energy because the mobile device does not pay for the energy consumption corresponding to the tasks that are offloaded and completed in the cloud. Second, the data exchanges between application components are now fulfilled by networking instead of local procedure invocation, which leads to energy cost for sending and receiving packets. Similar to the time benefit of offloading, the computation-intensive application may obtain an obvious energy benefit when computation tasks are offloaded as large CPU energy consumption is spared and network energy consumption is small.

5.2.2 Model and Impact of Network Unavailability

Connection between the mobile device and the cloud is usually not stable due to mobility of devices. When the mobile device moves out of wireless coverage, it loses connection to the cloud. The mobile device continues to make attempts to reconnect to the cloud when the network is unavailable. When it moves into coverage again, the connection resumes. As the mobile device moves, the connection state changes as on, off, on, off, …, which can be modeled as an alternating renewal process.

Fig. 5.4 shows how network availability changes along with time. The solid line represents that the network is available, while the dashed line represents that the network is unavailable. Two network states alternate with each other. One on duration and one off duration form a cycle. The on state duration is denoted as ξ and the off state duration is denoted as η. The variables {ξi,i=1,2,}Image are independent and identically distributed (i.i.d.), and so are {ηi,i=1,2,}Image. And ξiImage and ηjImage are independent for any ijImage, but ξiImage and ηiImage can be dependent [228]. The cycle duration is denoted as χ, and χi=ξi+ηiImage where i=1,2,Image. The proportion of on duration in any individual cycle is a random variable denoted as ρ=ξ/χImage.

Image
Figure 5.4 Networking model under unavailability of communication links.

Execution Time

When the network is unavailable, the application has to wait because the phone cannot send input to the cloud and cannot retrieve output from the cloud either. The application resumes the execution after the network becomes available again. The total execution time is prolonged according to the proportion of ρ, namely

t(c)=t(c)ρ.

Image (5.18)

The offloading gives time benefit when t(c)<tphone(c)Image. In an ideal network environment, ρ=1Image and t(c)=t(c)Image. t(c)Image rises to infinity when ρ decreases from 1 to 0. At some point, the benefit finally disappears. We define this point as a critical value of ρ for the time benefit,

ρtime(c)=t(c)tphone.

Image (5.19)

And the time benefit is

Δt(c)=tphone(c)t(c)

Image (5.20)

when ρ>ρtime(c)Image.

Energy Consumption

During the time t(c)Image, the computation time tcomputation(c)Image and network time tnetwork(c)Image are the same as tcomputation(c)Image and tnetwork(c)Image, respectively, in an ideal network environment because computation and data transfer only work properly when an ideal network is available. The CPU active time period is the same as that in an ideal network model because the given task is the same. However, the CPU idle time period is the whole execution time that is different from that in an ideal network model. Thus, the energy consumption for CPU is

PCPU(c)=KCPUstat(c)+KCPUdyntcomputationphone(c).

Image (5.21)

The RF module is active even when the network is unavailable because it continues scanning for the available network to resume connection. Thus, the active time period for the RF module is t(c)tcomputation(c)Image. The energy consumption for RF is

PRF(c)=KRFstat(c)+KRFdyn(t(c)tcomputation(c)).

Image (5.22)

Thus, the total energy consumption is

P(c)=PCPU(c)+PRF(c).

Image (5.23)

The offloading gives energy benefit if P(c)<PphoneImage. As ρ decreases, both PCPU(c)Image and PRF(c)Image increase. Similarly, the critical value of ρ for energy is defined as the point where the energy benefit disappears, i.e.,

ρenergy(c)=(KCPUsta+KRFsta+KRFdyn)t(c)/(PphoneKCPUdyntcomputationphone(c)+KRFdyntcomputation(c)).

Image (5.24)

And the offloading energy benefit is

ΔP(c)=Pphone(c)P(c)

Image (5.25)

when ρ>ρenergy(c)Image.

Problem Formulation

When network availability ρ is greater than the larger of the ρtime(c)Image and ρenergy(c)Image, both time and energy benefits are obtained. We define the critical value of ρ as

ρ(c)=max{ρtime(c),ρenergy(c)}.

Image (5.26)

The offloading problem with possible network unavailability is finding the application partition c to minimize ρ(c)Image:

min ρ(c)

Image (5.27)

while both time and energy benefits exist, i.e., when

ρ>ρ(c),

Image (5.28)

where ρ is the current network availability estimated based on observations. The c satisfying (5.28) may not exist when ρ is too low. In this situation, the application should not offload any components to the cloud. The solution to (5.27) is the best partition that tolerates network unavailability, and it may give benefit when current network availability ρ gets worse.

5.2.3 Optimization Solution and Simulation Analysis

Bundle computation times tiImage form a vector t of dimension m. Data sizes dijImage form a square matrix Dm×mImage. If there is no edge from biImage to bjImage, then dijImage is set to 0.

The configuration c can be represented as a vector x of dimension m where xiImage indicates whether biImage should be offloaded. xi=1Image means that biImage should be offloaded to a remote cloud, and xiImage=0 means biImage should be kept on the smart phone locally. For biImage that cannot be offloaded, xiImage is set to 0 initially and does not change. Vector x has m elements in which n elements are variables and the others are 0. For simplicity, all 0s are put at the end of x.

Let 1 be a column vector whose elements are all 1s, then tphone=tT1Image. Offloading rate p(c)Image is now p(x)=tTx/tT1Image. And tnetwork(c)Image is tnetwork(x)=((1x)TDx+xTD(1x))/wImage. Thus t(c)Image is finally a function of x, which is t(x)Image.

The objective of the offloading decision is to find a configuration x satisfying (5.27). This is a 0–1 Integer Programming (IP) problem.

Optimization Solution

The solution space for configuration x is 2nImage, which means it costs a lot of time to search for the optimal solution. To find a proper x within acceptable time, we propose an Artificial Bee Colony (ABC) [157] based algorithm. The colony consists of three types of bees: employed bees, onlooker bees, and scout bees. A bee that goes to a food source visited by it before is named an employed bee. A bee that waits in the dance area to make a selection of the food source is called an onlooker bee. And a bee that carries a random search to discover a new food source is named a scout bee. The food source is a possible solution x, and every bee can memorize one food source. It is assumed that there is only one employed bee for each food source. The memory of employed bees is considered as the consensus of the whole colony, and the food sources found by onlooker or scout bees merge into employed bees' memory in the algorithm. Assume that the number of employed bees is N and the number of onlooker bees is M (M>N)Image. And let MCN be the Maximum Cycle Number. The algorithm overview is shown in Algorithm 5.1.

Image
Algorithm 5.1 Application partition algorithm overview.

In the first step, the algorithm generates a random initial population X (cycle=0)Image of N solutions where the population size is the same as the number of employed bees. Based on this initial generation, the algorithm starts to evolve the generation in cycles. The evolution repeats until the cycle number reaches the limit MCN. The algorithm outputs the best solution, denoted as xbestImage, ever found in all cycles.

In the cycle, three types of bees work in sequence. The details of various bees' actions are shown in Algorithm 5.2. Employed bees produce new solutions by two local search methods:

Flip when an employed bee randomly flips one element in the vector x.

Swap when an employed bee randomly flips two elements of different values in the vector x, which is equivalent to swapping two different elements in that vector.

Each employed bee evaluates the fitness of its original solution x, newly found xflipImage, and xswapImage by (5.26). Then, each employed bee memorizes the best one of these three food sources and forgets the others.

Image
Algorithm 5.2 Application partition algorithm details.

Onlooker bees watch employed bees dancing, and plan the preferred food source. Onlooker bees record critical values of all food sources and calculate the probability for the ithImage food source as follows:

pi=1/ρ(xi)j=1N(1/ρ(xj)).

Image (5.29)

Intentionally, the lower the food source's critical value, the more likely the onlooker bee would like to go. The onlooker bees choose the food source y randomly according to its probability. Since M>NImage, several onlooker bees may follow the same employed bee and choose the same food source. Then each onlooker bee applies the same local search methods used by employed bees previously to explore new neighbor solutions, and picks the best one of the three. After all onlooker bees update their solution, each employed bee compares its solution with its followers' solutions, and picks the best one as its new solution.

In our algorithm, only one scout bee is used. This scout bee randomly generates a vector z and compares z to the worst solution of employed bees. If this randomly generated z is better than the worst solution of employed bees, the corresponding employed bee memorizes this new solution and forgets the old one.

Evaluation and Tuning

In this section, we evaluate ABC based partition algorithm, including algorithm tuning and impact of different mobile applications and the cloud. We evaluate our model and algorithms in MATLAB.

We generate 200 random application graphs as a base evaluation data set. The default parameter settings are shown in Table 5.2. We use a set of typical energy parameters K for a phone according to [269]. The cloud–phone processing ability ratio q varies in a large range from previous work [274][281]. We pick a medium value from the possible range as the default value and evaluate its impact to algorithm in Section 5.2.3. We evaluate the algorithm based on three aspects: bee colony, different applications, and cloud–phone relation.

Table 5.2

Default parameter setting

Parameter Default value
Application m 10
n 8
Cloud [274][281] q 30
Phone [269] KCPUsta Image 2.5
KCPUdyn Image 5
KRFsta Image 1.25
KRFdyn Image 1.25
Algorithm N 3
M 5

Image

Bee Colony and Algorithm Tuning

This experiment is based on 200 random application graphs (t and D). These application graphs are randomly generated, and at least one configuration of each graph is guaranteed to obtain both time and energy benefit in an ideal network environment. We evaluate the proposed algorithm performance with respect to different bee colony size. The results are shown in Fig. 5.5. The x-axis represents how many iterations the algorithm needs to reach xbestImage, and the y-axis represents how many cases are needed to reach the solution of corresponding iterations. From the figure, we may draw the following guidelines for algorithm tuning:

•  By increasing the onlooker bee number, the algorithm shows better convergence rate. For the same employed bee number (N), the more onlooker bees there are, the fewer iterations are obviously required to reach the optimal solution in all three situations (N=2,3,4Image).

•  While increasing the employed bee number improves convergence rate, the improvement is not as obvious compared to increasing the onlooker bee number. For the same onlooker bees of M=3Image (Fig. 5.5B, Fig. 5.5D), M=4Image (Fig. 5.5C, Fig. 5.5G), and M=7Image (Fig. 5.5F, Fig. 5.5H), the cases that have more employed bees have slightly better performance improvement, which is not as obvious as the improvement given by increasing onlooker bees. For M=4Image figures, more than 0.05 cases reach the optimal solution in 7 iterations in Fig. 5.5C while there are only 0.05 cases that reach a solution in 7 iterations, which means more cases reach a solution in less than 7 iterations, in Fig. 5.5G. Similar phenomenon is found for M=3Image and M=7Image figures.

•  For the same total numbers of employed and onlooker bees, the algorithm prefers more onlooker bees slightly. For the same total bees of N+M=6Image (Fig. 5.5C, Fig. 5.5D) and N+M=8Image (Fig. 5.5E, Fig. 5.5G), we can see that the overall performance is almost the same. But the iterations needed to get optimal solutions in the cases that have more onlooker bees are slightly concentrated on some iteration numbers. For N+M=6Image, the iterations in Fig. 5.5C are concentrated demonstrated by a higher summit at iteration 4, while they are diversely distributed from 1 to 8 in Fig. 5.5D. A similar situation occurs for N+M=8Image.

Image
Figure 5.5 Partition performance of difference bee colonies. (A) N = 2, M = 2. (B) N = 2, M = 3. (C) N = 2, M = 4. (D) N = 3, M = 3. (E) N = 3, M = 5. (F) N = 3, M = 7. (G) N = 4, M = 4. (H) N = 4, M = 7. (I) N = 4, M = 10.
Application Impact

To evaluate the algorithm performance for different applications, three experiments are done for varying component number, unmovable component proportion, and computation–communication ratio separately. The experiment result for different component number is shown in Fig. 5.6. For the same bee colony, the iterations to find the solution increase along with the component number. For the large applications that have many components, the algorithm may use a large bee colony to assure small number of iterations.

Image
Figure 5.6 Partition performance for different component numbers. (A) m = 8. (B) m = 10. (C) m = 12.

We evaluate the impact of unmovable component proportion of application in the second experiment, and the result is shown in Fig. 5.7. From the figure, we find that more iterations are required to get the solution when the movable component number increases. The trend is very like that in Fig. 5.6, which implies that the unmovable component number does not play a significant role in the algorithm performance. This is because the algorithm always considers the movable components and ignores the unmovable component when generating new solutions in each cycle. The total component size increase in Fig. 5.6 leads to the increase of movable component number, which is like what this experiment does in Fig. 5.7. Besides, we also found in this experiment that a higher movable proportion results in the robust solution that can work under low network availability ρ(c)Image situations. This is because the high movable proportion provides more candidate partition options so that a more robust solution may be achieved.

Image
Figure 5.7 Partition performance for different unmovable component proportions. (A) n = 7. (B) n = 8. (C) n = 9.

We generate another two sets of application graph data for different computation load. The data sets used in previous experiments are used as the reference data set. Then we adjust the computation task to half and double of the reference data set in the application graph generation process. The network task remains the same, thus the computation–communication ratio is adjusted to half and double in the new data sets. The experiment results for these three data sets are shown in Fig. 5.8. From the figure, we can see that the iterations, distributed at 2,3,4,5Image, and 6, are almost the same, which implies the computation proportion of the given task does not influence the algorithm performance. This is because the computation proportion in the task influences the time and energy benefits in the same direction. In the experiment, we also find that the computation proportion impacts the ρ(c)Image, because a larger computation proportion leads to a larger offloading benefit and the possible solution is more resistant to network unavailability.

Image
Figure 5.8 Partition performance for different computation tasks. (A) Half computation task. (B) Reference computation task. (C) Double computation task.
Cloud Impact

We evaluate the algorithm performance under different cloud speedup ratios shown in Fig. 5.9. The figure shows that the iteration number does not depend on the cloud processing capability. The cloud processing capability influences the execution time considered in the algorithm, which is similar to the computation proportion impact. And similarly, the higher cloud processing capability results in a more robust partition configuration.

Image
Figure 5.9 Partition performance for different cloud speedup ratios. (A) q = 5. (B) q = 10. (C) q = 20.

5.3 Many-to-Many Offloading Case

Nowadays, many mobile cloud applications adopt a multisite service model [189][249]. To maximize the benefits from multiple service providers, the research focuses on how to compose services that have been already implemented on multiple service providers. Here, we do not differentiate between application functions and services since our model can be applied to both. A simple example can be used to highlight the application scenario: a mobile device calls a video capturing function from multiple remote mobile devices at a congested road segment, an image processing function uses this to recognize vehicles on the road segment from the cloud, and then the requesting mobile device uses its local UI to display the road traffic with identified lanes and vehicles. Compared to the traditional approach where users upload captured videos to the cloud and the requester downloads the processed videos from the cloud, the presented application scenario does not require a presetup application scenario to each function. This approach is very flexible in terms of ad hoc application composition, and it can maximally improve the resource utilization. For example, the video capturing function of mobile devices can be shared by multiple users for different purposes, e.g., congestion monitoring, road events detection, vehicle identification and tracking, etc.

Besides the flexibility of the service/function composition using multisite service composition, it also introduces benefits in reducing execution time and energy consumption of mobile devices; however, at the same time, it brings more management issues as well. The multisite service composition paradigm involves multiple surrogate sites in the service composition process, and the application running environment changes demand a decision model in the service composition decision processes to consider the application running environment changes related to network connectivity, delay, device resource consumption, energy usage, etc. Moreover, due to the mobility, the benefits of service composition may not be consistent during the entire application execution time period. To adapt to the application running environment changes, we need to study the service reconfiguration strategy by modeling the service composition as a service-topology mapping (or reconfiguration) problem that is illustrated in Fig. 5.10. Relying on a cloud service framework, once the mobile application running environment state changes, a new service-topology reconfiguration is decided, and then the application components are redistributed to the surrogate sites through the cloud. In this way, the service composition is adaptive to gain the maximum service benefits during the entire execution time period [276].

Image
Figure 5.10 Service composition topology reconfiguration motivation.

To address the above mobile cloud service composition problem, many existing approaches (e.g., [117] [160] [274]) only focus on solving the one-time service composition topology configuration without considering a sequence of service composition due to the application running environment changes (e.g., due to the mobility of nodes). When considering multiple service composition decisions, one decision may impact other service mapping decisions at an upcoming service mapping. This demands that the topology reconfiguration decision must not only consider the current environment state but also predict future environment changes, and thus, the service-topology reconfiguration issue can be modeled as a decision process issue. To address the above described issues, we model the service composition topology reconfiguration as a five-element tuple system and we present three algorithms to solve these decision process problems for three mobile cloud application scenarios: (1) finite horizon process where the application execution time is restricted by a certain time period, (2) infinite horizon process where there is no clear boundary of the application execution time, and (3) large-state situation where the large numbers of many-to-many service mappings demand a parallel computing framework to compute the service mapping decision.

The offloading as a service and service composition in mobile cloud computing achieve three essential tasks: First, the mobile application components, which can be offloaded, are partitioned into several groups. Second, the surrogate sites are picked from candidate sites that are usually virtual machines in cloud. Third, the component groups in the first task are mapped to surrogate sites in the second task, and then computation is offloaded. The service composition is not a one-time process. Instead, the mapping in the third task should be dynamically changed to adapt to the system and environment changes, especially in mobile cloud computing where mobility adds to the environment variation.

This section first describes the normal service composition system, and then models the players in the system including mobile application and surrogate network, and finally formulates the service composition topology reconfiguration process.

5.3.1 Service Composition System

The Service composition system consists of three parts shown in Fig. 5.11, which can be emulated as human decision processes. The Monitor represents the human's eyes watching both the mobile applications and infrastructure, and notifying the Service composition topology reconfiguration about their states' changes. The Service composition topology reconfiguration is the human's brain thinking about how to put application components onto which surrogate sites. The Service composition executor represents the human's hands that enforce the component–surrogate mapping and make sure a mobile device and its surrogates work together properly. These three interdependent modules can be deployed in a cloud computation platform to provide offloading-as-a-service, which exposes http REST API for mobile applications and the infrastructure to interact with. The infrastructure registers itself to the service and pushes the state information to the Monitor. The mobile application as well registers itself to the service and receives the execution command from the Service composition executor.

Image
Figure 5.11 Continuous service composition system.

Besides the Service composition system, the Mobile application and Infrastructure are involved in the service composition process, and they form a loop where the Mobile application and the Infrastructure share a part of the loop in parallel. The Service composition system initiates the service composition operations that stimulate the Mobile application and the Infrastructure. The Mobile application and the Infrastructure integrate the service composition impacts and the variances form the outside, such as user inputs to the application and the device load variance, and feedback to the Service composition system. Then, the Service composition system based on the feedback makes the service composition operation.

The Mobile application is the objective of the Service composition system. The Infrastructure consists of the three players that are involved in the service composition process: the Mobile device, the Surrogate sites, and the Network between them; they are modeled in the following subsections.

Application Graph

A modern mobile application is usually guided by component oriented design. Components provide functionality via interfaces and may, conversely, consume functionality provided by other components [277]. The application can be presented as a graph Gapp=(C,E)Image where the vertexes are the components and the edges show the interaction between components.

To be extensible, the application graph is not limited to present only one application. The application graph can be extended to contain several applications and even the connections between applications.

Surrogate Network

In a multisite service composition scenario, some computation workload is offloaded from the original mobile device and distributed onto the chosen surrogate sites from candidate sites. The original site and its candidate sites form an egocentric network Gsur=(S,L)Image, where the node is the site and the link is the network connection between sites.

Component–Surrogate Mapping

The service composition mapping is a mapping from the application graph GappImage to a surrogate network GsurImage, where vertexes are mapped to nodes and the edges are mapped to links correspondingly. Let matrix X present this mapping, whose element xijImage is set to either 1 when component i is assigned to site j or 0, otherwise. Matrix X has the following properties:

1.  Let n be the component number, n=|X|Image, and m be the candidate site number, m=|Y|Image. Then, E is En×mImage. The relation of m and n is not strict, which means m>nImage, m<nImage, and m=nImage are all valid.

2.  The mapping is also not strict, which means several components may be mapped to the same surrogate site and some surrogate site may not host any components. However, each component in the application is assigned to exactly one site, thus, there is one and only one 1 in each row of E, i.e., j=1neij=1Image for every row i.

3.  In a mobile application, some components have to be assigned to particular sites due to application requirements. For example, human–machine interaction components and sensor components have to be put on the original mobile device because they use mobile device hardware that is not available on surrogate sites. This requirement enforces the positions of some 1's in some rows of E to be predefined and not to be moved. These rows are put at the bottom of E. Except for these rows, the rest of E is the effective matrix En˜×mImage, which corresponds to the movable components.

Based on E, four more mappings can be defined for easy expression in the following sections. Mapping fCSImage implements a similar function as E, which maps component i to site j: fXY(i)=jImage, eij=1Image, eijEImage. Mapping fYXImage is the reverse mapping of fXYImage, which given site j outputs a set of components {i1,i2,,ik}Image coded as a vector i. Besides, mappings can also be defined between A and B. Mapping fABImage maps edge a=(i1,i2)Image to link b=(fXY(i1),fXY(i2))Image. And similarly to fYXImage, mapping fBAImage maps a link to a vector of edges.

5.3.2 Model Statement

This subsection models several factors involved in the service composition topology reconfiguration, followed by model formulation in the end.

Decision Points

Decision points are the moments when the service composition topology reconfiguration decisions are made. At these moments in Fig. 5.11, the Monitor triggers the Service composition topology reconfiguration to generate a service composition topology. The moments are decided by the Monitor that is always observing the Infrastructure and the Mobile application states. The Monitor can trigger decisions periodically according to a predefined period Δt.

The decision points are a sequence that starts from the time when the application starts to the time when the application ends, T={0,1,2,,N1}Image. In some scenarios, the application termination time is not expected and the sequence is an infinite sequence, T={0,1,2,}Image.

Measures

The Monitor measures the Infrastructure states. The node computation capability and link throughput are labeled on the surrogate network, which transforms GsurImage into a weighted graph. The available computation capability on a candidate site s is labeled as a node weight usImage and vector u collects weights of all sites. The network throughput on link l=(s1,s2)Image from s1Image to s2Image is labeled as link weight ds1s2Image and matrix Dn×nImage contains weights of all links. The diagonal of D has large values because the delay in the same site can be considered negligible.

The above measures may be continuous variables. They are manipulated by normalization and quantization to make them into discrete states. A relatively large value is picked and the observation is scaled to be in [0,1]Image. Quantization precision determines the size of state space. The evaluation shows the results of different state space. The state space is denoted as S.

Service Composition Topology

The service composition topology is the effective component surrogate mapping Xm˜×nImage. Each mapping corresponds to an action that enforces the mapping. The size of service composition topology space is nm˜Image since each component has n choices and there are m˜Image components that make their choices independently. Let A be the corresponding action space from which the Service composition system in Fig. 5.11 acts – picking and enforcing the mappings. The output of the Service composition topology reconfiguration is a service composition topology. If the outputted service composition topology is different from the old one, reconfiguration is needed. “Reconfiguration” means that the components in the old service composition topology should be moved properly to satisfy the new service composition topology, which is fulfilled by the Service composition executor.

Observation Learning

The Service composition topology reconfiguration in Fig. 5.11 counts the historical states and actions, and estimates the state transition probability p(j|i,a)Image where i,jSImage and aAImage. The transition probability satisfies jSp(j|i,a)=1Image. This probability is updated at decision points. The Service composition topology reconfiguration maintains a buffer that keeps the count for valid observed states and the count of historical actions. At each decision point, it gets the current state j from the Monitor and, the last state i and the last topology decision a from its buffer. Then it calculates the state transition probability for every pair of states with every action. This transition probability that comes from the recent history is used to predict the probability of transition for the near future Δt period assuming the transition probability stays steady in a short time period.

Service Composition Objective

One major service composition goal in mobile cloud computing is to save mobile device energy. Following the same procedures of equations from (5.4) to (5.7), the total power is calculated through the following equations:

PCPU(i,a)=1TE(u.cCPU),

Image (5.30)

D(i)=D.(1n×nI).(cradio1T),

Image (5.31)

Pradio(i,a)=lfAB(e)dl,

Image (5.32)

P(i,a)=PCPU+PidleCPU+Pradio+Pbaseradio.

Image (5.33)

When a topology is picked at a decision point, a reward value is calculated to indicate how good the decision is. The reward of choosing action a at state i depends on not only state i and action a but also the next state j. The reward is

r(i,a)=jSr(i,a,j)p(j|i,a),

Image (5.34)

where the reward of transition from state i to state j with action a is the expected delta power between two states i and j with the same action a, and

r(i,a,j)=P(j,a)P(i,a).

Image (5.35)

Model Formulation

The service composition topology reconfiguration process is modeled as a five element tuple:

{T,S,A,p(|i,a),r(i,a)}.

Image (5.36)

This is a Markov decision process [188].

5.3.3 Optimization Solution

Based on the proposed service composition topology reconfiguration system and model, this section formulates the topology reconfiguration policy problem in both finite horizon scenario and infinite horizon scenario. The solutions in both scenarios are presented. Besides, the MapReduce based algorithms are discussed for large state count situations that are common in real world.

Topology Reconfiguration Policy

The service composition reconfiguration policy is a function π that maps states to actions π:SAImage. The function π can be stored in memory as an array whose index is the state and whose content of each element is the corresponding action.

Let YtImage and ΔtImage be the system state and the picked action at decision point t, Δt=π(Yt)Image. The sequence L(π)={Y0,Δ0,Y1,Δ1,}Image is a stochastic process depending on π. Let Rt(π)=r(Yt,Δt)Image, then the sequence {R0(π),R1(π),}Image is a reward process depending on π.

Finite Decision Points

At any decision point, the current period reward could be used as a decision goal, which, however, is shortsighted because the maximum current period reward does not guarantee that the sum of rewards in all periods is maximum. To make a proper decision on service composition topology, the total rewards of N periods should be considered as the goal:

VN(Y0,π)=t=0N1βtRt(π)=t=0N1βtr(Yt,Δt)

Image (5.37)

where β is the confidence index. As the N periods' rewards are estimated future rewards, the degree of confidence on the reward sequence Rt(π)Image decreases with t. The confidence index presents this decreasing confidence trend. The service composition topology reconfiguration problem is to find the policy π that maximizes VN(Y0,π)Image.

Let utImage be the reward sum from decision point t to N. There is backward recursive relation between t+1Image and t:

ut(it,at)=r(it,at)+βjSp(j|it,at)ut+1(j)

Image (5.38)

=jSp(j|it,at)(r(it,at,j)+βut+1(j))

Image (5.39)

where itSImage is the state at time t. Equation (5.38) shows the reward sum from time t to N consists of the current period reward and the β scaled reward sum from time t+1Image to N.

Let the superscript notation represent the maximum value of the corresponding variable. To get the maximum rewards, the backward recursive relation formulation is

ut(it)=maxatA{r(it,at)+βjSp(j|it,at)ut+1(j)}

Image (5.40)

Algorithm 5.3 shows the algorithm to calculate the policy π. The main body of the algorithm repeats equation (5.40) N times. In the algorithm, line 5 and line 6 could share the intermediate result of equation (5.38), which means r(it,a)+jSp(j|it,a)ut+1(j)Image, itSImage is calculated only once but used in both operations.

Image
Algorithm 5.3 Finite horizon backward induction.

The algorithm requires storage for two arrays indexed by state, v and f. The ith element of the array v is u(i)Image where iSImage. The ith element of the array f is an action π(i)AImage that is the optimal action corresponding to state iSImage. The array f hosts one instance of π. The length of both v and f is |S|Image.

At the end of the algorithm, v contains the discounted sum of the rewards to be earned on average from the corresponding initial state i: VN(i)=v(i)=u0(i)Image where iSImage. The policy is π={π0,π1,,πN1}Image for N decision points. The array f contains π0Image when the algorithm ends. The action π0(Y0)=f(Y0)Image is the action that should be performed at the current decision point.

Infinite Decision Points

The previous discussion of the finite horizon scenario can be extended to the infinite horizon scenario. The objective function for the infinite horizon scenario can be achieved by pushing N to ∞ in equation (5.37), i.e.,

V(Y0,π)=limNVN(Y0,π).

Image (5.41)

Similarly, the problem is to find the policy π that maximizes the total rewards V(Y0,π)Image. In the infinite horizon scenario, the recursive relation (5.38) is generalized by removing iteration subscript:

u(i,a)=r(i,a)+βjSp(j|i,a)u(j).

Image (5.42)

Similarly, the recursive relation (5.40) changes to

u(i)=maxaA{r(i,a)+βjSp(j|i,a)u(j)}

Image (5.43)

which means the u(i)Image achieves to the maximum total rewards.

Algorithm 5.4 shows the algorithm to calculate the policy π. Compared to Algorithm 5.3, the iteration termination condition is changed to comparing the vector norm and tolerance. ε indicates the tolerance for the converging state. In line 6, Image is a vector norm that could be any type of LpImage: L1Image, L2Image, or LImage norm. In addition, a local improvement loop is added inside the main iteration. The sequence {m}Image consists of nonnegative integers that are used in each iteration as improvement depth; {m}Image could be generated in many ways. For example, it may be constant, i.e., mn=mImage, or it may get more precise along with the iteration sequence number, i.e., mn=nImage. When the algorithm ends, the policy is πn+1Image that is stored in the array f.

Image
Algorithm 5.4 Infinite horizon induction.

The column vector r(π)Image and matrix P(π)Image are defined to simplify expressions in the algorithm. The ith element of vector r(π)Image is r(i,π(i))Image where iSImage. The size of r(π)Image is |S|Image. The (i,j)Imageth element of matrix P(π)Image is p(j|i,π(i))Image where i,jSImage. The size of P(π)Image is |S|×|S|Image. In the algorithm, lines 13 through 15 repeat the same operations as lines 3 to 5. Line 8 is the vector version of equation (5.42). Lines 5 and 15 are the vector version of equation (5.43). Lines 3 and 5 share the intermediate computation result. Similarly, lines 13 and 15 also share the intermediate computation result.

Large State Space

To make a more accurate and agile decision, the real world measures usually lead to a large state space in Section 5.3.2. The large state space size results in a long responding time. To mitigate the response time in a large state space situation, MapReduce could be used. This section discusses the conversion from Algorithm 5.3 and Algorithm 5.4 to MapReduce algorithms.

Algorithm 5.5 and Algorithm 5.6 show the MapReduce algorithms for the finite horizon scenario. The input to the mapper function, which is also the output of the reducer function, is the state id i and an object Q that encapsulates the state information defined in Section 5.3.2. Besides encoded state information, two components Q.vImage and Q.fImage corresponding to the arrays v and f are also included in the state object. Moreover, a component Q.pImage corresponding to the state transition probability obtained in Section 5.3.2 is included in the state object as well. The state object is passed from the mapper to the reducer for calculating Equation (5.39). This is accomplished by emitting the state data structure itself, with the state id as a key in line 2 of the mapper. In the reducer line 3, the node data structure is distinguished from other values.

Image
Algorithm 5.5 Finite horizon Mapper.
Image
Algorithm 5.6 Finite horizon Reducer.

The mapper function associates the current state with all backward states. The reducer function aggregates the reward sum of all forward states according to Equation (5.39), which is categorized by action. Then it picks the maximum reward sum and the corresponding action as the current reward sum and action according to Equation (5.40).

It is apparent that Algorithm 5.3 is an iterative algorithm, where each iteration corresponds to a MapReduce job. The actual checking of the termination condition must occur outside of MapReduce. Typically, execution of an iterative MapReduce algorithm requires a non-MapReduce “driver” program, which submits a MapReduce job to iterate the algorithm, checks to see if a termination condition has been met, and if not, repeats [187].

As presented in Section 5.3.3, just as the infinite horizon algorithm is obtained by extending the finite algorithm, the MapReduce based algorithm for the infinite horizon scenario can be obtained by extending the MapReduce based finite horizon algorithms. The mapper function could be used without modification in the infinite horizon algorithms. The improvement loop in the infinite horizon algorithm can be achieved by repeating lines 8 through 12 m+nImage times. Besides the modification on the reduce function, a modification on the driver is required. The iteration termination condition in the driver is changed from a fixed number to a comparison of norm and coverage tolerance.

5.3.4 Evaluation

This section discusses the proposed models and presents the evaluations of the proposed algorithms including finite horizon, infinite horizon, and MapReduce based algorithms.

Evaluation Cases and Default Parameter Setting

We generate 200 test cases of the proposed model in Section 5.3.2. To make the mobile device profile based on solid ground, we pick up the mobile device profiling parameters obtained in a previous work [289]. The maximum dynamic power consumption values in each mobile CPU and RF components, cCPUImage and cradioImage, are normally distributed with mean of 4.34 and 710, and variance of 1.46 and 48, respectively. The static power consumption values in each mobile CPU and RF components, PidleCPUImage and PbaseradioImage, are normally distributed with mean of 121.46 and 20, and variance of 9.20 and 4.86, respectively. To estimate the surrogate infrastructure, we pick up the cloud profiling parameters obtained in a previous experience report [81]. The CPU utility is uniformly distributed from 40%Image to 90%Image. The network throughput is uniformly distributed from 10%Image to 40%Image after normalization.

Besides the mobile device and cloud profiling, we use the default algorithm parameter values (see Table 5.3). These values may be changed in the experiments to show their impact on the algorithms.

Table 5.3

Default parameter setting

Parameter Default value
application and cloud m˜ Image 8
n 5
|S| 100
finite horizon N 3
β 0.7
infinite horizon L p L 2
m n n
ε 1
large state space |S| 1000

Image

Experiments on Finite Horizon

We first evaluate the norm of the reward sum trend along with the variance of forecast decision point number N for different confidence index β. Since the reward sum range of test cases vary, we normalize the reward sum against the maximum reward sum in the evaluation. The experiment result is shown in Fig. 5.12. The trend in the figure shows that the reward sum approaches the maximum reward sum as N increases. The approach follows a monotonically increasing trend. When the reward sum approximates a stable value (e.g., N is greater than 8 for β=0.7Image), we can claim that N is large enough to be considered as an infinite horizon scenario.

Image
Figure 5.12 N and β correlation in the finite horizon scenario.

In Fig. 5.12, when the confidence index is small (β=0.5Image), the reward sum converges after a short period (N=4Image). When β=0.7Image, the value for the reward sum to converge (N=8Image) is twice as that for β=0.5Image. The higher the confidence index, the larger the decision point number to make the expected reward sum converge. Since the N values for convergence are related to the iteration times in the infinite scenario, we can infer that the smaller the confidence index, the fewer iterations are required in the infinite horizon scenario.

We then evaluate the norm of the reward sum trend along with the variance of confidence index β. The experiment result is shown in Fig. 5.13. In the figure, the reward sum is normalized against the values of the default confidence index. The reward sum increases monotonically along with the confidence index. The higher the confidence index, the more reward values are added to the total considered reward, which leads to the higher norm value of the reward norm. The reward sum increases sharply when the confidence index approaches 1, which leads to a linear proportional relation between the reward sum and the forecast period N or an infinite horizon reward sum calculation failure. When the confidence index is small, the reward sum is steady because the reward sum mainly consists of rewards in several near future forecast periods.

Image
Figure 5.13 Reward sum vs. β in the finite horizon scenario.

Experiments on Infinite Horizon

In the infinite horizon algorithm, the main loop of the infinite horizon algorithm terminates using a condition controlled by the reward sum tolerance. We experiment with different tolerance and their corresponding main loop iteration cycles and show the results in Fig. 5.14. In the figure, the x-axis ranges from 1 times ε to 50 times ε, and the y-axis is the iteration cycle number that is normalized against the cycle number of the default ε situation. Obviously, the higher the tolerance, the sooner the iteration ends. A large tolerance means that larger reward sum values fall into the area of considered converged values, so fewer iterations may let the reward sum trend go into that area and terminate the iteration cycle. We also illustrate the reward sum of different ε in Fig. 5.15. Here, similar to Fig. 5.14, the x-axis ranges from 1 times ε to 50 times ε, and the y-axis is the reward sum that is normalized against the cycle number of the default ε situation. We can see that the reward sum decreases when the tolerance increases, which demonstrates the that the coverage area is enlarged by the large tolerance. In addition, the reward sum decreases proportionally to the tolerance variance, which is expected because the convergence area is enlarged by turbulence proportionally.

Image
Figure 5.14 Reward sum vs. N in the finite horizon scenario.
Image
Figure 5.15 Reward sum for different ε.

5.4 Evolving Mobile Cloud Computing

In the previous and this chapter, we saw how a mobile cloud system works. The world changes fast, as does the mobile cloud. In this section, we discuss several promising research areas of mobile cloud computing, hoping to inspire users explore future research ideas.

Semantic Compute Offloading

Information-centric networking (ICN) is initially conceptualized as a general form of communication architecture to achieve efficient content distribution on the Internet. ICN focuses on what (content) instead of where (host). This is to fulfill the primary demands that consumers are only interested in content itself, not its provenance, and publishers strive to efficiently distribute contents to consumers. To this end, ICN uses node or data attributes (e.g., content name, geo-location, or context) for routing rather than a specific node address (i.e., IP address). This decouples the content from the publishers. In this sense, content-based routing, geo-routing, and context-based routing can be classified into types of ICN [177].

Service discovery plays a key role in the computation offloading and service composition. The current mobile cloud offloading systems and strategies work based on the addresses. Thus, a system-wide central service registry or service broker is necessary to route the offloading request or to answer the service searching. When ICN is introduced to fulfill the service discovery of the mobile cloud offloading, the offloading architecture may be simplified and the service composition can be more flexible.

MicroService

A microservice [100] [179] [261] [214] is a minimal functional service module which is independently developed and deployed, and microservice architecture is an architecture of distributed software modules composed by a microservice which is rather an evolved software engineering pattern from successful field practice as opposed to an invented principle. The major characteristics of microservice include small, focused, self-contained service for componentization, loosely coupled architecture, clear boundary by contexts, autonomous and software architecture aligned development team, decentralized governance, design for failure, etc. These architectural characteristics bring many benefits such as capability of integration of heterogeneous technology, continuous delivery, resilience, scalability, and eventually a fast-evolutionary architecture.

Microservice patterns are mainly discussed in the context of large web based applications, while less focus has been on the IoT system. It is interesting to see that they actually share many similar characteristics [70] [172]. First, they have a similar loosely coupled architecture. A typical IoT system will integrate many devices and software components from different vendors, where each of them has its own life cycle. Second, most IoT systems need to integrate heterogeneous software components implemented on different hardware devices. To cope with the fast-evolving technology, some of them might be changed or updated without the influence of the other parts of the system. Third, communications among different software modules in an IoT system are usually based on well-defined message oriented interfaces, or REST API, which is similar to calling a service. Fourth, they both try to maintain minimum deployment and management effort in the field. The smaller the services, the easier it is to offload. Especially on the IOT devices, which are more resource constrained than smart phones, offloading the tasks to other devices might be necessary. Besides, the number of IOT devices may be much larger than that of phones, which leads to offloading scalability research topic.

Multistage Offloading

The present offloading model regards the mobile device and cloud as the only two layers in the model. However, more devices are involved in the mobile cloud system, such as IOT devices, vehicles, road site units, and mobile stations. These devices are equipped with computation and storage capability, which can host offloaded computation. The advantage of these devices compared to the Internet cloud is that they are closer to the user. Naturally, they can be candidate surrogates. A typical example is the vehicle cloud. When a smart phone connects to a vehicle, the computation can be offloaded from the phone to the vehicle, which is supposed to be faster than that offloaded to the Internet cloud due to network length. However, the computation and storage on the vehicle are still limited compared to the cloud. In some application scenarios, the vehicle cannot provide all the required resources and the vehicle may choose to offload the overload compute request to the road site unit or further Internet cloud. The cascading offloading for multistage offloading is more suitable in the present world where everything gets smart.

Bibliography

[47] E. Abebe, C. Ryan, A hybrid granularity graph for improving adaptive application partitioning efficacy in mobile computing environments, 10th IEEE International Symposium on Network Computing and Applications (NCA). IEEE; 2011:59–66.

[48] E. Abebe, C. Ryan, Adaptive application offloading using distributed abstract class graphs in mobile environments, Journal of Systems and Software 2012;85(12):2755–2769.

[70] B. Butzin, F. Golatowski, D. Timmermann, Microservices approach for the internet of things, Emerging Technologies and Factory Automation (ETFA), 2016 IEEE 21st International Conference on. IEEE; 2016:1–6.

[72] J. Chakareski, Adaptive multiview video streaming: challenges and opportunities, Communications Magazine, IEEE 2013;51(5):94–100.

[75] M. Chen, Y. Zhang, Y. Li, S. Mao, V. Leung, EMC: emotion-aware mobile cloud computing in 5G, IEEE Network 2015;29(2):32–38.

[81] C.J. Chung, H. Wu, Y. Deng, V-lab report for fall 2013. [Tech. Rep.] Arizona State University; 2013.

[85] A. Corradi, M. Fanelli, L. Foschini, VM consolidation: a real case based on OpenStack Cloud, Future Generation Computer Systems 2014;32:118–127.

[100] N. Dragoni, S. Giallorenzo, A.L. Lafuente, M. Mazzara, F. Montesi, R. Mustafin, L. Safina, Microservices: yesterday, today, and tomorrow, arXiv preprint arXiv:1606.04036; 2016.

[114] M. Gerla, Vehicular cloud computing, 2012 The 11th Annual Mediterranean Ad Hoc Networking Workshop (Med-Hoc-Net). 2012:152–155.

[116] I. Giurgiu, O. Riva, G. Alonso, Dynamic software deployment from clouds to mobile devices, Middleware. Springer; 2012:394–414.

[117] I. Giurgiu, O. Riva, D. Juric, I. Krivulev, G. Alonso, Calling the cloud: enabling mobile phones as interfaces to cloud applications, Middleware. Springer; 2009:83–102.

[125] R. Hall, K. Pauls, S. McCulloch, D. Savage, OSGi in Action: Creating Modular Applications in Java. Manning Publications Co.; 2011.

[131] C.-Y. Hsu, C.-S. Yang, L.-C. Yu, C.-F. Lin, H.-H. Yao, D.-Y. Chen, K.R. Lai, P.-C. Chang, Development of a cloud-based service framework for energy conservation in a sustainable intelligent transportation system, International Journal of Production Economics 2014.

[138] D. Huang, Mobile cloud computing, IEEE COMSOC Multimedia Communications Technical Committee (MMTC) E-Letter October 2011;6(10):27–31.

[140] D. Huang, T. Xing, H. Wu, Mobile cloud computing service models: a user-centric approach, IEEE Network 2013;27(5):6–11.

[153] W. Jung, C. Kang, C. Yoon, D. Kim, H. Cha, Devscope: a nonintrusive and online power analysis tool for smartphone hardware components, Proceedings of the Eighth IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis. ACM; 2012:353–362.

[157] D. Karaboga, B. Akay, A comparative study of artificial bee colony algorithm, Applied Mathematics and Computation 2009;214(1):108–132.

[160] R. Kemp, N. Palmer, T. Kielmann, H. Bal, Cuckoo: a computation offloading framework for smartphones, Mobile Computing, Applications, and Services. Springer; 2012:59–79.

[170] D. Kovachev, Framework for computation offloading in mobile cloud computing, IJIMAI 2012;1(7):6–15.

[172] A. Krylovskiy, M. Jahn, E. Patti, Designing a smart city internet of things platform with microservice architecture, Future Internet of Things and Cloud (FiCloud), 2015 3rd International Conference on. IEEE; 2015:25–30.

[177] E. Lee, E.-K. Lee, M. Gerla, S.Y. Oh, Vehicular cloud networking: architecture and design principles, IEEE Communications Magazine 2014;52(2):148–155.

[179] J. Lewis, M. Fowler, Microservices – a definition of this new architectural term, 2014.

[187] J. Lin, C. Dyer, Data-intensive text processing with MapReduce, Synthesis Lectures on Human Language Technologies 2010;3(1):1–177.

[188] K. Liu, Applied Markov Decision Processes. Tsinghua University Press; 2004.

[189] Y. Liu, An energy-efficient multisite offloading algorithm for mobile devices, International Journal of Distributed Sensor Networks 2013;2013.

[196] J.C. McCullough, Y. Agarwal, J. Chandrashekar, S. Kuppuswamy, A.C. Snoeren, R.K. Gupta, Evaluating the effectiveness of model-based power characterization, USENIX Annual Technical Conf.. 2011.

[206] R. Mittal, A. Kansal, R. Chandra, Empowering developers to estimate app energy consumption, Proceedings of the 18th Annual International Conference on Mobile Computing and Networking. ACM; 2012:317–328.

[208] A. Mtibaa, A. Fahim, K.A. Harras, M.H. Ammar, Towards resource sharing in mobile device clouds: power balancing across mobile devices, ACM SIGCOMM Computer Communication Review 2013;43(4):51–56.

[209] A. Mtibaa, K.A. Harras, K. Habak, M. Ammar, E.W. Zegura, Towards mobile opportunistic computing, Cloud Computing (CLOUD), 2015 IEEE 8th International Conference on. IEEE; 2015:1111–1114.

[214] S. Newman, Building Microservices. O'Reilly Media, Inc.; 2015.

[217] J. Niu, W. Song, M. Atiquzzaman, Bandwidth-adaptive partitioning for distributed execution optimization of mobile applications, Journal of Network and Computer Applications 2014;37:334–347.

[224] S. Ou, Y. Wu, K. Yang, B. Zhou, Performance analysis of fault-tolerant offloading systems for pervasive services in mobile wireless environments, IEEE International Conference on Communications (ICC). IEEE; 2008:1856–1860.

[228] T. Pham-Gia, N. Turkkan, System availability in a gamma alternating renewal process, Naval Research Logistics (NRL) 1999;46(7):822–844.

[231] M.-R. Ra, B. Priyantha, A. Kansal, J. Liu, Improving energy efficiency of personal sensing applications with heterogeneous multi-processors, Proceedings of the 2012 ACM Conference on Ubiquitous Computing. ACM; 2012:1–10.

[243] C. Shi, M.H. Ammar, E.W. Zegura, M. Naik, Computing in cirrus clouds: the challenge of intermittent connectivity, Proceedings of the First Edition of the MCC Workshop on Mobile Cloud Computing. ACM; 2012:23–28.

[244] C. Shi, P. Pandurangan, K. Ni, J. Yang, M. Ammar, M. Naik, E. Zegura, IC-cloud: computation offloading to an intermittently-connected cloud. [Tech. Rep.] Georgia Institute of Technology; 2013.

[245] D. Shin, K. Kim, N. Chang, W. Lee, Y. Wang, Q. Xie, M. Pedram, Online estimation of the remaining energy capacity in mobile systems considering system-wide power consumption and battery characteristics, 18th Asia and South Pacific Design Automation Conference (ASP-DAC). IEEE; 2013:59–64.

[249] K. Sinha, M. Kulkarni, Techniques for fine-grained, multi-site computation offloading, IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGrid). IEEE; 2011:184–194.

[250] M. Smit, M. Shtern, B. Simmons, M. Litoiu, Partitioning applications for hybrid and federated clouds, Proceedings of the 2012 Conference of the Center for Advanced Studies on Collaborative Research. IBM Corp.; 2012:27–41.

[261] J. Thönes, Microservices, IEEE Software 2015;32(1):113–116.

[266] T. Verbelen, T. Stevens, F. De Turck, B. Dhoedt, Graph partitioning algorithms for optimizing software deployment in mobile cloud computing, Future Generation Computer Systems 2013;29(2):451–459.

[269] Y. Wang, X. Lin, M. Pedram, A nested two stage game-based optimization framework in mobile cloud computing system, SOSE. 2013:494–502.

[274] R. Wolski, S. Gurun, C. Krintz, D. Nurmi, Using bandwidth data to make computation offloading decisions, IEEE International Symposium on Parallel and Distributed Processing (IPDPS). IEEE; 2008:1–8.

[275] H. Wu, D. Huang, Modeling multi-factor multi-site risk-based offloading for mobile cloud computing, 10th International Conference on Network and Service Management (CNSM). IEEE; 2014:230–235.

[276] H. Wu, D. Huang, MoSeC: mobile-cloud service composition, 3rd International Conference on Mobile Cloud Computing, Services, and Engineering (MobileCloud). IEEE; 2015.

[277] H. Wu, D. Huang, S. Bouzefrane, Making offloading decisions resistant to network unavailability for mobile cloud collaboration, 9th International Conference on Collaborative Computing: Networking, Applications and Worksharing (CollaborateCom). IEEE; 2013:168–177.

[281] C. Xian, Y.-H. Lu, Z. Li, Adaptive computation offloading for energy conservation on battery-powered systems, International Conference on Parallel and Distributed Systems, vol. 2. IEEE; 2007:1–8.

[285] L. Yang, J. Cao, Y. Yuan, T. Li, A. Han, A. Chan, A framework for partitioning and execution of data stream applications in mobile cloud computing, ACM SIGMETRICS Performance Evaluation Review 2013;40(4):23–32.

[286] C. Yoon, D. Kim, W. Jung, C. Kang, H. Cha, AppScope: application energy metering framework for android smartphone using kernel activity monitoring, USENIX ATC. 2012.

[289] L. Zhang, B. Tiwana, Z. Qian, Z. Wang, R.P. Dick, Z.M. Mao, L. Yang, Accurate online power estimation and automatic battery behavior based power model generation for smartphones, Proceedings of the Eighth IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis. ACM; 2010:105–114.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset