Rate limiting routing method

Rate limiting routing method

With the dramatic increase in user traffic, the service provider must find a way to share network resources will be distributed to different users and applications, which means that service providers must be able to manage incoming traffic and rate SP network traffic, because there are so as to ensure basic services for each user. Rate limiting and traffic management is important because it allows the service provider to determine the type of traffic into the network of people, each type of traffic and traffic rate allows, when a change in network traffic congestion occurs as the load changes redefining each hop discarded by the packet's strategy.

This article describes what routing method that is rate limiting traffic shaping.

By shaping the traffic packets into the queue with a vertical shaper to reduce the likelihood of occurrence of congestion in the network, it is permitted to reach the network and the flow rate through the broom smooth output packet rate, there are two basic information Traffic shaping tool.

1) information flow smoothing tool: Elimination of burst traffic, the traffic burst smooth steady flow of information fed into the network, the rate limiting algorithm is typically achieved through a funnel;

2) long-term average traffic rate-shaping tool: Allow previously determined duration bursty traffic entering the network, burst traffic may be formed integral bursty traffic into the network is limited, this limitation is burst duration of the current letter word can not exceed the duration of the pre-determined. Such rate limiting function implemented by a token bucket algorithm.

Each of these methods limit the ability to support different rates, and resulting in the output streams having different characteristics.

(1) Algorithm funnel

The rate limiting algorithm funnel bursty packet stream into a steady output stream of packets, as shown below.

Rate limiting algorithm in the funnel during operation, the sudden flow of packets into the packet queue is a queue by the stabilizer control the funnel. If the packet flow exceeds the storage capacity of the queue, transfer the excess messages are discarded, when the packet reaches the front of the queue, it is fed into the network at a steady rate, this rate is determined by the configuration queue stabilizer.

Limited by the rate algorithm using a funnel, the service provider may be limited in rate allowed by the network offer rate, length of the packet queue size determines the delay of packets due to the shaping caused by traffic.

(2) the token bucket algorithm

Token bucket rate limiting algorithm limits the long-term average transmission rate, allow limited burst traffic enters the network in the selection process, the token bucket for management, control packets into the network speed regulator, to the FIG. operation of such a process the rate control algorithm.

The token generator generates tokens at a rate R tokens per second, and place them in the token bucket having a depth D tokens. Each token is granted the ability to transport a given number of bytes of the same. When a token bucket fills (D tokens), the newly generated token is discarded, while the token generator generates tokens, burst packet stream arrives and is placed in a queue of length L when the message queue is capable of storing the stream broom beyond capacity, the excess will be discarded packets.

Queue determining forwarding regulator P tokens having a corresponding byte length of the packet, the following factors must be considered:

If the token bucket is full, the packets into the network, removing the P tokens from the token bucket;

If the token bucket is empty, the message has been waiting in front of the queue, until P token is generated and placed in the token bucket, only if the token bucket has a P tokens, packets can be sent to network and then removing P tokens from a token bucket;

If the token contains only the tokens T, when T or less P, immediately sends the packets to the network, and remove the P tokens from the token bucket. If P is greater than T, the front end of the packet in the queue must wait until the token has P tokens, packets sent to the network, and then move P tokens from the token bucket.

Token bucket rate limiting algorithm may be adjusted long term average transmission rate, and allow a certain flow, a certain sustained long-term average rate of bursty traffic time. Token depth determination bursty traffic information flow. Since packets queue length limit traffic shaping delay caused by size.

Guess you like

Origin blog.csdn.net/qq_44892098/article/details/91361224
Recommended