1 Cache Me If You Can. NUS.SOC.CS5248 OOI WEI TSANG 2 You Are Here Network Encoder Sender Middlebox...

Preview:

Citation preview

1

Cache Me If You Can

NUS.SOC.CS5248OOI WEI TSANG

2

You Are Here

Network

Encoder

Sender

Middlebox

Receiver

Decoder

NUS.SOC.CS5248OOI WEI TSANG

3

Cache Proxies for Web

A

NUS.SOC.CS5248OOI WEI TSANG

4

Hierarchical Caching

A

B

NUS.SOC.CS5248OOI WEI TSANG

5

Cooperative Caching

A B

NUS.SOC.CS5248OOI WEI TSANG

6

Distributed Caching

A B

NUS.SOC.CS5248OOI WEI TSANG

7

Streaming Media vs. Web Pages

NUS.SOC.CS5248OOI WEI TSANG

8

Video Access Pattern

by S. Acharya and B. Smith

Study at Lulea University, Sweden 55% complete, 45% stop very early High temporal locality

NUS.SOC.CS5248OOI WEI TSANG

9

Bimodal Distribution

10 30 50 70 90

% Played

NUS.SOC.CS5248OOI WEI TSANG

10

Zipf Distribution

log (Frequency)

log (rank)

Frequency = C/rankm

NUS.SOC.CS5248OOI WEI TSANG

11

Zipf Law

Frequency of English Words“the” “of” “to” “a”

City size

12

Benefits of Caching

NUS.SOC.CS5248OOI WEI TSANG

13

Reduce Access Latency

