CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID....

35
1 CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE AND CLOUD Byung-Gon Chun Joint work with Sunghwan Ihm (Princeton) Petros Maniatis (Intel), Mayur Naik (Intel), Ashwin Patti (Intel)

Transcript of CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID....

Page 1: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

1

CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE AND CLOUD

Byung-Gon Chun

Joint work with Sunghwan Ihm (Princeton) Petros Maniatis (Intel), Mayur Naik (Intel), Ashwin Patti (Intel)

Page 2: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

2

Mobile Apps Gain Rapid Popularity

Page 3: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

3

Users Increasingly Expect More from Apps

• Examples – Mobile augmented reality – Visual/audio search – Image/video/speech processing – Citizen science – Intrusion detection, exfiltration protection

Page 4: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

4

The Mobile-Resource Disparity

• Handheld devices still in the ’90s

– Constrained by thermal profile & size

Page 5: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

5

Project Goal

Enable expensive, exotic applications on mobile devices without increase in device

footprint or required capabilities

Page 6: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

6

Observations

• Powered devices more powerful than ever – Have them at home, and there’s cloud

• Lots of faster wireless connectivity

Page 7: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

7

Use Ambient Resources

• Use accessible clouds, computing hotspots (e.g., cloudlets), available desktops or plugged-in laptops nearby

• Augment mobile device applications through ambient resource execution to make its applications better

Cyber foraging (Balan et al. 2002)

Abundant computation, lots of faster connectivity

Page 8: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

8

Approach: Dynamic Splitting of Apps

• Client-Server model? – Split is made manually, early – Split persists even when hardware, networks,

costs, workload, urgency change

• Dynamically shift computation between mobile device and cloud

Page 9: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

9

What Does This Look Like? Phone

Application

100%

Phone

Application

10%

Originally

Slow device, Cloud available

Page 10: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

10

What Does This Look Like? Phone

Application

100%

Originally

Fast device, Cloud available

MID

Application

80%

Page 11: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

11

Talk Outline

• Introduction • CloneCloud design

– Clones – Partitioning – Migration

• Evaluation • Conclusion

Page 12: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

12

CloneCloud: Powerful Clones

Datacenter

Page 13: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

13

CloneCloud v1 Strategy • Partition apps written for a mobile device

automatically

• Seamlessly execute locally & remotely

• Optimize high-level objective (time, energy) by adaptation

• Exploit application-level VMs

Page 14: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

14

The Before-After Picture

Phone

UI W

Phone

Clone

Cloud

WUI W'

Clone

Clone

Clone

Page 15: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

15

CloneCloud v1 Architecture

VMMHW

PartitionAnalyzer

OSVirtual HW

Migration

Mobile Device

Runtime

OSHW

Application

App.VM

Man

ager Migration

Clone VM

ProfilerOS

Virtual HW

Application

App.VM

ManagerProfiler

Page 16: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

16

AppVM Clones

• Virtual machine of entire client device – Android x86 VM natively executed on

VMWare in an x86 machine

• Synchronized file systems

Page 17: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

17

Partitioning

Where to partition code, satisfying any constraints for correctness,

so as to optimize for current conditions

Page 18: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

18

Automatic Partitioning Framework

Partition Analyzer

Application binary

Partitioning constraints

Static analysis

location- constraints

Profiling inputs

Dynamic profiling

cost-annotated executions

Optimization solver

Optimal partitioning

points

Identify valid split points

Construct cost models

Pick best choice for an objective

Page 19: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

19

Partitioning: Static Analysis • Partitioning points

– Restrict to method entry/exit

• Identify “pinned” methods – Identify framework library methods

• Identify mutually dependent native state

– Class natives stay together

• Collect static control flow – Who calls whom

Page 20: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

20

Partitioning: Profiling

• Pick k invocations • For each invocation

– Run app on mobile device

– Run app on clone • For each method

– Execution time – Context size entry/exit – Estimate of energy

