token bucket leaky bucket

32
Token Bucket Leaky Bucket

Upload: ranae

Post on 29-Jan-2016

182 views

Category:

Documents


1 download

DESCRIPTION

Token Bucket Leaky Bucket. Leaky Bucket. (a) A leaky bucket with water. (b) a leaky bucket with packets. Token Bucket. We want to allow some burstiness. x(t) is the instantaneous sending rate,. Max bits b(u). Slope= average rate. Max burst rate. Interval size u. b(u)= r u +b. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Token Bucket Leaky Bucket

Token BucketLeaky Bucket

Page 2: Token Bucket Leaky Bucket

Leaky Bucket

(a) A leaky bucket with water. )b( a leaky bucket with packets.

Page 3: Token Bucket Leaky Bucket

Token Bucket

x(t) is the instantaneous sending rate ,

ut

t

0t dt)t(xmaxubMax bits b(u)

Interval size u

Max burst

rate

Slope=average rate

b(u)=r u +b

We want to allow some burstiness.

Page 4: Token Bucket Leaky Bucket

Token Bucket Regulator (Shaper)

Page 5: Token Bucket Leaky Bucket

What is it good for?

• Traffic shaper– Shape the traffic to conform to contract

• Traffic policer– Drop packets that do not conform

• Traffic marker– Color packets by conformance to contract– Rate estimator

Page 6: Token Bucket Leaky Bucket

Remarks

• When tokens are not available– Store packet (shaper)– Discard packet (policer)

• The sum of two regulated flows (b1,r1)& (b2,r2) behave like a regulated flow (b1+b2,r1+r2)

• Cascading t.b. after a l.b. can shape the burst rate

Page 7: Token Bucket Leaky Bucket

Shaping Examples

(a) Input to a leaky bucket.

(b) Output from a leaky bucket.

Output from a token bucket with capacities of (c) 250 KB, (d) 500 KB, (e) 750 KB,

(f) Output from a 500KB token bucket feeding a 10-MB/sec leaky bucket.

Page 8: Token Bucket Leaky Bucket

Traffic Marker

Packet arrival

Enough tokens in

bucket?

Color greenColor red

Packet forwarding

Page 9: Token Bucket Leaky Bucket

IETF Packet Marking

• Two types of markers are available:– RFC 2697: A Single-Rate, Three-Color Marker

• Committed Information Rate (CIR), • Committed Burst Size (CBS), • Excess Burst Size (EBS)

– RFC 2698: A Dual-Rate, Three-Color Marker• Peak Information Rate (PIR) • Committed Information Rate (CIR), • Committed Burst Size (CBS), • Peak Burst Size (PBS)

• Suggested in the context of DiffServ

Heinanen and Guerin, 1999

Page 10: Token Bucket Leaky Bucket

Single-Rate Three-Color MarkerUsage:•Mark conforming traffic with a low drop precedence•Mark exceeding traffic with a high drop precedence•Drop violating traffic

Definitions:•CIR – Committed Information Rate•CBS – Committed Burst Size (max)•EBS – Excess Burst Size (max)•Tc – Current size of CBS bucket•Te – Current size of EBS bucket

Page 11: Token Bucket Leaky Bucket

Two-Rate Three-Color MarkerUsage:•Mark packets within CIR as conforming•Mark packets between CIR and PIR as exceeding •Drop packets above the PIR

Definitions:•CIR – Committed Rate•PIR – Peak rate•CBS – Committed burst size (max)•PBS – Peak burst size (max)•Tc – Current size of CBS bucket•Tp – Current size of PBS bucket

Page 12: Token Bucket Leaky Bucket

Marker Locations and Size

Frame Relay header

ATM Cell header

ISL or 802.1q/p header

Part of 20 bit MPLS label

Six most significant bits of TOS byte in IPv4 and IPv6 headers

Three most significant bits of TOS byte in IPv4 and IPv6 headers

Bits Location

1Frame Relay DE Bit

1ATM CLP Bit

3Ethernet CoS Bits

3MPLS Experimental )EXP( Bits

6Differentiated Services Code Point )DSCP(

3IP Precedence

#of Bits

Type of Marking

Page 13: Token Bucket Leaky Bucket

©Juha Heinanen13

RED with Multiple ThresholdsDiscard

Probability

AverageQueue Length0

1

“Red”Threshold

0 “Yellow”Threshold

“Green”Threshold

“Red”Packets

“Red”Packets

“Green”Packets

“Green”Packets

“Yellow”Packets

“Yellow”Packets

Full

Page 14: Token Bucket Leaky Bucket

©Juha Heinanen14

Metering, Marking and Policing

Host

EnterpriseNetwork

EnterpriseNetwork ISPISP

May police hostbehavior and

classify packets onbehalf of host

May police hostbehavior and

classify packets onbehalf of host

Polices aggregatebehavior and remarks

or drops excess

Polices aggregatebehavior and remarks

or drops excess

May meter aggregatebehavior, classify,

(re)mark, drop, andshape packets

May meter aggregatebehavior, classify,

(re)mark, drop, andshape packets

May meter hostbehavior and

shape packets

May meter hostbehavior and

shape packets

R

R R

May classifypackets to

service classes

May classifypackets to

service classesMay select outgoing packets

and drop excess

May select outgoing packetsand drop excess

Page 15: Token Bucket Leaky Bucket

Leaky Buckets in ATM

Page 16: Token Bucket Leaky Bucket

Chapter 13: ATM Traffic & Congestion Control16

ATM Traffic Parameters• Source Traffic Descriptor

– Peak Cell Rate (PCR)Peak Cell Rate (PCR): upper bound on traffic submitted by source (PCR = 1/T, where T = minimum cell spacing

– Sustainable Cell Rate (SCR)Sustainable Cell Rate (SCR): upper bound on average rate of traffic submitted by source (over a larger T)

– Maximum Burst Size (MBS)Maximum Burst Size (MBS): maximum number of cells sent continuously at PCR

– Minimum Cell Rate (MCR)Minimum Cell Rate (MCR): used with ABR and GFR… minimum cell rate requested, access to unused capacity up to PCR (elastic capacity = PCR-MCR?)

– Maximum Frame Size (MFS)Maximum Frame Size (MFS): maximum size of a frame in cells available for GFR service

The ATM Guaranteed Frame Rate (GFR) service is for best effort traffic. Offers

minimum throughput guarantees.

Page 17: Token Bucket Leaky Bucket

17

Generic Cell Rate Algorithm (GCRA): Virtual Scheduling

GCRA (I, L):I = IncrementL = Limitta(k) = Time of arrival of a cellTAT = Theoretical arrival time

At time of arrival ta(1) of the first cell of connection, TAT = ta(1)

Algorithm takes two arguments, I and L

With PCR of R, I = T = 1/R CDVT limit, = L Then peak cell rate algorithm is

expressed as:

GCRA(T, )

I.e., this cell arrived too late.

Late arrival OK

Reset TAT

Early arrival within limit OK

Early arrival beyond limit NOT OK

Early arrival TEST

Page 18: Token Bucket Leaky Bucket

• Virtual scheduling algorithm – Conforming cell

– Non-conforming cell

* At the time of arrival of the first cell of the connection, TAT = ta(k)

I

Time

ta(k)

TAT(k)

L

TAT(k)

TAT(k+1)TAT(k-1)

)a(

I

Time

ta(k)

TAT(k)

TAT(k+1)TAT(k-1)

)b(

L

I

Time

ta(k)

TAT(k-1)TAT(k)TAT(k-2)

Page 19: Token Bucket Leaky Bucket

Leaky Bucket

Page 20: Token Bucket Leaky Bucket

Multiple Leaky Buckets

Can we create traffic differentiation?

Page 21: Token Bucket Leaky Bucket

Scenario

At the Edges: Multiple Cascading Token Buckets (RFQ?)At Core router : Multi-GRED drop Model

Page 22: Token Bucket Leaky Bucket

RED differentiation

Page 23: Token Bucket Leaky Bucket

Simulation Set-Up

Page 24: Token Bucket Leaky Bucket

04/22/23 24

Definitions

• The committed rate of R: comm(A) = • The excess link rate of R ex(R) = bw(R) − comm(A).• CIR aggregation level: AGGCIR = comm(A)/bw(R) .

• The EIR aggregation-level is the entire EIR allocated on a bottleneck link divided by its excess rate,

AGGEIR =

• The fair throughput of an aggregate i is composed of its CIRi and its fair share of the excess bandwidth

EIRaggi = (EIRi/AGGEIR).

Ai

iCIR

)(/ RexEIRAi

i

Page 25: Token Bucket Leaky Bucket

SLAa

Page 26: Token Bucket Leaky Bucket

Token Bucket Rate Assignment

Page 27: Token Bucket Leaky Bucket

Aggregate Traffic Mix

Page 28: Token Bucket Leaky Bucket
Page 29: Token Bucket Leaky Bucket

Three-Color Marking Goodput Per Aggregate )a(

0

300000

600000

900000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Tim e )10 seconds(

Go

od

Pu

t)B

ytes

(

Six-Color Marking Goodput Per Aggregate )b(

0

300000

600000

900000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Tim e )10 seconds (

Go

od

Pu

t)B

ytes

(

Betterdifferentiation

Page 30: Token Bucket Leaky Bucket

Effect of Packet Size

Page 31: Token Bucket Leaky Bucket
Page 32: Token Bucket Leaky Bucket

Things to Remember

• Increasing the number of colors indeed improves differentiation between the aggregates according to the committed and the excess rates.

• The token bucket coloring policies, which is widely used for this purpose, prefer short packets and mark them with a higher priority colors.

• The differentiation process is more difficult for the short TCP connections that remain in the slow start phase, than for the long connections that are usually in the congestion avoidance phase.