mobile cloud computing - arvutiteaduse instituut

43
Mobile Cloud Computing Satish Srirama [email protected] MTAT.03.262 - Mobile Application Development – Lecture 8

Upload: others

Post on 04-Apr-2022

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mobile Cloud Computing - Arvutiteaduse instituut

Mobile Cloud Computing

Satish [email protected]

MTAT.03.262 - Mobile Application Development – Lecture 8

Page 2: Mobile Cloud Computing - Arvutiteaduse instituut

Outline

• Cloud Computing

• Mobile Cloud

– Binding Models

• HomeAssignment3

10/30/2015 Satish Srirama 2/43

Page 3: Mobile Cloud Computing - Arvutiteaduse instituut

WHAT IS CLOUD COMPUTING?

No consistent answer!

Everyone thinks it is something else…

“It’s nothing new”“...we’ve redefined Cloud Computing to include everything that we already do... I don’t understand what we would do differently ... other than change the wording of some of our ads.”

Larry Ellison, CEO, Oracle (Wall Street Journal, Sept. 26, 2008)

“It’s a trap”“It’s worse than stupidity: it’s marketing hype. Somebody is saying this is inevitable—and whenever you hear that, it’s very likely to be a set of businesses campaigning to make it true.”

Richard Stallman, Founder, Free Software Foundation (The Guardian, Sept. 29, 2008)

Slide taken from Professor Anthony D. Joseph’s lecture at RWTH Aachen10/30/2015 Satish Srirama 3

Page 4: Mobile Cloud Computing - Arvutiteaduse instituut

What is Cloud Computing?

• Computing as a utility

– Utility services e.g. water, electricity, gas etc

– Consumers pay based on their usage

10/30/2015 Satish Srirama 4/43

Page 5: Mobile Cloud Computing - Arvutiteaduse instituut

Timeline

10/30/2015 Satish Srirama 5/43

Page 6: Mobile Cloud Computing - Arvutiteaduse instituut

Clouds - Why Now (not then)?

• Experience with very large datacenters

– Unprecedented economies of scale

– Transfer of risk

• Technology factors

– Pervasive broadband Internet

– Maturity in Virtualization Technology

• Business factors

– Minimal capital expenditure

– Pay-as-you-go billing model

10/30/2015 Satish Srirama 6/43

Page 7: Mobile Cloud Computing - Arvutiteaduse instituut

• Virtualization techniques are the basis of the cloud computing

• Virtualization technologies partition hardware and thus provide flexible and scalable computing platforms

• Virtual machine techniques

– VMware and Xen

– OpenNebula

– Amazon EC2

Virtualization

Hardware

OS

App App App

Hypervisor

OS OS

Virtualized Stack

10/30/2015 Satish Srirama 7/43

Page 8: Mobile Cloud Computing - Arvutiteaduse instituut

Cloud Computing - Characteristics

• Illusion of infinite resources

• No up-front cost

• Fine-grained billing (e.g. hourly)

• Gartner: “Cloud computing is a style of

computing where massively scalable IT-related

capabilities are provided ‘as a service’ across

the Internet to multiple external customers”

10/30/2015 Satish Srirama 8/43

Page 9: Mobile Cloud Computing - Arvutiteaduse instituut

Cloud Computing - Services• Software as a Service – SaaS

– A way to access applications hosted on the web through your web browser

• Platform as a Service – PaaS

– Provides a computing platform and a solution stack (e.g. LAMP) as a service

• Infrastructure as a Service –IaaS

– Use of commodity computers, distributed across Internet, to perform parallel processing, distributed storage, indexing and mining of data

– Virtualization

SaaS

Facebook, Flikr, Myspace.com,

Google maps API, Gmail

PaaS

Google App Engine, Force.com, Hadoop, Azure,

Heroku, etc

IaaS

Amazon EC2, Rackspace, GoGrid, SciCloud, etc.

Level of

Abstraction

10/30/2015 Satish Srirama 9/43

Page 10: Mobile Cloud Computing - Arvutiteaduse instituut

Cloud Computing - Themes

• Massively scalable

• On-demand & dynamic

• Only use what you need - Elastic – No upfront commitments, use on short term basis

• Accessible via Internet, location independent

• Transparent – Complexity concealed from users, virtualized,

abstracted

• Service oriented – Easy to use SLAs

SLA – Service Level Agreement

10/30/2015 Satish Srirama 10/43

