7 - Rate Limiting and Traffic Shaping Flashcards
Data Traffic Classifications
Bursty, periodic, and regular
Audio Traffic Classifications
Continuous, and Periodic
Video Traffic Classifications
Continuous, bursty, and periodic
Two kinds of traffic
Constant Bit Rate Source (CBR) Variable Bit Rate Source (VBR)
CBR
Constant Bit Rate Source - Examples are Audio - Shaped according to a peak rate
VBR
Variable Bit Rate source - Examples are Video and Data - Shaped according to average and peak rate where average rate is small fraction of peak rate
VBR
CBR
Leaky Bucket
Each flow has own bucket
Beta = size of bucket
Rho = drain rate of bucket (“regulator”)
Accomodates different burst rates by ensuing the packets are always delivered at a constant rate Rho.
(r, t) Traffic Shaping
Traffic divided into T-bit frames.
Flow can inject <= r bits into any T-bit frame
If a sender wants to send more than r bits, it needs to wait until next T-bit frame
Known as (r,t) smooth traffic shaping
Limited to fixed rate flows
(r, t) Traffic Shaping compared to Leaky Bucket
(r, t) Traffic shaping is slightly relaxed compared to Leaky Bucket. In (r,t) rather than sending a packet every time unit like Leaky BUcket, a sender can send a certain number of bits every time unit.
What happens if a flow exceeds a rate?
Excess packets in flow are given lower priority or preferentially dropped
Where are packet priorities set?
Sender or Network
Sender - App may mark own packets as it knows which are most important
Network - Marks some packets lower priority called “policing”
Token Bucket
For shaping bursty traffic but still ensure flow does not exceed average rate
Rho - Rate tokens arrive in bucket
Beta - Capacity of bucket
Traffic can arrive at rates lambda avg or lambda peak
Need to wait until there are b tokens in the bucket before sending
Token Bucket vs Leaky Bucket
Leaky bucket:
Parameters: rate
1. Smooth out traffic by passing packets only when there is a token. Does not permit burstiness.
2. Discards packets for which no tokens are available (no concept of queue)
3. Application: Traffic shaping or traffic policing.
Token bucket:
Params: rate, burstiness.
1. Token bucket smooths traffic too but permits burstiness - which is equivalent to the number of tokens accumulated in the bucket.
2. Discards tokens when bucket is full, but never discards packets (infinite queue).
3. Application: Network traffic shaping or rate limiting.
- Difficult to police traffic flow. Need to limit how long a sender can monopolize network