Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Working parameters of token bucket algorithm
Working parameters of token bucket algorithm
The working process includes three stages: token generation, token consumption and judging whether the data packet passes or not. There are two parameters involved: token generation rate CIR (committed information rate) /EIR (excess information rate) and token bucket size CBS (committed burst size) /EBS (excess burst size). Let's briefly summarize the relationship between these three stages and two parameters with charts.

Token generation: Tokens are added to the token bucket regularly at the rate of CIR/EIR, and the number of tokens in the bucket is increasing. If the number of tokens in the bucket has reached CBS/EBS, the redundant tokens are discarded. Consume tokens: incoming packets will consume tokens in the bucket. In network transmission, the size of data packets is usually inconsistent. Large packets consume more tokens than small packets. Judging whether it passes or not: the result of the input packet passing through the token bucket includes the output packet and the discarded packet. When the number of tokens in the bucket can meet the demand of the packet for tokens, the packet is output, otherwise the packet is discarded.