A virtual cloud computing provider for mobile ... - ACM Digital Library

32 downloads 115145 Views 437KB Size Report
Jun 15, 2010 - the target provider for the application is changed, reflecting a ... of cloud computing to execute mobile applications in behalf of the device.
A Virtual Cloud Computing Provider for Mobile Devices Gonzalo Huerta-Canepa

Dongman Lee

KAIST 335 Gwahak-ro, Yuseong-gu Daejeon, South Korea +82-42-350-7759

KAIST 335 Gwahak-ro, Yuseong-gu Daejeon, South Korea +82-42-350-3559

[email protected]

[email protected]

ABSTRACT A mobile device like a smart phone is becoming one of main information processing devices for users these days. Using it, a user not only receives and makes calls, but also performs information tasks. However, a mobile device is still resource constrained, and some applications, especially work related ones, usually demand more resources than a mobile device can afford. To alleviate this, a mobile device should get resources from an external source. One of such sources is cloud computing platforms. Nevertheless an access to these platforms is not always guaranteed to be available and/or is too expensive to access them. We envision a way to overcome this issue by creating a virtual cloud computing platform using mobile phones. We argue that due to the pervasiveness of mobile phones and the enhancement in their capabilities this idea is feasible. We show prior evaluation results to support our concept and discuss future developments.

Categories and Subject Descriptors C.2.4 [Distributed Systems]: Cloud Computing

General Terms Experimentation

Keywords Cloud Computing, Mobile Phones, Ad Hoc.

1. INTRODUCTION Mobile phones are becoming pervasive. According to the latest reports, the number of mobile phone subscriptions is close to 4.6 billion [1], which means that there is one mobile phone every two person in the world. Mobile phones are no longer a luxury, but a must. Given the advances in mobile phones, users start to consider a mobile phone a personal information processing tool. That is, a user expects to execute any application on top of a mobile device. However it still lacks in resources compared to a conventional information processing device such as a workstation or a laptop. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. ACM Workshop on Mobile Cloud Computing & Services: Social Networks and Beyond. MCS’10, June 15, 2010, San Francisco, California, USA. Copyright 2010 ACM 978-1-4503-0155-8…$10.00.

One of ways to overcome this limitation is mobile cloud computing [2]. It allows resources in cloud computing platforms such as Amazon EC2, Microsoft Azure, and Google AppEngine to be used to overcome the lack of local resources in mobile devices. Previous researches in this area explore this possibility by enabling a mobile device as a client [3, 4, 5, 6] and as both client and resource provider [7] to cloud computing platforms. These approaches port traditional cloud computing frameworks to mobile devices. In both, management of mobile devices and jobs is done at a coordinator located on the infrastructure. However, this hinders a mobile user from enjoying a cloud computing service if a connection to the cloud computing platform is either unavailable or too expensive to afford. , In this paper, we present the guidelines for a framework to create virtual mobile cloud computing providers. This framework mimics a traditional cloud provider using mobile devices in the vicinity of users. The framework detects nearby nodes that are in a stable mode, meaning that will remain on the same area or follow the same movement pattern. If nodes in that state are found, then the target provider for the application is changed, reflecting a virtual provider created on the fly among users. The proposed approach allows avoiding a connection to infrastructure-based cloud providers while maintaining the main benefits of offloading. The rest of the paper is organized as follows section 2 shows previous work on the area; then the motivation, considerations and architecture are shown in section 3. Section 4 and section 5 describe preliminary implementation and its results, respectively. Finally we conclude in section 6.

2. RELATED WORK Integration between mobile devices and cloud computing is presented in several previous works. Christensen [3] presents general requirements and key technologies to achieve the vision of mobile cloud computing. The author introduces an analysis on smart phones, context awareness, cloud and restful based web services, and explains how these components can interact to create a better experience for mobile phone users. Luo [4] introduces the idea of using cloud computing to enhance the capabilities of mobile devices. The main goal of this work is to show the feasibility of such implementation, introducing a new partition scheme for tasks. The best point about this paper is the considerations about using the cloud to back mobile computing. Giurgiu et al. [5] use the cloud as the container for mobile applications. Applications are pre-processed based on the current context of the user, so only the bundles that can run on the local device and minimize the communication overhead with the cloud

