Traffic Policing Using the CAR

aamallik   钻石会员    发表于 2014-5-22 21:21:58   最新回复:2018-05-05 14:19:20

Traffic Policing Using the CAR

Token Bucket

CAR focuses on restricting the traffic rate. This can be implemented after the traffic passing a device is measured. At present, the token bucket is widely used to measure traffic. In CAR and traffic shaping, it is used to control the traffic rate. Note that the token bucket measures traffic only, it cannot filter communication or take measures. For example, packets are discarded by other functions.

A token bucket has a certain capacity. The system puts tokens into a bucket at a defined rate. When the token bucket is full of tokens, the extra tokens overflow and no more tokens can be added.

Measuring Traffic with the Token Bucket

Configure the following parameters when the token bucket measures traffic:

Mean rate: indicates the rate of putting tokens into a bucket, namely, the permitted average traffic rate. It is often set as the Committed Information Rate (CIR).   Generally, traffic rate is lower than CIR.

Burst size: indicates the capacity of a token bucket, namely, the maximum burst traffic size. It is set as the Committed Burst Size (CBS)  . The configured burst size must be greater than the maximum packet size.

In ideal circumstance, tokens can be put into the bucket for CIR times per second, with a token for each time. When data packets are forwarded, tokens are taken out and filled in the bucket. When no data needs to be forwarded, tokens can be accumulated to handle burst data. There is a hidden parameter TI in another algorithm. The value of TI is CBS/CIR, which defines the interval for putting tokens into the token bucket. That is, new tokens are added to the token bucket every TI. The number of added tokens is defined by CBS. The VRP, however, has a different algorithm. In the VRP, neither are tokens added for CIR times per second with one token for each time nor are CBS tokens added each TI. When tokens are insufficient, new tokens are added into the bucket. The number of newly-added tokens is the product of the time difference of two additions and CIR. The tokens are added until the bucket is full of tokens. When measuring traffic, the token bucket uses the length of a data packet as the unit to judge whether the number of tokens in the bucket can meet the requirements for packet forwarding. If the bucket has sufficient tokens to forward packets (usually, one token is used to be associated with one bit of forwarding authority), the traffic does not exceed the specification. Otherwise, it exceeds the specification.

A new evaluation is made when a new packet arrives. If there are enough tokens in the bucket for each evaluation, it shows the traffic is within the bound. A certain number of tokens are taken out for forwarding packets. If the tokens in the bucket are not enough, it indicates the traffic exceeds.

Complicated Evaluation with the Token Bucket

You can configure two token buckets to evaluate complicated conditions and implement a flexible regulation policy . For example, TP has three parameters, CIR, CBS, and Excess Burst Size (EBS).

The two token buckets are configured with the same rate of CIR. The two buckets, however, have different capabilities, namely, CBS and EBS, referred to as C Bucket and E Bucket, which represents different permitted burst classes. The method to fill one token bucket with tokens is different from that to fill two token buckets.

When tokens are added to one token bucket, extra tokens overflow and are discarded because there is no space to store extra tokens after this bucket is full of tokens. When being added to two token buckets, tokens are added to E bucket after C buck is full of tokens. Thus, the total number of tokens in TP is CBS + EBS.

In each evaluation, you may use different traffic control policies for different situations, such as "C bucket has enough tokens", "Tokens of C bucket are deficient, but those of E bucket are enough", "Tokens of C bucket and E bucket are all deficient".

Traffic Policing Using the CAR

Packets are first classified according to the predefined matching rules,  such as the incoming interfaces, the source or destination MAC addresses of packets, IP precedence, DSCP, EXP, and User Datagram Protocol (UDP)portofReal-time Transfer Protocol(RTP). The packets that conform to the specified rate limit are directly forwarded. The packets that exceed the specifications are dropped or remarked with IP precedence, DSCP, and EXP. CAR can not only perform TP but also mark and remark packets.  REF _Ref167942112 \r \h Figure 2-2shows that CAR performs TP by using the token bucket.

Figure 2-1 Traffic policing  using the CAR

 Traffic Policing Actions

According to different evaluation results, TP implements the pre-configured policing actions,  "policing actions,"  which are described as follows:

l   Forward: continues to forward the packets evaluated as "conforming" or re-forwards the service marked with DSCP by Diff-Serv.

l   Drop: drops the packets evaluated as "non-conforming".

l   Remark precedence and forward: remarks the precedence of the packets evaluated as "partly conforming" and then forwards them.

l   Using the next policing policy: TP can be performed one level after another. Each TP level concerns and polices specific objects.

Armetta   钻石会员    发表于 2014-5-28 16:58:54

documentation very useful for my job
mashaker   白金会员    发表于 2014-5-25 16:08:53

CAR focuses on restricting the traffic rate...

Please anyone explain the above line of the post.

mashaker   白金会员    发表于 2014-5-25 16:15:13

Mapping based on DSCP values on IP packets. its useful for the post:

TISLAM   白金会员    发表于 2014-5-27 15:44:13

To mashaker, Nice share in reply...
sumon_ahsan   钻石会员    发表于 2014-5-22 22:51:04

very informative share.
TISLAM   白金会员    发表于 2014-5-22 23:09:13

very nice.
user_2837311   钻石会员    发表于 2018-5-5 14:19:20

useful document, thanks
Have a nice day
快速回复 返回顶部