Policing the regulation of the rate at which a flow is allowed to inject packets into the network, as on of the cornerstones
of any QoS architecture. But what aspects of a flow's packet rate should be policed? We can identify three important
policing criteria, each differing from the other according to the time scale over which the packet flow is policed:
Average rate-The network may wish to limit the long-term average rate at which a flow's packets can be sent into the
network.
Peak rate-While the average rate constraint limits the amount of traffic that can be sent into the network over a relatively
long period of time, a peak-rate constraint limits the maximum number of packets that can be sent over a shorter period of
time.
Burst size-The network may also wish to limit the maximum number of packets that can be sent into the network over an
extremely short interval of times.
The leaky bucket mechanism is an abstraction that can be used to characterize these policing limits. A leaky bucket
consists of a bucket that can hold up to b tokens. Tookens are added to this bucket as folows. New tokens,
which may poorentially be added to the bucket, are always being generated at a rate of r tokens per second.
If the bucket is filled with less than b tokens when a token is gererated, the newly generated token is added to
the bucket; otherwise the newly generated token is ignored, and the token bucket remains full with b tokens.