Rate Limiting and Traffic Shaping Flashcards
Would you use a leaky bucket or a token bucket to traffic shape a constant bit rate (CBR) audio stream?
Since a constant bit rate stream isn’t bursty, the traffic shaping mechanism doesn’t need to handle bursts. Since the original stream is “smooth”, it would be better to use the leaky bucket to keep the stream “smooth” and even out any bursts.
Properties of Constant Bit Rate (CBR) traffic.
Traffic Arrives at Regular Intervals
Packets are typically the same size when they arrive.
Properties of Variable Bit Rate (VBR) traffic.
Shaped according to average rate and peak rate
Average rate may be small fraction of peak rate
Properties of a Leaky Bucket
Each flow has its own bucket of size Beta
Data arrives in a bucket and drains from the bucket at a rate rho, that controls the average rate
Data can arrive at a rate faster or slower into the bucket but it cannot drain at a rate faster than rho.
Size of bucket controls maximum burst size that a sender can send for a particular flow. Even if average rate cannot exceed rho, sender might be able to send at a faster rate as long as bucket does not overflow.
Properties of (r,T) Traffic Shaping
Traffic is divided into T-bit frames
A flow can inject <= r bits in any T-bit frame
A flow that obeys this rule has an (r,T) smooth traffic shape
In the case of (r,T) smooth traffic shaping, One cannot send a packet that is greater than r bits long. Maximum packet size is relatively small, so range of behaviors is typically limited to fixed rate flows.
If a flow exceeds its rate, the excess packets in the flow are given a lower priority
Properties of a Token Bucket
Tokens arrive in a bucket, of size Beta, at a rate rho
Traffic may arrive at an average rate lambda(average) and a peak rate lambda(peak)
Traffic can be sent by the regulator as long as there are tokens in the bucket.
If the bucket is empty, a packet must wait until a number of tokens equal to the packets size are added to the bucket before it can be sent.
How many bits in a Byte?
8 bits = 1 Byte
Traffic Shaping Equation:
Beta = (Burst Rate - rho(average rate)) * T
Rate < B + T * P
Composite Shaper
Combines token bucket shaper with leaky bucket shaper.
Combination of token bucket shaper with leaky bucket shaper allows for good policing.
Policing
If a flow exceeds its rate, excess packets are given lower priority. If network is heavily loaded or congested.
Routers marking packets with lower priority on flows that exceed its rate.
Power Boost
Traffic shaping mechanism that allows a subscriber to send at a higher rate for a brief time
Targets Spare Capacity for users who do not put a sustained load on the network
Buffer Bloat
Buffer will start filling up with more packets if sender sends at faster rate because Buffer will only be able to drain at the previous constant rate.
Passive Measurement
Packets, Flow Statistics, etc are collected on traffic that is already being sent on the network.
Ex. Packet Traces, Flow Stats, or Application Level Logs
Active Measurement
Additional traffic is injected into the network to measure various characteristics of the network.
Simple Network Management Protocol
Internet-standard protocol for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behavior
Packet and Byte Counters provided by protocol can be used to perform passive network traffic management.