Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Overall traffic shaping of GTS
Overall traffic shaping of GTS
The typical function of traffic shaping is to limit the traffic and connection bursts flowing out of the network, so that such messages can be sent out at a relatively consistent speed. Traffic shaping is usually accomplished by using buffers and token buckets. When the message is sent too fast, it is cached in the cache first, and then these cached messages are sent evenly under the control of the token bucket.

There are two core algorithms of traffic shaping, and the specific technologies are GTS (General traffic shaping) and General 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.

Global Telecommunication System (global telecommunication system)

GTS can shape the irregular or non-conforming traffic to match the bandwidth between the upstream and downstream of the network. GTS, like CAR, uses token bucket technology to control traffic, but the main difference is that when CAR is used for message traffic control, messages that don't meet the traffic characteristics are discarded, while GTS buffers messages that don't meet the traffic characteristics, which reduces the discarding of messages and conforms to the traffic characteristics of messages.

GTS can control the message flow or all messages specified on the interface. When a message arrives, it first classifies the message. If the message does not need GTS processing, it will continue to be sent without token bucket processing. If the message needs GTS processing, it will be compared with the tokens in the token bucket.

Token bucket puts tokens into the bucket at the speed set by the user. If there are enough tokens in the token bucket to send messages, continue to send messages directly, and the number of tokens in the token bucket will decrease according to the length of the message. When there are few tokens in the token bucket, the message will be cached in the GTS queue.

When there is a message in the GTS queue, GTS will take the message out of the queue and send it out at some time. Compare each transmission with the number of tokens in the token bucket. Until the number of tokens in the token bucket decreases, until the messages in the queue can no longer be sent, or all the messages in the queue are sent.