consumption

a30, 2100

c60, 810

a'11, 1200

main

main'19, 9

5

b50, 5900

a

Page 21: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

21

Partitioning: Intuition

• Partitioning points splice profile trees together • Context size used to estimate network cost

a30, 2100

c60, 810

a'11, 1200

main

main'19, 9

5

b50, 5900

a a

ca'

main

main'

b50, 520

a

MobileDevice Clone

Page 22: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

22

Partitioning: Optimization

• List all partitioning choices

• Remove partitioning choices that do not meet the constraints

• For each choice, compute total time

• Find the minimum

Page 23: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

23

Distributed Execution

How to seamlessly execute the partitions of an application locally and remotely

Page 24: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

24

Migration Architecture

App-VM

Migrator

NodeManager

NodeManagerNet

(1) (4)

Mobile Device Clone

Partitions

App-VM

Application

Migrator

App-VM

Migrator

Application

App-VM

Migrator

Clone

App-VM

Migrator

Clone

App-VM

Migrator

(2)

(3)

Page 25: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

25

Migration: Suspend-Transmit-Resume Mobile device Clone

Transmit

At migration point Suspend thread Capture context Transmit Launch process

Patch migrated context Resume thread

Suspend thread Capture context Merge migrated

context Resume thread

At reintegration point

Page 26: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

26

Migration Challenges

• Regular IDs (references) not globally unique – Address space difference between mobile

device and clone

• System objects created at boot everywhere

Page 27: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

27

Migration: References in Motion

(1) Mobile Device

Reference MID CID0x01 1 null0x02 2 null0x03 3 null

migration

New objects

GC’ed

(2) Clone

Reference MID CID0x21 1 110x22 2 120x23 3 130x24 null 140x22 null 15

rein

tegr

atio

n(3) Mobile DeviceReference MID CID

0x01 1 110x02 2 120x03 3 130x04 4 140x05 5 15

Page 28: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

28

The CloneCloud v1 Prototype

• On Android platform + x86 VM clones • Modified DalvikVM to support thread-level

migration and dynamic profiling • Implemented NodeManager to handle

registration and communication • Static analysis using JChord

Page 29: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

29

Evaluation Setup • Test applications

– Image search – Virus scanning – Privacy-preserving user profiling

• Phone: Android Dev Phone 1 • Clone VM: a server with a 3.0GHz Xeon CPU

running VMWare ESX 4.1 in Intel IT infrastructures

• Wireless connection: WiFi, T-mobile 3G

Page 30: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

30

Execution Time Comparison (Image Search)

Exec

utio

n tim

e (s

econ

ds)

0

500

1000

1500

2000

2500

1 image 10 images 100 images

Phone(Local)

CloneCloud(Wi-Fi)

CloneCloud(3G)

20x

1x

Page 31: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

31

Energy Consumption Comparison (Image Search)

Ener

gy c

onsu

mpt

ion

(J)

0

300

600

900

1200

1500

1800

1 image 10 images 100 images

Phone(Local)

CloneCloud(Wi-Fi)

CloneCloud(3G)

20x

1x

Page 32: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

32

Discussion

• Applicability is application-specific – Application characteristics – Execution mechanism

• A design point with focus on automation – Apps structured to be more amenable to

migration • Clone VMs in untrusted environments

Page 33: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

33

Related Work

• MAUI • Partitioning • Migration • Remote execution

Page 34: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

34

Conclusion

• CloneCloud: automatic partitioning and migration to enhance mobile applications – Use of clones – Flexible app partitioning – Seamless migration

Lots of excitements in mobile cloud computing

Page 35: CLONECLOUD: ELASTIC EXECUTION BETWEEN MOBILE DEVICE … · (1) Mobile Device. Reference MID CID. 0x01 1 null 0x02 2 null 0x03 3 null. on. New objects GC’ed (2) Clone. Reference

35

THANK YOU! Q & A