are offloaded to the mobile device from the cloud. They focus on partition policies to support the execution of application on mobile devices, and do not tackle any other issue related to mobile cloud computing. Chun and Maniatis [6] explore the use of cloud computing to execute mobile applications in behalf of the device. They propose the creation of clone VMs to run applications/services the same way that they will run on mobile devices in order to avoid inconsistencies produced to run part of a program in different architecture. Their work is strongly tied to distributed file systems, and assumes connectivity to the cloud.

This can be achieved by maximizing the number of operations that can be executed while waiting for a result from other node [11] if the communication overhead does not affect the overall performance. However these two aspects lack incentives for users to share their resources. A way to overcome this is by finding users pursuing the same task, and splitting the elements of the task among them. . Since only a portion of the task is executed locally, nodes can save energy compared with a complete local execution. The following scenario reflects potential benefits of this collaboration.

Marinelli [7] introduce Hyrax, a mobile cloud computing client that allows mobile devices to use cloud computing platforms. Based on Hadoop1, the main focus of this work is to port a client into a mobile device to enable the integration. The author introduces the concept of using mobile devices as resource providers, but further experimentation is not included. Similar work has been done in grid computing. Black and Edgar [8] demonstrate the feasibility of using mobile devices as part of a grid. They create a VM to emulate x86 instructions on top of an iPhone. The usage of a VM hurts performance, but solves heterogeneity and also enables the execution of pre-existing clients. Even though the general concept is promising, there are no real considerations about mobility and collaboration.

"Peter is visiting South Korea. He takes a city tour that will visit several museums and places in companion of a group of foreigners. At one museum he becomes intrigued with some form of art from ancient times, but he cannot get more information since the description of this picture is in Korean. Fortunately he has a translator on his mobile phone that is able to handle Korean. He takes a picture of the text and passes it through OCR software. However his mobile phone is not capable of processing the whole text. He could connect to Internet and use a remote server to process it, but the cost of roaming for data is prohibited to him. Instead he checks for other users that are also interested in reading the material, and request resources from their mobile devices. The other users - realizing that the common processing is useful for them - create an ad hoc network with Peter. He is now able to translate the text, and stores the information on his mobile device to share with the other users when they need it."

3. Using Mobile Devices as a virtual cloud computing provider 3.1 Motivation and Scenario If we consider the case of offloading to devices with similar characteristics, in which the performance will be similar to the source node, the overall performance of the task will be worse than running it on a single device due to the migration overhead. Therefore we need to explore what makes the offloading to similar devices beneficial. On an economical basis, accessing cloud computing providers is associated with two costs: the cost of networking plus the cost of using the provider’s resources. The latter is not high nowadays - it can be as cheap as 5 USD per month considering the access of a small on-demand server 2 hours per day 2 - but is expected to increase to reach higher levels of uptime and better support [9]. On the other hand, wireless data fee is still very high. As an example, in South Korea the subscription plans for the iphone3GS(32GB) are near 70 USD per month, and if the user wants to download 1 GB of data he has to pay more than 200 USD. Besides, using 3G connectivity consumes more battery and is slower than network interactions with nearby devices using other interface such as WiFi [10]. On a technical side, there are several benefits to consider: First, we still preserve conventional offloading benefits, such as allowing applications that cannot, otherwise, be executed on mobile devices due to a lack of resources. For example, if memory is not enough then creating instances of those objects on any remote device will allow the application to be executed. Second, performance can be enhanced if the execution sequence of an application can be reordered for increasing the level of parallelism.

1

http://hadoop.apache.org/

2

http://calculator.s3.amazonaws.com/calc5.html

The scenario above shows the potential of applications in which an ad hoc mobile cloud solution can be of benefit. This scenario is not unusual in place-based activities. Collocation increases the opportunity of sharing common goals/activities among different users, giving them a reason to share their resources. Kangasharju et al. [12] expose that people’s interaction is given by the environment, and therefore they tend to share similar tasks. This is especially true in the case of groups performing an activity together, like visiting a museum or performing archeological expeditions in the dessert, etc. These place-bound activities present an extra interest: since they occur at a fix location, in which nodes’ movement is reduced, connectivity is more stable, leading to fewer disconnections and faults. Another similar case is a situation where a mobile device delegates its task to other nodes that are already running the same task in order to save energy and/or resources [13]. For example, when a user wants to download a P2P file, he may contact another node that is already downloading the file, which means that he has already discovered a higher number of nodes, and therefore can download the file faster. Such collaborative task is highly probable in collocation. In summary, mobile devices can be a virtual cloud computing provider: their pervasiveness means the increasing availability of nearby devices; they are more powerful over the time; they include different network interfaces allowing devices to communicate with each other (with no money cost); moreover they allow us to create communities in which we can execute shared tasks.