Page 11: Mobile Cloud Computing - Arvutiteaduse instituut

Cloud Models

• Internal (private) cloud– Cloud with in an organization

• Community cloud– Cloud infrastructure jointly

owned by several organizations

• Public cloud– Cloud infrastructure owned by

an organization, provided to general public as service

• Hybrid cloud– Composition of two or more

cloud models

10/30/2015 Satish Srirama 11/43

Page 12: Mobile Cloud Computing - Arvutiteaduse instituut

Cloud Application Demand

• Many cloud applications have cyclical demand curves– Daily, weekly, monthly, …

• Workload spikes are more frequent and significant– When some event happens like a pop star has expired:

• More # tweets, Wikipedia traffic increases

• 22% of tweets, 20% of Wikipedia traffic when Michael Jackson expired in 2009 – Google thought they are under attack

Demand

Time

Res

ourc

es

10/30/2015 Satish Srirama 12/43

Page 13: Mobile Cloud Computing - Arvutiteaduse instituut

Unused resources

Economics of Cloud Users

• Pay by use instead of provisioning for peak

Static data center Data center in the cloud

Demand

Capacity

Time

Res

ourc

es

Demand

Capacity

Time

Res

ourc

es

10/30/2015 Satish Srirama 13/43

Page 14: Mobile Cloud Computing - Arvutiteaduse instituut

Unused resources

Economics of Cloud Users - continued

• Risk of over-provisioning: underutilization

– Huge sunk cost in infrastructure

Static data center

Demand

Capacity

Time

Res

ourc

es

10/30/2015 Satish Srirama 14/43

Page 15: Mobile Cloud Computing - Arvutiteaduse instituut

Economics of Cloud Users - continued

• Heavy penalty for under-provisioning

Lost revenue

Lost users

Res

ourc

esDemand

Capacity

Time (days)

1 2 3

Res

ourc

es

Demand

Capacity

Time (days)

1 2 3

Res

ourc

es

Demand

Capacity

Time (days)

1 2 3

10/30/2015 Satish Srirama 15/43

Page 16: Mobile Cloud Computing - Arvutiteaduse instituut

Optimal resource provisioning for

auto-scaling enterprise applications• Auto-Scaling

– Scaling policy -> When to Scale

– Resource provisioning policy -> How to scale

• Cloud providers offer various instance types with different processing power and price– Can it be exploited in deciding the resource provisioning policy?

– Makes the policy to be aware of current deployment configuration

• Another challenge: Cloud providers charge the resource usage for fixed time periods– E.g. Hourly prices of Amazon cloud

• Developed an LP based optimization model which considers both the issues [Srirama and Ostovar, CloudCom 2014]

10/30/2015 Satish Srirama 16/43

Page 17: Mobile Cloud Computing - Arvutiteaduse instituut

Scaling enterprise application with the

optimization model

10/30/2015 Satish Srirama

Incoming load and scaling

curves of Optimization model

Instance type usage curves of

Optimization model

Scaling with Amazon

AutoScale

[Srirama and Ostovar, CloudCom 2014]

Basics of Cloud Computing - MTAT.08.027 (Spring 2016)17/43

Page 18: Mobile Cloud Computing - Arvutiteaduse instituut

Short Term Implications of Clouds

• Startups and prototyping

– Minimize infrastructure risk

– Lower cost of entry

• Batch jobs

• One-off tasks

– Washington post, NY Times

• Cost associatively for scientific applications

• Research at scale

10/30/2015 Satish Srirama 18/43

Page 19: Mobile Cloud Computing - Arvutiteaduse instituut

Long Term Implications of clouds

• Application software:

– Cloud & client parts, disconnection tolerance

• Infrastructure software:

– Resource accounting, VM awareness

• Hardware systems:

– Containers, energy proportionality

10/30/2015 Satish Srirama 19/43

Page 20: Mobile Cloud Computing - Arvutiteaduse instituut

Economics of Cloud Providers

• Cloud Computing providers bring a shift from high reliability/availability servers to commodity servers– At least one failure per day in large datacenter

• Why?– Significant economic incentives

• much lower per-server cost

• Caveat: User software has to adapt to failures– Very hard problem!

• Solution: Replicate data and computation– MapReduce & Distributed File System

10/30/2015 Satish Srirama

Basics of Cloud Computing - MTAT.08.027 (Spring 2016)[Srirama et al, FGCS 2012]20/43

