A Reference Architecture for
Mobile Code Offload in Hostile
Environments
Grace A. Lewis (glewis@[Link])
Soumya Simanta (ssimanta@[Link])
Ed Morris (ejm@[Link])
Carnegie Mellon University Software Engineering Institute
Kiryong Ha (krha@[Link])
Mahadev Satyanarayanan(satya@[Link])
Carnegie Mellon University School of Computer Science
© 2012 Carnegie Mellon University
Motivation
First responders and others operating in crisis and hostile environments
increasingly make use of handheld devices to help with compute-
intensive tasks such as speech and image recognition, natural language
processing, decision-making and mission planning
Challenges for mobile devices in hostile environments
• Mobile devices offer less computational power than conventional desktop or
server computers
• Computation-intensive tasks take a heavy toll on battery power
• Networks in hostile environments are often unreliable and bandwidth is
limited and inconsistent
Reference Architecture for Mobile Code Offload
WICSA 2012 2
© 2012 Carnegie Mellon University
Cyber-Foraging
Cyber-foraging is the leverage of external resources to augment the
capabilities of resource-limited devices
One form of cyber-foraging is code offload from mobile devices to the
cloud to conserve battery power, increase computational capability, or to
provide access to data resources
Most cyber-foraging solutions rely on:
• conventional Internet for connectivity to the cloud
• strategies that tightly couple applications running on handheld devices to the
servers on which computation is offloaded
These solutions are not appropriate for hostile environments because
they do not address the challenge of unreliable networks and dynamic
environments
Reference Architecture for Mobile Code Offload
WICSA 2012 3
© 2012 Carnegie Mellon University
Code Offload in Hostile Environments*
Central Cloudlets as Offload
Core Elements
[Enterprise Cloud] • Discoverable, generic,
stateless servers located in
Multi- or Single-Hop Network single-hop proximity of mobile
devices
• Run a separate virtual
Offload Offload Offload Offload machine (VM) for each
Element Element Element Element offloaded application
[Cloudlet] [Cloudlet] [Cloudlet] [Cloudlet]
• Enhance processing capacity
Single-Hop Network
and conserve battery power
while at the same time
providing ease of deployment
in the field
• Communication with the
central core is only needed
for provisioning
* K. Ha, G. Lewis, S. Simanta, S and M. Satyanarayanan. Code Offload in Hostile Environments. Carnegie Mellon University, CMU-CS-11-
146, 2011. [Link]
Reference Architecture for Mobile Code Offload
WICSA 2012 4
© 2012 Carnegie Mellon University
VM Synthesis as a Strategy for Code Offload
Calculate Diff
Obtain Base VM
Start Base Install Save Modified Between
from Central Stop VM
VM Application VM Disk Image Complete and
Core
Base VM Image
Base VM Complete VM
Disk Image Disk Image
VM Disk Image
Overlay
Application
Application overlays Overlay
• Correspond to the server portion of a mobile app
• Created once, offline, by qualified personnel
Only constraint is that cloudlets need to store a copy of the same Base VM that was
used for overlay creation
During execution
• Mobile device discovers available cloudlets
• Mobile device uploads application overlay to selected cloudlet
• Cloudlet applies application overlay to the Base VM and produces a Complete VM
• Cloudlet starts Complete VM which is now ready for application execution
Reference Architecture for Mobile Code Offload
WICSA 2012 5
© 2012 Carnegie Mellon University
Reference Mobile Client Cloudlet Host
VM Manager
Architecture Application
Overlay 1 Cloudlet-
Ready
Guest VM 1
for Code Client
App 1
Server 1
Application
Offload Based Overlay 2
Cloudlet
Client Cloudlet-
Ready
Guest VM 2
Server 2
on VM Client
...
App 2
...
...
Synthesis Application
Overlay n Cloudlet- Guest VM n
Ready
Server n
Client
App n
Application Overlay
Cloudlet Base VM
Server Image
Cloudlet Server IP Address/Port
Discovery Service
Legend
File Read/ Broadcast
Call Write
rd
3 Party
System Custom Runtime
Runtime File
Boundary Component
Component
Reference Architecture for Mobile Code Offload
WICSA 2012 6
© 2012 Carnegie Mellon University
Prototype 1:
Initial Prototype
Application Platform Language Application Size Base VM Disk VM Disk Image
(MB) Image Size (MB) Overlay Size (MB)
OBJECT Linux C++ 27.50 3546 165.32
FACE Windows XP C++ 17.65 3073 43.55
SPEECH Linux Java 51.04 3546 176.23
NULL Linux N/A N/A 3546 0.12
Reference Architecture for Mobile Code Offload
WICSA 2012 7
© 2012 Carnegie Mellon University
Prototype 1: Analysis
Limitations Major Changes for Prototype 2
• Large overlays • Disk image format: Changed from
• Long Start VM times raw to qcow2
• Implementation complexity • Memory snapshot overlay plus disk-
image overlay
• KVM in NAT mode and port
redirection
Base Base
Memory Disk
Snapshot Snapshot
Save Disk
Obtain Base Start Calculate Diff Between
Install Start Suspend and
VM from Base Complete Snapshots and
Application Application VM Memory
Central Core VM Base Snapshots
Snapshots
Complete Complete VM Disk Memory
Base VM Memory Disk Image Snapshot
Disk Image Snapshot Snapshot Overlay Overlay
Application Overlay
Reference Architecture for Mobile Code Offload
WICSA 2012 8
© 2012 Carnegie Mellon University
Prototype 2:
Revised Prototype
Application Base VM Base Disk Base Memory Compressed VM Compressed
Disk Image Snapshot Snapshot Disk Image Overlay Memory Snapshot
qcow2 (MB) qcow2 (MB) (MB) (MB) Overlay (MB)
OBJECT 3558 17 554 94 293
FACE 2421 15 278 71 101
SPEECH 3558 17 554 86 257
NULL 3558 17 554 1 3
Reference Architecture for Mobile Code Offload
WICSA 2012 9
© 2012 Carnegie Mellon University
Prototype 2: Analysis Advantages
• Shorter VM Synthesis and Start
VM times
• Simple implementation
Limitation
• Very large overlays lead to
increased battery consumption
For the revised prototype to pay
off, the efficiencies gained in VM
Synthesis and Start VM would
require supplementation with
greater bandwidth
Reference Architecture for Mobile Code Offload
WICSA 2012 10
© 2012 Carnegie Mellon University
Current and Future Work
Current work
• Application-level virtualization
– Using static and dynamic analysis tools to create packages with all dependencies—
early results show that packages are 20% the size of overlays
– Tradeoff is anticipation of necessary “containers”
• Mobility-induced cloudlet handoffs to transfer state between cloudlets with minimal
interruption to a moving user
– Challenges have been on the networking side and not the actual VM migration
Future work
• Rapid VM synthesis
– Extension of the discovery protocol to enable VM caching so that overlays do not
always require transmission
– Exploiting of multicore architecture to parallelize VM synthesis activities
• Cloudlet-selection mechanism that maps application needs to cloudlet characteristics
exposed as cloudlet metadata during the cloudlet-discovery process
Reference Architecture for Mobile Code Offload
WICSA 2012 11
© 2012 Carnegie Mellon University
Summary
Cloudlets are discoverable, localized, stateless servers running one or
more virtual machines (VMs) on which mobile devices can offload
expensive computation
• Provide a general-purpose strategy for code offload and resource
optimization in hostile environments
• Enhance processing capacity and conserve battery power while at the same
time providing ease of deployment and application flexibility in the field
The two implementations of the proposed references architecture show
the tradeoffs between overlay size, battery consumption and application-
ready time
• Operationalization of the concept will require further reduction in overlay sizes
and incorporation of strategies for minimizing or eliminating overlay transfer
Reference Architecture for Mobile Code Offload
WICSA 2012 12
© 2012 Carnegie Mellon University
Contact Information
Grace A. Lewis
Research, Technology and Systems Solutions (RTSS) Program
Advanced Mobile Systems (AMS) Initiative
Software Engineering Institute
4500 Fifth Avenue
Pittsburgh, PA 15213-2612
USA
Phone: +1 412-268-5851
Email: glewis@[Link]
WWW: [Link]
Reference Architecture for Mobile Code Offload
WICSA 2012 13
© 2012 Carnegie Mellon University
Copyright 2012 Carnegie Mellon University and IEEE
This material is based upon work funded and supported by the Department of
Defense under Contract No. FA8721-05-C-0003 with Carnegie Mellon University
for the operation of the Software Engineering Institute, a federally funded
research and development center.
NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE
ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN “AS-IS” BASIS.
CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND,
EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT
NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR
MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE
OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE
ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM
PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
This material has been approved for public release and unlimited distribution
except as restricted below.
Carnegie Mellon® is registered in the U.S. Patent and Trademark Office by
Carnegie Mellon University.
DM-0000001
Reference Architecture for Mobile Code Offload
WICSA 2012 14
© 2012 Carnegie Mellon University