Traffic shaping uses the token bucket system to decide whether to transmit, delay or discard new packets. Using this token bucket system, each interface has a committed information rate (CIR), that is, the rate at which the interface transmits packets in a period of time. The continuous burst rate (Bc) defines the maximum number of tokens that a token bucket can contain in another time interval. When the packet arrives at the interface, it will take a token from the token bucket. When the packet is sent, the token will be released. When the time interval (Tc) has passed, the token will be returned to the token bucket. If the token bucket is empty, any new packets arriving on the interface will be put in the queue until the time interval has passed and the token is refilled. If the CIR continues to exceed, tokens will be deleted from the token bucket faster than added, thus filling the queue and causing packets to be discarded.
Traffic shaping can be applied to some different Layer 2 technologies, such as Ethernet, ATM, HDLC, PPP (not supported by ISDN and dial-up interfaces) and Frame Relay. All these technologies except Frame Relay support General traffic shaping (GTS). GTS can also shape certain types of traffic defined in the re-access control list by specifying a group in the traffic shaping.
In order to configure GTS, we must know the destination bit rate of the interface, that is, committed information rate (CIR), which refers to the rate of sending traffic under normal circumstances. The continuous burst rate (Bc) refers to the rate at which traffic bursts are allowed to exceed the normal traffic rate in each time interval, expressed in bits. Excess burst rate (Be) refers to the rate at which traffic bursts are allowed to exceed the sustained burst rate in the first time interval. In traffic shaping, every other time interval (Tc), traffic will be filled into the token bucket.
Tc = British Columbia /CIR
The time interval of traffic shaping cannot be less than 10ms or greater than 125 ms. The router finds the best time interval according to the formula Tc=Bc/CIR. The default interval is125ms. This time interval is the result of CIR and Bc configuration, so it is not configurable. Cisco suggested that Bc should be 1/8 of CIR. It will generate 8 time intervals of125ms per second.
Configure GTS for all interface traffic and use the traffic shaping rate command on interfaces that require traffic shaping. Use traffic shaping group commands and access control lists for specific traffic.
Traffic shaping {rate|group access-list-number} target bit rate [sustained] [exceeded] [buffer limit].
Group access-list-number specifies to shape all traffic that matches the access control list (1-2699).
Rate specifies that all traffic on this interface is shaped.
The normal rate (CIR) at which the target bit rate transmits the traffic ranges from 8000 to the full CIR of the interface (in bits per second).
Sustained sustained bit rate (Bc) refers to the number of traffic bursts allowed in each time interval, expressed in bits.
Excess excess bit rate (Be) refers to the service burst that exceeds the sustained bit rate in the first time interval, and is expressed by the number of bits in each time interval. Is an optional parameter, assuming that the token bucket is completely full: Be=Bc*2.
Buffer is used to specify a cache limit ranging from 1 to 4096.
GTS configuration requires two steps: finding the value of traffic shaping and configuring traffic shaping on the interface.
1, find the correct value of traffic shaping. CIR, BC, BC
Bc specifies the number of bits that the interface can transmit in a specific time interval. Bc=CIR*Tc
Be specifies the burst traffic that can be supported when the interface is full of enough tokens, which is usually considered in the first time interval. Be=Bc*2
If the interface does not support bursts, the following formula can be used: Be=Bc.
2. In interface mode, use the traffic-shaping command to enable traffic shaping.
To check the configuration of GTS, use the show traffic-shaping [statistics] command to use FRTS in the following four situations:1When the center is at high speed and the branches are at low speed. One physical line transports many VCS to different destinations. If FR is congested, you want the router to suppress the data flow. 4 It is necessary to transmit data streams of multiple protocols (IP, SNA) on the same FR VC, and it is hoped that each data stream can occupy a certain BW.
FECN and BECN in FR are used to indicate network congestion. When packets marked with BECN are received, FR traffic shaping (FRTS) will dynamically shape the traffic. Note: FRTS can only be used for SVC of PVC and FR. Among them, there is an adaptive FRTS. At each Tc interval, the process checks whether BECN is received from the Frame Relay network. If BECN is received within a Tc interval, the transmission rate will be reduced by 25% until it is reduced to half of CIR. If and only if BECN is not received within 16 TCs, the communication rate will return to CIR.
FRTS configuration steps
1) creates a case-sensitive MAP-CLASS.
2) Methods of defining traffic shaping, such as setting average rate and maximum rate.
3) Encapsulate Frame Relay on the interface.
4) Apply MAP-CLASS 5 to the port to open the traffic shaping, which is generally used for the source interface.