AFMEACI: A Framework for Mobile Execution Augmentation Using Cloud Infrastructure

AFMEACI: A Framework for Mobile Execution Augmentation Using Cloud Infrastructure Karishma Pawar1, Vandana Jagtap1, Mangesh Bedekar1, and Debajyoti Mu...
3 downloads 3 Views 269KB Size
AFMEACI: A Framework for Mobile Execution Augmentation Using Cloud Infrastructure Karishma Pawar1, Vandana Jagtap1, Mangesh Bedekar1, and Debajyoti Mukhopadhyay2 1

Maharashtra Institute of Technology, Department of Computer Engineering, Pune 411038 [email protected], {vandana.jagtap,mangesh.bedekar}@mitpune.edu.in 2 Maharashtra Institute of Technology, Department of Information Technology, Pune 411038, Maharashtra, India [email protected]

Abstract. Due to advancement in mobile device technology, mobile devices are becoming an inevitable part of human lives. In context of running massive applications on mobile devices, users can’t utilize the potential of mobile devices in an efficient manner since mobile devices are constrained by processing power, memory requirements and battery capacity. To alleviate this resource scarcity problem of the mobile devices, mobile cloud computing is the most promising solution which combines the technologies from both the mobile computing and the cloud computing. The execution of heavy application on mobile devices is augmented by powerful and resource-abundant cloud servers. This is achieved by partitioning an application into tasks such that the computational intensive tasks are offloaded to cloud and after executing task on cloud, results are sent back to mobile device, referred to as computation offloading. In this paper, we have put forth a scalable, fault-tolerant framework for dynamically and optimally partition the application using our proposed genetic algorithm. Keywords: Augmented Execution, Computation Offloading, Mobile Cloud Computing, Partitioning.

1

Introduction

The mobile devices like smartphones are playing significant roles in human lives due to seamless features and productivity. The ease of user friendly interface, high definition graphics, customized application installment, compact size, portability, multi-card Subscriber Identity Modulefacility, multi-mode service operation, multiband connectivity, high responsiveness, multimedia application support, etc features of mobile devices have attracted attentions of users worldwide. The demand of mobile phones is increasing in a tremendous way. A survey states that, in 2014more than1.1 billion phones will be shipped worldwide and is expected to rise over 1.5 billion in 2017 as predicted by International Data Corporation Market Research Company [1]. M.K. Kundu et al. (eds.), Advanced Computing, Networking and Informatics - Volume 2, Smart Innovation, Systems and Technologies 28, DOI: 10.1007/978-3-319-07350-7_49, © Springer International Publishing Switzerland 2014

441

442

K. Pawar et al.

In-spite of advancement in computer and communication technology, mobile devices can’t reach full potential for the execution of high-end applications. These include computer vision applications, augmented reality applications, face and object recognition applications, natural language processing applications, file indexing in mobile system applications, virus scanning applications, optical character recognition applications, image and video processing applications, health monitoring applications, 3D gaming applications, etc. These applications require high processing speed, large memory and battery backup to execute efficiently and accurately. However, these application requirements are not fulfilled by mobile devices. Therefore, to ameliorate resource scarcity of mobile phones, computation offloading provides the best solution in mobile cloud computing. According to Wikipedia [2], mobile cloud computing is defined as “The state-of-the-art mobile distributed computing paradigm comprising of three heterogeneous domains of mobile computing, cloud computing, and wireless networks that aims to enhance computational capabilities of resource-constrained mobile devices towards rich user experience.” The computation offloading is the method of migrating entire or partial application tasks from mobile device to the resource-abundant and powerful cloud servers for execution bringing optimization in objective function. From contribution point of view, we have proposed concurrent, scalable, faulttolerant, distributed application processing framework supporting the dynamic partitioning approach for partitioning of massive application applied in mobile cloud computing paradigm. A genetic algorithm is devised to optimally partition the application providing run-time support. The contents of the paper are portrayed as follows: The Section 2 deals with the literature survey of partitioning techniques. The system architecture and implementation details of the proposed method are discussed in Section 3. The design of optimal partitioning genetic algorithm is elaborated in Section 4. The paper is concluded in Section 5.

2

Related Work

This section deals with the types of partitioning methods adopted in various offloading environments. How the partitioning can be achieved is discussed along with pros and cons of each partitioning approach in our survey paper augmented execution in mobile cloud computing [3]. According to us, application partitioning is meant as the methodology of splitting the resource-consuming application into computationally intensive tasks (parts) with intention of execution on cloudservers having powerful resources. Generally, two types of partitioning are considered viz. static partitioning and dynamic partitioning. The static partitioning involves separation of computational intensive components at compile time statically [4], [5]. It results into fixed number of partitions. They are only suitable in conventional Internet computing. They don’t consider varying load of CPU (Central Processing Unit), Network parameters and can’t utilize elastic property of cloud resources. So, dynamic partitioning seems to be the best option for partitioning purpose.

AFMEACI: A Framework for Mobile Execution Augmentation

443

