Cellular Networks and Mobile Computing COMS 6998-10 , Spring 2013
Cellular Networks and Mobile Computing COMS 6998-8, Spring 2012
description
Transcript of Cellular Networks and Mobile Computing COMS 6998-8, Spring 2012
Cellular Networks and Mobile Computing (COMS 6998-8)
1
Cellular Networks and Mobile ComputingCOMS 6998-8, Spring 2012
Instructor: Li Erran Li ([email protected])
http://www.cs.columbia.edu/~coms6998-8/4/2/2012: Mobile Cloud Computing
4/2/12
Mobile Cloud Computing (mCloud) today
• Apple iCloud– Store content in cloud and
sync to all registered devices
– Hosted by Windows Azure and Amazon AWS
– iCloud Storage APIs support third-party app document syncing
24/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
Mobile Cloud Computing today (Cont’d)
• Amazon Silk browser– Accelerates web access– Learns user behavior and
precache– Intelligently partition work
between local and Amazon cloud
34/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
mCloud Fundamental Challenges
• What architecture best supports mCloud?• What programming model best enables client
to tap mCloud resources?• What are basic services or building blocks for
mCloud?• What best supports service interaction?
44/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
mCloud Architecture• Resource-intensive mobile
applications– Face recognition for social
networking app– Gesture recognition for control
media app – Object and post recognition for
augmented reality app• End-to-end latency and througput
matters for crisp interaction– Augmented reality need to display
results within 1 sec– Need high data rate processing
capability, low frame rate can miss gesture
5
Delay, loss on frame rate of video stream transfer [Odessa, 2011]
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
mCloud Architecture (Cont’d)• WAN performance
– First hop latency in 3G is 200ms– Verizon LTE :128ms, 6.44 Mbps
downlink, 5Mbps uplink [Pcworld, March 2011]
• There is a need for a middle tier
• cloudlet = (compute cluster+ wireless access point+ wired Internet access+ no battery limitations)
• “data center in a box”6
“Anatomizing Application Performance Differences on Smartphones”, MobiSys 2010 (Huang et al)
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
mCloud Architecture (Cont’d)
• Cloudlet possible locations• Cellular providers has a unique advantage
7
BS
Wireless Core
Internet
WiFi AP
RDCA1
RDCA2
RDCB1
RDCB2
Regional Data centers (RDC)
RNC
Storage nodes
Computenodes
Possible locationsof cloudlet
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
mCloud Programming Model• MAUI: RPC based offloading architecture• CloneCloud: tight synchronization between cloud and
phone• Odessa: data-flow graph to exploit parallelism in
perception applications• Orelans: a new programming model based on grains• MAUI, CloneCloud , Odessa all have profiler, solver
8
MAUI CloneCloud Odessa Orleans
Remote execution unit
Methods (RMI)
Threads Tasks Grains
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
mCloud Programming Model: MAUI
• Combine extensive profiling with an ILP solver– Makes dynamic offload decisions– Optimize for energy reduction– Profile: device, network, application
• Leverage modern language runtime (.NET CLR)– Portability:
• Mobile (ARM) vs Server (x86)• .NET Framework Common Intermediate Language
– Type-Safety and Serialization: • Automate state extraction
– Reflection: • Identifies methods with [Remoteable] tag• Automates generation of RPC stubs
94/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
Maui serverSmartphone
Application
Client Proxy
Profiler
Solver
Maui Runtime
Server Proxy
Profiler
Solver
Maui Runtime
Application
RPC
RPC
Maui Controller
mCloud Programming Model: MAUI (Cont’d)
Intercepts Application CallsSynchronizes State
Chooses local or remote
Handles Errors
Provides runtime information
• MAUI architecture
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 10Source: MAUI Mobisys presentation
MAUI Profiler
ProfilerCallgraph
Execution Time
State size
Network Latency
Network Bandwidth
Device ProfileCPU Cycles
Network Power CostNetwork DelayComputational Delay
Computational Power CostComputational Delay
Annotated Callgraph
Source: MAUI Mobisys presentation4/2/12Cellular Networks and Mobile Computing
(COMS 6998-8) 11
MAUI Solver
B900 mJ15ms
C5000 mJ3000 ms
1000mJ25000 m
J D15000 mJ12000 ms
1000
0 m
J
A
Computation energy and delay for execution
Energy and delay for state transfer
A sample callgraph
Source: MAUI Mobisys presentation
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
12
Is Global Program Analysis Needed?
FindMatch900 mJ
InitializeFaceRecognizer
5000 mJ
1000mJ25000 m
J DetectAndExtract Faces
15000 mJ
1000
0 m
J
UserInterface
Yes! – This simple example from Face Recognition app shows why local analysis fails.
Cheaper to do local
Source: MAUI Mobisys presentation
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 13
Is Global Program Analysis Needed?
FindMatch900 mJ
InitializeFaceRecognizer
5000 mJ
1000mJ25000 m
J DetectAndExtract Faces
15000 mJ
1000
0 m
J
UserInterface
Yes! – This simple example from Face Recognition app shows why local analysis fails.
Cheaper to do local
Cheaper to do local
Source: MAUI Mobisys presentation
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 14
Is Global Program Analysis Needed?
FindMatch
InitializeFaceRecognizer
1000mJ
DetectAndExtract Faces
UserInterface 25900mJ
Cheaper to offload
Source: MAUI Mobisys presentation
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
15
Can MAUI Adapt to Changing Conditions?
• Adapt to:– Network Bandwidth/Latency Changes– Variability on method’s computational requirements
• Experiment:– Modified off the shelf arcade game application– Physics Modeling (homing missiles)– Evaluated under different latency settings
Source: MAUI Mobisys presentation4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 16
DoLevel
HandleMissiles
DoFrame
HandleEnemies
HandleBonuses11KB + missiles
11KB
+
miss
iles
missiles
*Missiles take around 60 bytes each
11KB + missiles
Required state is smaller
Complexity increases with # of missiles
Can MAUI Adapt to Changing Conditions?
Source: MAUI Mobisys presentation
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
17
Case 1
DoLevel
HandleMissiles
DoFrame
HandleEnemies
HandleBonuses
*Missiles take around 60 bytes each
Zero Missiles Low latency (RTT < 10ms)
Computation cost is close to zero
Offload starting at DoLevel
Source: MAUI Mobisys presentation
4/2/12Cellular Networks and Mobile Computing
(COMS 6998-8) 18
Case 2
DoLevel
HandleMissiles
DoFrame
HandleEnemies
HandleBonuses
*Missiles take around 60 bytes each
5 Missiles Some latency (RTT = 50ms)
Most of the computation cost
Very expensive to offload everything
Little state to offload
Only offload Handle Missiles
Source: MAUI Mobisys presentation4/2/12 Cellular Networks and Mobile Computing
(COMS 6998-8) 19
MAUI Implementation• Platform– Windows Mobile 6.5– .NET Framework 3.5– HTC Fuze Smartphone– Monsoon power monitor
• Applications– Chess– Face Recognition– Arcade Game– Voice-based translator
Source: MAUI Mobisys presentation4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 20
Questions
• How much can MAUI reduce energy consumption?• How much can MAUI improve performance?• Can MAUI Run Resource-Intensive Applications?
Source: MAUI Mobisys presentation4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 21
0
5
10
15
20
25
30
35Smartphone onlyMAUI (Wi-Fi, 10ms RTT)MAUI (Wi-Fi, 25ms RTT)MAUI (Wi-Fi, 50ms RTT)MAUI (Wi-Fi, 100ms RTT)MAUI* (3G, 220ms RTT)
Ener
gy (J
oule
s)
How much can MAUI reduce energy consumption?
Big savings even on 3GAn order of magnitude improvement on Wi-Fi
Face Recognizer
Source: MAUI Mobisys presentation4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 22
How much can MAUI improve performance?
0
3,000
6,000
9,000
12,000
15,000
18,000
21,000Smartphone onlyMAUI (Wi-Fi, 10ms RTT)MAUI (Wi-Fi, 25ms RTT)MAUI (Wi-Fi, 50ms RTT)MAUI (Wi-Fi, 100ms RTT)MAUI* (3G, 220ms RTT)
Exec
ution
Dur
ation
(ms)
Improvement of around an order of magnitude
Face Recognizer
Source: MAUI presentation4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 23
Latency to server impacts the opportunities for fine-grained offload
0
20
40
60Smartphone onlyMAUI (Wi-Fi, 10ms RTT)MAUI (Wi-Fi, 25ms RTT)MAUI (Wi-Fi, 50ms RTT)MAUI (WiFi, 100ms RTT)MAUI* (3G, 220ms RTT)
Ener
gy (J
oule
s)
Up to 40% energy savings on Wi-Fi
Solver would decide not to offloadArcade Game
Source: MAUI Mobisys presentation4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 24
Can MAUI Run Resource-Intensive Applications?
00:00 00:1700:3400:51 01:0901:26 01:4302:0002:18 02:3502:520
102030405060708090
100
CPU1CPU2
Time
CPU
Con
sum
ption
(%)
CPU Intensive even on a Core 2 Duo PC
Can be run on the phone with MAUI
Translator
Source: MAUI Mobisys presentation4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 25
Conclusions
• MAUI enables developers to:– Bypass the resource limitations of handheld devices– Low barrier entry: simple program annotations
• For a resource-intensive application– MAUI reduced energy consumed by an order of magnitude– MAUI improved application performance similarly
• MAUI adapts to:– Changing network conditions – Changing applications CPU demands
Source: MAUI Mobisys presentation4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 26
mCloud Programming Model: CloneCloud
• Offloading decision done at beginning of execution
274/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
The Before-After Picture
PhoneUI W
Phone
Clone
CloudWUI W'
Clone
Clone
Clone
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 28Courtesy: Byung-Gon Chun et. al.
CloneCloud v1 Architecture
VMMHW
PartitionAnalyzer
OSVirtual HW
Migration
Mobile Device
RuntimeOSHW
Application
App.VM
Man
ager Migration
Clone VM
ProfilerOS
Virtual HW
Application
App.VM
ManagerProfiler
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 29Courtesy: Byung-Gon Chun et. al.
AppVM Clones
• Virtual machine of entire client device– Android x86 VM natively executed on VMWare in
an x86 machine
• Synchronized file systems
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 30Courtesy: Byung-Gon Chun et. al.
Partitioning
Where to partition code, satisfying any constraints for correctness,
so as to optimize for current conditions
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 31Courtesy: Byung-Gon Chun et. al.
Automatic Partitioning Framework
Partition Analyzer
Applicationbinary
Partitioningconstraints
Static analysis
location-constraints
Profilinginputs
Dynamicprofiling
cost-annotatedexecutions
Optimizationsolver
Optimal partitioning
pointsIdentify valid split points
Construct cost models
Pick best choice for an objective
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 32Courtesy: Byung-Gon Chun et. al.
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
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 33Courtesy: Byung-Gon Chun et. al.
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
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 34Courtesy: Byung-Gon Chun et. al.
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
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 35Courtesy: Byung-Gon Chun et. al.
Partitioning: Optimization
• List all partitioning choices
• Remove partitioning choices that do not meet the constraints
• For each choice, compute total time
• Find the minimum
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 36Courtesy: Byung-Gon Chun et. al.
Distributed Execution
How to seamlessly execute the partitions of an application locally and remotely
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 37Courtesy: Byung-Gon Chun et. al.
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)
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 38Courtesy: Byung-Gon Chun et. al.
Migration: Suspend-Transmit-Resume
Mobile device Clone
Transmit
At migration pointSuspend threadCapture context Transmit Launch process
Patch migrated contextResume thread
Suspend threadCapture contextMerge migrated
contextResume thread
At reintegration point
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 39Courtesy: Byung-Gon Chun et. al.
Migration Challenges
• Regular IDs (references) not globally unique– Address space difference between mobile device
and clone
• System objects created at boot everywhere
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 40Courtesy: Byung-Gon Chun et. al.
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
ation(3) Mobile Device
Reference MID CID0x01 1 110x02 2 120x03 3 130x04 4 140x05 5 15
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 41Courtesy: Byung-Gon Chun et. al.
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
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 42Courtesy: Byung-Gon Chun et. al.
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 3G4/2/12 Cellular Networks and Mobile Computing
(COMS 6998-8) 43Courtesy: Byung-Gon Chun et. al.
Execution Time Comparison (Image Search)
Exec
utio
n tim
e (s
econ
ds)
1 image 10 images 100 images0
500
1000
1500
2000
2500
Phone(Local)
CloneCloud(Wi-Fi)
CloneCloud(3G)
20x
1x
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 44Courtesy: Byung-Gon Chun et. al.
Energy Consumption Comparison (Image Search)
Ener
gy c
onsu
mpt
ion
(J)
1 image 10 images 100 images0
300
600
900
1200
1500
1800
Phone(Local)CloneCloud(Wi-Fi)CloneCloud(3G)
20x
1x
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 45Courtesy: Byung-Gon Chun et. al.
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
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 46Courtesy: Byung-Gon Chun et. al.
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
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 47Courtesy: Byung-Gon Chun et. al.
mCloud Programming Model: Odessa• Data flow graph: vertices are stages; edges are connectors;
stages share nothing
48Face Recognition Gesture Recognition4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)Object Pose Estimation
Source: Odessa Mobisys presentation
mCloud Programming Model: Odessa (Cont’d)
• Offloading DEcision System for Streaming Applications
NetworkApplication
Sprout
Odessa
Mobile Device
Application
SproutOdessa Profiler
Cloud Infrastructure
OdessaRuntime Profiler Decision
Engine
4/2/12Cellular Networks and Mobile Computing
(COMS 6998-8) 49Source: Odessa Mobisys presentation
mCloud Programming Model: Odessa (Cont’d)
50
B2
Network
CB A
B1 A
Application Data Flow Graph Screen
C
Local Execution
Cost
RemoteExecution
Cost>4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)Smartphone
Cloud Infrastructure
Incremental decisions adapt quickly to input and platform variability.
Source: Odessa Mobisys presentation
mCloud Programming Model: Orleans
51
• Software framework and runtime to make cloud programming easier and more productive
• Shift burden of correctness and performance from developer to Orleans system
• Experimental system from Microsoft Research
• Radically simplified, prescriptive programming model – Actors– Asynchronous messaging– Lightweight transactions– Persistence– Adaptive performance management
Application
Orleans
.NET
Azure
Servers
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
mCloud Programming Model: Orleans (Cont’d)
• Actor based: fine-grain distributed objects are natural abstraction
• Grains partition data• Secure and isolated computation with clear
points of communications– Enable computation replication
• Natural integration with persistent storage– Grain resides on disk until activated
52
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
mCloud Programming Model: Orleans (Cont’d)
53
Field ValueName “John Doe”Email “john.doe@hotmail
.com”Address “123 Main St.,
Anywhere UR 01234”
Products
Grain ID1Grain
ID2
Checkout
AddProduct
RemoveProduct
Grain (actor)
Customer GrainMessages
State
MethodsMessage Queue
4/2/12Cellular Networks and Mobile Computing
(COMS 6998-8) Courtesy Jim Larus
Support for Service Interaction
• Synergy of mCloud services– Shared basic services enables more efficient usage of
cloud resources(e.g. shared memcache eliminates data duplication of individual services)
– Co-location makes mashed-up applications to achieve native performance (file transfer becomes an object reference)
• mCloud offers shared platform services• mCloud optimizes service interaction through
active VM migration544/2/12 Cellular Networks and Mobile Computing
(COMS 6998-8)
Closing Thoughts
• Cloud computing needs to advance in architecture, programming model, platform services to revolutionize mobile computing
554/2/12 Cellular Networks and Mobile Computing (COMS 6998-8)
Useful Tools
• Hprof: a heap/CPU profiling tool• Jchord: a static analysis tool on Java bytecode• Dummynet (ipfw): simulates/enforces queue
and bandwidth limitations, delays, packet losses
• OpenCV: a library of programming functions for real time computer vision
4/2/12 Cellular Networks and Mobile Computing (COMS 6998-8) 56