46
Each arriving packet is evaluated. In each evaluation, if the number of tokens in the
bucket is enough, the traffic conforms to the specification and the tokens for forwarding
the packet are taken away; if the number of tokens in the bucket is not enough, the
traffic is excessive.
Complicated evaluation
You can set two token buckets, bucket C and bucket E, to evaluate traffic in a more
complicated environment and achieve more policing flexibility. For example, traffic
policing uses four parameters:
CIR: Rate at which tokens are put into bucket C. It specifies the average packet
transmission or forwarding rate allowed by bucket C.
CBS: Size of bucket C, which specifies the transient burst of traffic that bucket C can
forward.
Peak information rate (PIR): Rate at which tokens are put into bucket E, which
specifies the average packet transmission or forwarding rate allowed by bucket E.
Excess burst size (EBS): Size of bucket E, which specifies the transient burst of traffic
that bucket E can forward.
The two token-bucket model is as shown in
Figure 7
. CBS is implemented with bucket C
and EBS with bucket E. In each evaluation, packets are measured against the buckets:
If bucket C has enough tokens, packets are colored green.
If bucket C does not have enough tokens but bucket E has enough tokens, packets
are colored yellow.
If neither bucket C nor bucket E has sufficient tokens, packets are colored red.
Figure 7
Two token-bucket model
CBS
EBS
Traffic policing
A typical application of traffic policing is to supervise the specification of certain traffic
entering a network and limit it within a reasonable range, or to "discipline" the extra
traffic. In this way, the network resources and the interests of the carrier are protected.
For example, you can limit bandwidth consumption of HTTP packets to less than 50% of