z6110x0035: introduction to cloud computing - cloud edge...

43
Z6110X0035: Introduction to Cloud Computing - Cloud–Edge Computing Lecturer: Prof. Zichen Xu Acknowledge Dr. Weisong Shi, ApproxIoT, and Tsinghua University

Upload: others

Post on 25-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Z6110X0035: Introduction to Cloud Computing

- Cloud–Edge Computing

Lecturer: Prof. Zichen Xu

Acknowledge Dr. Weisong Shi, ApproxIoT, and Tsinghua University

Page 2: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Recap from Previous Class

Finals!

Page 3: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Cloud-edge Computing Paradigm

物联网 云计算

Page 4: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Why do we need edge computing

Push from cloud services

Pull from IoT

Change From Data Consumer to Producer

Page 5: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

What is edge computing

We define “edge” as any

computing and network

resources along the path

between data sources and cloud

data centers.

Edge computing is

interchangeable with fog

computing.

Page 6: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Case study

1. Cloud offloading (online shopping services)

2. Video analytics (finding a lost child in the city)

3. Smart home

4. Smart city

5. Collaborative edge

Page 7: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Challenges and opportunities

ProgrammabilityComputing stream that is defined as a serial of functions/computing applied on the data

along the data propagation path.

The function/computing distribution metric could be latency-driven, energy cost, TCO,

and hardware/software specified limitations.

Page 8: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Challenges and opportunities

Naming

Page 9: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Challenges and opportunities

Data abstraction

Page 10: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Challenges and opportunities

Service Managementdifferentiation, extensibility, isolation, and reliability

Privacy and Security

Optimization Metrics(latency、bandwidth、energy、cost)

Page 11: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Quantifying the Impact of Edge Computing on

Mobile Applications

How much can edge computing actually benefit end users

Latency and energy consumption

Compute-intensive and latency-sensitive applications such as

mobile augmented reality

Page 12: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Experimental applications

Comet: a existing tool that can transparently migrate threads

from a mobile device to a remote server and back

Page 13: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Experimental Setup

Cloudlet: a mobility-enhanced small-scale cloud datacenter

that is located at the edge of the Internet.

Page 14: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Experimental Setup

No offload

Cloud-WiFi

Cloudlet-WiFi

Cloudlet-LTE

Cloud-LTE

Page 15: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

WiFi offloading performance

Page 16: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

WiFi offloading and energy

Page 17: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

LTE offloading performance

Page 18: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Mobile Edge Computing: Progress and Challenges

Page 19: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

A Edge Analytics Demo

IBM

Page 20: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

An Edge Analytics Demo

This demo is to showcase the following

1.How sensors and digitized elements get locally connected with one or more IoT gateway instances in order to gather and transmit

any useful and usable data to the IoT gateway. In other words, multi-structed and massive data getting generated by various sensors

and sensors-attached assets in a particular environment (say, homes, hotels, hospitals, etc.) are received and temporarily stocked by

IoT gateways / middleware/brokers for purpose-specific data analytics.

2.By deploying an edge analytics and application development platform in the IoT gateway (Raspberry Pi was used for our demo), all

kinds of data getting collected are getting cleansed and crunched in real-time in order to emit out actionable and timely insights.

3.The IoT gateway also contributes in filtering out irrelevant data at the source itself so that a very limited amount of useful data gets

transmitted to the faraway clouds to facilitate historical and comprehensive big data analytics. The IoT gateway acts as an

intermediary between scores of on-premise edge systems and off-premise clouds.

4.IoT gateway modules (typically touted as fog devices) act as the master node/leader in monitoring, measuring and managing

various dynamic edge devices and their operational parameters

5.IoT gateway modules seamlessly and spontaneously integrate the physical world with the cyber world (cloud services, applications,

databases, platforms, etc.)

6.IoT gateway activates, augments, and adapts actuation devices (edge) based on the insights extricated through analytics in real

time

Page 21: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Cloud

Edge Compute(Raspberry Pi)

The Macro-level Architecture of our Demo System

21

Edge Analytics(Edgent)

Container Management (Kubernetes)

Me

ssag

e B

roke

r (K

afka

)

Machine Learning / AI

Sen

sors

/Dev

ice

Co

ntr

olle

rs

Dev

ice

s

Page 22: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

The Demo Components

•Raspberry Pi Configuration Steps:

•https://www.raspberrypi.org/documentation/configuration/

•Model 3 b+, Configuration – 1 GB RAM, 64GB SD card

•Processor Type: Broadcom BCM2837B0, Cortex-A53 64-bit SoC @ 1.4 GHz

•Ports: 3 USBs, HDMI, 2 WLAN, 1 Ethernet, Bluetooth

•IR/Motion Sensor / Pulse Rate Monitor

•Pi4j - http://pi4j.com/download.html

•Apache Edgent 1.2.0

•https://developer.ibm.com/recipes/tutorials/setting-up-apache-edgent-on-my-raspberry-pi-3/

•Docker Container - through the clustering of heterogeneous edge / fog devices

•AWS Compute Instance

•Apache Flink 1.4.2

•https://data-flair.training/blogs/install-configure-apache-flink-ubuntu/

•Not used for this demo/workshop:

•Kafka

•Kubernetes

Page 23: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Confidential | DD.MM.YY | version #

The Raspberry Pi PIN Layout

Page 24: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Modern online services

Stream aggregator

Stream analytics system