Dynamic partitioning is a robust technique which partitions application at run time taking into account varying CPU load on mobile device and network parameters and utilizes elastic resources of cloud server [6], [7], [8], [9], [10].MAUI (Mobile Assistance Using Infrastructure) [6] uses managed code environment feature of .NET Common Language Runtime by Microsoft. The code portability feature allows MAUI to write the separate application code for both the smartphone and cloud server’s CPUs exhibiting different instruction sets. MAUI suffers from scalability problem. Also programmer has to write the code for cloud as well as smartphone for running the framework, hence, increases the burden on programmer. CloneCloud [7] supports the thread level migration. When the massive application is launched, then depending upon the current available cloud resources and network conditions, partition file is generated which contains migration and integration points for methods. CloneCloud does not support on-demand allocation of resources. Agent-based application partition is implemented in [8]. The mobile agent encapsulates the application code and gets executed on any server platform on behalf of the owner. This approach lacks mobile agent authentication and so fake mobile agents can access the cloud service. In [9], the data stream application is represented as a dataflow graph representing the components. Adaptive execution of partitioning is supported which checks the CPU load, bandwidth at run time. Maximizing the throughput of data stream applications is the main objective function. ThinkAir [10] provides scalability in virtual machines at cloud side and supports parallel execution of tasks by assigning more virtual machines. But it does not give mechanism for efficient data transfer between mobile device and cloud. Like MAUI, it too increases coding overhead on programmer. Calling the cloud [11] uses R-OSGi (Remote Services for OSGi-Open Source Gateway initiative) for module management and Alfred-O model [12] as a deployment tool. Bundles (Software modules) are offloaded to cloud for execution. Due to coarse level of migration granularity, bundle can expose to unauthorized access and security of data might get hampered. Dynamic partitioning best suits in offloading context which exploits the elastic resources of cloud and execute applications adaptive to changing mobile’s and network parameters.

3

System Model

This section deals with the system architecture of the proposed approach and detailed discussion of implementation of the system. a.

System Architecture

The computation offloading scenario is depicted in Fig.1. Broadly speaking, the offloading scenario consists of 3 crucial components viz. mobile device, Internet wireless network and cloud server. The mobile device is connected to cloud using wireless technology like 3G, LTE (Long Term Evolution), or Wi-Fi (Wireless Fidelity) for accessing services from cloud. Due to mobility requirements of mobile device, mobile device runs location based services that consumes a lot of resources on it.

444

K. Pawar et al. Input Parameters: • Response Time • Bandwidth • User Data

Constraints: • Dynamic Environment • Migration Granularity

Offloading massive components to cloud

Offloading Decision Module Heavy application on Mobile Device RESOURCE CONSTRAINED MOBILE CLIENT

Result of executing components

WIRELESS NETWORK Output: • Max. Performance • Max. Throughput

RESOURCE ABUNDANT COMPUTATIONAL CLOUD SERVER

Fig. 1. Proposed System Architecture

The Internet bandwidth goes on fluctuating continuously. Therefore, mobile device is said to be resource-constrained by processor speed, memory, battery backup and bandwidth. On the contrary, cloud server has ample of processing speed, storage and power. So it is resource-abundant in nature. When any massive application gets launched on mobile device, its execution speed can be accelerated by offloading the heavy components onto cloud. Due to this, the computation time is saved as the application’s components are executed by powerful processors on cloud and hence performance of mobile device gets enhanced. But, the question arises which components should be offloaded to cloud so that the execution time of the application can be enhanced. This decision is taken by the offloading decision module deployed on cloud which runs the genetic algorithm put forth by us. This decision is taken on-the-fly considering continuously changing parameters like bandwidth and response time of executing the components under varying CPU load conditions.In this way, the proposed approach works on dynamic partitioning with the objective function of enhancing the throughput of application considering response time of component to execute the task. The two costs are considered for partitioning viz. computation cost and communication cost. The computation cost constitutes the time required by processing the components on both the mobile device and the cloud servers. The communication cost is the cost required for transferring the data and control information between the mobile device and the cloud. The data required for executing the application is sent to the cloud. The data in the form of results is sent back to mobile device from cloud.

AFMEACI: A Framework for Mobile Execution Augmentation

445

