Traffic Shaping by Token Bucket: Unit 03.04.04 CS 5220: Computer Communications

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Unit 03.04.

04
CS 5220:
COMPUTER COMMUNICATIONS

Traffic Shaping by Token Bucket


XIAOBO ZHOU, Ph.D.
Professor, Department of Computer Science
Flow-level Traffic Shaping
 Traffic shaping refers to the process of altering a
traffic flow to ensure conformance
 A traffic shaping device is often located at the
node just before traffic flow leaves network
 A traffic policing device is usually located at the
node that receives the traffic flow from a network
Leaky Bucket Traffic Shaper
Size N
Incoming traffic Shaped traffic
Server

Packet

 Buffer incoming packets


 Play out periodically to conform to parameters
 Surges in arrivals are buffered & smoothed out
 Possible packet loss due to buffer overflow
 Restrctive, not allowing any variable-rate outgoing traffic
Token Bucket Traffic Shaper Tokens arrive
periodically

An incoming packet must


have sufficient tokens
before admission into the
network Size K
Token

Size N
Incoming traffic Shaped traffic
Server

Packet
 Token rate regulates transfer of packets
 If sufficient tokens available, packets enter network without delay
 K determines how much burstiness allowed into the network
Token Bucket Shaping Effect (full)

b bytes instantly b+rt The token bucket constrains


the traffic from a source to be
limited to b + r t bits in an
interval of length t
r bytes/second

Q1: what are two main differences of a leaky bucket and a token bucket?
Allow saving for burst spending; packet discarding or not.

Q2: When a token bucket is the same as a leaky bucket?


b = 0; but still different indeed: packet discarding or not
Token Bucket Shaping Effect (empty)
 Behavior of the token bucket shaper is
similar to that of the leady bucket shaper
 If the bucket size is reduced to zero, they
are identical
Closed-Loop Flow Control
 Congestion control
 Feedback information to regulate flow from sources into network
 Based on buffer length, link utilization, etc.
 Examples: TCP at transport layer; congestion control at ATM level
 End-to-end vs. Hop-by-hop
 Delay in effecting control
 Implicit vs. Explicit Feedback
 Source deduces congestion from observed behavior
 Routers/switches generate messages alerting to congestion
E2E vs. H2H Congestion Control

Source Packet flow Destination

(a)

TCP vs. ATM


Source Destination

(b)

Feedback information
Congestion Warning

 The Warning Bit in ACKs


 Choke packets to the source
 A time-out due to missing acknowledgement
Aggregate Level - Traffic Engineering
 Management exerted at flow aggregate level
 Distribution of flows in network to achieve efficient
utilization of resources (bandwidth)
 Must take into account aggregate demand from all
flows
 “Traffic Engineering”, at scale of minutes to days

You might also like