3.2 Design Considerations To exploit a collection of nearby mobile devices as a virtual cloud computing provider, we believe that it should have the features as follows:

-

Resource monitoring and management to recognize when a task cannot be locally executed on a mobile device.

first time. Once an application is modified, its modified copy is used to avoid further delays.

-

Seamless integration with the existing cloud APIs. If applications are developed using a certain interface provided by a cloud host, the goal is to mimic the same API on top of the ad hoc mobile P2P cloud.

-

A partition and offloading scheme suitable for mobile devices. If an application is not built for cloud, or the job defined is too heavy, job splitting is required.

-

Activity detection to find users of the same or similar goals. This detection should focus on detecting the task per se and to determine if users will remain together to minimize potential disconnections.

The Resource Manager is in charge of application profiling and resource monitoring on a local device. For each application, a profile is defined in terms of the number of remote devices needed to create a virtual cloud, and sensibility to privacy and amount of resources needed for the migration to happen (in average). This profile is checked by the application manager whenever an application is executed in order to determine whether an instance of the virtual provider should be created or not.

-

Spontaneous interaction network support. In order to create a virtual cloud provider, the discovery and selection of mobile devices is needed.

-

A memory cache scheme to save intermediate results.

-

Lightweight and resource friendly architecture. We must not introduce excessive overhead that consumes resources on a local device in a faster pace than local execution.

3.3 Architecture The process for the creation and usage of a virtual cloud provider is simple: If a user is at a stable place and wants to execute a task which need more resources than available at the device, the system listens for nodes in the vicinity. If available, the system intercepts the application loading and modifies the application in order to use the virtual cloud. To support this process, we propose the architecture shown in Figure 1. It consists of five main features: Application manager; Resource manager; Context manager; P2P component and; Offloading manager.

The Context Manager wields and synchronizes contextual information from context widgets and makes it available in some way for other processes. It is composed by three subcomponents: context widgets that communicate with the sources of information; a context manager itself that handles the information and extracts new contexts from them; and a social manager that is used to store the knowledge regarding relationship between users. Two basic contexts are of utter importance: the location and number of nearby devices. The former is used for the mobility traces. The later for the enabling of a cloud from the application manager, and it is given by the P2P component. This component is aware of the status of the devices in the surroundings: it sends events to the context manager in case a new device enters the space, or if an existing device leaves the space. It utilizes an ad hoc discovery mechanism, and then groups the nodes using a P2P scheme, allowing for better scalability and distribution of contents. Once that information is captured, a context aggregator located in the context manager generates high level contexts from the basic contexts. They represent the consolidated information related to the user. We only define one high level context for this framework, which is whether the user is in a stable location or not. More details are in the next section. The Offloading manager component is in charge of sending and managing jobs from the node to other remote devices, plus receiving and processing jobs sent from them. It communicates with the P2P component once a job is issued to the respective node, and waits for the results to be delivered back to the application. This component is the one in charge of detecting failures in the execution and to re-emit them. It also is in charge of creating protected spaces for the execution of the tasks coming from remote nodes. This protected spaces (represented here as a VM), are utilized to block the access to sensitive data located on the devices.

4. CURRENT IMPLEMENTATION Figure 1. General architecture for the ad hoc mobile cloud.

The Application Manager is in charge of launching and intercepting an application at loading time and modifying an application to add features required for offloading – proxy creation, RPC support - according to the current context. Since the idea is to replace calls to infrastructure-based clouds, the interception and modification should focus on modifying the reference to that provider with a reference to the virtual provider. This process is performed when an application is executed the

We implement a prototype of our framework in Java. It was selected because it provides all the needed capabilities in terms of intercepting the loading, modifying the classes and also there were implementations available for cloud computing providers and clients on top of this platform. This project consists of two sub-implementations: -

Cloud computing provider client

-

Ad Hoc mobile cloud framework