Page 21: Mobile Cloud Computing - Arvutiteaduse instituut

Cloud Computing Progress

Armando Fox, 2010

10/30/2015 Satish Srirama 21/43

Page 22: Mobile Cloud Computing - Arvutiteaduse instituut

Mobile Cloud Computing

• One can do interesting things on mobiles directly

– Today’s mobiles are far more capable

– We can even provide services from smart phones[Srirama et al, ICIW 2006; Srirama and Paniagua, MS 2013; Chang et al, ICSOC 2012; Liyanage et al, MS 2015]

• However, some applications need to offload certain activities to servers

– Processing sensor data

• Resource-intensive processing on the cloud

– To enrich the functionality of mobile applications

10/30/2015 Satish Srirama 22/43

Page 23: Mobile Cloud Computing - Arvutiteaduse instituut

Mobile Cloud Applications

• Bring the cloud infrastructure to the proximity

of the mobile user

• Mobile has significant advantage by going

cloud-aware

– Increased data storage capacity

– Availability of unlimited processing power

– PC-like functionality for mobile applications

– Extended battery life (energy efficiency)

10/30/2015 Satish Srirama 23/43

Page 24: Mobile Cloud Computing - Arvutiteaduse instituut

Mobile cloud - Binding models

Delegation Code Offloading

MCM

[Flores and Srirama, JSS 2014] [Flores et al, IEEE Communications Mag 2015]

10/30/2015 Satish Srirama 24/43

Page 25: Mobile Cloud Computing - Arvutiteaduse instituut

Demo & Exercise

• Start an Amazon EC2 instance from mobile

• Exercise: Submit a job there

https://bitbucket.org/mobilecloudlab/mad_fall2

015_ec2_adaptor/

10/30/2015 Satish Srirama 25/43

Page 26: Mobile Cloud Computing - Arvutiteaduse instituut

Mobile Cloud mash-up applications

• Mobiles may have to take advantage of multiple clouds

• Follows traditional SOA model to invoke services

• Typical scenarios – Process intensive services

• Face recognition, sensor mining etc.

– Data Synchronization (SyncML, Funambol, Google Sync)• Calendar, contacts etc.

• Critical challenges – Cloud interoperability is a huge trouble

– Mobiles need to possess multiple APIs

– Unavailability of standards and mobile platform specific API

10/30/2015 Satish Srirama 26/43

Page 27: Mobile Cloud Computing - Arvutiteaduse instituut

Mobile Cloud Middleware

[Flores et al, MoMM 2011; Flores and Srirama, JSS 2014]

[Srirama and Paniagua, MS 2013]

10/30/2015

[Warren et al, IEEE PC 2014]

Satish Srirama

Google Cloud

Messaging

Microsoft Push

Notification

Service

27/43

Page 28: Mobile Cloud Computing - Arvutiteaduse instituut

MCM – enables

• Interoperability between different Cloud Services (IaaS, SaaS, PaaS) and Providers (Amazon, Eucalyptus, etc)

• Provides an abstraction layer on top of API

• Composition of different Cloud Services

• Asynchronous communication between the device and MCM

• Means to parallelize the tasks and take advantage of Cloud’s intrinsic characteristics

10/30/2015 Satish Srirama 28/43

Page 29: Mobile Cloud Computing - Arvutiteaduse instituut

CroudSTag – Scenario

• CroudSTag takes the pictures/videos from the cloud and tries to recognize people

– Pictures/Videos are actually taken by the phone

– Processes the videos

– Recognizes people using facial recognition technologies

• Reports the user a list of people recognized in the pictures

• The user decides whether to add them or not to the social group

• The people selected by the user receive a message in facebook inviting them to join the social group

10/30/2015 Satish Srirama 29/43

Page 30: Mobile Cloud Computing - Arvutiteaduse instituut

CroudSTag [Srirama et al, PCS 2011;

SOCA 2012]

• Cloud services used

– Media storage on

Amazon S3

– Processing videos on

Elastic MapReduce

– face.com to recognize

people on facebook

– Starting social group

on facebook

10/30/2015 Satish Srirama 30/43

Page 31: Mobile Cloud Computing - Arvutiteaduse instituut

Other applications

• Zompopo [Srirama et al, NGMAST 2011]

– Intelligent calendar, by mining accelerometer sensor data

• Bakabs [Paniagua et al, iiWAS-2011]

– Managing the Cloud resources from mobile

• Sensor data analysis– Human activity recognition