The control information constitutes the mobile phone number, name of component, etc is sent to cloud. This is explained in more detailed manner in section 3.2. b. Implementation Details The Fig.2. shows the application framework for augmented execution in mobile cloud computing paradigm. The mobile client side monitors the response time of the execution of components under varying CPU load and bandwidth. When an application is launched on mobile device, then request from mobile device is sent to the cloud controller in cloud. The cloud controller assigns node for the mobile device and allocates the resources for node. The node controller acts as an interface for accessing the services offered by nodeand maintains the status of node. Initially, node asks the device characteristics (Response time) from mobile client. Taking this information as an input, node generates partitioning result using our proposed genetic algorithm. Partitioning result states which components should be executed on cloud so that processing of application execution can be enhanced. To achieve concurrent, fault tolerant, distributed and scalable framework, we have implemented the actor-based programming model provided by akka toolkit (version 2.2.3) [11] which works on the message-passing paradigm. Whenever message is sent to the actor-based model, the message is first accepted by actor’s reference. All messages are queued up in the actor’s mailbox. Dispatcher sends these messages to Actor for execution when mailbox dequeue message. After execution, Actor sends task execution notification to dispatcher to dequeue next message from mailbox for execution. After completing the whole procedure of execution, actor sends the task execution status to cloud controller. Akka toolkit frees the programmer from issues of resource management and managing scalability. The communication between all components deployed on both the mobile and cloud is governed by HTTP (Hypertext Transfer Protocol). The node is responsible for managing the data and control flow from the mobile client. To uniquely identify which mobile is requesting for execution, profiler on the mobile device maintains and communicates following details to the profiler on node of cloud using a reliable Redis message queue [12]. ─ Mobile phone number to uniquely identify the mobile device onto cloud server ─ Time required by component to execute task on the mobile device i.e. response time of component and Component name ─ Name of application currently being executed by mobile device or cloud ─ Current status of executing location of component i.e. where the component currently get executed (either mobile device or cloud) When the mobile device connects with server, above information along with the task list is pushed in message queue. The controller on mobile device is responsible for maintaining the thresholds on performance measuring parameters mentioned.

446

K. Pawar et al.

Cloud Controller

Node Controller Node Controller Mobile Device

Actor

Dispatcher

Node Mailbox Queue

Node Controller Node Controller

Actor

Dispatcher

Node

Mobile Device

Mailbox Queue Mobile Client Request Data and Control Communication Node Status Task Execution Reuest (TaskList) Deque the task Task Completion Notification Process the task Task Execution Status

Fig. 2. Application Framework Overview

We have considered threshold as “When 80% resources of performance measuring parameters are consumed then the request for modifying the partitioning result is sent to the solver present on node of cloud”. The solver then runs genetic algorithm in an iterative manner to get updated partitioning so that the processing speed of an application can be maximized. The genetic algorithm takes response time of the components as an input parameter for calculating the throughput. The algorithm chooses the partitions giving maximized throughput. It is a robust algorithm and gives the best results from huge solution search space even though the input parameters are changing continuously. We have deployed whole program (code) of the framework on cloud. So, for heavy components to execute on cloud, data required for running those components is

AFMEACI: A Framework for Mobile Execution Augmentation

447

offloaded to executer on cloud from mobile device. We have developed a framework using java. For achieving the partitioning, there should be loose coupling between the Java components/classes. To achieve the class level granularity, we have used Dependency Injection feature of spring framework (version 3.2.5) [13-15].

4

Design of Genetic Algorithm for Partitioning

For optimally partitioning the application we have designed genetic algorithm shown in Algorithm 1.The parameters used are denoted as: ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─

Components running on mobile device = C1, C2,.,Cn Total number of components running on mobile = n Virtual Machines available on cloud = V1, V2,.,Vm Virtual Machines consumed by cloud = V1’, V2’,.,Vp’ Total number of virtual machines available on cloud = m Total number of virtual machines consumed by cloud= p The condition p • m must be followed Total mobile CPU usage = UsageCPU Total mobile memory usage = UsageMEM Threshold CPU = ThCPU Threshold memory = ThMEM Time at which input data is given to component ifor processing = INCi Time at which component i gives the output after processing data = OUTCi Time in milliseconds required by component i to execute on mobile device = RETi

The optimization problem is given as “Select the massive components of a partitioned application such that their response time is maximum and offload them to cloud”. The Performance in terms of maximum Response time is calculated as eq. 1. .

for

1,2, . . ,

(1)

We consider the partitions of an application as the population of individuals. The individuals which higher response time will be selected by the fitness function and offloaded to cloud for execution. Let us say, application is defined by the total set of components running as {C1, C2, C3,.., Cn}. From Genetic Algorithm point of view using binary encoding, we will denote these components as the bits 0 and 1. 0 is used for denoting the components executing on cloud and 1 is used for the components executing on mobile device. For example, if an application has 5 components. If the components C1, C2, C3 executes on cloud while C4 and C5executes on mobile device, then the partition is represented as {0,0,0,1,1} according to binary encoding. Initially, we generate random population from the input population size PS (Step 1). We have applied elitism in our algorithm which facilitates to keep the individual with the best fitness in the population without undergoing mutation. elitism – boolean variable is used for checking the elitism. If elitism is to be applied (Step 3), then the

448

K. Pawar et al.

best individual is obtained from the population (Step 4) and saved (Step 5). The flag elitismOffset is set to 1 to specify that the selected Best individual won’t undergo mutation (Step 6); otherwise it is set to 0 (Step 9). Algorithm: Optimally Partitioning Genetic Algorithm Input: PS, TS, CR, MR PS: Population Size TS: Tournament Size CR: Crossover Rate MR: Mutation Rate Output: Optimal partitioning result 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24.

newPopulation• GenerateRandomPopulation( GenerateRandomPopulation(PS) while (Request_To_Stop ! = true) do if (elitism) Best_Individual•Get GetMaxFitness(newPopulation) newPopulation • SaveIndividual(Best_Individual) SaveIndividual( elitismOffset•1 if end else elitismOffset• 0 else end fori •elitismOffsettoi