UsefulInformation

Processing streaming data from different sources

Page 25: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Modern online services

Low latency

Tension

Approximate computing

Efficient resourceutilization

Page 26: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Approximate computing

Many applications:Approximate output is good enough!

The proportion of data is useful for this application

Live taxi heatmap

Page 27: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Approximate computing

Idea: To achieve low latency, compute over a sub-set of data items instead of the entire data-set

Analyze

Approximate output ±error bound

Approximatecomputing(sampling)

Page 28: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

State-of-the-art system

StreamApprox [Middleware’17]

Approximate output ± error boundStreamApprox

Stream aggregator

S1

S2

Sn

Data stream

Cloud datacenter

Limitations: • It wastes bandwidth• It utilizes only cloud datacenter resources

Page 29: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Edge computing

Cloud

Gateway

Edge nodeLocal processing

Source of data

Allows data to be processed at the edge node before it’s sent to the cloud

Opportunities: • Providing more computing resources • Saving bandwidth

Page 30: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Edge infrastructure

Source: https://peering.google.com/#/infrastructure

Azure IoT edge

Watson IoT

AWS IoT

Page 31: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Problem statement

To build a stream analytics systemBy utilizing the cloud and edge computing resourcesBy leveraging approximate computing

Design goalsEfficiency: Efficient utilization of computing resourcesAdaptability: Adaptive execution based on the available resourcesTransparency: No code change required and resource management

Page 32: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

ApproxIoT: Overview

S1

Si

Sn

Sm

……

Central node

Cloud

Query

Approximate output ± error bound

ApproxIoTApproxIoT employs sampling in the distributed environment of

edge + cloud

Edge nodes

Regional edge

Continental node

Page 33: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Naïve algorithm

SRS Query

Simple random sampling (SRS)

Approximate output ± error bound

Sampled unfairly Overlooked Low accuracy

Page 34: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Background: Stratified sampling

Stratified sampling

Advantage: The sub-streams are sampled fairly

Disadvantage: Requires the knowledge of each sub-stream size

Page 35: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Background: Reservoir sampling

Reservoir sampling

Size of reservoir = 4

Reservoir sampling

Size of reservoir = 4

Advantage: • No pre-knowledge required of sub-stream size

Disadvantages: • The sub-streams are sampled unfairly• Difficult to run on multiple nodes

Reservoir sampling

Size of reservoir = 4

The 5th item With probability(4

5) replaced by the 5th item

Reservoir sampling

Size of reservoir = 4

Reservoir sampling

Size of reservoir = 4

The 6th item With probability(4

6) replaced by the 6th item

Reservoir sampling

Size of reservoir = 4

Reservoir sampling

Size of reservoir = 4

Page 36: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

ApproxIoT sampling algorithm

Easy to parallelize, requires no synchronization between

sub-streams

Weighted hierarchical sampling (WHS)

Combining stratified and reservoir sampling

Weight: C/N, if C>N 1, if C <=N

WHS

Reservoir size N=4 With initial weight 1

W=1W=1

W=1

W=6/4W=1

W=1

C=6

Page 37: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

WHS on edge nodes

Regional edge WHS

W=1W=1

W=1

W=6/2=3W=4/2=2

W=1

Continental node WHS

W=4W=1

W=3

W=4*5/2=10W=1*3/2=3/2

W=3

Reservoir size equals 2

Central node

CloudEdge nodes

Regional edge Continental node

Easy to parallelize, requires no synchronization between

computing nodes

Carried weight Current weight

Page 38: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

ApproxIoT in the cloud

Reservoir size equals 1

Query (sum)WHS

The weights are carried W=4/3*6/1 =8

W=1*4/1=4

W=1*2/1=2

± error bound

8* +4* +2*

W=4/3

W=1

W=1

Approximate output:

Central node

CloudEdge nodes

Regional edge Continental node

Page 39: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Implementation

S1

S2

Sn

Kafka cluster

Streampub/sub

Edgenodes

Clouddatacenter

Data stream

Sampleddata stream

Sampleddata stream

See the paper for more details

Kafka Streams

Page 40: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Experimental setup

Evaluation questionsAccuracy vs. sample sizeThroughput vs. sample size

Testbed: 25 nodes15 nodes for ApproxIoT deployment 10 nodes for Kafka cluster

Datasets: Synthetic: Poisson and Gaussian distributionReal: Brasvo pollution and New York Taxi Ride

See the paper for more results!

Page 41: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Accuracy vs. sample size

0

20

40

60

80

10 20 40 60 80

Acc

ura

cy lo

ss(%

)

Sampling fraction(%)

SRS ApproxIoTLower

the better

ApproxIoT: ~2600X higher accuracy over SRS

The average is 0.035%

Page 42: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Throughput vs. sample size

0

40

80

120

10 20 40 60 80 90 100

Thro

ugh

pu

t(k)

item

s/s

Sampling fraction(%)

Native SRS ApproxIoTHigher

the better

• ApproxIoT has low overhead compared to the native execution• ApproxIoT has similar throughput as SRS

Page 43: Z6110X0035: Introduction to Cloud Computing - Cloud Edge Computinggood.ncu.edu.cn/~xuz/cc/L10.pdf · 2019-05-14 · Edge computing is interchangeable with fog computing. Case study

Conclusion: The promise of edge computing

Infrastructure and design

Measurement works

Related applications The Design and Implementation of a Wireless Video Surveillance System