– Context aware gaming

– MapReduce based sensor data analysis [Paniagua et al, MobiWIS2012]

• SPiCa: A Social Private Cloud Computing Application Framework [Chang et al, MUM 2014]

10/30/2015 Satish Srirama 31/43

Page 32: Mobile Cloud Computing - Arvutiteaduse instituut

Checking for updates

• Polling

• Polling consumes lot of battery of mobile

• Heavy load on the resources of the server

• Strains the network

10/30/2015 Satish Srirama

Any new updates ?

No

Any new updates ?

No

Any new updates ?

YES

32/43

Page 33: Mobile Cloud Computing - Arvutiteaduse instituut

Google Cloud Messaging

• Free service that allows you to send data from

your servers to your users and vice versa

• Handles queuing of messages and delivery to

the target application

– Application does not need to be running in the background for receiving data messages

– The system will wake up the Android application

via Intent broadcast when the message arrives

10/30/2015 Satish Srirama 33/43

Page 34: Mobile Cloud Computing - Arvutiteaduse instituut

Working with GCM

10/30/2015 Satish Srirama

Mobile App

GCM

1.Request for Registration

2.Reply with Registration Id

5. Send Message

3.Send Registration Id 4. Send message {RegId, msg}

https://developers.google.com/cloud-messaging/

[Warren et al, IEEE PC 2014]

34/43

Page 35: Mobile Cloud Computing - Arvutiteaduse instituut

Exercise

• Working with GCM

https://bitbucket.org/snsrirama/gcmtrial

http://52.91.75.87:8080/gcm/

10/30/2015 Satish Srirama 35/43

Page 36: Mobile Cloud Computing - Arvutiteaduse instituut

Code Offloading

• Also known as Cyber-foraging [M. Satyanarayanan, 2001]

• Not a completely new topic

– Can be realized similar to RMI, RPC etc.

• Devices offload some of their heavy work to

stronger surrogate machines in the vicinity

(Cloudlets)

10/30/2015 Satish Srirama 36/43

Page 37: Mobile Cloud Computing - Arvutiteaduse instituut

Major Components

• Mobile

– Code profiler

– System profilers

– Decision engine

• Cloud based surrogate platform

10/30/2015 Satish Srirama 37/43

Page 38: Mobile Cloud Computing - Arvutiteaduse instituut

Some of the well known frameworks

• MAUI

– Manual annotations [Cuervo et al., 2010]

• CloneCloud

– Code profilers & Automated process [Chun et al.,

2011]

• ThinkAir

– Manual annotations and scalability [Kosta et al, 2012]

• EMCO [Flores and Srirama, MCS 2013] & etc.

10/30/2015 Satish Srirama 38/43

Page 39: Mobile Cloud Computing - Arvutiteaduse instituut

Code offloading – Major challenges

• Work in controlled environments like nearby

servers

– However, none can be adapted for real life

applications

• Major research challenges

– What, when, where and how to offload?

10/30/2015 Satish Srirama

[Flores et al, IEEE Communications Mag 2015]

39/43

Page 40: Mobile Cloud Computing - Arvutiteaduse instituut

Practical adaptability of offloading

Applications that can benefit became limited with increase in device capacities10/30/2015 Satish Srirama 40/43

Page 41: Mobile Cloud Computing - Arvutiteaduse instituut

Exercise - optional

• Java reflection

– https://gist.github.com/huberflores/9829019

• Transforming a java method to a

computational offloading format

– https://gist.github.com/huberflores/6e4e0894d95

e16f1c25e

10/30/2015 Satish Srirama 41/43

Page 42: Mobile Cloud Computing - Arvutiteaduse instituut

Home Assignment - 3

• Encrypting and decrypting an image on the Cloud instance (15 points)

• Initiate the procedure on receiving a GCM message (10 points)– Design a protocol for the received messages

• Deadline – 12th November 2015

• Last deadline for all submissions – 19th November 2015

10/30/2015 Satish Srirama 42/43

Page 43: Mobile Cloud Computing - Arvutiteaduse instituut

References• S. N. Srirama, A. Ostovar: Optimal Resource Provisioning for Scaling Enterprise Applications on the Cloud, The 6th IEEE International Conference on

Cloud Computing Technology and Science (CloudCom-2014), December 15-18, 2014, pp. 262-271. IEEE.