:) :(

NUS.SOC.CS5248OOI WEI TSANG

14

Reduce Server Load

NUS.SOC.CS5248OOI WEI TSANG

15

Buy Some Time

NUS.SOC.CS5248OOI WEI TSANG

16

Reduce Client Buffer Size

17

Type of Cache

NUS.SOC.CS5248OOI WEI TSANG

18

Types of Cache

Static caching

Dynamic cachingpatching buffer

NUS.SOC.CS5248OOI WEI TSANG

19

Static Caching

Cache “all or nothing” is badSplit video into segments of size

S

NUS.SOC.CS5248OOI WEI TSANG

20

If I am writing a survey Introduction

Differences between web and media caching

Video access pattern Benefits of caching

Different type of cache Proxy caching architecture

NUS.SOC.CS5248OOI WEI TSANG

21

Other Caching Issues

How to segment?Which segments to cache?When to fetch data?Who to fetch from?When cache is full, who to kick

out?How to measure popularity?Can cache adapt to popularity?

NUS.SOC.CS5248OOI WEI TSANG

22

Rest of the Lecture

Soccer – cooperative caching proxy

Silo, rainbow and cache token – distributed caching proxy

Mocha – with congestion control

23

SOCCER

Self-organizing cooperative caching architecture

NUS.SOC.CS5248OOI WEI TSANG

24

How to segment?

NUS.SOC.CS5248OOI WEI TSANG

25

Effects of Size S

Large S : Low utilizationSmall S : Lots of gaps

NUS.SOC.CS5248OOI WEI TSANG

26

Prefix Caching Policy

1 Chunk = k segments

NUS.SOC.CS5248OOI WEI TSANG

27

Fetching Cache Data

B

A

Server

Client 2Client 1

NUS.SOC.CS5248OOI WEI TSANG

28

Option 2

B

A

Server

Client 2Client 1

NUS.SOC.CS5248OOI WEI TSANG

29

Option 3

B

A

Server

Client 2Client 1

NUS.SOC.CS5248OOI WEI TSANG

30

Issues

How to advertise?How to choose helper?

NUS.SOC.CS5248OOI WEI TSANG

31

How to Advertise?

Balance betweennetwork loadfreshness of information

NUS.SOC.CS5248OOI WEI TSANG

32

Scalable AdvertisementExpanding Ring Advertisement

163264128

NUS.SOC.CS5248OOI WEI TSANG

33

How to Choose Helper?Consideration for Static Cache

network distance (1,2,3,4)number of streams being served

NUS.SOC.CS5248OOI WEI TSANG

34

Static Cache

Cost for retrieving data from node X to node Y =

treamsCurrNumOfSreamsMaxNumOfSt

reamsMaxNumOfStYXDist

*),(

NUS.SOC.CS5248OOI WEI TSANG

35

Dynamic Caching

Need to consider the size of patching buffer

S

NUS.SOC.CS5248OOI WEI TSANG

36

Dynamic Caching

Nused

Nfetched = min(s, Nused + Δ)

S

NUS.SOC.CS5248OOI WEI TSANG

37

Dynamic Cache

Potential Waste = Nfetched/Nused

Integrate into overall cost

NUS.SOC.CS5248OOI WEI TSANG

38

Helper Selection

Helper ask other helpers to help if segments not found on local cache

Pick lowest cost helper

NUS.SOC.CS5248OOI WEI TSANG

39

If Static Cache

Retrieve to fill current gapMay pick different helpers for

different gaps

Should avoid frequent switching

NUS.SOC.CS5248OOI WEI TSANG

40

If Dynamic Cache

Stick to one helper

NUS.SOC.CS5248OOI WEI TSANG

41

Evaluations

SOCCER

Hierarchical Proxies

Single Proxy

42

Silo, Rainbow and Cache Token

NUS.SOC.CS5248OOI WEI TSANG

43

Distributed Caching

B

A

Server

new clip!

NUS.SOC.CS5248OOI WEI TSANG

44

Distributed Caching

B

A

Server

NUS.SOC.CS5248OOI WEI TSANG

45

Distributed Caching

B

A

Server

NUS.SOC.CS5248OOI WEI TSANG

46

Distributed Caching

B

A

Server

NUS.SOC.CS5248OOI WEI TSANG

47

Cooperative vs DistributedCooperative caching caches

independentlyDistributed caching caches as a

team

NUS.SOC.CS5248OOI WEI TSANG

48

Problems

Who should cache what?

Which segment to kick out?

How to redistribute data?

NUS.SOC.CS5248OOI WEI TSANG

49

RCache

Np proxies

video of length Lv

divide into Ns equal segments

Each proxy caches each segment with a/Np probability

NUS.SOC.CS5248OOI WEI TSANG

50

Analysis

Probability that whole video is cached

Storage requirement aL

1ln

11

sNa

sN

NUS.SOC.CS5248OOI WEI TSANG

51

Two Parameters

How to divide video into segments?

What is the probability of storing each segment?

NUS.SOC.CS5248OOI WEI TSANG

52

Silo

segment size probabilityof storage

NUS.SOC.CS5248OOI WEI TSANG

53

Problems

Who should cache what?

Which segment to kick out?

How to redistribute data?

NUS.SOC.CS5248OOI WEI TSANG

54

Compute Popularity

For each videoFor each segment

NUS.SOC.CS5248OOI WEI TSANG

55

Rainbow Algorithm

less popular

NUS.SOC.CS5248OOI WEI TSANG

56

Problems

Who should cache what?

Which segment to kick out?

How to redistribute data?

NUS.SOC.CS5248OOI WEI TSANG

57

Data Redistribution

When popularity changes, need to redistribute.

Redistribute “on-demand” (lazy)

NUS.SOC.CS5248OOI WEI TSANG

58

Cache Token

Each segment have two bits(T,C)

T: I am suppose to have the segment C: I have the segment

NUS.SOC.CS5248OOI WEI TSANG

59

Data Redistribution

(T=1,C=1)(T=0,C=0)(T=1,C=0) (T=0,C=1)

NUS.SOC.CS5248OOI WEI TSANG

60

Silo, Rainbow and TokenDistributed Caching ArchitectureFault tolerantScalable

61

Proxy Cache + Congestion Control

NUS.SOC.CS5248OOI WEI TSANG

62

Scenario (10am)

A

Server

Client 2

NUS.SOC.CS5248OOI WEI TSANG

63

Scenario (1am)

A

Server

Client 2

NUS.SOC.CS5248OOI WEI TSANG

64

Problem

Cache interfere with congestion control algorithm

Make cache adapt aware of quality adaptation

NUS.SOC.CS5248OOI WEI TSANG

65

Congestion Control ProtocolRAP: AIMD + Layered Coding

“sender-driven layered unicast”

NUS.SOC.CS5248OOI WEI TSANG

66

Solutions

Making cache “quality-aware”PrefetchReplacement Algorithm

NUS.SOC.CS5248OOI WEI TSANG

67

Cache Miss

A

Server

Client 2

NUS.SOC.CS5248OOI WEI TSANG

68

Cache Hit

A

Server

Client 2

repair +prefetch

NUS.SOC.CS5248OOI WEI TSANG

69

Peeking Inside the Cache

NUS.SOC.CS5248OOI WEI TSANG

70

Cache Hit: Repair

NUS.SOC.CS5248OOI WEI TSANG

71

Cache Hit: Prefetch

NUS.SOC.CS5248OOI WEI TSANG

72

Cache Hit: Prefetch

NUS.SOC.CS5248OOI WEI TSANG

73

Prefetch Algorithm

prefetchwindow

playbackpoint

NUS.SOC.CS5248OOI WEI TSANG

74

Proxy Request to ServerMultiple requests (for different

clients) are batched.

NUS.SOC.CS5248OOI WEI TSANG

75

Server Response

Missing segments are sent in decreasing priority

1

2

3 4

NUS.SOC.CS5248OOI WEI TSANG

76

Server Response

Send as many segments as possible until next prefetch request

NUS.SOC.CS5248OOI WEI TSANG

77

Solutions

Making cache “quality-aware”PrefetchReplacement Algorithm

NUS.SOC.CS5248OOI WEI TSANG

78

Goal of Replacement AlgorithmGoal: converge to efficient state

if a stream is popularaverage quality is highvariation in quality is low

NUS.SOC.CS5248OOI WEI TSANG

79

The Algorithm

NUS.SOC.CS5248OOI WEI TSANG

80

Trashing and Locking

NUS.SOC.CS5248OOI WEI TSANG

81

Choosing Victim

whit (weighted hit) =Tplay/Ttotal

Calculate whit for each layer in a stream over a popularity window

NUS.SOC.CS5248OOI WEI TSANG

82

Example

Popularity Lock? Name Layer

5.9 1 Nemo 0

4.3 1 Nemo 1

4.0 0 Matrix 2 0

3.9 0 Matrix 2 1

1.1 0 Gigli 0

NUS.SOC.CS5248OOI WEI TSANG

83

Evaluations

Two CriteriaCompletenessContinuity

NUS.SOC.CS5248OOI WEI TSANG

84

vs Request Number

NUS.SOC.CS5248OOI WEI TSANG

85

Different Popularity

NUS.SOC.CS5248OOI WEI TSANG

86

Summary

Proxy Caching for videoTechniques for segmentation,

replacement etc. Interactions with other aspect of

streaming

Recommended