[ieee 2014 ieee international conference on pervasive computing and communication workshops (percom...

3
Code Offloading on Opportunistic Computing Alan Ferrari Networking Laboratory University of Applied Sciences of Southern Switzerland (SUPSI) Manno, Switzerland [email protected] Daniele Puccinelli Networking Laboratory University of Applied Sciences of Southern Switzerland (SUPSI) Manno, Switzerland [email protected] Silvia Giordano Networking Laboratory University of Applied Sciences of Southern Switzerland (SUPSI) Manno, Switzerland [email protected] Abstract—Although mobile smart devices are becoming more and more resourceful, they cannot compete with higher-end devices in terms of computational capabilities. Therefore, it is generally advantageous to offload computationally intensive tasks. While cloud-based offloading is popular, it has a non-negligible impact on the energy consumption of mobile devices. Our solution is a novel approach based on locally opportunistic code offloading that leverages the local availability of higher-end devices. We aim to demonstrate the benefits of our approach with respect to a widely adopted benchmark: face recognition. I. I NTRODUCTION Cloud-based offloading is a popular mechanism to allow mobile devices to run computationally intensive tasks, but it has a non-negligible impact on the energy consumption of mo- bile devices [1]. Inspired by recent advances in opportunistic computing [2], we have developed LOCO [3], a novel solution for Locally Opportunistic Code Offloading that leverages the local availability of higher-end devices. We aim to demonstrate the benefits of our approach with respect to a widely adopted benchmark: face recognition. II. RELATED WORK Ubiquitous devices have gained a significant market share in recent years by allowing users to access an incredible set of features and applications. In 2013, the majority of american adults owned a Smartphone [4] and they can access more than 900’000 applications on Google’s Play Store [5]. This increasing popularity and demand of new applications is challenging the performances of the smartphones, a possible solution consists in offloading expensive tasks into the Cloud. Cloud-based solutions have proved effective in several domains ranging from file sharing (e.g. Google Drive [6]) to interactive map search (e.g. Google Map[7]). However, WAN latencies and user mobility pose several severe limitations to the size of the offloading task. For instance, online speech recognition has proved to be impractical in that domain [1]. Satyanarayanan et. al. propose a different perspective by moving the cloud paradigm to the edge of the network, so that users can access cloud-like resources, called cloudlets, from high-end devices that are placed in their proximity [8]. Such cloudlets are very effective but still suffer from centralization as everything revolves around the cloud-like device. Conti et. al. propose Opportunistic Computing (OC) [2], [9], a novel approach that enables devices to leverage the computational capabilities of other devices to let users access a much wider palette of services and resources than what is available on their individual devices. Devices are accessed opportunistically removing the need for a central entity. Con- sequently, the computation is then spread across physically co- located devices according to their specific properties. OC has been the object of the FP7 ICT SCAMPI [10] project, leading to the implementation of an OC framework for Android- based [11] platforms. Code Offloading, also referred to as Computation Offloading, has also been the object of several studies. It has been shown that the energy footprint of the application can be reduced by delegating its execution to remote servers (either clouds or cloudlets). Mobile Assistance Using Infrastructure (MAUI) [1] has been proposed by Cuervo et al. to enable the fine-grained energy-aware offload from a mobile device to a nearby piece of infrastructure connected to the mobile device by a high- performance WLAN link. MAUI aims to reduce the energy footprint of mobile devices by delegating code execution to remote devices; it dynamically selects the function to be offloaded depending on the expected transmission costs of the network and provides developers with easy access to the framework. Mobile terminals can leverage cloudlets of nearby infrastructure that can be accessed over Wi-Fi. This is certainly a promising strategy, especially given the recent results on the advantages of augmenting 3G with Wi-Fi [12]. It is shown in [1] that the cost of 3G for code offloads is prohibitive compared to Wi-Fi, and that the energy consumption of code offloads grows almost linearly with the Round Trip Time (RTT): using a nearby server is much more beneficial and energy-efficient than using a distant cloud, which confirms the conclusions in [8]. If small clouds in the neighborhood are better than a large distant cloud, why not further break up the cloud [13]? By adopting opportunistic computing pervasive devices can opportunistically tap into each other’s resources and access each other’s services, or even combine each other’s resources. The combination of resources has already been studied in the context of the MobiUS architecture [14] and its better-together paradigm, which focuses on close proximity networking between pairs of devices. Opportunistic computing represents a radical generalization of both the MobiUS and the cloudlet/MAUI approach: services can be combined across multiple nodes, are offered by any node, and can be offloaded to any node (and not just a special subset 2014 IEEE International Conference on Pervasive Computing and Communications Demonstrations 978-1-4799-2736-4/14/$31.00 ©2014 IEEE 148

Upload: silvia

Post on 24-Feb-2017

216 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: [IEEE 2014 IEEE International Conference on Pervasive Computing and Communication Workshops (PERCOM WORKSHOPS) - Budapest, Hungary (2014.03.24-2014.03.28)] 2014 IEEE International

Code Offloading on Opportunistic Computing

Alan Ferrari

Networking Laboratory

University of Applied Sciences

of Southern Switzerland (SUPSI)

Manno, Switzerland

[email protected]

Daniele Puccinelli

Networking Laboratory

University of Applied Sciences

of Southern Switzerland (SUPSI)

Manno, Switzerland

[email protected]

Silvia Giordano

Networking Laboratory

University of Applied Sciences

of Southern Switzerland (SUPSI)

Manno, Switzerland

[email protected]

Abstract—Although mobile smart devices are becoming moreand more resourceful, they cannot compete with higher-enddevices in terms of computational capabilities. Therefore, it isgenerally advantageous to offload computationally intensive tasks.While cloud-based offloading is popular, it has a non-negligibleimpact on the energy consumption of mobile devices. Our solutionis a novel approach based on locally opportunistic code offloadingthat leverages the local availability of higher-end devices. We aimto demonstrate the benefits of our approach with respect to awidely adopted benchmark: face recognition.

I. INTRODUCTION

Cloud-based offloading is a popular mechanism to allowmobile devices to run computationally intensive tasks, but ithas a non-negligible impact on the energy consumption of mo-bile devices [1]. Inspired by recent advances in opportunisticcomputing [2], we have developed LOCO [3], a novel solutionfor Locally Opportunistic Code Offloading that leverages thelocal availability of higher-end devices. We aim to demonstratethe benefits of our approach with respect to a widely adoptedbenchmark: face recognition.

II. RELATED WORK

Ubiquitous devices have gained a significant market sharein recent years by allowing users to access an incredibleset of features and applications. In 2013, the majority ofamerican adults owned a Smartphone [4] and they can accessmore than 900’000 applications on Google’s Play Store [5].This increasing popularity and demand of new applications ischallenging the performances of the smartphones, a possiblesolution consists in offloading expensive tasks into the Cloud.

Cloud-based solutions have proved effective in severaldomains ranging from file sharing (e.g. Google Drive [6]) tointeractive map search (e.g. Google Map[7]). However, WANlatencies and user mobility pose several severe limitations tothe size of the offloading task. For instance, online speechrecognition has proved to be impractical in that domain [1].

Satyanarayanan et. al. propose a different perspective bymoving the cloud paradigm to the edge of the network, so thatusers can access cloud-like resources, called cloudlets, fromhigh-end devices that are placed in their proximity [8]. Suchcloudlets are very effective but still suffer from centralizationas everything revolves around the cloud-like device.

Conti et. al. propose Opportunistic Computing (OC) [2],[9], a novel approach that enables devices to leverage the

computational capabilities of other devices to let users accessa much wider palette of services and resources than whatis available on their individual devices. Devices are accessedopportunistically removing the need for a central entity. Con-sequently, the computation is then spread across physically co-located devices according to their specific properties. OC hasbeen the object of the FP7 ICT SCAMPI [10] project, leadingto the implementation of an OC framework for Android-based [11] platforms. Code Offloading, also referred to asComputation Offloading, has also been the object of severalstudies. It has been shown that the energy footprint of theapplication can be reduced by delegating its execution toremote servers (either clouds or cloudlets).

Mobile Assistance Using Infrastructure (MAUI) [1] hasbeen proposed by Cuervo et al. to enable the fine-grainedenergy-aware offload from a mobile device to a nearby pieceof infrastructure connected to the mobile device by a high-performance WLAN link. MAUI aims to reduce the energyfootprint of mobile devices by delegating code execution toremote devices; it dynamically selects the function to beoffloaded depending on the expected transmission costs ofthe network and provides developers with easy access to theframework. Mobile terminals can leverage cloudlets of nearbyinfrastructure that can be accessed over Wi-Fi. This is certainlya promising strategy, especially given the recent results on theadvantages of augmenting 3G with Wi-Fi [12]. It is shown in[1] that the cost of 3G for code offloads is prohibitive comparedto Wi-Fi, and that the energy consumption of code offloadsgrows almost linearly with the Round Trip Time (RTT): usinga nearby server is much more beneficial and energy-efficientthan using a distant cloud, which confirms the conclusions in[8].

If small clouds in the neighborhood are better than alarge distant cloud, why not further break up the cloud[13]? By adopting opportunistic computing pervasive devicescan opportunistically tap into each other’s resources andaccess each other’s services, or even combine each other’sresources. The combination of resources has already beenstudied in the context of the MobiUS architecture [14]and its better-together paradigm, which focuses on closeproximity networking between pairs of devices. Opportunisticcomputing represents a radical generalization of both theMobiUS and the cloudlet/MAUI approach: services can becombined across multiple nodes, are offered by any node, andcan be offloaded to any node (and not just a special subset

2014 IEEE International Conference on Pervasive Computing and Communications Demonstrations

978-1-4799-2736-4/14/$31.00 ©2014 IEEE 148

Page 2: [IEEE 2014 IEEE International Conference on Pervasive Computing and Communication Workshops (PERCOM WORKSHOPS) - Budapest, Hungary (2014.03.24-2014.03.28)] 2014 IEEE International

of infrastructure nodes). Opportunistic computing effectivelyoffers a distributed cloud, i.e., a computing system thatharnesses the CPU, memory, energy, and sensing resources ofmultiple nodes of heterogeneous capabilities that collectivelyform a cloud that is distributed in both space and time.Each node in the distributed cloud corresponds to a pairwiseencounter, and may therefore provide useful local contextinformation, which is something that a distant computingcloud would not be able to give. Opportunistic computingalso avoids the centralization of cloud computing, withsignificant benefits in terms of security and reliability. Themain challenge in OC consists in accessing resources acrossmultiple heterogeneous mobile devices. On the one hand,device mobility provides more connectivity opportunitiesand more resources over time, but on the other hand dataexchanges among devices are more challenging becauseend-to-end connectivity between devices is not necessarilyavailable at any given time.

III. LOCAL OPPORTUNISTIC CODE OFFLOADING

Inspired by recent work in OC [15], we built a novelframework for code offloading, named LOCO (LocallyOpportunistic Code Offloading) [3] based on a locallyopportunistic behavior. Rather than assuming the existence ofa dedicated piece of high-end hardware and being rigidly tiedto it, LOCO may elect to use any viable piece of hardware, i.e.,any other device with sufficient computing power that is locallyavailable and can be accessed through a LAN. In this sense,we speak of locally opportunistic code offloading. LOCOis built on top of the SCAMPI framework, which providesaccess to neighboring devices in the form of service calls andbroadcasts the instantaneous resource usage (memory and CPUusage) of each device. For each method to be run, LOCO usesinformation about the resource usage and availability of remotedevices as well as local profiling information about the methodto determine whether offloading it to a remote device wouldrequire fewer resources than local execution.

The goal of LOCO is to dynamically decide whether anykth run (k ∈ N) of a method m should be offloaded or runlocally. To make this decision on resource-constrained devices,we employ a Bayesian approach, which is known to be veryefficient and lightweight in terms of resource usage [16], [17].Specifically, we focus on the Naıve Bayes approach [18],which requires relatively little computing power and providesan excellent inference quality compared to more sophisticatedapproaches. We focus on method granularity in order to have afair comparison respect to MAUI [1], but we note that LOCO[3] could be easily adapted to work at a different granularity(i.e. to offload threads). Figure 1 shows the LOCO’s maincomponents and their interactions.

In our recent results [3] we have tested LOCO againstMAUI using our custom-made testbed. The goal of our testbedis to emulate the dynamics of network connectivity usingreal contact traces. We compare LOCO and MAUI in twomain scenarios: a stationary network topology (a resource-richmachine is always reachable) and a highly dynamic topologieswhere link breakages are emulated (we have used Scott et.al. iMote traces [19]). We performed more than 20 hours ofexperiments and we found out that LOCO compares favorably

Fig. 1. State machine of a typical method execution under LOCO. The entrypoint (Stub component) evaluates whether is beneficial offloading the methodusing the Inference Manager component. if the offloading might be beneficialthe stub forwards the call to the remote execution manager that uses Remotemethod invocation feature in the SCAMPI platform that forwards the requestto the remote device. The Local execution manager component is called in twosituation, the first when the Inference manager says that offload the method isnot convenient, and in case the time needed to retrieve data from the remotedevice is too long (timeout) consequently not beneficial .

with MAUI in the presence of a stable network topologybut outperforms it with dynamic network topologies. We arecurrently investigating the behavior of LOCO in differentscenarios with a variety of benchmarks.

IV. GOALS OF THE DEMONSTRATION

The goal of the demo we are proposing is to show two mainfeatures of LOCO[3]: the analysis of neighboring devices, andthe offloading gain.

a) Neighborhood analysis: after setting up the networkwith a certain amount of heterogeneous devices (laptop, smart-phone and tables), we will show that LOCO is able to correctlydetect the neighboring devices and their remote resources.We will also show the inferences made by LOCO about theprobability that offloading is preferable to local execution.

b) Offloading gain: we will show the run time gain withrespect to face recognition.After configuring a mobile deviceto run a face recognition algorithm, we will first show the costof using internal resources, and we will then show the costincurred by the local device when an method is offloaded tothe neighboring device that is expected by LOCO to offer thelargest runtime reduction.

Face recognition algorithms represent a natural choice ofbenchmark due to their computational complexity. In ourimplementation, we use the eigenface approach proposed byTurk et. al [20]. The widely adopted eigenface approach canrecognize a face in a user-provided image by comparingcharacteristics of an existing database of faces. The eigenface

2014 IEEE International Conference on Pervasive Computing and Communications Demonstrations

149

Page 3: [IEEE 2014 IEEE International Conference on Pervasive Computing and Communication Workshops (PERCOM WORKSHOPS) - Budapest, Hungary (2014.03.24-2014.03.28)] 2014 IEEE International

Fig. 2. Demo setup featuring a wireless access point, a Laptop, twosmartphones and a tablet

approach works in an unsupervised manner to learn andrecognize new faces and is relatively fast.

V. DEMO SETUP

Figure 2 shows the setup of the demo that is composed by:

• Two Android-based Smartphones to instrument a re-alistic network scenario.

• One Android smart device to run the face recognitionalgorithm locally and remotely (by offloading it). Thecontents of its screen are projected to offer a clearoverview of the results of the demo.

• One laptop that serves as a resource-rich machine forLOCO [3] to offload resource-hungry tasks to.

• One access point to emulate device-to-device connec-tivity.

VI. CONCLUSIONS

The centerpiece of the demostration is LOCO [3], ourframework for Locally Opportunistic Code Offloading.This paper highlights the key ideas behind our demo: therecognition and evaluation of neighboring devices and theadvantages of local code offloading in terms of runtimereduction.

ACKNOWLEDGEMENTS

This work was supported by the EU FP7 ERANET pro-gram under grant CHIST-ERA-2012 MACACO.

REFERENCES

[1] E. Cuervo, A. Balasubramanian, D. Cho, A. Wolman, S. Saroiu,R. Chandra, and P. Bahl. MAUI: Making Smartphones Last Longerwith Code Offload. In MobiSys’10, San Francisco, CA, USA, June2010.

[2] M. Conti and M. Kumar. Opportunities in Opportunistic Computing.IEEE Computer, pages 42–50, January 2010.

[3] Alan Ferrari, Daniele Puccinelli, and Silvia Giordano. LOCO: locallyopportunistic code offloading. Technical report, Available under request,University of Applied Sciences of Southern Switzerland (SUPSI),November 2013.

[4] PewResearch Center. Smartphone ownership - 2013, June 2013.

[5] AppBrain. Number of available android applications, October 2013.

[6] Google Inc. Google drive,, October 2013.

[7] Google Inc. Google map, October 2013.

[8] M. Satyanarayanan, P. Bahl, R. Caceres, and N. Davies. The Casefor VM-Based Cloudlets in Mobile Computing. IEEE PervasiveComputing, 8(4):14–23, 2004.

[9] M. Conti, S. Giordano, M. May, and A. Passarella. From OpportunisticNetworks to Opportunistic Computing. In IEEE CommunicationsMagazine, 2010.

[10] Scampi Consortium. Scampi, service platform for social aware mobileand pervasive computing, March 2012.

[11] Google Inc. Android operating system, November 2013.

[12] A. Balasubramanian, R. Mahajan, and A. Venkataramani. AugmentingMobile 3G Using WiFi. In 5th Annual International Conference on Mo-bile Systems, Applications and Services (MobiSys’10), San Francisco,CA, USA, June 2010.

[13] S. Giordano and D. Puccinelli. The Human Element as the Key Enablerof Pervasiveness. In 10th IEEE IFIP Annual Mediterranean Ad HocNetworking Workshop (Med-Hoc-Net 2011), Favignana Island, Italy, Jun2011.

[14] G. Shen, Y. Li, and Y. Zhang. MobiUS: Enable Together-ViewingVideo Experience across Two Mobile Devices. In 5th Annual In-ternational Conference on Mobile Systems, Applications and Services(MobiSys’07), San Juan, Puerto Rico, June 2007.

[15] M. Pitkanen, T. Karkkainen, J. Ott, M. Conti, A. Passarella, S. Gior-dano, D. Puccinelli, F. Legendre, S. Trifunovic, K. Hummel, M. May,N. Hedge, and T. Spyropoulos. SCAMPI: Service platform for soCialAware Mobile and Pervasive computing. In ACM SIGCOMM Workshopon Mobile Cloud Computing (MCC), Helsinki, Finland, Aug 2012.

[16] F. Jensen and T. Nielsen. Bayesian Networks and Decision Graphs.Springer, 2007.

[17] D. Berry. Statistics: A Bayesian Perspective. Duxbury, 1996.

[18] H. Zhang. The optimality of naive bayes. In Proceedings of the Sev-enteenth International Florida Artificial Intelligence Research SocietyConference (FLAIRS 2004), 2004.

[19] James Scott, Richard Gass, Jon Crowcroft, Pan Hui,Christophe Diot, and Augustin Chaintreau. CRAWDAD tracecambridge/haggle/imote/cambridge (v. 2006-01-31). Downloaded fromhttp://crawdad.cs.dartmouth.edu/cambridge/haggle/imote/cambridge,January 2006.

[20] Matthew Turk and Alex Pentland. Eigenfaces for recognition. Journalof cognitive neuroscience, 3(1):71–86, 1991.

2014 IEEE International Conference on Pervasive Computing and Communications Demonstrations

150