• S. N. Srirama, P. Jakovits, E. Vainikko: Adapting Scientific Computing Problems to Clouds using MapReduce, Future Generation Computer Systems Journal, 28(1):184-192, 2012. Elsevier press. DOI 10.1016/j.future.2011.05.025.

• S. N. Srirama, M. Jarke, W. Prinz: Mobile Web Service Provisioning, Proceedings of the Advanced International Conference on Telecommunications and International Conference on Internet and Web Applications and Services (AICT-ICIW 2006), February 23-25, 2006, pp. 120-125. IEEE CS Press.

• S. N. Srirama, C. Paniagua: Mobile Web Service Provisioning and Discovery in Android Days, The 2013 IEEE International Conference on Mobile Services (MS 2013), June 27 - July 02, 2013, pp. 15-22. IEEE.

• C. Chang, S. N. Srirama, S. Ling: An Adaptive Mediation Framework for Mobile P2P Social Content Sharing, 10th International Conference on Service Oriented Computing (ICSOC 2012), November 12-16, 2012, pp. 374-388. Springer LNCS.

• M. Liyanage, C. Chang, S. N. Srirama: Lightweight Mobile Web Service Provisioning for Sensor Mediation, 4th International Conference on Mobile Services (MS 2015), June 27 - July 2, 2015, pp. 57-64. IEEE.

• H. Flores, S. N. Srirama: Mobile Cloud Middleware, Journal of Systems and Software, ISSN: 0164-1212, 92(1):82-94, 2014. Elsevier. DOI: 10.1016/j.jss.2013.09.012.

• H. Flores, P. Hui, S. Tarkoma, Y. Li, S. N. Srirama, R. Buyya: Mobile Code Offloading: From Concept to Practice and Beyond, IEEE Communications Magazine, ISSN: 0163-6804, 53(3):80-88, 2015. IEEE. DOI:10.1109/MCOM.2015.7060486

• I. Warren, A. Meads, S. N. Srirama, T. Weerasinghe, C. Paniagua: Push Notification Mechanisms for Pervasive Smartphone Applications, IEEE Pervasive Computing, ISSN: 1536-1268, 13(2):61-71, 2014. IEEE. DOI:10.1109/MPRV.2014.34.

• H. Flores, S. N. Srirama, C. Paniagua: A Generic Middleware Framework for Handling Process Intensive Hybrid Cloud Services from Mobiles, The 9th International Conference on Advances in Mobile Computing & Multimedia (MoMM-2011), December 5-7, 2011, pp. 87-95. ACM.

• S. N. Srirama, C. Paniagua, H. Flores: CroudSTag: Social Group Formation with Facial Recognition and Mobile Cloud Services, The 8th International Conference on Mobile Web Information Systems (MobiWIS 2011), September 19-21, 2011, v. 5 of Procedia Computer Science, pp. 633-640. Elsevier.

• S. N. Srirama, C. Paniagua, H. Flores: Social Group Formation with Mobile Cloud Services, Service Oriented Computing and Applications Journal, ISSN: 1863-2386, 6(4):351-362, 2012. Springer. DOI: 10.1007/s11761-012-0111-5.

• S. N. Srirama, H. Flores, C. Paniagua: Zompopo: Mobile Calendar Prediction based on Human Activities Recognition using the Accelerometer and Cloud Services, 5th Int. Conf. on Next Generation Mobile Applications, Services and Technologies (NGMAST 2011), Sep. 14-16, 2011, pp. 63-69. IEEE.

• Cuervo, Eduardo, et al. "MAUI: making smartphones last longer with code offload." Proceedings of the 8th international conference on Mobile systems, applications, and services. ACM, 2010.

• Kosta, Sokol, et al. "Thinkair: Dynamic resource allocation and parallel execution in the cloud for mobile code offloading." INFOCOM, 2012 Proceedings IEEE. IEEE, 2012.

• Satyanarayanan, Mahadev, et al. "The case for vm-based cloudlets in mobile computing." Pervasive Computing, IEEE 8.4 (2009): 14-23.

• H. Flores, S. N. Srirama: Adaptive Code Offloading for Mobile Cloud Applications: Exploiting Fuzzy Sets and Evidence-based Learning, The Fourth ACM Workshop on Mobile Cloud Computing and Services (MCS 2013) @ The 11th International Conference on Mobile Systems, Applications and Services (MobiSys 2013), June 25-28, 2013, pp. 9-16. ACM.

10/30/2015 Satish Srirama 43/43