Both are developed based on Hadoop, a cloud computing platform from Apache. For the former, we used Retroweaver3 to port a client of Hadoop to Java 1.4, ensuring that it will run on top the PhoneME4, Mysaifu5 and JamVM6, the selected target VMs for the mobile devices. For the later, we exploit the Hadoop’s API and create our own implementation. Most of the classes and interfaces related to the filesystem were replaced by direct downloads from the source mobile device, while the map/reduce framework calls were replaced to RPC methods implemented using the Jabber RPC extension described below. A main issue was to modify applications in order to intercept and replace references to infrastructure-based clouds with mobile ones. In Java, code interception can be done using bytecoders in conjunction with a personalized class loader component, built on top of regular JVM loader. A bytecode generator creates and injects the needed code, while the loader allows the interception of the classes before loading them in memory. A personalized version of Javassist[14] was utilized for this purpose. Communication between devices is based on the Extensible Messaging and Presence Protocol (XMPP). We modify Yaja!7 a XMPP client implemented in Java. The modifications allow us to be able to execute Yaja! on mobile devices and to incorporate two extensions for XMPP: Serverless Messaging8 and Jabber RPC9. The former is based on mDNS and ZeroConf, and allows for the discovery and messaging among devices without the need of an infrastructure. The latter is a scheme based on XML-RPC using XMPP as the transport protocol, and it is utilized to execute the remote tasks associated with a cloud job.

5. PRELIMINARY EVALUATION AND DISCUSSION We conduct a preliminary evaluation to evaluate the feasibility of our approach in situations where each input data for the distributed jobs is small (less than 100kb). The scenario exposed in our motivation is used for this analysis.

5.1 Evaluation settings

Communication was performed using Ad Hoc WIFI for communication between the mobile devices, and using an 802.11b/g compatible access point for accessing the servers. A Korean OCR that reads an image and scans for the Korean characters and then presents a Romanize version of them was developed for testing purposes. This work is based on a previous Korean OCR developed by Nemeth et al. 10

5.2 Preliminary Results and Discussion Preliminary results of performing offloading between two mobile devices are shown in figure 2. Current results show that the execution of tasks is slightly slower than executing it directly on the mobile device (less than 1% slower in average). In the figure, we can observe that offloading preparation and waiting time takes approx. 44% of the execution time, while the processing time itself is approx. 56%. This shows that the performance is not harmed with small files. Based on the work by Kristensen and Bouvin [16], we can assume that the saving in processing time implies a saving in energy (if mobile device goes to idle state while waiting for results), but further tests are required to validate this. Some lessons are learned from the usage of our mobile cloud computing client. Since Hadoop suffers from low performance with small files [15] since it is programmed to create a new JVM per each map processing. We modify this behavior by changing the value of the “mapred.job.reuse.jvm.num.tasks” option for best performance, configuring with an infinite number of reuse. The gain was of 2% for the average performance and of 3% for the best one. Moreover, multiple small files trigger memory problems since Hadoop creates one record in the data table for each file. Concatenation of input files can resolve this problem, but we found that this is not always possible. Let’s take as an example the compression of images. We cannot concatenate pictures because the result will not be the expected one. There is one more problem with small files that we found during our test: During start up, each DataNode scans its file system and provides the NameNode with the information which files it is storing. The more files there are, the longer this takes in scanning and networking.

Enabling a cloud computing client on mobile devices was not an easy task. Test on top of windows mobile devices with PhoneME and Mysaifu were futile, and we were not able to execute the client on these devices. The main problem was the lack of needed APIs, such as Sun’s reflection on the PhoneME environment. We have more luck running a client on a jailbroken Ipod Touch with JamVM as the Java VM. However, we were not able to run the latest version of Hadoop (0.23), and the 0.18 was utilized. The cloud computing provider was set up using Hadoop on a farm composed of four servers. OpenJDK VM 6 is used on the servers.

3

http://retroweaver.sourceforge.net/

4

https://phoneme.dev.java.net/

5

http://www2s.biglobe.ne.jp/~dat/java/project/jvm/index_en.html

6

http://jamvm.sourceforge.net/

7

http://yaja.sourceforge.net/

8

http://xmpp.org/extensions/xep-0174.html

9

http://xmpp.org/extensions/xep-0009.html

Figure 2. Performance of Mobile Offloading compared to local execution. Results are normalized to local execution (value 1).

10

http://www.inf.unideb.hu/~ssip/teams/team3/

6. CONCLUSIONS AND FUTURE WORK

[6]

