940 likes | 1.35k Views
Traffic Shaping and Policing. Objectives. Upon completing this module, you will be able to: Describe and configure generic traffic shaping (GTS) Describe and configure Frame Relay traffic shaping (FRTS) Describe and configure committed access rate (CAR)
E N D
Objectives • Upon completing this module, you will be able to: • Describe and configure generic traffic shaping (GTS) • Describe and configure Frame Relay traffic shaping (FRTS) • Describe and configure committed access rate (CAR) • Name other mechanisms that support traffic shaping and policing (class-based policing and class-based shaping) Inner Mongolia University
Objectives • Upon completing this lesson, you will be able to: • Describe the need for implementing traffic policing and shaping mechanisms • List traffic policing and shaping mechanisms available in Cisco IOS • Describe the benefits and drawbacks of traffic shaping and policing mechanisms Inner Mongolia University
Traffic shaping and policing mechanisms are used to rate-limit traffic classes. They have to be able to classify packets and meter their rate of arrival. Traffic shapingdelays excess packets so that they stay within the rate limit. Traffic policing typically drops excess traffic so that it stays within the limit; alternatively, it can remark excess traffic. Traffic Shaping and Policing Meter Classifier Marker Dropper Traffic Stream Inner Mongolia University
Why Use Rate Limiting? • To handle congestion at ingress to ATM/Frame Relay network with asymmetric link bandwidths • To limit access to resources when high-speed access is used but not desired • To limit certain applications or classes • To implement a virtual TDM system Inner Mongolia University
Typical Traffic Shaping or Policing Applications Low-Speed Link High-Speed Link WAN Output interface isnot congested; queuing andWRED do not work. Congestion in WAN network results innonintelligentLayer 2 drops. 256 kbps A virtual TDM or leased line is implementedover a single physical link on one side Access to resources is limited. 64 kbps FastEthernet 128 kbps Server Farm Internet Inner Mongolia University
Shaping vs. Policing • Benefits of shaping: • Shaping does not drop packets. • Shaping supports interaction with Frame Relay congestion indication. • Benefits of policing: • Policing supports marking. • Buffer usage is not increased (shaping requires an additional queuing system). Inner Mongolia University
Routers use the token bucket mathematical model to keep track of packet arrival rate. The token bucket model is used whenever a new packet is processed. The return value is conform or exceed. How Do Routers Measure Traffic Rate? Bandwidth Link Bandwidth Exceeding Traffic Rate Limit Conforming Traffic Time Inner Mongolia University
500 bytes Conform Action Token Bucket 700 200 500 bytes Inner Mongolia University
Exceed Action 300 bytes Token Bucket (cont.) 200 300 bytes Inner Mongolia University
Bc is normal burst size (specifies sustained rate) Be is excess burst size (specifies length of burst) Token Bucket Be Link BW Bc of tokens is added every Tc [ms] Tc = Bc / CIR Link Utilization Bc Bc Bc Bc Bc Bc Average BW (CIR) Time Tc 2*Tc 3*Tc 4*Tc 5*Tc Bc + Be Inner Mongolia University
Traffic Shaping and Policing Mechanisms • Shaping mechanisms: • Generic traffic shaping (GTS) • Frame Relay traffic shaping (FRTS) • Class-based shaping • Policing mechanisms: • Committed access rate (CAR) • Class-based policing Inner Mongolia University
Summary • Upon completing this lesson, you should be able to: • Describe the need for implementing traffic policing and shaping mechanisms • List traffic policing and shaping mechanisms available in Cisco IOS • Describe the benefits and drawbacks of traffic shaping and policing mechanisms Inner Mongolia University
Lesson Review • How do shaping and policing mechanisms keep track of the traffic rate? • Which shaping mechanisms are available with Cisco IOS software? • Which policing mechanisms are available with Cisco IOS software? • What are the main differences between shaping and policing? Inner Mongolia University
Objectives • Upon completing this lesson, you will be able to: • Describe the GTS mechanism • Describe the benefits and drawbacks of GTS • Configure GTS on Cisco routers • Monitor and troubleshoot GTS Inner Mongolia University
Can shape multiple classes (classification) Can measure traffic rate of individual classes (metering) Delays packets of exceeding classes (shaping) Generic Traffic Shaping Meter Shaper Classifier Marker Dropper Traffic Stream Inner Mongolia University
GTS Building Blocks Shaping Forwarder Classifier Yes No WFQ No No Shaping Classifier Yes Yes WFQ No Yes Shaping Classifier Yes No WFQ Yes Physical Interface Queue(s) No Inner Mongolia University
GTS Overview • GTS is multiprotocol. • GTS uses WFQ for the shaping queue. • GTS can be implemented in combination with any queuing mechanisms: • FIFO queuing • Priority queuing (PQ) • Custom queuing (CQ) • Weighted fair queuing (WFQ) • GTS works on output only. Inner Mongolia University
The software queue may have no function if the sum of all shaping rates is less than the link bandwidth. GTS Implementation Dispatches packets at configured rate Dispatches packets at line rate Dispatches packets at line rate Shaping Queue (WFQ) Software Queue (FIFO, PQ, CQ, WFQ, ...) Hardware Queue (FIFO) Bypasses the software queue if it is empty and there is room in the hardware queue Inner Mongolia University
Configuring GTS Router(config-if)# traffic-shape rate bit-rate [burst-size [excess-burst-size]] • Enables traffic shaping of all outbound (sub)interface traffic • In IOS versions prior to 11.2(19) and 12.0(4), optimum switching is disabled on all interfaces if traffic shaping is enabled on any interface Inner Mongolia University
Configuring GTS (cont.) Router(config-if)# traffic-shape rate bit-rate [burst-size [excess-burst-size]] • Bit rate: average traffic rate in bps (equivalent to Frame Relay CIR) • Burst size: amount of traffic sent in a measurement interval in bits (equivalent to Frame Relay Bc) • Default value: 1/8 of bit rate Inner Mongolia University
Configuring GTS (cont.) Router(config-if)# traffic-shape rate bit-rate [burst-size [excess-burst-size]] • Excess burst size: amount of excess traffic that can be sent during the first burst in bps (equivalent to Frame Relay Be) • Default value: no excess burst • Measurement interval (Tc): computed from bit rate and burst size • Tc smaller than 25 ms is rejected: Tc greater than 125 ms is reduced Inner Mongolia University
Configuring GTS (cont.) Router(config-if)# traffic-shape group access-listbit-rate [burst [excess-burst]] • Traffic-shape group shapes outbound traffic matched by the specified access list. • Several traffic-shapegroupcommands can be configured on the same interface. • The traffic-shape rateand traffic-shape groupcommands cannot be mixed on the same interface. • A separate token bucket and shaping queue is maintained for each traffic-shape group command. • Traffic not matching any access list is not shaped. Inner Mongolia University
GTSExample #1 • An ISP wants to sell a service in which a customer may use all of an E1 line for 30 seconds in a burst, but on a long-term average is limited to 256 kbps. • GTS parameters: • Bit rate: 256,000—output rate is 256,000 bps • Burst size—32,000 the number of bits sent in 125 ms • Excess burst size: 61,440,000 = 2,048,000 x 30 Inner Mongolia University
GTSExample #1 (cont.) WAN Core Customer interface ethernet0/0 traffic-shape rate 256000 32000 61440000 ! interface serial1/0 traffic-shape rate 256000 32000 61440000 • Because the ISP wants to control the total amount of load,the configuration would be done on both the inbound and outbound interfaces. Inner Mongolia University
GTSExample #2 WAN Core Customer interface ethernet 0/0 traffic-shape group 101 64000 interface serial 1/0 traffic-shape group 101 64000 ! access-list 101 permit tcp any any eq www • The customer wants to be sure that web traffic will never use more than 64 kbps. Inner Mongolia University
Router#show traffic-shape access Target Byte Sustain Excess Interval Increment Adapt I/F list Rate Limit bits/int bits/int (ms) (bytes) Active Se3/3 100000 2000 8000 8000 80 1000 - Monitoring GTS Router(config)# show traffic-shape • Displays current traffic shaping configuration MAX = (Bc + Be)/8 Be Bc = Tc * CIR Do we listen to FECN/BECN? CIR Bc Tc=Bc/CIR Inner Mongolia University
Router#show traffic-shape statistics Access Queue Packets BytesPackets Bytes Shaping I/F List Depth Delayed Delayed Active Se3/3 77 16091 3733112 414 96048 yes Monitoring GTS (cont.) Router(config)# show traffic-shape statistics • Displays traffic shaping statistics Number of packets/bytes sent on the interface Subset of the previous number of packets/bytes delayed via the WFQ queue Depth of the associated WFQ queue for delayed packets Inner Mongolia University
router#show traffic-shape queue Traffic queued in shaping queue on Serial0 (depth/weight) 1/4096 Conversation 254, linktype: ip, length: 232 source: 1.1.1.1, destination: 1.1.2.47, id: 0x0001, ttl: 208, TOS: 0 prot: 17, source port 11111, destination port 22222 Monitoring GTS (cont.) Router(config)# show traffic-shape queue • Displays the shaping queue contents Inner Mongolia University
GTS on Frame Relay Interfaces • GTS can be implemented on any type of (sub)interface. • GTS supports additional features when implemented on Frame Relay interfaces: • Adaptation to Frame Relay congestion notification • BECN-to-FECN reflection • FECN creation on congestion Inner Mongolia University
Frame Relay Refresher • Frame Relay explicit congestion notification • FECN (Forward explicit congestion notification) • BECN (Backward explicit congestion notification) • CLLM (Consolidated link layer management) • Implicit congestion notification • Network discards detected by end user at higher layers • DE (discard eligibile) bit Inner Mongolia University
Frame Relay FECN/BECN Congestion Control Same Virtual Circuit (VC) Switch monitors all transmit queues for congestion. Receiver Sender Frame 1FECN Frame 1 Frame Relay Switch No Congestion This Side Congestion This Side Frame 2BECN Frame 2 • Frame Relayswitch detects congestion on output queue and informs: • The receiver, by setting the FECN bit on forwarded frames • The source, by setting the BECN bit on frames going in the opposite direction Inner Mongolia University
GTS Frame Relay Congestion Adaptability • On a Frame Relay (sub)interface, GTS can adapt dynamically to available Frame Relay bandwidth by integrating BECN signals: • The GTS bit rate is reduced when BECN packets are received in order to reduce the data flow through the congested Frame Relay network. • Adaptation is done on a per- (sub)interface basis. • The GTS bit rate is gradually increased when the congestion is no longer present (no BECN packets are received anymore). Inner Mongolia University
GTS Frame Relay Congestion Adaptability Mechanisms • Bit-rate adaptation: • The traffic shaping bit rate is reduced when a packet with a BECN bit is received in the Tc . • The traffic shaping bit rate is increased if no BECN bits were received in the Tc . • FECN-to-BECN propagation: • A test packet with a BECN bit set is sent to the sender if a packet with an FECN bit set is received. Inner Mongolia University
Inc An Example of BECN Integration BECN 9000 BECN Integration 8000 BECN 7000 6000 Inc Added Every Tc in the Token Bucket 5000 4000 traffic-shape rate 64000 8000 8000traffic-shape adaptive 32000 BECN received at Tc#1 and Tc#3 Hypothesis: no idle traffic 3000 2000 1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 Time Represented in Units of Tc Inner Mongolia University
Congestion FECN-to-BECN Propagation Receiver Sender FECN Frame Relay Switch BECN in Q.922Test If there is no reverse traffic, the switch is not able to set BECN in frames going back to sender. Inner Mongolia University
Configuring Bit-Rate Adaptation Router(config-if)# traffic-shape adaptive [bit-rate] • Configures traffic shaping Frame Relay bit-rate adaptation • bit-rate—lowest bit rate the traffic is shaped to in response to continuous BECN signals • Default: one-half the specified traffic shaping rate • Traffic shaping has to be enabled Inner Mongolia University
Configuring FECN-to-BECN Propagation Router(config-if)# traffic-shape fecn-adapt • Configures the router to send Frame Relay TEST message with BECN bit set in response to receiving a frame with FECN bit set • Can be used without adaptive traffic shaping Router(config-if)# traffic-shape fecn-create • Sets FECN bit in all outgoing packets that have been delayed due to traffic shaping • Use for debugging/simulation only Inner Mongolia University
GTS Frame Relay Adaptation Design • Conservative scenario: • Set shaping rate to CIR • Set minimum rate to MIR (or one-half CIR) • Optimistic scenario: • Set shaping rate to EIR • Set minimum rate to CIR • Realistic scenario: • Set shaping rate to EIR • Set minimum rate to MIR (or one-half CIR) Inner Mongolia University
GTS Frame Relay Adaptation Example WAN Core interface serial0/0 traffic-shape rate 64000 8000 8000 traffic-shape adaptive 48000 Customer • EIR = 64 kbps • CIR = 48 kbps • Assumption:Frame Relay network is usually not congested. Inner Mongolia University
Summary • Upon completing this lesson, you should be able to: • Describe the GTS mechanism • Describe the benefits and drawbacks of GTS • Configure GTS on Cisco routers • Monitor and troubleshoot GTS Inner Mongolia University
Lesson Review • What software queuing mechanisms are supported in combination with GTS? • Which queuing structure does GTS use? • What features does GTS include when it is used on Frame Relay interfaces? Inner Mongolia University
Objectives • Upon completing this lesson, you will be able to: • Describe the CAR mechanism • Describe the benefits and drawbacks of CAR • Describe the differences between CAR, GTS, and FRTS • Configure CAR on Cisco routers • Monitor and troubleshoot CAR Inner Mongolia University
Primarily intended for rate limiting Can be used on inbound and outbound traffic Does not queue (delay) packets Can also mark packets Can be implemented for differentiated marking Committed Access Rate Meter Inbound or Outbound Classifier Marker Dropper Inner Mongolia University
CAR on input is processed just before forwarding (most other QoS mechanisms are processed before CAR). CAR on output is processed immediately after forwarding (most other QoS mechanisms are processed after CAR). CAR on Input and Output Meter Dropper Classifier Marker Inbound Forwarding Outbound Meter Queuing Classifier Marker Dropper Inner Mongolia University
The software queue may have no function if the sum of all CAR rates is less than the link bandwidth. CAR Implementation Dispatches packets at configured rate Dispatches packets at line rate Dispatches packets at line rate Software Queue (FIFO, PQ, CQ, WFQ, ...) Hardware Queue (FIFO) CAR Bypasses the software queue if it is empty and there is room in the hardware queue Inner Mongolia University
Interface-Wide CAR Diagram drop Class 1? transmit CAR continue drop Output Queue or Forward Class 2? transmit CAR continue drop Class n? transmit CAR • CAR has three different actions: • Transmit • Continue • Drop Inner Mongolia University