No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CLI-based Configuration Guide - QoS

AR100-S, AR110-S, AR120-S, AR150-S, AR160-S, AR200-S, AR1200-S, AR2200-S, and AR3200-S V200R009

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Token Bucket

Token Bucket

Overview

A token bucket is a container that can store a certain number of tokens. The system places tokens into a token bucket at the configured rate. If the token bucket is full, excess tokens overflow and the number of tokens in the bucket can no longer increase.

The system determines whether there are enough tokens in the bucket for packet forwarding. If so, the traffic rate conforms to the rate limit. Otherwise, the traffic rate exceeds or violates the rate limit.

RFC standards define two token bucket algorithms:
  • The single rate three color marker (srTCM) algorithm determines traffic bursts based on packet lengths.
  • The two rate three color marker (trTCM) algorithm determines traffic bursts based on packet rates.

The srTC and trTCM algorithms mark packets red, yellow, or green based on traffic metering results. Then the system processes packets based on their colors. The two algorithms can work in color-aware and color-blind modes. The color-blind mode is used as an example in the following descriptions.

Single-Rate-Two-Bucket Mechanism

The single-rate-two-bucket mechanism uses the srTCM algorithm to measure traffic and marks packets green, yellow, or red based on the metering result.

Figure 3-1  Single-rate-two-bucket mechanism

As shown in Figure 3-1, buckets C and E contain Tc and Te tokens respectively. The single-rate-two-bucket mechanism uses three parameters:
  • CIR: indicates the rate at which tokens are put into bucket C, that is, the average traffic rate that bucket C allows.
  • CBS: indicates the capacity of bucket C, that is, the maximum volume of burst traffic that bucket C allows.
  • Excess burst size (EBS): indicates the capacity of bucket E, that is, the maximum volume of excess burst traffic that bucket E allows.
The system places tokens into the bucket at the CIR:
  • If Tc is less than the CBS, Tc increases.
  • If Tc is equal to the CBS and Te is smaller than the EBS, Te increases.
  • If Tc is equal to the CBS and Te is equal to the EBS, Tc and Te do not increase.
B indicates the size of an arriving packet:
  • If B is less than or equal to Tc, the packet is colored green, and Tc decreases by B.
  • If B is greater than Tc and less than or equal to Te, the packet is colored yellow and Te decreases by B.
  • If B is greater than Tc and B is greater than Te, the packet is colored red, and Tc and Te remain unchanged.

Two-Rate-Two-Bucket Mechanism

The two-rate-two-bucket mechanism uses the trTCM algorithm to measure traffic and marks packets green, yellow, or red based on the metering result.

Figure 3-2  Two-rate-two-bucket mechanism

As shown in Figure 3-2, buckets P and C contain Tp and Tc tokens respectively. Two-rate-two-bucket mechanism uses four parameters:
  • Peak information rate (PIR): indicates the rate at which tokens are put into bucket P, that is, the maximum traffic rate that bucket P allows. The PIR is greater than the CIR.
  • CIR: indicates the rate at which tokens are put into bucket C, that is, the average traffic rate that bucket C allows.
  • Peak burst size (PBS): indicates the capacity of bucket P, that is, the maximum volume of burst traffic that bucket P allows.
  • CBS: indicates the capacity of bucket C, that is, the maximum volume of burst traffic that bucket C allows.
The system places tokens into bucket P at the PIR and places tokens into bucket C at the CIR:
  • If Tp is less than the PBS, Tp increases. If Tp is greater than or equal to the PBS, Tp remains unchanged.
  • If Tc is less than the CBS, Tc increases. If Tc is greater than or equal to the CBS, Tp remains unchanged.
B indicates the size of an arriving packet:
  • If B is greater than Tp, the packet is colored red.
  • If B is greater than Tc and less than or equal to Tp, the packet is colored yellow and Tp decreases by B.
  • If B is less than or equal to Tp and B is less than or equal to Tc, the packet is colored green, and Tp and Tc decrease by B.

Color-aware Mode

In color-aware mode, if the arriving packet has been colored red, yellow, or green, the packet color affects metering results of the token bucket mechanism in the following ways:
  • If the packet has been colored green, the metering mechanism is the same as that in color-blind mode.
  • If the packet has been colored yellow, the system marks the packet yellow if it conforms to the limit and marks the packet red if it violates the limit, depending on the packet length and the number of tokens.
  • If the packet has been colored red, it is marked red in the token bucket.
Translation
Download
Updated: 2019-05-17

Document ID: EDOC1000174115

Views: 39945

Downloads: 28

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next