In this paper, we present the motivation and preliminary design for a framework to create Ad Hoc cloud computing providers. This framework takes advantage of the pervasiveness of mobile devices, creating a cloud among the devices in the vicinity, allowing them to execute jobs between the devices. The work presented here is preliminary, and creates the foundation for future work.

B. Chun and P. Maniatis, "Augmented Smartphone Applications Through Clone Cloud Execution," HOTOS workshop, USENIX, 2009.

[7]

E. Marinelli, "Hyrax: Cloud Computing on Mobile Devices using MapReduce,", Master Thesis Draft, Computer Science Dept., CMU, September 2009.

[8]

M. Black and W. Edgar, "Exploring mobile devices as Grid resources: Using an x86 virtual machine to run BOINC on an iPhone," 2009 10th IEEE/ACM International Conference on Grid Computing, IEEE, 2009, pp. 9-16.

[9]

D. Durkee, "Why cloud computing will never be free," Communications of the ACM, vol. 53, 2010, pp. 62-69.

[10]

E. Cuervo, A. Balasubramanian, D.K. Cho, A. Wolman, S. Saroiu, R. Chandra, and V. Bahl. "MAUI: Making Smartphones Last Longer with Code Offload", in Proceedings of the 8th ACM Mobisys, June 2010.

[11]

O. Bushehrian, "Automatic actor-based program partitioning," Journal of Zhejiang University SCIENCE C, vol. 11, number 1, 2009, pp. 45-55.

[12]

J. Kangasharju, J. Ott, and O. Karkulahti, "Floating Content: Information Availability in Urban Environments," Proceedings of the 8th Annual IEEE International Conference on Pervasive Computing and Communications (PerCom) (WiP), Mannheim, Germany: 2010.

[13]

A. Berl, H. Meer, H. Hlavacs, and T. Treutner, "Virtualization in energy-efficient future home environments," IEEE Communications Magazine, vol. 47, 2009, pp. 62-67.

[14]

S. Chiba and M. Nishizawa, "An easy-to-use toolkit for efficient Java bytecode translators," Generative Programming And Component Engineering; Vol. 48, 2003.

[15]

Hadop, the small files problem. Online at : http://www.cloudera.com/blog/2009/02/the-small-filesproblem/. Accessed on March 2010.

[16]

M.D. Kristensen and N.O Bouvin, "Using Wi-Fi to Save Energy via P2P Remote Execution". Mobile Peer-toPeer workshop in conjunction with Eighth Annual IEEE International Conference on Pervasive Computing and Communications (Percom 2010), Mannheim, 2010

As a future work, the usage of mobility traces will be considered to create stable communities and not only places. In certain occasions a user is moving with other users as a community, and even though each one of them is never on a stable place, they create a stable group in which tasks can be distributed. Also, further considerations related to the usage of context awareness for fault tolerance must be introduced. For instance, replication of jobs based on the instability of the nodes in the network. If a node is marked as not stable in the area that does not means that we are not able to use it as part of the cloud, but jobs sent to it can be replicated to another unstable node, gaining a delta of confidence that the task will be completed.

ACKNOWLEDGEMENT This work was supported at the IT R&D program of MKE/KEIT under grant KI001877 [Locational/Societal Relation-Aware Social Media Service Technology].

REFERENCES [1]

Wikipedia, "Mobile phone - Wikipedia, the free encyclopedia," Accessed March 2010, http://en.wikipedia.org/wiki/Mobile_Phones.

[2]

K. Kumar and L. Yung-Hsiang, "Cloud Computing for Mobile Users: Can Offloading Computation Save Energy?," IEEE Computer , vol.43, no.4, pp.51-56, April 2010. doi: 10.1109/MC.2010.98

[3]

J.H. Christensen, "Using RESTful web-services and cloud computing to create next generation mobile applications," Proceeding of the 24th conference on Object oriented programming systems languages and applications - OOPSLA '09, New York, New York, USA: ACM Press, 2009, p. 627.

[4]

[5]

X. Luo, "From Augmented Reality to Augmented Computing: A Look at Cloud-Mobile Convergence," International Symposium on Ubiquitous Virtual Reality, vol. 0, 2009, pp. 29-32. I. Giurgiu, O. Riva, D. Juric, I. Krivulev, and G. Alonso, "Calling the cloud: enabling mobile phones as interfaces to cloud applications," Middleware '09: Proceedings of the 10th ACM/IFIP/USENIX International Conference on Middleware, New York, NY, USA, 2009, pp. 1-20.