Token Bucket

advertisement
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,
bu   maxt 0
tu
 x( t)dt
Max bits b(u)
t
Max
burst
rate
Slope=
average rate
Interval size u
b(u)=r u +b
Token Bucket Regulator (Shaper)
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
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
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.
Traffic Marker
Packet arrival
Enough
tokens in
bucket?
Color red
Color green
Packet
forwarding
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
Single-Rate Three-Color Marker
Usage:
•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
Two-Rate Three-Color Marker
Usage:
•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
Marker Locations and Size
Type of Marking
# of
Bits
Bits Location
3
Three most significant bits of TOS byte in IPv4
and IPv6 headers
6
Six most significant bits of TOS byte in IPv4
and IPv6 headers
MPLS
Experimental
(EXP) Bits
3
Part of 20 bit MPLS label
Ethernet CoS Bits
3
ISL or 802.1q/p header
ATM CLP Bit
1
ATM Cell header
Frame Relay DE Bit
1
Frame Relay header
IP Precedence
Differentiated
Services Code Point
(DSCP)
RED with Multiple Thresholds
Discard
Probability
“Red”
Packets
“Yellow”
Packets
“Green”
Packets
1
Average
Queue Length
0
0
13
“Red”
Threshold
“Yellow”
Threshold
“Green”
Threshold
Full
© Juha Heinanen
Metering, Marking and Policing
May classify
packets to
service classes
May meter host
behavior and
shape packets
May police host
behavior and
classify packets on
behalf of host
14
Host
May select outgoing packets
and drop excess
R
Enterprise
Network
R
May meter aggregate
behavior, classify,
(re)mark, drop, and
shape packets
R
ISP
Polices aggregate
behavior and remarks
or drops excess
© Juha Heinanen
Leaky Buckets in ATM
ATM Traffic Parameters
• Source Traffic Descriptor
– Peak Cell Rate (PCR): upper bound on traffic submitted
by source (PCR = 1/T, where T = minimum cell spacing
– Sustainable Cell Rate (SCR): upper bound on average
rate of traffic submitted by source (over a larger T)
– Maximum Burst Size (MBS): maximum number of cells
sent continuously at PCR
– 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 size of a frame
in cells available for GFR service
16
Chapter 13: ATM Traffic & Congestion
Control
Generic Cell Rate Algorithm (GCRA):
Virtual Scheduling
Late
arrival
OK
Early arrival
beyond limit
NOT OK
At time of arrival ta(1) of the
first cell of connection, TAT =
ta(1)
Early arrival
TEST
I.e., this cell
arrived too late.
Early arrival
within limit
OK
Reset
TAT
17
GCRA (I, L):
I = Increment
L = Limit
ta(k) = Time of arrival of a cell
TAT = Theoretical arrival time
 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, )
• Virtual scheduling algorithm
– Conforming cell
ta(k)
(a)

TAT(k-1)


TAT(k)

TAT(k+1)
TAT(k)
Time
I
ta(k)
(b)

TAT(k-1)
L


TAT(k)
TAT(k+1)
Time
I
– Non-conforming cell
ta(k)

TAT(k-2)
L

TAT(k-1)

TAT(k)
Time
I
* At the time of arrival of the first cell of the connection, TAT = ta(k)
Leaky Bucket
Multiple Leaky Buckets
Can we create traffic differentiation?
Scenario
At the Edges: Multiple Cascading Token Buckets (FRQ?)
At Core router : Multi-GRED drop Model
RED differentiation
Simulation Set-Up
Definitions
The committed rate of R: comm(A) =  CIR
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 =  EIRi / ex( R)
iA
• The fair throughput of an aggregate i is composed of its CIRi
and its fair share of the excess bandwidth
EIRaggi = (EIRi/AGGEIR).
•
•
•
•
iA
4/8/2015
i
24
SLAa
Token Bucket Rate Assignment
Aggregate Traffic Mix
Three-Color Marking Goodput Per Aggregate (a)
GoodPut
(Bytes)
900000
600000
300000
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Tim e (10 seconds)
Better
differentiation
Six-Color Marking Goodput Per Aggregate (b)
GoodPut
(Bytes)
900000
600000
300000
0
1
2
3
4
5
6
7
8
9
10
11
Tim e (10 seconds)
12 13
14
15 16
17
Effect of Packet Size
Things to Remember
• Increasing the number of colors indeed improving
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.
Download