© 2001, Cisco Systems, Inc. Modular QoS CLI Service Policy.

download © 2001, Cisco Systems, Inc. Modular QoS CLI Service Policy.

If you can't read please download the document

description

Service Policy © 2001, Cisco Systems, Inc. QOS v1.0—9-3

Transcript of © 2001, Cisco Systems, Inc. Modular QoS CLI Service Policy.

2001, Cisco Systems, Inc. Modular QoS CLI Service Policy 2001, Cisco Systems, Inc. QOS v1.09-2 Objectives Upon completing this module, you will be able to: Describe the policy part of the Modular QoS CLI Configure packet marking with the modular CLI Configure policing and shaping with the modular CLI Configure class-based WFQ with the modular CLI Configure congestion avoidance mechanisms (WRED) with the modular CLI Configure low-latency queuing Monitor and troubleshoot policy maps Service Policy 2001, Cisco Systems, Inc. QOS v1.09-3 2001, Cisco Systems, Inc. QOS v1.09-4 Objectives Upon completing this lesson, you will be able to: Describe and configure policy maps List all the QoS mechanisms currently available in the MQC Monitor and troubleshoot policy maps 2001, Cisco Systems, Inc. QOS v1.09-5 Service Policy One aspect of MQC modularity is configuration. The MQC is split into two configuration modules: Configuration of classification Configuration of service policies Classification is configured by using class maps. Service policy is configured by using policy maps. 2001, Cisco Systems, Inc. QOS v1.09-6 Modular QoS CLI Classification Service Policy Class 1? Class 2? Class N? CBWFQ CBLLQ Class-Based Policing Service policy implements per-hop behaviors (PHBs) for all traffic classes. Supported mechanisms: CBWFQ CBLLQ Class-Based Policing Class-Based Shaping Class-Based Marking Up to 256 classes can be used within one service policy. 2001, Cisco Systems, Inc. QOS v1.09-7 PHB Mechanisms The MQC supports these QoS mechanisms: Class-based weighted fair queuing (CBWFQ) to guarantee bandwidth Class-based low-latency queuing (CBLLQ) to guarantee bandwidth and low latency Class-based policing to limit traffic rate by dropping excess traffic Class-based shaping to limit traffic rate by delaying excess traffic Class-based marking to mark packets 2001, Cisco Systems, Inc. QOS v1.09-8 Configuring Policy Maps policy-map name Router(config)# Enter policy-map configuration mode. Policy maps are identified by a case-sensitive name. class class-map Router(config-pmap)# Enter the per-class policy configuration mode by using the name of a previously configured class map. Use the name class-default to configure the policy for the default class. class class-map condition Router(config-pmap)# Optionally, you can define a new class map by entering the condition after the name of the new class map. The class map will use the match-any strategy. 2001, Cisco Systems, Inc. QOS v1.09-9 Configuring Policy Maps (cont.) description Router(config-pmap)# It is recommended to use descriptions in large and complex configurations. The description has no operational meaning. rename policy-map Router(config-pmap)# Complex policy maps can be renamed by using the rename policy-map command. All references to the policy map are also renamed. Router(config-pmap-c)# Per-class service policies are configured within the per-class policy map configuration mode. 2001, Cisco Systems, Inc. QOS v1.09-10 Configuring Policy Maps (cont.) service-policy {input | output} policy-map Router(config-if)# Attaches the specified service policy map to the input or output interface The interface should be in the default queuing mode prior to using this command if it is used on output class-map HTTP match protocol http ! policy-map PM class HTTP bandwidth 2000 class class-default bandwidth 6000 ! class-map HTTP match protocol http ! policy-map PM class HTTP bandwidth 2000 class class-default bandwidth 6000 ! interface Serial0/0 service-policy output PM ! interface Serial0/0 service-policy output PM ! 2001, Cisco Systems, Inc. QOS v1.09-11 Attaching Policy Maps to ATM PVCs interface atm 5/0/0.1 point-to-point service-policy output PM1 ! interface atm 5/0/0.2 point-to-point pvc 1/40 service-policy output PM2 ! interface atm 5/0/0.1 point-to-point service-policy output PM1 ! interface atm 5/0/0.2 point-to-point pvc 1/40 service-policy output PM2 ! service-policy {input | output} policy-map Router(config-subif)# Service policies can be attached to an ATM (sub)interface. Using service policies on the main interface and subinterfaces at the same time is not supported in the distributed (VIP-based) version. service-policy {input | output} policy-map Router(config-if-atm-vc)# Service policies can also be attached to an ATM PVC. 2001, Cisco Systems, Inc. QOS v1.09-12 Attaching Policy Maps to Frame Relay Interfaces service-policy {input | output} policy-map Router(config-subif)# Service policy can be attached to an interface/subinterface. Service policy attached to a subinterface cannot include CBWFQ or CBLLQ except in the distributed (VIP-based) version. Using service policies on the main interface and subinterfaces at the same time is not supported in the distributed (VIP-based) version. 2001, Cisco Systems, Inc. QOS v1.09-13 Attaching Policy Maps to Frame Relay PVCs service-policy {input | output} policy-map Router(config-map-class)# Service policy can be attached to a Frame Relay map class. class-map Voice match protocol vofr ! policy-map LLQ class Voice priority 100 ! interface Serial0/0 encapsulation frame-relay ! interface Serial0/0.1 point-to-point frame-relay class Voice ! map-class frame-relay Voice service-policy output LLQ ! class-map Voice match protocol vofr ! policy-map LLQ class Voice priority 100 ! interface Serial0/0 encapsulation frame-relay ! interface Serial0/0.1 point-to-point frame-relay class Voice ! map-class frame-relay Voice service-policy output LLQ ! 2001, Cisco Systems, Inc. QOS v1.09-14 Policy Map Example class-map match-all Test1 match protocol http match access-group 100 class-map match-any Test2 match protocol http match access-group 101 ! policy-map Test class Test1 bandwidth 100 class Test2 bandwidth 200 class Test3 access-group 100 bandwidth 300 ! access-list 100 permit tcp any host access-list 101 permit tcp any host class-map match-all Test1 match protocol http match access-group 100 class-map match-any Test2 match protocol http match access-group 101 ! policy-map Test class Test1 bandwidth 100 class Test2 bandwidth 200 class Test3 access-group 100 bandwidth 300 ! access-list 100 permit tcp any host access-list 101 permit tcp any host 2001, Cisco Systems, Inc. QOS v1.09-15 Monitoring and Troubleshooting Policy Maps show policy-map [policy-map] Router# Router#show policy-map Policy Map Test Class Test1 Weighted Fair Queueing Bandwidth 100 (kbps) Max Threshold 64 (packets) Class Test2 Weighted Fair Queueing Bandwidth 200 (kbps) Max Threshold 64 (packets) Class Test3 Weighted Fair Queueing Bandwidth 300 (kbps) Max Threshold 64 (packets) Router#show policy-map Policy Map Test Class Test1 Weighted Fair Queueing Bandwidth 100 (kbps) Max Threshold 64 (packets) Class Test2 Weighted Fair Queueing Bandwidth 200 (kbps) Max Threshold 64 (packets) Class Test3 Weighted Fair Queueing Bandwidth 300 (kbps) Max Threshold 64 (packets) 2001, Cisco Systems, Inc. QOS v1.09-16 Monitoring and Troubleshooting Policy Maps (cont.) show policy-map interface [intf] {input | output} Router# Router#show policy-map interface FastEthernet0/0 output FastEthernet0/0 Service-policy output: Test (1101) Class-map: Test1 (match-all) (1103/3) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: access-group 101 (1107) Match: access-group 102 (1111) Match: protocol http (1115) Weighted Fair Queueing Output Queue: Conversation 265 Bandwidth 100 (kbps) Max Threshold 64 (packets) (pkts matched/bytes matched) 0/0 (depth/total drops/no-buffer drops) 0/0/0... Class-map: class-default (match-any) (1143/0) 25 packets, bytes 5 minute offered rate 1000 bps, drop rate 0 bps Match: any (1147) Router#show policy-map interface FastEthernet0/0 output FastEthernet0/0 Service-policy output: Test (1101) Class-map: Test1 (match-all) (1103/3) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: access-group 101 (1107) Match: access-group 102 (1111) Match: protocol http (1115) Weighted Fair Queueing Output Queue: Conversation 265 Bandwidth 100 (kbps) Max Threshold 64 (packets) (pkts matched/bytes matched) 0/0 (depth/total drops/no-buffer drops) 0/0/0... Class-map: class-default (match-any) (1143/0) 25 packets, bytes 5 minute offered rate 1000 bps, drop rate 0 bps Match: any (1147) 2001, Cisco Systems, Inc. QOS v1.09-17 Summary Upon completing this lesson, you should be able to: Describe and configure policy maps List all the QoS mechanisms currently available in the MQC Monitor and troubleshoot policy maps 2001, Cisco Systems, Inc. QOS v1.09-18 Lesson Review 1.What are the benefits of using the MQC? 2.How many classes can be used for one service policy? Class-based Weighted Fair Queuing 2001, Cisco Systems, Inc. QOS v1.09-19 2001, Cisco Systems, Inc. QOS v1.09-20 Objectives Upon completing this lesson, you will be able to: Describe class-based weighted fair queuing (CBWFQ) Configure CBWFQ Monitor and troubleshoot CBWFQ 2001, Cisco Systems, Inc. QOS v1.09-21 Class-Based Weighted Fair Queuing Class-based weighted fair queuing (CBWFQ) is a mechanism that is used to guarantee bandwidth to classes. CBWFQ extends the standard WFQ functionality to provide support for user-defined traffic classes: Classes are based on user-defined match criteria. Packets satisfying the match criteria for a class constitute the traffic for that class. A queue is reserved for each class, and traffic belonging to a class is directed to that class queue. 2001, Cisco Systems, Inc. QOS v1.09-22 CB-WFQ Up to 64 classes (class maps) and one default class CBWFQ Hardware Queuing System Class 1? Queue 1 CBWFQ Scheduler Interface Forwarded Packets Hardware Q Tail drop Class 2? Queue 2Tail drop Class-Default? Default QueueTail drop 2001, Cisco Systems, Inc. QOS v1.09-23 CBWFQ Classification Classification uses class-maps. The availability of certain classification options depends on the Cisco IOS version. Some classification options depend on the type of interface and encapsulation where the service policy is used. For example: Matching on Frame Relay DE bits can be used only on interfaces with Frame Relay encapsulation. Matching on MPLS experimental bits has no effect if MPLS is not enabled. Matching on ISL priority bits has no effect if ISL is not used. 2001, Cisco Systems, Inc. QOS v1.09-24 CBWFQ Insertion Policy Each queue has a maximum number of packets that it can hold (queue size). The default maximum queue size is 64. After a packet is classified to one of the queues, the router will enqueue the packet if the queue limit has not been reached (tail drop within each class). WRED can be used in combination with CBWFQ to prevent congestion of the class. 2001, Cisco Systems, Inc. QOS v1.09-25 CBWFQ Scheduling CBWFQ guarantees bandwidth according to weights assigned to traffic classes. Weights can be defined by specifying: Bandwidth (in kbps) Percentage of bandwidth (percentage of configured interface bandwidth) Percentage of available bandwidth One service policy cannot have mixed types of weights. The show interface command can be used to display the available bandwidth. 2001, Cisco Systems, Inc. QOS v1.09-26 Available Bandwidth Available bandwidth is calculated according to this formula: BW avail = BW * MaxReservable SUM(all fixed guarantees) Configured using the interface bandwidth command Configured using the interface max-reserved-bandwidth command 75% is the default value Configured using the interface max-reserved-bandwidth command 75% is the default value Sum of all fixed guarantees using CBWFQ, CBLLQ, IP RTP Prioritization 2001, Cisco Systems, Inc. QOS v1.09-27 Available Bandwidth Example 1 Ethernet interface uses a default bandwidth of 10,000 (kbps) and WFQ: BW avail = BW * MaxReservable SUM(all fixed guarantees) BW avail = kbps * 75% 0 kbps = 7500 kbps Router#show interface Ethernet 0/0 Ethernet0/0 is up, line protocol is up Hardware is AmdP2, address is 00b0.64e (bia 00b0.64e2.2860) Internet address is MTU 1500 bytes, BW Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:04, output 00:00:08, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/0/256 (active/max active/max total) Reserved Conversations 0/0 (allocated/max allocated) Available Bandwidth 7500 kilobits/sec... Router#show interface Ethernet 0/0 Ethernet0/0 is up, line protocol is up Hardware is AmdP2, address is 00b0.64e (bia 00b0.64e2.2860) Internet address is MTU 1500 bytes, BW Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:04, output 00:00:08, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/0/256 (active/max active/max total) Reserved Conversations 0/0 (allocated/max allocated) Available Bandwidth 7500 kilobits/sec... 2001, Cisco Systems, Inc. QOS v1.09-28 Available Bandwidth Example 2 Ethernet interface uses a default bandwidth of 10,000 (kbps) with WFQ: Maximum reservable bandwidth is set to 50% IP RTP Prioritization is used to guarantee 1 Mbps to VoIP BW avail = BW * MaxReservable SUM(all fixed guarantees) BW avail = kbps * 50% 1000 kbps = 4000 kbps interface Ethernet0/0 ip address half-duplex max-reserved-bandwidth 50 fair-queue ip rtp priority interface Ethernet0/0 ip address half-duplex max-reserved-bandwidth 50 fair-queue ip rtp priority 2001, Cisco Systems, Inc. QOS v1.09-29 Available Bandwidth Example 2 (cont.) Router#show interface Ethernet0/0 Ethernet0/0 is up, line protocol is up Hardware is AmdP2, address is 00b0.64e (bia 00b0.64e2.2860) Internet address is MTU 1500 bytes, BW Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:04, output 00:00:06, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total) Reserved Conversations 0/0 (allocated/max allocated) Available Bandwidth 4000 kilobits/sec... Router#show interface Ethernet0/0 Ethernet0/0 is up, line protocol is up Hardware is AmdP2, address is 00b0.64e (bia 00b0.64e2.2860) Internet address is MTU 1500 bytes, BW Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:04, output 00:00:06, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total) Reserved Conversations 0/0 (allocated/max allocated) Available Bandwidth 4000 kilobits/sec... 2001, Cisco Systems, Inc. QOS v1.09-30 Configuring CBWFQ bandwidth Router(config-pmap-c)# Allocate a fixed amount of bandwidth to a class. Set the value in kbps. bandwidth percent percent Router(config-pmap-c)# Allocate a percentage of bandwidth to a class. The configured (or default) interface bandwidth is used to calculate the guaranteed bandwidth. bandwidth remaining percent percent Router(config-pmap-c)# Allocate a percentage of available bandwidth to a class. 2001, Cisco Systems, Inc. QOS v1.09-31 Configuring CBWFQ (cont.) queue-limit Router(config-pmap-c)# Set the maximum number of packets this queue can hold The default maximum is 64 Sets the discard threshold in the class-default if flow-based WFQ is used fair-queue [dynamic-queues] Router(config-pmap-c)# The class-default class can be configured to use flow-based WFQ WFQ can be configured with 16 to 4096 dynamic queues 2001, Cisco Systems, Inc. QOS v1.09-32 CBWFQ Example 1 policy-map Policy1 class Class1 bandwidth 2000 class Class2 bandwidth 2000 ! interface FastEthernet0/0 ip address duplex auto speed 10 max-reserved-bandwidth 80 service-policy output Policy1 ip rtp priority ! policy-map Policy1 class Class1 bandwidth 2000 class Class2 bandwidth 2000 ! interface FastEthernet0/0 ip address duplex auto speed 10 max-reserved-bandwidth 80 service-policy output Policy1 ip rtp priority ! BW avail = kbps * 80% - ( ) kbps = 3000 kbps 2001, Cisco Systems, Inc. QOS v1.09-33 CBWFQ Example 2 policy-map Policy1 class Class1 bandwidth percent 20 class Class2 bandwidth percent 20 ! interface FastEthernet0/0 ip address duplex auto speed 10 max-reserved-bandwidth 80 service-policy output Policy1 ip rtp priority ! policy-map Policy1 class Class1 bandwidth percent 20 class Class2 bandwidth percent 20 ! interface FastEthernet0/0 ip address duplex auto speed 10 max-reserved-bandwidth 80 service-policy output Policy1 ip rtp priority ! BW avail = kbps * 80% - (10000*(20%+20%)+1000) kbps = 3000 kbps 2001, Cisco Systems, Inc. QOS v1.09-34 CBWFQ Examples 1 and 2 Router#show interface fastethernet 0/0 FastEthernet0/0 is up, line protocol is up Hardware is AmdFE, address is aa00 (bia aa00) Internet address is /24 MTU 1500 bytes, BW Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Half-duplex, 10Mb/s, 100BaseTX/FX ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:09, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total) Reserved Conversations 2/2 (allocated/max allocated) Available Bandwidth 3000 kilobits/sec... Router#show interface fastethernet 0/0 FastEthernet0/0 is up, line protocol is up Hardware is AmdFE, address is aa00 (bia aa00) Internet address is /24 MTU 1500 bytes, BW Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Half-duplex, 10Mb/s, 100BaseTX/FX ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:09, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total) Reserved Conversations 2/2 (allocated/max allocated) Available Bandwidth 3000 kilobits/sec... 2001, Cisco Systems, Inc. QOS v1.09-35 CBWFQ Example 3 policy-map Policy1 class Class1 bandwidth remaining percent 20 class Class2 bandwidth remaining percent 20 ! interface FastEthernet0/0 ip address duplex auto speed 10 max-reserved-bandwidth 80 service-policy output Policy1 ip rtp priority ! policy-map Policy1 class Class1 bandwidth remaining percent 20 class Class2 bandwidth remaining percent 20 ! interface FastEthernet0/0 ip address duplex auto speed 10 max-reserved-bandwidth 80 service-policy output Policy1 ip rtp priority ! BW avail = kbps * 80% kbps = 7000 kbps 2001, Cisco Systems, Inc. QOS v1.09-36 CBWFQ Example 3 (cont.) Router#show interface fastethernet 0/0 FastEthernet0/0 is up, line protocol is up Hardware is AmdFE, address is aa00 (bia aa00) Internet address is /24 MTU 1500 bytes, BW Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Half-duplex, 10Mb/s, 100BaseTX/FX ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:03, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total) Reserved Conversations 2/2 (allocated/max allocated) Available Bandwidth 7000 kilobits/sec... Router#show interface fastethernet 0/0 FastEthernet0/0 is up, line protocol is up Hardware is AmdFE, address is aa00 (bia aa00) Internet address is /24 MTU 1500 bytes, BW Kbit, DLY 1000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Half-duplex, 10Mb/s, 100BaseTX/FX ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:03, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total) Reserved Conversations 2/2 (allocated/max allocated) Available Bandwidth 7000 kilobits/sec... 2001, Cisco Systems, Inc. QOS v1.09-37 Monitoring and Troubleshooting CBWFQ show policy-map interface [intf] Router# Displays parameters and statistics of CBWFQ Router#show policy-map interface FastEthernet0/0 Service-policy output: Policy1 Class-map: Class1 (match-any) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any Weighted Fair Queueing Output Queue: Conversation 265 Bandwidth remaining 20 (%) Max Threshold 64 (packets) (pkts matched/bytes matched) 0/0 (depth/total drops/no-buffer drops) 0/0/0 Class-map: class-default (match-any) 42 packets, 4439 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any Router#show policy-map interface FastEthernet0/0 Service-policy output: Policy1 Class-map: Class1 (match-any) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any Weighted Fair Queueing Output Queue: Conversation 265 Bandwidth remaining 20 (%) Max Threshold 64 (packets) (pkts matched/bytes matched) 0/0 (depth/total drops/no-buffer drops) 0/0/0 Class-map: class-default (match-any) 42 packets, 4439 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any 2001, Cisco Systems, Inc. QOS v1.09-38 Monitoring and Troubleshooting CBWFQ show queueing fair Router# Displays queuing parameters on interfaces Router#show queueing fair Current fair queue configuration: Interface Discard Dynamic Reserved Link Priority threshold queues queues queues queues FastEthernet0/ Serial0/ Serial0/ Router#show queueing fair Current fair queue configuration: Interface Discard Dynamic Reserved Link Priority threshold queues queues queues queues FastEthernet0/ Serial0/ Serial0/ One queue is reserved for IP RTP Prioritization. CBWFQ reserves 64 queues in the WFQ system. 2001, Cisco Systems, Inc. QOS v1.09-39 Monitoring and Troubleshooting CB-DWFQ show queueing interface [intf] Router# Displays queuing parameters on a specific VIP-based interface c7500#show queueing interface serial 5/1/0 Interface Serial5/1/0 queueing strategy: VIP-based fair queueing Serial5/1/0 queue size 0 pkts output 0, wfq drops 0, nobuffer drops 0 WFQ: aggregate queue limit 0 max available buffers 0 Class 0: weight 50 limit 250 qsize 0 pkts output 0 drops 0 Class 23: weight 30 limit 150 qsize 0 pkts output 0 drops 0 Class 24: weight 20 limit 100 qsize 0 pkts output 0 drops 0 c7500#show queueing interface serial 5/1/0 Interface Serial5/1/0 queueing strategy: VIP-based fair queueing Serial5/1/0 queue size 0 pkts output 0, wfq drops 0, nobuffer drops 0 WFQ: aggregate queue limit 0 max available buffers 0 Class 0: weight 50 limit 250 qsize 0 pkts output 0 drops 0 Class 23: weight 30 limit 150 qsize 0 pkts output 0 drops 0 Class 24: weight 20 limit 100 qsize 0 pkts output 0 drops 0 2001, Cisco Systems, Inc. QOS v1.09-40 Summary Upon completing this lesson, you should be able to: Describe class-based weighted fair queuing (CBWFQ) Configure CBWFQ Monitor and troubleshoot CBWFQ 2001, Cisco Systems, Inc. QOS v1.09-41 Lesson Review 1.What type of guarantee does CBWFQ provide? 2.Which DiffServ PHB can be implemented using CBWFQ? 3.What configuration steps are needed to configure CBWFQ? Class-based WRED 2001, Cisco Systems, Inc. QOS v1.09-42 2001, Cisco Systems, Inc. QOS v1.09-43 Objectives Upon completing this lesson, you will be able to: Describe class-based weighted random early detection (CB-WRED) Configure CB-WRED Monitor and troubleshoot CB-WRED 2001, Cisco Systems, Inc. QOS v1.09-44 Class-Based WRED Class-based WRED can be used in combination with CBWFQ. Using CBWFQ with WRED allows the implementation of DiffServs assured forwarding PHB. The class-based configuration of WRED is identical to standalone WRED. Flow-based WRED is not available with the Modular QoS CLI. 2001, Cisco Systems, Inc. QOS v1.09-45 RED Profile WRED starts randomly dropping packets when the average queue size is above the minimum threshold. Average Queue Size Drop Probability 10% 100% Minimum Threshold Maximum Threshold Maximum Drop Probability Maximum Drop Probability No dropRandom dropFull drop 2001, Cisco Systems, Inc. QOS v1.09-46 RED Modes RED has three modes: No drop: when the average queue size is between 0 and the minimum threshold Random drop: when the average queue size is between the minimum and the maximum threshold Full drop (tail drop): when the average queue size is at maximum threshold or above Random drop should prevent congestion (prevent tail drops). 2001, Cisco Systems, Inc. QOS v1.09-47 WRED Building Blocks IP Packet WRED Calculate Average Queue Size Calculate Average Queue Size FIFO Queue Select WRED Profile Select WRED Profile Current Queue Size IP Precedence or DSCP Minimum threshold Maximum threshold Mark probability Denominator Queue Full? Queue Full? No Yes Tail DropRandom Drop 2001, Cisco Systems, Inc. QOS v1.09-48 Weighted Random Early Detection WRED uses a different RED profile for each weight. Each profile is identified by: Minimum threshold Maximum threshold Maximum drop probability Weight can be: IP Precedence (8 profiles) DSCP (64 profiles) WRED drops less important packets more aggressively than more important packets. 2001, Cisco Systems, Inc. QOS v1.09-49 WRED Profiles WRED profiles can be manually set. WRED has 8 default value sets for IP Precedencebased WRED. WRED has 64 default value sets for DSCP-based WRED. Average Queue Size Drop Probability 10% 100% 2001, Cisco Systems, Inc. QOS v1.09-50 IP Precedence and Class Selector Profiles Average Queue Size Drop Probability 10% 100% 2040 RSVP IP Precedence 2001, Cisco Systems, Inc. QOS v1.09-51 DSCP-Based WRED (Expedited Forwarding) Average Queue Size Drop Probability 10% 100% 2040 EF 36 2001, Cisco Systems, Inc. QOS v1.09-52 DSCP-Based WRED (Assured Forwarding) Average Queue Size Drop Probability 10% 100% 2040 AF High Drop AF Medium Drop AF Low Drop 2001, Cisco Systems, Inc. QOS v1.09-53 Configuring WRED random-detect Router(config-pmap-c)# Enables IP Precedencebased WRED in the selected class within the service policy configuration mode Default service profile is used 2001, Cisco Systems, Inc. QOS v1.09-54 Changing the WRED Profile random-detect precedence precedence min-threshold max-threshold mark-prob-denominator Router(config-pmap-c)# Changes RED profile for specified IP Precedence value Packet drop probability at maximum threshold is 1 / mark-prob-denominator nonweighted RED is achieved by using the same RED profile for all precedence values 2001, Cisco Systems, Inc. QOS v1.09-55 Changing WRED Sensitivity to Bursts random-detect exponential-weighting-constant n Router(config-pmap-c)# WRED takes the average queue size to determine the current WRED mode (no drop, random drop, full drop). High values of n allow short bursts. Low values of n make WRED more burst-sensitive. The default value (9) should be used in most scenarios. The average output queue size with n=9 is average t+1 = average t * queue_size t * Current Queue Size Previous Average Queue Size New Average Queue Size 2001, Cisco Systems, Inc. QOS v1.09-56 Configuring DSCP-Based WRED random-detect {prec-based | dscp-based} Router(config-pmap-c)# Selects WRED mode Precedence-based WRED is the default mode DSCP-based command uses 64 profiles 2001, Cisco Systems, Inc. QOS v1.09-57 Changing the WRED Profile random-detect dscp dscp min-threshold max- threshold mark-prob-denominator Router(config-pmap-c)# Changes RED profile for specified DSCP value Packet drop probability at maximum threshold is 1 / mark-prob-denominator 2001, Cisco Systems, Inc. QOS v1.09-58 CBWFQ with WRED Example 1 Enable CBWFQ to prioritize traffic according to these requirements: Class Gold is marked with IP Precedence values 3 and 4 (3 is high drop, 4 is low drop) and should get 30% of interface bandwidth Class Silver is marked with IP Precedence values 1 and 2 (1 is high drop, 2 is low drop) and should get 20% of interface bandwidth All other traffic should be per-flow fair-queued Use differentiated WRED to prevent congestion in all three classes (try to set up your own WRED profiles for Gold and Silver). 2001, Cisco Systems, Inc. QOS v1.09-59 CBWFQ with WRED Example 1 (cont.) class-map Gold match ip precedence 3 4 ! class-map Silver match ip precedence 1 2 ! policy-map Policy1 class Gold bandwidth percent 30 random-detect random-detect precedence random-detect precedence class Silver bandwidth percent 20 random-detect random-detect precedence random-detect precedence class class-default fair-queue random-detect ! class-map Gold match ip precedence 3 4 ! class-map Silver match ip precedence 1 2 ! policy-map Policy1 class Gold bandwidth percent 30 random-detect random-detect precedence random-detect precedence class Silver bandwidth percent 20 random-detect random-detect precedence random-detect precedence class class-default fair-queue random-detect ! 2001, Cisco Systems, Inc. QOS v1.09-60 CBWFQ with WRED Example 2 Use the QoS design from the previous example. Implement it using DSCP: Class Gold is using AF1. Class Silver is using AF2. Make sure that the new configurations still conform to the design and implementation from the previous example. 2001, Cisco Systems, Inc. QOS v1.09-61 CBWFQ with WRED Example 2 class-map Gold match ip dscp af11 af12 af13 cs3 cs4 ! class-map Silver match ip dscp af21 af22 af23 cs1 cs2 ! policy-map Policy1 class Gold bandwidth percent 30 random-detect dscp-based random-detect dscp af random-detect dscp af random-detect dscp af random-detect dscp cs random-detect dscp cs class-map Gold match ip dscp af11 af12 af13 cs3 cs4 ! class-map Silver match ip dscp af21 af22 af23 cs1 cs2 ! policy-map Policy1 class Gold bandwidth percent 30 random-detect dscp-based random-detect dscp af random-detect dscp af random-detect dscp af random-detect dscp cs random-detect dscp cs class Silver bandwidth percent 20 random-detect dscp-based random-detect dscp af random-detect dscp af random-detect dscp af random-detect dscp cs random-detect dscp cs class class-default fair-queue random-detect dscp-based ! class Silver bandwidth percent 20 random-detect dscp-based random-detect dscp af random-detect dscp af random-detect dscp af random-detect dscp cs random-detect dscp cs class class-default fair-queue random-detect dscp-based ! 2001, Cisco Systems, Inc. QOS v1.09-62 Monitoring and Troubleshooting CB-WRED Router#show policy-map interface fastEthernet 0/0 FastEthernet0/0 Service-policy output: Policy1 Class-map: Gold (match-all) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: ip precedence 3 4 Match: ip dscp Weighted Fair Queueing Output Queue: Conversation 265 Bandwidth 30 (%) Bandwidth 3000 (kbps) (pkts matched/bytes matched) 0/0 (depth/total drops/no-buffer drops) 0/0/0 exponential weight: 9 mean queue depth: 0 Dscp Random drop Tail drop Minimum Maximum Mark (Prec) pkts/bytes pkts/bytes threshold threshold probability 0(0) 0/0 0/ /10 1 0/0 0/ /10 2 0/0 0/ /10 3 0/0 0/ /10... Router#show policy-map interface fastEthernet 0/0 FastEthernet0/0 Service-policy output: Policy1 Class-map: Gold (match-all) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: ip precedence 3 4 Match: ip dscp Weighted Fair Queueing Output Queue: Conversation 265 Bandwidth 30 (%) Bandwidth 3000 (kbps) (pkts matched/bytes matched) 0/0 (depth/total drops/no-buffer drops) 0/0/0 exponential weight: 9 mean queue depth: 0 Dscp Random drop Tail drop Minimum Maximum Mark (Prec) pkts/bytes pkts/bytes threshold threshold probability 0(0) 0/0 0/ /10 1 0/0 0/ /10 2 0/0 0/ /10 3 0/0 0/ /10... 2001, Cisco Systems, Inc. QOS v1.09-63 Summary Upon completing this lesson, you should be able to: Describe class-based weighted random early detection (CB-WRED) Configure CB-WRED Monitor and troubleshoot CB-WRED 2001, Cisco Systems, Inc. QOS v1.09-64 Lesson Review 1.How does WRED supplement CBWFQ? 2.Can WRED be combined with flow-based WFQ in the default class? 3.Which two operational modes does WRED support? 4.How many profiles does WRED support? Class-based Low-latency Queuing 2001, Cisco Systems, Inc. QOS v1.09-65 2001, Cisco Systems, Inc. QOS v1.09-66 Objectives Upon completing this lesson, you will be able to: Describe class-based low-latency queuing (CBLLQ) Configure CBLLQ Monitor and troubleshoot CBLLQ 2001, Cisco Systems, Inc. QOS v1.09-67 Class-Based Low-Latency Queuing VoIP or other multimedia applications should not be fair-queued with other data. IP RTP Prioritization has a number of drawbacks: It is not selective enough (filters only on UDP port range). It does not support TCP or other protocols. You can specify only overall high-priority traffic rate. Class-based low-latency queuing (CBLLQ) removes most of the drawbacks of IP RTP Prioritization. 2001, Cisco Systems, Inc. QOS v1.09-68 Low-Latency Queuing Queuing and Scheduling Forwarder Class Priority Class Priority No WFQ Scheduling Priority Queue (FIFO) Yes Class Default? No WFQ/FIFO Class N? Flow Queue (FIFO) Yes BW Policing Yes BW Policing 2001, Cisco Systems, Inc. QOS v1.09-69 CBLLQ Scheduling High-priority classes are guaranteed: Low-latency propagation of packets Bandwidth High-priority classes are also policedthey cannot exceed the guaranteed bandwidth. 2001, Cisco Systems, Inc. QOS v1.09-70 Configuring CBLLQ priority bandwidth Router(config-pmap-c)# Allocate a fixed amount of bandwidth (in kbps) to a class and ensure expedited forwarding. Traffic exceeding the specified bandwidth is dropped. priority percent percent Router(config-pmap-c)# Allocate a percentage of configured or default interface bandwidth to a class and ensure expedited forwarding. Traffic exceeding the specified bandwidth is dropped. 2001, Cisco Systems, Inc. QOS v1.09-71 CBLLQ Example class-map VoIP match ip precedence 5 ! class-map Gold match ip precedence 3 4 ! class-map Silver match ip precedence 1 2 ! policy-map Policy1 class VoIP priority percent 10 class Gold bandwidth percent 30 random-detect class Silver bandwidth percent 20 random-detect class class-default fair-queue random-detect ! class-map VoIP match ip precedence 5 ! class-map Gold match ip precedence 3 4 ! class-map Silver match ip precedence 1 2 ! policy-map Policy1 class VoIP priority percent 10 class Gold bandwidth percent 30 random-detect class Silver bandwidth percent 20 random-detect class class-default fair-queue random-detect ! 2001, Cisco Systems, Inc. QOS v1.09-72 Monitoring and Troubleshooting CBLLQ Router#show policy-map interface fastethernet 0/0 FastEthernet0/0 Service-policy output: LLQ Class-map: LLQ (match-any) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any Weighted Fair Queueing Strict Priority Output Queue: Conversation 264 Bandwidth 1000 (kbps) Burst (Bytes) (pkts matched/bytes matched) 0/0 (total drops/bytes drops) 0/0 Class-map: class-default (match-any) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any Router#show policy-map interface fastethernet 0/0 FastEthernet0/0 Service-policy output: LLQ Class-map: LLQ (match-any) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any Weighted Fair Queueing Strict Priority Output Queue: Conversation 264 Bandwidth 1000 (kbps) Burst (Bytes) (pkts matched/bytes matched) 0/0 (total drops/bytes drops) 0/0 Class-map: class-default (match-any) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any 2001, Cisco Systems, Inc. QOS v1.09-73 Summary Upon completing this lesson, you should be able to: Describe class-based low-latency queuing (CBLLQ) Configure CBLLQ Monitor and troubleshoot CBLLQ 2001, Cisco Systems, Inc. QOS v1.09-74 Lesson Review 1.What advantages does CBLLQ have over IP RTP Prioritization? 2.What guarantees does CBLLQ provide? Class-based Policing 2001, Cisco Systems, Inc. QOS v1.09-75 2001, Cisco Systems, Inc. QOS v1.09-76 Objectives Upon completing this lesson, you will be able to: Describe class-based policing Configure class-based policing Monitor and troubleshoot class-based policing 2001, Cisco Systems, Inc. QOS v1.09-77 Class-Based Policing Class-based policing is used to limit a traffic class to a configured bit rate. It uses a token bucket model to measure the arrival rate of packets. Class-based policing is an improved version of the committed access rate (CAR) mechanism. Class-based policing is configured using the Modular QoS CLI. 2001, Cisco Systems, Inc. QOS v1.09-78 How Do Routers Measure Traffic Rate? 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. Bandwidth Time Link Bandwidth Rate Limit Exceeding Traffic Conforming Traffic 2001, Cisco Systems, Inc. QOS v1.0 Token Bucket 500 bytes Conform Action 2001, Cisco Systems, Inc. QOS v1.0 Token Bucket (cont.) 300 bytes Exceed Action 300 bytes 2001, Cisco Systems, Inc. QOS v1.09-81 Token Bucket B c is normal burst size (specifies sustained rate). B e is excess burst size (specifies length of burst). BeBe B c of tokens is added every T c [ms] T c = B c / CIR Time Link Use TcTc 2*T c 3*T c 4*T c 5*T c BcBc BcBc BcBc BcBc BcBc BcBc Link BW Average BW (CIR) BeBe 2001, Cisco Systems, Inc. QOS v1.09-82 Class-Based Policing CAR uses one single token bucket to determine if a packet conforms to or exceeds the bit-rate policy. Class-based policing uses one or two token buckets to determine if a packet: Conformsis within the average bit rate Exceedsexceeds the average bit rate but is within the allowed excess burst Violatesexceeds both the average bit rate and the allowed excess burst (optional) 2001, Cisco Systems, Inc. QOS v1.09-83 Class-Based Policing Actions A packet can conform, exceed, or violate the rate limit. In response, the policer can take one of these actions: Transmit Drop Set IP Precedence and transmit Set IP DSCP and transmit Set QoS group and transmit Set MPLS experimental bits and transmit Set Frame Relay DE bit and transmit Set ATM CLP bit and transmit 2001, Cisco Systems, Inc. QOS v1.09-84 Single Token Bucket with Class-Based Policing The packet conforms to the policy if the size of the packet is less than or equal to the number of tokens in the token bucket. 700 BeBe 500 bytes Conform Action 700 2001, Cisco Systems, Inc. QOS v1.09-85 Single Token Bucket with Class-Based Policing (cont.) The packet exceeds the policy if the size of the packet is more than the number of tokens in the token bucket. 200 BeBe 300 bytes Exceed Action 2001, Cisco Systems, Inc. QOS v1.09-86 Double Token Bucket with Class-Based Policing The packet conforms to the policy if the size of the packet is less than or equal to the number of tokens in the first token bucket BcBc BeBe 500 bytes Conform Action 700 2001, Cisco Systems, Inc. QOS v1.09-87 Double Token Bucket with Class-Based Policing (cont.) The packet exceeds the policy if the size of the packet is more than the number of tokens in the first token bucket and less or equal to the number of tokens in the second token bucket BcBc BeBe 300 bytes Exceed Action 400 2001, Cisco Systems, Inc. QOS v1.09-88 Double Token Bucket with Class-Based Policing (cont.) The packet violates the policy if the size of the packet is more than the number of tokens in the first and the second token bucket BcBc BeBe 400 bytes Violate Action 2001, Cisco Systems, Inc. QOS v1.09-89 Refilling the Token Buckets TB 1 TB 2 Add tokens at the configured bit rate Excess spills over into the second token bucket The number of tokens that have to be added is actually calculated every time a new packet has to be processed: TB 1 = min(B C, TB 1 + ( T now - T LastPacket ) * BitRate / 8) BcBc BeBe Time of the last packet [seconds] Time now [seconds] New size of the token bucket Previous size of the token bucket 2001, Cisco Systems, Inc. QOS v1.09-90 Configuring Class-Based Policing police avg-rate [B C [B E ]] [conform-action [action] [exceed-action [action] [violate-action [action]]]] Router(config-pmap-c)# avg-rate traffic rate in bps (8.000 to ) B C normal burst sets the size of the first token bucket in bytes (default is 1500 or avg-rate/32, whatever is higher) B E excess burst sets the size of the second token bucket in bytes (equals B C if not configured) action can be: transmit (default conform action) drop (default exceed and violate action) set-prec-transmit ip-precedence set-dscp-transmit dscp set-qos-transmit qos-group set-mpls-exp-transmit mple-exp set frde-transmit set-clp-transmit 2001, Cisco Systems, Inc. QOS v1.09-91 Class-Based Policing Example The customer can locate a server at service provider premises (switched LAN). Class-based policing is used to limit the amount of traffic that the web server can generate (more flexible per-bandwidth pricing). Unknown traffic is rate-limited to 64 kbps to allow remote configuration of new servers. 2001, Cisco Systems, Inc. QOS v1.09-92 Class-Based Policing Example class-mapmatch source-address mac 000d.dddf.0480 ! class-mapmatch source-address mac 000d.dddc.ad21 ! policy-map ServerFarm classpolice conform-action transmit exceed-action drop classpolice conform-action transmit exceed-action drop class class-default police ! interface FastEthernet 0/0 service-policy input ServerFarm ! class-mapmatch source-address mac 000d.dddf.0480 ! class-mapmatch source-address mac 000d.dddc.ad21 ! policy-map ServerFarm classpolice conform-action transmit exceed-action drop classpolice conform-action transmit exceed-action drop class class-default police ! interface FastEthernet 0/0 service-policy input ServerFarm ! 2001, Cisco Systems, Inc. QOS v1.09-93 Monitoring and Troubleshooting Class-Based Policing Router#show policy interface fastethernet 0/0 FastEthernet0/0 Service-policy input: ServerFarm (1207) Class-map:(match-all) (1209/6) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: ip precedence 4 (1213) Match: source-address mac 000D.DDDF.0480 (1217) police: bps, 4000 limit, 4000 extended limit conformed 0 packets, 0 bytes; action: transmit exceeded 0 packets, 0 bytes; action: drop conformed 0 bps, exceed 0 bps violate 0 bps... Class-map: class-default (match-any) (1229/0) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any (1233) police: bps, 2000 limit, 2000 extended limit conformed 0 packets, 0 bytes; action: transmit exceeded 0 packets, 0 bytes; action: drop conformed 0 bps, exceed 0 bps violate 0 bps... Router#show policy interface fastethernet 0/0 FastEthernet0/0 Service-policy input: ServerFarm (1207) Class-map:(match-all) (1209/6) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: ip precedence 4 (1213) Match: source-address mac 000D.DDDF.0480 (1217) police: bps, 4000 limit, 4000 extended limit conformed 0 packets, 0 bytes; action: transmit exceeded 0 packets, 0 bytes; action: drop conformed 0 bps, exceed 0 bps violate 0 bps... Class-map: class-default (match-any) (1229/0) 0 packets, 0 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any (1233) police: bps, 2000 limit, 2000 extended limit conformed 0 packets, 0 bytes; action: transmit exceeded 0 packets, 0 bytes; action: drop conformed 0 bps, exceed 0 bps violate 0 bps... 2001, Cisco Systems, Inc. QOS v1.09-94 Summary Upon completing this lesson, you should be able to: Describe class-based policing Configure class-based policing Monitor and troubleshoot class-based policing 2001, Cisco Systems, Inc. QOS v1.09-95 Lesson Review 1.What do CAR and class-based policing do? 2.What are the main differences between CAR and class-based policing? 3.Which marking options does class-based policing support? 4.Which actions does class-based policing support? Class-based Shaping 2001, Cisco Systems, Inc. QOS v1.09-96 2001, Cisco Systems, Inc. QOS v1.09-97 Objectives Upon completing this lesson, you will be able to: Describe class-based shaping Configure class-based shaping Monitor and troubleshoot class-based shaping 2001, Cisco Systems, Inc. QOS v1.09-98 Class-Based Shaping Use of class-based shaping is similar to that of class-based policing Class-Based Shaping is used to rate-limit packets Delays exceeding packets rather than dropping them Has no marking capabilities Class-based shaping is a version of generic traffic shaping (GTS) using the Modular QoS CLI 2001, Cisco Systems, Inc. QOS v1.09-99 Class-Based Shaping Router periodically updates the token bucket (every T C ) and checks if any packets can be forwarded to the main queue. T C = B C / BitRate Shaping Queue N Token Bucket Enough Tokens? packet Check Shaping Queue N Forward Yes Do Nothing No Packet Size Tokens Queue N B C +B E Add Tokens 2001, Cisco Systems, Inc. QOS v1.09-100 Refilling the Token Bucket Class-based shaping has two shaping methods: Shaping to the configured average rate (adds B C tokens every T C ) Shaping to the peak rate (adds B C +B E tokens every T C ) Average rate is forwarding packets at the configured average rate with allowed bursting up to B E when there are extra tokens available Peak rate is forwarding packets at the peak rate, which is calculated using this formula: PeakRate = AvgRate * (1+B E /B C ) 2001, Cisco Systems, Inc. QOS v1.09-101 Configuring Class-Based Shaping shape {average | peak} bit-rate [B C [B E ]] Router(config-pmap-c)# B C and B E can be omitted to let the router select the optimal values. shape max-buffers queue-limit Router(config-pmap-c)# Set the maximum number of packets that can be stored in the shaping queue. 2001, Cisco Systems, Inc. QOS v1.09-102 Class-Based Shaping Frame Relay Adaptation shape adaptive min-rate Router(config-pmap-c)# Adapts the shaping rate when BECN bits are received Each BECN bit causes the shaping rate to be reduced to three-quarters of the previous rate but not below the min-rate This command has effect only if used on Frame Relay interfaces shape fecn-adapt Router(config-pmap-c)# Responds to FECN bits by creating test frames in the opposite direction with the BECN bit set 2001, Cisco Systems, Inc. QOS v1.09-103 Class-Based Shaping Example class-map Shape match access-group 123 ! policy-map ShapeAvg class Shape shape average ! policy-map ShapePeak class Shape shape peak ! interface Serial0/0 service-policy output ShapeAvg ! interface Serial0/1 service-policy output ShapePeak ! access-list 123 permit udp any any class-map Shape match access-group 123 ! policy-map ShapeAvg class Shape shape average ! policy-map ShapePeak class Shape shape peak ! interface Serial0/0 service-policy output ShapeAvg ! interface Serial0/1 service-policy output ShapePeak ! access-list 123 permit udp any any 2001, Cisco Systems, Inc. QOS v1.09-104 Monitoring and Troubleshooting Class-Based Shaping Router#show policy-map interface Serial0/0 Service-policy output: ShapeAvg Class-map: Shape (match-all) 782 packets, bytes 5 minute offered rate bps, drop rate bps Match: access-group 123 Traffic Shaping Target Byte Sustain Excess Interval Increment Adapt Rate Limit bits/int bits/int (ms) (bytes) Active Queue Packets Bytes Packets Bytes Shaping Depth Delayed Delayed Active yes Class-map: class-default (match-any) 9 packets, 3234 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any Router#show policy-map interface Serial0/0 Service-policy output: ShapeAvg Class-map: Shape (match-all) 782 packets, bytes 5 minute offered rate bps, drop rate bps Match: access-group 123 Traffic Shaping Target Byte Sustain Excess Interval Increment Adapt Rate Limit bits/int bits/int (ms) (bytes) Active Queue Packets Bytes Packets Bytes Shaping Depth Delayed Delayed Active yes Class-map: class-default (match-any) 9 packets, 3234 bytes 5 minute offered rate 0 bps, drop rate 0 bps Match: any 2001, Cisco Systems, Inc. QOS v1.09-105 Summary Upon completing this lesson, you should be able to: Describe class-based shaping Configure class-based shaping Monitor and troubleshoot class-based shaping 2001, Cisco Systems, Inc. QOS v1.09-106 Lesson Review 1.What are the main differences between class-based policing and class-based shaping? 2.What are the two class-based shaping methods? Class-based Marking 2001, Cisco Systems, Inc. QOS v1.09-107 2001, Cisco Systems, Inc. QOS v1.09-108 Objectives Upon completing this lesson, you will be able to: Describe class-based marking Configure class-based marking Monitor and troubleshoot class-based marking 2001, Cisco Systems, Inc. QOS v1.09-109 Class-Based Marking Class-based marking is an additional tool available with the Modular QoS CLI that allows static per-class marking of packets. It can be used to mark inbound or outbound packets. It can be combined with any other QoS feature on output. It can be combined with class-based policing on input. 2001, Cisco Systems, Inc. QOS v1.09-110 Class-Based Marking Packets can be marked with one of these markers: IP Precedence IP DSCP QoS group MPLS experimental bits IEEE 802.1Q CoS bits or ISL priority bits Frame Relay DE bit ATM CLP bit 2001, Cisco Systems, Inc. QOS v1.09-111 Configuring IP Precedence Marking set ip precedence ip-precedence Router(config-pmap-c)# Mark IP packets with the specified IP Precedence value. IP Precedence can be set using a value (0 to 7) or a corresponding name (e.g., routine, priority, immediate). policy-map SetPrec class Class1 set ip precedence priority class Class2 set ip precedence flash class Class3 set ip precedence 5 ! policy-map SetPrec class Class1 set ip precedence priority class Class2 set ip precedence flash class Class3 set ip precedence 5 ! 2001, Cisco Systems, Inc. QOS v1.09-112 Configuring IP DSCP Marking set ip dscp dscp Router(config-pmap-c)# Mark IP packets with the specified DSCP value. DSCP can be set using a value (0 to 63) or a corresponding name (e.g., af11, af12, af13, af21, ef, cs1, default). policy-map SetDSCP class Class1 set ip dscp af11 class Class2 set ip dscp af21 class Class3 set ip dscp ef ! policy-map SetDSCP class Class1 set ip dscp af11 class Class2 set ip dscp af21 class Class3 set ip dscp ef ! 2001, Cisco Systems, Inc. QOS v1.09-113 Configuring QoS Group Marking set qos-group qos-group Router(config-pmap-c)# Mark packets with the specified QoS group value (0 to 99). policy-map SetQoS class Class1 set qos-group 1 class Class2 set qos-group 2 class Class3 set qos-group 3 ! policy-map SetQoS class Class1 set qos-group 1 class Class2 set qos-group 2 class Class3 set qos-group 3 ! 2001, Cisco Systems, Inc. QOS v1.09-114 Configuring MPLS Marking set mpls experimental exp-bits Router(config-pmap-c)# Mark labeled packets with the specified value (0 to 7). MPLS marking can be used only on input. policy-map SetMPLS class Class1 qos-group 1 set mpls experimental 1 class Class2 qos-group 2 set mpls experimental 2 class Class3 qos-group 2 set mpls experimental 3 ! policy-map SetMPLS class Class1 qos-group 1 set mpls experimental 1 class Class2 qos-group 2 set mpls experimental 2 class Class3 qos-group 2 set mpls experimental 3 ! 2001, Cisco Systems, Inc. QOS v1.09-115 Configuring LAN Marking set cos cos Router(config-pmap-c)# Mark frames with the specified value (0 to 7). The value applies to the class of service bits with the IEEE 802.1Q encapsulation or priority bits with the ISL encapsulation. The command can be used only on output LAN interfaces that are using one of the two mentioned encapsulations. policy-map SetCoS class Class1 set cos 1 class Class2 set cos 2 class Class3 set cos 3 ! policy-map SetCoS class Class1 set cos 1 class Class2 set cos 2 class Class3 set cos 3 ! 2001, Cisco Systems, Inc. QOS v1.09-116 Configuring Frame Relay DE Marking set fr-de Router(config-pmap-c)# Mark packets with the Frame Relay discard eligibility (DE) bit value 1. Do not use the command to mark frames with the default value 0. The command can be used only on output Frame Relay interfaces. policy-map SetFR class Class1 set fr-de class Class2 class Class3 set fr-de ! policy-map SetFR class Class1 set fr-de class Class2 class Class3 set fr-de ! 2001, Cisco Systems, Inc. QOS v1.09-117 Configuring ATM CLP Marking set atm-clp Router(config-pmap-c)# Mark cells of packets with the ATM cell loss priority (CLP) bit value 1. Do not use the command to mark cells with the default value 0. The command can be used only on output ATM interfaces. policy-map SetATM class Class1 set atm-clp class Class2 class Class3 set atm-clp ! policy-map SetATM class Class1 set atm-clp class Class2 class Class3 set atm-clp ! 2001, Cisco Systems, Inc. QOS v1.09-118 Monitoring and Troubleshooting Class-Based Marking Router#show policy-map interface serial 0/0 Serial0/0 Service-policy input: SetMPLS (1837) Class-map: Class1 (match-any) (1839/12) 0 packets, 0 bytes 30 second offered rate 0 bps, drop rate 0 bps Match: qos-group 1 (1843) 0 packets, 0 bytes 30 second rate 0 bps QoS Set mpls experimental 1 Class-map: Class2 (match-any) (1847/13) 0 packets, 0 bytes 30 second offered rate 0 bps, drop rate 0 bps Match: qos-group 2 (1851) 0 packets, 0 bytes 30 second rate 0 bps QoS Set mpls experimental 2... Router#show policy-map interface serial 0/0 Serial0/0 Service-policy input: SetMPLS (1837) Class-map: Class1 (match-any) (1839/12) 0 packets, 0 bytes 30 second offered rate 0 bps, drop rate 0 bps Match: qos-group 1 (1843) 0 packets, 0 bytes 30 second rate 0 bps QoS Set mpls experimental 1 Class-map: Class2 (match-any) (1847/13) 0 packets, 0 bytes 30 second offered rate 0 bps, drop rate 0 bps Match: qos-group 2 (1851) 0 packets, 0 bytes 30 second rate 0 bps QoS Set mpls experimental 2... 2001, Cisco Systems, Inc. QOS v1.09-119 MQC Compatibility Matrix Police Shape Queue WRED Schedule Classify Output Forward Classify Input Mark Police Class-Based QoS mechanism Configuration command Supported directions Can be combined with these class-based mechanisms WFQbandwidthoutput WRED, shaping, policing, marking LLQpriorityoutput shaping, policing, marking WREDrandom-detectoutput WFQ, LLQ Policingpoliceinput/output WRED, shaping, WFQ, LLQ, marking Shapingshapeoutput WRED, policing, WFQ, LLQ, marking Markingsetinput/output WRED, policing, shaping, WFQ, LLQ 2001, Cisco Systems, Inc. QOS v1.09-120 Summary Upon completing this lesson, you should be able to: Describe class-based marking Configure class-based marking Monitor and troubleshoot class-based marking 2001, Cisco Systems, Inc. QOS v1.09-121 Lesson Review 1.Which parameters can be set using class- based marking? 2.Can class-based marking be used on input? 3.Can class-based marking be combined with any other QoS mechanisms? 2001, Cisco Systems, Inc. QOS v1.09-122 Module Summary Upon completing this module, you should be able to: Describe the policy part of the Modular QoS CLI Configure packet marking with the modular CLI Configure policing and shaping with the modular CLI Configure class-based WFQ with the modular CLI Configure congestion avoidance mechanisms (WRED) with the modular CLI Configure low-latency queuing Monitor and troubleshoot policy maps 2001, Cisco Systems, Inc. IP QoS Modular QoS CLI Service Policy-123