Statistical Multiplexing End-to-End Principle EE122 TAs 9/7/12

Preview:

Citation preview

Statistical Multiplexing End-to-End Principle

EE122 TAs9/7/12

Statistical MultiplexingSharing of a single link over multiple flows on

demand, allocating only for the average bandwidth needed

Statistical MultiplexingSharing of a single link over multiple flows on

demand, allocating only for the average bandwidth needed

Packet Switching or Circuit Switching?Packet Switching or Circuit Switching?

Statistical MultiplexingSharing of a single link over multiple flows on

demand, allocating only for the average bandwidth needed

Packet Switching or Circuit Switching?Packet Switching or Circuit Switching?

Hotel Telephone Operator

Colin, Andrew, Panda, Thurston and Scott check into Hotel Durant, which accommodates 5

Once in a while, one of them makes a call using the hotel telephone

Sometimes two of them call at the same time…Sometimes three of them call at the same time…

Hotel Telephone Operator Kay

Hey Joshua, did you report your lecture participation to

ee122.andrew@gmail.com yet?

Hotel Telephone Operator Kay

Hey Joshua, did you report your lecture participation to

ee122.andrew@gmail.com yet?

Yeah, the HW looks long, so get started

early. Hint hint.

Hotel Telephone Operator Kay

Hey Joshua, did you report your lecture participation to

ee122.andrew@gmail.com yet?

Yeah, the HW looks long, so get started

early. Hint hint.

Mmm… Cadbury chocolate

Hotel Telephone Operator

Sometimes four of them call at the same time…Sometimes all five call at the same time…

Let’s say each phone conversation lasts 5 minutes (300 seconds) on average.

There are 86400 seconds in a day… what are the chances these calls will overlap?

Not very high...

Hotel Telephone Operator

How many lines do we need?Do we need all 5?Let’s say we allocate 3.

What will happen if all 5 call at the same time?

Hotel Telephone Operator Kay

GO SPAIN!!!

ITALY!!!

Mmm… Hershey’s

SPAIN!!!

GO ITALY!

Hotel Telephone Operator

How many lines do we need?Do we need all 5?Let’s say we allocate 3.

What will happen if all 5 call at the same time?Not everyone can be serviced, and there will be some dropped calls.But the probability of this happening is very low.

A Similar Problem

The WorldShared Link

Alice, Bob, Eve and Mallory each have a cat videoThey want to broadcast this to the worldBut they share a single link to the world

A Similar Problem

The World

First they tried sharing the link by dividing the available bandwidth evenly

TOO SLOW!!

Hope For A Solution

• They could go one at a time– We decided this is bad

• But notice they are not really sending at the same time

• The chance of someone sending is a random variable

• Let us try and apply the law of large numbers

Statistical Multiplexing

The World

Better: Everyone gets more bandwidthLess wasted bandwidth, but not reserving a circuit

Statistical Multiplexing

• Works because everyone sends at random times

• What is the expected bandwidth used?• What would we need if we reserved

bandwidth for all?• When does this fail?

• TADA INTERNET

The Law of Large Numbers

The average value taken by a large set of observations of a random variables approaches the

mean of the random variable

• For our purposes– The sum of a set of random variables is

Sum = Mean × Number of Variables• Note this is smaller than

Maximum × Number of Variables

The Law of Large Numbers

• Example:– 30 end hosts, each want to send at 100kbps– But each host only sends 10% of the time

How much bandwidth do we need to guarantee that everyone gets 100kbps no matter what?

30 * 100kbps = 3Mbps

The Law of Large Numbers• Example:– 30 end hosts, each want to send at 100kbps– But each host only sends 10% of the time

How much bandwidth does the Law of Large Numbers say we need?

100kbps * 10% * 30 = 300kbps

Statistical Multiplexing says we only need a link with 300kbps, by the Law of Large Numbers.

End-to-End Principle

• Packets sometimes get lost• Have reliable links, each hop resends packets

that were lost

Host A Host B

Reliable Links

Host A Host B

Unreliable Links

End-to-End Principle

• Packets sometimes get lost• Have reliable links, each hop resends packets

that were lost• Does this violate the end-to-end principle?• Is this ever a reasonable scheme?– Remember End-To-End has an exception

• Does this violate layering?

The 5 Layers

Application

Transport

Network

Datalink

Physical

L5

L1

End-to-End Principle

• One needs a more perfect mechanism for delivering cat video

• Introducing the LOLCat Switch• Produce a cat video at the switch– Given a description of the kind of cat, props, and

witty caption, network switches will assemble a cat video

– Really fast, don’t need to go beyond the first hop– Ever!!!

Host A Host B

LOLCat SwitchKind of CatDescription

Witty Captioncat253.avi

End-to-End Principle

• Does this violate the end-to-end principle?• Does it violate layering?• Why is this a bad idea?– Duplicating application functionality– Unnecessarily complicating network– Inflexible switch design

Probability Primer

Independent Events• Independent: occurrence of one event does not

affect the likelihood of the other event• Example of two independent events:– Flow 1 sends 5 packets in a particular frame– Flow 2 sends 2 packets in a particular frame

• Assume that:– Event A happens with probability pA

– Event B happens with probability pB

• What is probability both event A and B happen?• Answer: Probability = pApB 30

Consider Dice

• Probability that rolling a single die yields a 1? 1/6th

• Probability rolling two dice yields 1 1?1/36th

• Probability rolling two dice yields a 1 and a 2?– Write it down!

31

Be Careful Counting Events

First die is 1 and second die is 2:1/36th

One die is 1 and one die is 2: 1/18th

• That’s because you could have 1 2 or 2 1

32

Mutually Exclusive Events

• First roll of die is 1:1/6th

• First roll of die is 2:1/6th

• First roll of die is 3:1/6th

• First roll of die is 4:1/6th

• First roll of die is 5:1/6th

• First roll of die is 6:1/6th

• This set of events is complete (or exhaustive) in that one of them must be true

Total of probabilities = 133

Exclusive vs Independent Events

• First roll of die is 1, second roll of die is 3– Independent

• First roll of die is 1, first roll of die is 2– Exclusive

34

Computing Averages

• Assume that x is some property of an event and that events A, B, C are mutually exclusive and complete (i.e., one of them happens)– E.g., x = number of packets sent in a particular frame

• Assume that:– Event A has x=5– Event B has x=2– Event C has x=10

• What is the average value of x? (denoted by <x>)– Write it down!

• Average <x> = 5pA + 2pB + 10pC

35

THIS IS ALL YOU NEED TO KNOW!

• The problems are easier than you think…• …but think clearly before computing the

answer…

36

Recommended