An important difference between two traffic shaping algorithms:
token bucket throws away tokens when the bucket is full but never
discards packets while leaky bucket discards packets when the
bucket is full. Unlike leaky bucket, token bucket allows saving, up
to maximum size of bucket n. This means that bursts of up to n
packets can be sent at once, giving faster response to sudden
bursts of input. Leaky bucket forces bursty traffic to smooth out,
token bucket permits burstiness but bounds it. Token bucket has no
discard or priority policy. Token bucket when compared to leaky
bucket, is easy to implement. Each flow needs just a counter to
count tokens and a timer to determine when to add new tokens to the
counter.