Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Traffic shaping's core algorithm
Traffic shaping's core algorithm
Traffic shaping's core algorithms are as follows: GTS (General traffic shaping) and traffic shaping: leaky bucket.

Leak bucket is an algorithm, which is often used for traffic shaping or rate limiting in the network world. Its main purpose is to control the rate of data injection into the network and smooth the burst traffic on the network. Leaky bucket provides a mechanism through which burst traffic can be shaped, thus providing stable traffic for the network. Token bucket algorithm (token bucket)

Sometimes people mistakenly confuse leaky bucket with token bucket algorithm. In fact, these two algorithms have completely different characteristics and uses. The main difference between them is that leaky bucket can restrict the data transmission rate, while token bucket algorithm can limit the average data transmission rate while allowing some burst transmission.

In some cases, leaky bucket can't effectively use network resources. Because the leakage rate of leaky bucket is a fixed parameter, even if there is no resource conflict (no congestion) in the network, leaky bucket can't make a single flow burst to the port rate. Therefore, leaky bucket is inefficient for traffic with sudden characteristics. Token bucket algorithm can meet these bursts of traffic. Generally speaking, leaky bucket and token bucket algorithms can be combined to provide greater control over network traffic.