In weighted fair queueing WFQ algorithm the output buffer comprises of two queues as
Table Of ContentsClass-Based Weighted Fair Queueing Show
Feature Overview Benefits Restrictions Related Features and Technologies Related Documents Supported Platforms Prerequisites Supported MIBs and RFCs Configuration Tasks Defining Class Maps Configuring Class Policy in the Policy Map Configuring Class Policy Using Tail Drop Configuring Class Policy Using WRED Packet Drop Configuring the Class-Default Class Policy Attaching the Service Policy and Enabling CBWFQ Modifying the Bandwidth for an Existing Policy Map Class Modifying the Queue Limit for an Existing Policy Map Class Configuring the Bandwidth Limiting Factor Deleting Classes Deleting Policy Maps Verifying Configuration of Policy Maps and Their Classes Configuration Examples Class Map Configuration Example Policy Creation Example Policy Attachment to Interfaces Example CBWFQ Using WRED Packet Drop Example Display Service Policy Map Content Examples All Classes for a Specified Service Policy Map All Classes for All Service Policy Maps Specified Class for a Service Policy Map All Classes for All Service Policy Maps on a Specified Interface Command Reference bandwidth (policy-map class) Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands class (policy-map) Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands class-map Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands fair-queue (class-default) Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands match access-group Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands match input-interface Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands match protocol Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands policy-map Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands queue-limit Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands random-detect exponential-weighting-constant Syntax Description Default Command Mode Command History Usage Guidelines Example Related Commands random-detect precedence Syntax Description Default Command Mode Command History Usage Guidelines Example Related Commands service-policy Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands show policy-map Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands show policy-map class Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands show policy-map interface Syntax Description Defaults Command Modes Command History Usage Guidelines Examples Related Commands Class-Based Weighted Fair QueueingFeature OverviewClass-based weighted fair queueing (CBWFQ) extends the standard WFQ functionality to provide support for user-defined traffic classes. For CBWFQ, you define traffic classes based on match criteria including protocols, access control lists (ACLs), and input interfaces. 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 the queue for that class. Once a class has been defined according to its match criteria, you can assign it characteristics. To characterize a class, you assign it bandwidth, weight, and maximum packet limit. The bandwidth assigned to a class is the guaranteed bandwidth delivered to the class during congestion. To characterize a class, you also specify the queue limit for that class, which is the maximum number of packets allowed to accumulate in the queue for the class. Packets belonging to a class are subject to the bandwidth and queue limits that characterize the class. After a queue has reached its configured queue limit, enqueuing of additional packets to the class causes tail drop or packet drop to take effect, depending on how class policy is configured. Tail drop is used for CBWFQ classes unless you explicitly configure policy for a class to use Weighted Random Early Detection (WRED) to drop packets as a means of avoiding congestion. Note that if you use WRED packet drop instead of tail drop for one or more classes comprising a policy map, you must ensure that WRED is not configured for the interface to which you attach that service policy. If a default class is configured with the bandwidth policy-map class configuration command, all unclassified traffic is put into a single queue and given treatment according to the configured bandwidth. If a default class is configured with the fair-queue command, all unclassified traffic is flow classified and given best-effort treatment. If no default class is configured, then by default the traffic that does not match any of the configured classes is flow classified and given best-effort treatment. Once a packet is classified, all of the standard mechanisms that can be used to differentiate service among the classes apply. Flow classification is standard WFQ treatment. That is, packets with the same source IP address, destination IP address, source Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) port, or destination TCP or UDP port are classified as belonging to the same flow. WFQ allocates an equal share of bandwidth to each flow. Flow-based WFQ is also called fair queueing because all flows are equally weighted. For CBWFQ, which extends the standard WFQ fair queueing, the weight specified for the class becomes the weight of each packet that meets the match criteria of the class. Packets that arrive at the output interface are classified according to the match criteria filters you define, then each one is assigned the appropriate weight. The weight for a packet belonging to a specific class is derived from the bandwidth you assigned to the class when you configured it; in this sense the weight for a class is user-configurable. After the weight for a packet is assigned, the packet is enqueued in the appropriate class queue. CBWFQ uses the weights assigned to the queued packets to ensure that the class queue is serviced fairly. Configuring a class policy—thus, configuring CBWFQ—entails these three processes: • Defining traffic classes to specify the classification policy (class maps).This process determines how many types of packets are to be differentiated from one another. • Associating policies—that is, class characteristics—with each traffic class (policy maps).This process entails configuration of policies to be applied to packets belonging to one of the classes previously defined through a class map. For this process, you configure a policy map that specifies the policy for each traffic class. • Attaching policies to interfaces (service policies).This process requires that you associate an existing policy map, or service policy, with an interface to apply the particular set of policies for the map to that interface. BenefitsBandwidth AllocationCBWFQ allows you to specify the exact amount of bandwidth to be allocated for a specific class of traffic. Taking into account available bandwidth on the interface, you can configure up to 64 classes and control distribution among them, which is not the case with flow-based WFQ. Flow-based WFQ applies weights to traffic to classify it into conversations and determine how much bandwidth each conversation is allowed relative to other conversations. for flow-based WFQ, these weights, and traffic classification, are dependent on and limited to the seven IP Precedence levels. Coarser Granularity and ScalabilityCBWFQ allows you to define what constitutes a class based on criteria that exceed the confines of flow. CBWFQ allows you to use access control lists and protocols or input interface names to define how traffic will be classified, thereby providing coarser granularity. You need not maintain traffic classification on a flow basis. Moreover, you can configure up to 64 discrete classes in a service policy. Restrictions• Configuring CBWFQ on a physical interface is only possible if the interface is in the default queueing mode. Serial interfaces at E1 (2.048 Mbps) and below use WFQ by default—other interfaces use FIFO by default. Enabling CBWFQ on a physical interface overrides the default interface queueing method. Enabling CBWFQ on an ATM PVC does not override the default queueing method.• If you configure a class in a policy map to use WRED for packet drop instead of tail drop, you must ensure that WRED is not configured on the interface to which you intend to attach that service policy.• Traffic shaping and policing are not currently supported with CBWFQ.• CBWFQ is supported on variable bit rate (VBR) and available bit rate (ABR) ATM connections. It is not supported on unspecified bit rate (UBR) connections.• CBWFQ is not supported on subinterfaces.Related Features and TechnologiesResource Reservation Protocol (RSVP) can be used in conjunction with CBWFQ. When both RSVP and CBWFQ are configured for an interface, RSVP and CBWFQ act independently, exhibiting the same behavior that they would if each were running alone. RSVP continues to work as it does when CBWFQ is not present, even in regard to bandwidth availability assessment and allocation. Related DocumentsFor related information on this feature, refer to the following documents: • Cisco IOS Release 12.0 Quality of Service Solutions Configuration Guide• Cisco IOS Release 12.0 Quality of Service Solutions Command ReferenceCBWFQ supports standard and extended numbered access lists only. For information on creating access lists, see the appropriate Cisco IOS Release 12.0 configuration guides and command references. Supported Platforms• Cisco 1600 series• Cisco 1700 series• Cisco 2500 series• Cisco 2600 series• Cisco 3600 series• Cisco 3800 series• Cisco 4500 series• Cisco 7100 router• Cisco 7200 series• Cisco 7500 series• Cisco AS5300 routerPrerequisitesWeighted Fair QueueingAttaching a service policy to an interface disables WFQ on that interface if WFQ is configured for the interface. For this reason, you should ensure that WFQ is not enabled on such an interface. For information on WFQ, see the "Configuring Weighted Fair Queueing" chapter of the Cisco IOS Release 12.0 Quality of Service Solutions Configuration Guide. Weighted Random Early DetectionAttaching a service policy containing classes configured to use WRED to an interface disables WRED on that interface. If any of the classes that you configure in a policy map use WRED for packet drop instead of tail drop, you must ensure that WRED is not configured on the interface to which you intend to attach that service policy. Access Control ListsYou can specify a numbered access list as the match criterion for any class that you create. For this reason, you should know how to configure access lists. Supported MIBs and RFCsMIBsNone RFCsNone Configuration TasksPerform the following tasks to configure CBWFQ: • Defining Class Maps• Configuring Class Policy in the Policy Map• Attaching the Service Policy and Enabling CBWFQ• Modifying the Bandwidth for an Existing Policy Map Class• Modifying the Queue Limit for an Existing Policy Map Class• Configuring the Bandwidth Limiting Factor• Deleting Classes• Deleting Policy Maps• Verifying Configuration of Policy Maps and Their ClassesDefining Class MapsTo create a class map containing match criteria against which a packet is checked to determine if it belongs to a class—and to effectively create the class whose policy can be specified in one or more policy maps—use the first command in global configuration mode to specify the class map name, then one of the following commands in class map configuration mode:
Configuring Class Policy in the Policy MapTo configure a policy map and create class policies that make up the service policy, use the policy-map command to specify the policy map name, then use one or more of the following commands to configure policy for a standard class or the default class: • class• bandwidth• fair-queue (for class-default class only)• queue-limit or random-detectFor each class that you define, you can use one or more of the listed commands to configure class policy. For example, you might specify bandwidth for one class and both bandwidth and queue limit for another class. The default class of the policy map (commonly known as the class-default class) is the class to which traffic is directed if that traffic does not satisfy the match criteria of other classes whose policy is defined in the policy map. You can configure class policies for as many classes as are defined on the router, up to the maximum of 64. However, the total amount of bandwidth allocated for all classes included in a policy map must not exceed 75 percent of the available bandwidth on the interface. The other 25 percent is used for control and routing traffic. (To override the 75 percent limitation, use the max-reserved bandwidth command.) If not all of the bandwidth is allocated, the remaining bandwidth is proportionally allocated among the classes, based on their configured bandwidth. To configure class policies in a policy map, perform the tasks in the following sections: • Configuring Class Policy Using Tail Drop• Configuring Class Policy Using WRED Packet Drop• Configuring the Class-Default Class PolicyConfiguring Class Policy Using Tail DropTo configure a policy map and create class policies that make up the service policy, use the first command in global configuration mode to specify the policy map name, then use the following commands in policy-map class configuration mode to configure policy for a standard class. To configure policy for the default class, see the section "Configuring the Class-Default Class Policy."
To configure policy for more than one class in the same policy map, repeat Step 2 through Step 4. Note that because this set of commands uses the queue-limit command, the policy map uses tail drop, not Weighted Random Early Detection (WRED) packet drop. Configuring Class Policy Using WRED Packet DropTo configure a policy map and create class policies comprising the service policy, use the first global configuration command to specify the policy map name, then use the following policy-map class configuration commands to configure policy for a standard class.To configure policy for the default class, see the section "Configuring the Class-Default Class Policy."
To configure policy for more than one class in the same policy map, repeat Step 2 through Step 5. Note that this set of commands uses WRED packet drop, not tail drop. Note If you configure a class in a policy map to use WRED for packet drop instead of tail drop, you must ensure that WRED is not configured on the interface to which you intend to attach that service policy.Configuring the Class-Default Class PolicyThe class-default class is used to classify traffic that does not fall into one of the defined classes. Once a packet is classified, all of the standard mechanisms that can be used to differentiate service among the classes apply. The class-default class was predefined when you created the policy map, but you must configure it. If no default class is configured, then by default the traffic that does not match any of the configured classes is flow classified and given best-effort treatment. By default, the class-default class is defined as flow-based WFQ. However, configuring the default class with the bandwidth policy-map class configuration command disqualifies the default class as flow-based WFQ. To configure a policy map and configure the class-default class to use tail drop, use the first global configuration command to specify the policy map name, then use the following policy-map class configuration commands to configure policy for the default class:
To configure a policy map and configure the class-default class to use WRED packet drop, use the first global configuration command to specify the policy map name, then use the following policy-map class configuration commands to configure policy for the default class:
Attaching the Service Policy and Enabling CBWFQTo attach a service policy to the output interface and enable CBWFQ on the interface, use the following interface configuration command. When CBWFQ is enabled, all classes configured as part of the service policy map are installed in the fair queueing system.
Modifying the Bandwidth for an Existing Policy Map ClassTo change the amount of bandwidth allocated for an existing class, use the following commands beginning in global configuration mode:
Modifying the Queue Limit for an Existing Policy Map ClassTo change the maximum number of packets that can accrue in a queue reserved for an existing class, use the following commands beginning in global configuration mode:
Configuring the Bandwidth Limiting FactorTo change the maximum reserved bandwidth allocated for CBWFQ, LLQ, and the IP RTP Priority feature, use the following command in interface configuration mode:
Deleting ClassesTo delete one or more class maps from a service policy map, use the following commands beginning in global configuration mode:
Deleting Policy MapsTo delete a policy map, use the following command in global configuration mode:
Verifying Configuration of Policy Maps and Their ClassesTo display the contents of a specific policy map, a specific class from a specific policy map, or all policy maps configured on an interface, use one of the following global configuration commands:
The counters displayed after issuing the show policy-map interface command are updated only if congestion is present on the interface. Configuration ExamplesThis section provides the following configuration examples: • Class Map Configuration Example• Policy Creation Example• Policy Attachment to Interfaces Example• CBWFQ Using WRED Packet Drop Example• Display Service Policy Map Content ExamplesClass Map Configuration ExampleIn the following example, ACLs 101 and 102 are created. Next, two class maps are created and their match criteria are defined. For the first map class, called class1, the numbered ACL 101 is used as the match criterion. For the second map class, called class2, the numbered ACL 102 is used as the match criterion. Packets are checked against the contents of these ACLs to determine if they belong to the class. Router(config)# access-list 101 permit udp host 10.10.10.10 host 10.10.10.20 range 16384 20000 Router(config)# access-list 102 permit udp host 10.10.10.10 host 10.10.10.20 range 53000 56000 Router(config)# class-map class1 Router(config-cmap)# match access-group 101 Router(config-cmap)# exit Router(config-cmap)# class-map class2 Router(config-cmap)# match access-group 102 Router(config-cmap)# exit Policy Creation ExampleIn the following example, a policy map called policy1 is defined to contain policy specification for the two classes—class1 and class2. The match criteria for these classes were defined in the previous section "Class Map Configuration Example." For class1, the policy specifies the bandwidth allocation request and the maximum number of packets that the queue for this class can accumulate. For class2, the policy specifies only the bandwidth allocation request, so the default queue limit of 64 packets is assumed. Router(config)# policy-map policy1 Router(config-pmap)# class class1 Router(config-pmap-c)# bandwidth 3000 Router(config-pmap-c)# queue-limit 30 Router(config-pmap-c)# exit Router(config-pmap)# class class2 Router(config-pmap-c)# bandwidth 2000 Router(config-pmap-c)# exit Policy Attachment to Interfaces ExampleThe following example shows how to attach an existing policy map. After you define a policy map, you can attach it to one or more interfaces to specify the service policy for those interfaces. Although you can assign the same policy map to multiple interfaces, each interface can have only one policy map attached at the input and one policy map attached at the output. The policy map in this example was defined in the previous section, "Policy Creation Example." Router(config)# interface e1/1 Router(config-if)# service output policy1 Router(config)# interface fa1/0/0 Router(config-if)# service output policy1 CBWFQ Using WRED Packet Drop ExampleIn the following example, the class map class1is created and defined to use the input interface FastEthernet0/1 as a match criterion to determine if packets belong to the class. Next, the policy map policy1 is defined to contain policy specification for class1, which is configured for WRED packet drop. Router(config)# class-map class1 Router(config-cmap)# match input-interface FastEthernet0/1 Router(config)# policy-map policy1 Router(config-pmap)# class class1 Router(config-pmap-c)# bandwidth 1000 Router(config-pmap-c)# random-detect Router(config)# interface serial0/0 Router(config-if)# service-policy output policy1 Display Service Policy Map Content ExamplesThe following examples show how to display the contents of service policy maps. There are four methods to display the contents: • Display all classes that make up a specified service policy map• Display all classes configured for all service policy maps• Display a specified class of a service policy map• Display all classes configured for all service policy maps on a specified interfaceAll Classes for a Specified Service Policy MapThe following example displays the contents of the po1 service policy map: Router# show policy-map po1 Policy Map po1 Weighted Fair Queueing Class class1 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class2 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class3 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class4 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class5 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class6 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class7 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class8 Bandwidth 937 (kbps) Max thresh 64 (packets) All Classes for All Service Policy MapsThe following example displays the contents of all policy maps on the router: Policy Map poH1 Weighted Fair Queueing Class class1 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class2 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class3 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class4 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class5 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class6 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class7 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class8 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class1 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class2 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class3 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class4 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class5 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class6 Bandwidth 300 (kbps) Max thresh 64 (packets) Specified Class for a Service Policy MapThe following example displays configurations for the class called class7 that belongs to the policy map po1: Router# show policy-map po1 class class7 Class class7 Bandwidth 937 (kbps) Max Thresh 64 (packets) All Classes for All Service Policy Maps on a Specified InterfaceThe following example displays configurations for classes on the output interface e1/1: Router# show policy-map interface e1/1 Ethernet1/1 output : po1 Output Queue: Conversation 264 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11548/0/0 Output Queue: Conversation 265 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11546/0/0 Output Queue: Conversation 266 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11546/0/0 Output Queue: Conversation 267 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11702/0/0 Output Queue: Conversation 268 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11701/0/0 Output Queue: Conversation 269 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11702/0/0 Output Queue: Conversation 270 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11857/0/0 Output Queue: Conversation 271 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11858/1/0 Command ReferenceThis section documents new commands that configure the CBWFQ feature. All other commands used with this feature are documented in the Cisco IOS Release 12.0 command references. • bandwidth (policy-map class)• class (policy-map)• class-map• fair-queue (class-default)• match access-group• match input-interface• match protocol• policy-map• queue-limit• random-detect exponential-weighting-constant• random-detect precedence• service-policy• show policy-map• show policy-map class• show policy-map interfacebandwidth (policy-map class)To specify or modify the bandwidth allocated for a class belonging to a policy map, use the bandwidth policy map configuration command. To remove the bandwidth specified for a class, use the no form of this command. bandwidth bandwidth-kbps Syntax Description
DefaultsNo default behavior. Command ModesPolicy map configuration Command History
Usage GuidelinesYou use the bandwidth command when you configure a policy in a map for a class defined by the class-map command. The bandwidth command specifies the bandwidth for traffic in that class. Class-based weighted fair queueing (CBWFQ) derives the weight for packets belonging to the class from the bandwidth allocated to the class. CBWFQ then uses the weight to ensure that the queue for the class is serviced fairly. Note that when the policy map containing class policy configurations is attached to the interface to stipulate the service policy for that interface, available bandwidth is assessed. If a policy map cannot be attached to a particular interface because of insufficient interface bandwidth, then the policy is removed from all interfaces to which it was successfully attached. ExamplesThe following example modifies the bandwidth for a class called acl22. The default class belongs to a service policy map called polmap6. The previous bandwidth for this class was 3000. policy-map polmap6 class acl22 bandwidth 2000 queue-limit 30 Related Commands
class (policy-map)To specify the name of the class whose policy you want to create or change or to specify the default class (commonly known as the class-default class) before you configure its policy, use the class policy-map configuration command. To remove a class from the policy map, use the no form of this command. class[class-name |class-default] Syntax Description
DefaultsNo default behavior. Command ModesPolicy-map configuration Command History
Usage GuidelinesEnter the policy-map command to identify the policy map and enter policy map configuration mode before you use the class command. After you specify a policy map, you can configure policy for new classes or modify policy for any existing classes in that policy map. The class name that you specify in the policy map ties the characteristics for that class—that is, its policy—to the class map and its match criteria configured using the class-map command. When you configure policy for a class and specify its bandwidth and attach the policy map to an interface, class-based weighted fair queueing (CBWFQ) determines if the bandwidth requirement of the class can be satisfied. If so, CBWFQ creates the necessary internal data structures to maintain state for the class and allocates a queue for it. When a class is removed, available bandwidth for the interface is incremented by the amount previously allocated to the class. The maximum number of classes you can configure for a router—and, therefore, within a policy map—is 64. You can define a class policy to use either tail drop (by using the queue-limit command) or Weighted Random Early Detection (WRED) packet drop (by using the random-detect command). You cannot use the queue-limit and random-detect commands in the same class policy, but they can be used in two class policies in the same policy map. You can configure the bandwidth command when either the queue-limit or the random-detect command is configured in a class policy. The bandwidth command specifies the amount of bandwidth allocated for the class. For the default class, you can configure the fair-queue (class-default) command. The fair-queue command specifies the number of dynamic queues for the default class. The fair-queue command can be used in the same class policy as either the queue-limit or random-detect command. It cannot be used with the bandwidth command. ExamplesThe following example configures policy for a class named acl136 included in the policy map called policy1. Class acl136 has these characteristics:a minimum of 2000 kilobits per second (kbps) of bandwidth are expected to be delivered to this class in the event of congestion, and the queue reserved for this class can enqueue 40 packets before tail drop is enacted. Note that when the policy map containing this class is attached to the interface to stipulate the service policy for that interface, available bandwidth is assessed, taking into account all class policies and RSVP, if configured. The following example configures policy for a class named int101 included in the policy map called policy8. Class int101 has these characteristics:a minimum of 3000 kbps of bandwidth are expected to be delivered to this class in the event of congestion, and a weight factor of 10 is used to calculate the average queue size. For congestion avoidance, WRED packet drop is used, not tail drop. Note that when the policy map containing this class is attached to the interface to stipulate the service policy for that interface, available bandwidth is assessed. random-detect exponential-weighting-constant 10 The following example configures policy for the class-default default class included in the policy map called policy1. The class-default default class has these characteristics:10 dynamic queues for traffic that does not meet the match criteria of other classes whose policy is defined by the policy map policy1, and a maximum of 20 packets per queue before tail drop is enacted to handle additional enqueued packets. The following example configures policy for the class-default default class included in the policy map called policy8. The class-default default class has these characteristics:20 dynamic queues for traffic that doesn't meet the match criteria of other classes whose policy is defined by the policy map policy8 and a weight factor of 20 is used to calculate the average queue size. For congestion avoidance, WRED packet drop is used, not tail drop. random-detect exponential-weighting-constant 14 Related Commands
class-mapTo create a class map to be used for matching packets to the class whose name you specify, use the class-map global configuration command. To remove an existing class map from the router, use the no form of this command. class-map class-map-name
Syntax Description
DefaultsNo default behavior. Command ModesGlobal configuration Command History
Usage GuidelinesUse this command to specify the name of the class for which you want to create or modify class map match criteria. Use of the class-map command enables class-map configuration mode in which you can enter one of the match commands to configure the match criteria for this class. Packets arriving at the output interface are checked against the match criteria configured for a class map to determine if the packet belongs to that class. You can use one of the following commands in a class map: • match access-group• match input-interface• match mpls experimental• match protocolIf you specify more than one command in a class map, only the last command entered applies. The last command overrides the previously entered commands. ExamplesThe following example specifies access101 as the name of a class, and it defines a class map for this class. The match access-group command is entered following the class-map command to configure the numbered access control list (ACL) 101 whose contents are to be used as match criteria for the class. Related Commands
fair-queue (class-default)To specify the number of dynamic queues to be reserved for use by the class-default class as part of the default class policy, use the fair-queue policy map configuration command. To delete the configured number of hash queues from the class-default policy, use the no form of this command. fair-queue number-of-dynamic-queues Syntax Description
DefaultsThe number of dynamic queues is derived from the interface or ATM permanent virtual circuit (PVC) bandwidth. See for the default number of dynamic queues that weighted fair queueing (WFQ) and class-based WFQ (CBWFQ) use when they are enabled on an interface. See for the default number of dynamic queues used when WFQ or CBWFQ is enabled on an ATM PVC.
Table 1 Default Number of Dynamic Queues as a Function of Interface Bandwidth
Table 2 Default Number of Dynamic Queues as a Function of ATM PVC Bandwidth
Command ModesPolicy-map configuration Command History
Usage GuidelinesThis command can be used for the default class (commonly known as the class-default class) only. You can use it in conjunction with either the queue-limit command or the random-detect command. The class-default class is the default class to which traffic is directed if that traffic does not satisfy the match criteria of other classes whose policy is defined in the policy map. ExamplesThe following example configures policy for the default class included in the policy map called policy9. Packets that do not satisfy match criteria specified for other classes whose policies are configured in the same service policy are directed to the default class, for which 16 dynamic queues have been reserved. Because the queue-limit command is configured, tail drop is used for each dynamic queue when the maximum number of packets are enqueued and additional packets arrive. The following example configures policy for the default class included in the policy map called policy8. The fair-queue command reserves 20 dynamic queues to be used for the default class. For congestion avoidance, Weighted Random Early Detection (WRED) packet drop is used, not tail drop. Related Commands
match access-groupTo configure the match criteria for a class map based on the specified access control list (ACL) number or name, use the match access-group class-map configuration command. To remove ACL match criteria from a class map, use the no form of this command. match access-group access-group | name access-group-name Syntax Description
DefaultsNo default behavior. Command ModesClass-map configuration Command History
Usage GuidelinesFor class-based weighted fair queueing (CBWFQ), you define traffic classes based on match criteria including ACLs, protocols, input interfaces, QoS labels, and EXP field values. Packets satisfying the match criteria for a class constitute the traffic for that class. The match access-group command specifies a numbered ACL whose contents are used as the match criteria against which packets are checked to determine if they belong to the class specified by the class map. To use the match access-group command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. After you identify the class, you can use one of the following commands to configure the match criteria. • match access-group• match input-interface• match mpls experimental• match protocolIf you specify more than one command in a class map, only the last command entered applies. The last command overrides the previously entered commands. ExamplesThe following example specifies a class map called acl144 and configures the ACL numbered 144 to be used as the match criteria for this class. Related Commands
match input-interfaceTo configure a class map to use the specified input interface as match criterion, use the match input-interface class-map configuration command. To remove the input interface match criterion from a class map, use the no form of this command. match input-interface
interface-name Syntax Description
DefaultsNo default behavior. Command ModesClass-map configuration Command History
Usage GuidelinesFor class-based weighted fair queueing (CBWFQ), you define traffic classes based on match criteria including input interfaces, ACLs, protocols, QoS labels, and EXP field values. Packets satisfying the match criteria for a class constitute the traffic for that class. The match input-interface command specifies the name of an input interface to be used as the match criterion against which packets are checked to determine if they belong to the class specified by the class map. To use the match input interface command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. After you identify the class, you can use the following commands to configure the match criteria. • match access-group• match input-interface• match mpls experimental• match protocolIf you specify more than one command in a class map, only the last command entered applies. The last command overrides the previously entered commands. ExamplesThe following example specifies a class map called eth2 and configures the input interface named ethernet1to be used as the match criterion for this class: match input-interface ethernet1 Related Commands
match protocolTo configure the match criteria for a class map based on the specified protocol, use the match protocol class-map configuration command. To remove protocol-based match criteria from a class map, use the no form of this command. match protocol protocol Syntax Description
DefaultsNo default behavior. Command ModesClass-map configuration Command History
Usage GuidelinesFor class-based weighted fair queueing (CBWFQ), you define traffic classes based on match criteria including protocols, ACLs, input interfaces, QoS labels, and EXP field values. Packets satisfying the match criteria for a class constitute the traffic for that class. The match protocol command specifies the name of a protocol to be used as the match criteria against which packets are checked to determine if they belong to the class specified by the class map. To use the match protocol command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. After you identify the class, you can use the following commands to configure the match criteria. • match access-group• match input-interface• match mpls experimental• match protocolIf you specify more than one command in a class map, only the last command entered applies. The last command overrides the previously entered commands. ExamplesThe following example specifies a class map called ipx and configures the ipx protocol as match criteria for it: Related Commands
policy-mapTo create or modify a policy map that can be attached to one or more interfaces to specify a service policy, use the policy-map global configuration command. To delete a policy map, use the no form of this command. policy-map policy-map Syntax Description
DefaultsNo default behavior or values. Command ModesGlobal configuration Command History
Usage GuidelinesUse the policy-map command to specify the name of the policy map to be created, added to, or modified before you can configure policies for classes whose match criteria are defined in a class map. Entering the policy-map command enables policy map configuration mode in which you can configure or modify the class policies for that policy map. You can configure class policies in a policy map only if the classes have match criteria defined for them. You use the class-map and match commands to configure the match criteria for a class. Because you can configure a maximum of 64 class maps, no policy map can contain more than 64 class policies. A single policy map can be attached to multiple interfaces concurrently. When you attempt to attach a policy map to an interface, the attempt is denied if the available bandwidth on the interface cannot accommodate the total bandwidth requested by class policies comprising the policy map. In this case, if the policy map is already attached to other interfaces, it is removed from them. Whenever you modify class policy in an attached policy map, CBWFQ is notified and the new classes are installed as part of the policy map in the CBWFQ system. ExamplesThe following example creates a policy map called policy1 and configures two class policies included in that policy map. The class policy called Class1 specifies policy for traffic that matches Access Control List 136. The second class is the default class to which packets that do not satisfy configured match criteria are directed. ! The following commands create class-map class1 and defines its match criteria: ! The following commands create the policy map, which is defined to contain policy ! specification for class1 and the default class: Related Commands
queue-limitTo specify or modify the maximum number of packets the queue can hold for a class policy configured in a policy map, use the queue-limit policy-map configuration command. To remove the queue packet limit from a class, use the no form of this command. queue-limit
number-of-packets Syntax Description
Defaults64 Command ModesPolicy-map configuration Command History
Usage GuidelinesWeighted fair queueing (WFQ) creates a queue for every class for which a class map is defined. Packets satisfying the match criteria for a class accumulate in the queue reserved for the class until they are sent, which occurs when the queue is serviced by the fair queueing process. When the maximum packet threshold you defined for the class is reached, enqueuing of any further packets to the class queue causes tail drop or, if Weighted Random Early Detection (WRED) is configured for the class policy, packet drop to take effect. ExamplesThe following example configures a policy map called policy11 to contain policy for a class called acl203. Policy for this class is set so that the queue reserved for it has a maximum packet limit of 40. Related Commands
random-detect exponential-weighting-constantTo configure the Weighted Random Early Detection (WRED) and VIP-Distributed WRED (DWRED) exponential weight factor for the average queue size calculation for the queue, use the random-detect exponential-weighting-constant interface command. To configure the exponential weight factor for the average queue size calculation for the queue reserved for a class, use the random-detect exponential-weighting-constant policy map configuration command. To return the value to the default, use the no form of this command. random-detect exponential-weighting-constantexponent Syntax Description
DefaultThe default exponential weight factor is 9. Command ModeInterface configuration when used on an interface. Policy-map class configuration when used to specify class policy in a policy map. Command History
Usage GuidelinesWRED is a congestion avoidance mechanism that slows traffic by randomly dropping packets when congestion exists. WRED and DWRED are most useful with protocols like TCP that respond to dropped packets by decreasing the transmission rate. Use this command to change the exponent used in the average queue size calculation for the WRED and DWRED services. You can also use this command to configure the exponential weight factor for the average queue size calculation for the queue reserved for a class. Note The default WRED/DWRED parameter values are based on the best available data. We recommend that you do not change the parameters from their default values unless you have determined that your applications would benefit from the changed values.The DWRED feature is not supported for class policy. The DWRED feature is only supported on Cisco 7000 series routers with an RSP7000 card and Cisco 7500 series routers with a VIP2-40 or greater interface processor. A VIP2-50 interface processor is strongly recommended when the aggregate line rate of the port adapters on the VIP is greater than DS3. A VIP2-50 interface processor is required for OC-3 rates. To use DWRED, distributed Cisco Express Forwarding (dCEF) switching must first be enabled on the interface. For more information on dCEF, refer to the Cisco IOS Switching Services Configuration Guide and the Cisco IOS Switching Services Command Reference. ExampleThe following example configures WRED on an interface with a weight factor of 10: ip address 10.200.14.250 255.255.255.252 random-detect exponential-weighting-constant 10 The following example configures the policy map policy1 to contain policy specification for the class called class1. During times of congestion, WRED packet drop is used instead of tail drop. The weight factor used for the average queue size calculation for the queue for class1 is 12. ! The following commands create the class map called class1: match input-interface FE0/1 ! The following commands define policy1 to contain policy specification for class1: random-detect exponential-weighting-constant 12 Related Commands
random-detect precedenceTo configure Weighted Random Early Detection (WRED) and VIP-Distributed WRED (DWRED) parameters for a particular IP Precedence, use the random-detect precedence interface configuration command. To return the values to the default for the precedence, use the no form of this command. To configure WRED parameters for a particular IP Precedence for a class policy in a policy map, use the random-detect precedence policy-map class configuration command. random-detect precedence precedence min-threshold max-threshold mark-prob-denominator Syntax Description
DefaultFor all precedences, the mark-prob-denominator is 10, and the max-threshold is based on the output buffering capacity and the transmission speed for the interface. The default min-threshold depends on the precedence. The min-threshold for IP Precedence 0 corresponds to half of the max-threshold. The values for the remaining precedences fall between half the max-threshold and the max-threshold at evenly spaced intervals. lists the default minimum threshold value for each IP Precedence.
Table 3 Default WRED and DWRED Minimum Threshold Values
Command ModeInterface configuration when used on an interface. Policy-map class configuration when used to specify class policy in a policy map. Command History
Usage GuidelinesWRED is a congestion avoidance mechanism that slows traffic by randomly dropping packets when congestion exists. DWRED is similar to WRED but uses the Versatile Interface Processor (VIP) instead of the Route Switch Processor (RSP). When you configure the random-detect command on an interface, packets are given preferential treatment based on the IP Precedence of the packet. Use the random-detect precedence command to adjust the treatment for different precedences. If you want WRED/DWRED to ignore the precedence when determining which packets to drop, enter this command with the same parameters for each precedence. Remember to use reasonable values for the minimum and maximum thresholds. Note that if you use the random-detect precedence command to adjust the treatment for different precedences within class policy, you must ensure that WRED is not configured for the interface to which you attach that service policy. Note The default WRED/DWRED parameter values are based on the best available data. We recommend that you do not change the parameters from their default values unless you have determined that your applications would benefit from the changed values.The DWRED feature is only supported on Cisco 7000 series routers with an RSP7000 card and Cisco 7500 series routers with a VIP2-40 or greater interface processor. A VIP2-50 interface processor is strongly recommended when the aggregate line rate of the port adapters on the VIP is greater than DS3. A VIP2-50 interface processor is required for OC-3 rates. To use DWRED, distributed Cisco Express Forwarding (dCEF) switching must first be enabled on the interface. For more information on dCEF, refer to the Cisco IOS Switching Services Configuration Guide and the Cisco IOS Switching Services Command Reference. Note The DWRED feature is not support in class policy.ExampleThe following example enables WRED on the interface and specifies parameters for the different IP Precedences: ip address 200.200.14.250 255.255.255.252 random-detect precedence 0 32 256 100 random-detect precedence 1 64 256 100 random-detect precedence 2 96 256 100 random-detect precedence 3 120 256 100 random-detect precedence 4 140 256 100 random-detect precedence 5 170 256 100 random-detect precedence 6 290 256 100 random-detect precedence 7 210 256 100 random-detect precedence rsvp 230 256 100 The following example configures policy for a class named acl10 included in the policy map called policy10. Class acl10 has these characteristics:a minimum of 2000 kbps of bandwidth are expected to be delivered to this class in the event of congestion and a weight factor of 10 is used to calculate the average queue size. For congestion avoidance, WRED packet drop is used, not tail drop. IP Precedence is reset for levels 0 through 4. random-detect exponential-weighting-constant 10 random-detect precedence 0 32 256 100 random-detect precedence 1 64 256 100 random-detect precedence 2 96 256 100 random-detect precedence 3 120 256 100 random-detect precedence 4 140 256 100 Related Commands
service-policyTo attach a policy map to an input interface or virtual circuit (VC), or an output interface to be used as the service policy for that interface or VC, use the service-policy global configuration command. To remove a service policy from an input or output interface or input or output VC, use the no form of this command. service-policy {input | output} policy-map Syntax Description
DefaultsNo service policy is specified. Command ModesGlobal configuration. VC submode (for a standalone VC). Bundle-vc configuration (for ATM VC bundle members). Command History
Usage GuidelinesYou can attach a single policy map to one or more interfaces or one or more VCs to specify the service policy for those interfaces or VCs. Currently a service policy specifies class-based weighted fair queueing (CBWFQ). The class policies comprising the policy map are then applied to packets that satisfy the class map match criteria for the class. To successfully attach a policy map to an interface or a VC, the aggregate of the configured minimum bandwidths of the classes comprising the policy map must be less than or equal to 75 percent of the interface bandwidth allocated to the VC. Configuring CBWFQ on a physical interface is only possible if the interface is in the default queueing mode. Serial interfaces at E1 (2.048 Mbps) and below use WFQ by default. Other interfaces use FIFO by default. Enabling CBWFQ on a physical interface overrides the default interface queueing method. Enabling CBWFQ on an ATM permanent virtual circuit (PVC) does not override the default queueing method. Attaching a service policy and enabling CBWFQ on an interface renders ineffective any commands related to fancy queueing such as commands pertaining to fair queueing, custom queueing, priority queueing, and Weighted Random Early Detection (WRED). You can configure these features only after you remove the policy map from the interface. You can modify a policy map attached to an interface or VC, changing the bandwidth of any of the classes comprising the map. Bandwidth changes that you make to an attached policy map are effective only if the aggregate of the bandwidth amounts for all classes comprising the policy map, including the modified class bandwidth, is less than or equal to 75 percent of the interface bandwidth. If the new aggregate bandwidth amount exceeds 75 percent of the interface bandwidth, the policy map is not modified. ExamplesThe following example attaches the service policy map called policy9 to the input interface Serial1: service-policy input policy9 The following example attaches the service policy map called policy9 to the input PVC called cisco: pvc cisco 0/34 service-policy input policy9 vbr-nt 5000 3000 500 precedence 4-7 The following example attaches the policy called policy9 to the output interface serial1 to specify the service policy for the interface and enable CBWFQ on it: service-policy output policy9 The following example attaches the service policy map called policy9 to the output PVC called cisco: pvc cisco 0/5 service-policy output policy9 vbr-nt 4000 2000 500 precedence 2-3 Related Commands
show policy-mapTo display the configuration of all classes comprising the specified service policy map or all classes for all existing policy maps, use the show policy EEC or privileged EXEC command. show policy [policy-map] Syntax Description
DefaultsAll existing policy map configurations are displayed. Command ModesEXEC or privileged EXEC Command History
Usage GuidelinesThe show policy-map command displays the configuration of a service policy map created using the policy-map command. You can use the show policy-map command to display all class configurations comprising any existing service policy map, whether or not that service policy map has been attached to an interface. ExamplesThe following example displays the contents of the po1 service policy map: Router# show policy-map po1 Policy Map po1 Weighted Fair Queueing Class class1 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class2 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class3 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class4 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class5 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class6 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class7 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class8 Bandwidth 937 (kbps) Max thresh 64 (packets) The following example displays the contents of all policy maps on the router: Policy Map poH1 Weighted Fair Queueing Class class1 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class2 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class3 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class4 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class5 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class6 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class7 Bandwidth 937 (kbps) Max thresh 64 (packets) Class class8 Bandwidth 937 (kbps) Max thresh 64 (packets) Policy Map policy2 Weighted Fair Queueing Class class1 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class2 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class3 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class4 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class5 Bandwidth 300 (kbps) Max thresh 64 (packets) Class class6 Bandwidth 300 (kbps) Max thresh 64 (packets) Related Commands
show policy-map classTo display the configuration for the specified class of the specified policy map, use the show policy-map class EXEC or privileged EXEC command. show policy-map policy-map class class-name Syntax Description
DefaultsNo default behavior or values. Command ModesEXEC or privileged EXEC Command History
Usage GuidelinesYou can use the show policy-map class command to display any single class configuration for any service policy map, whether or not the specified service policy map has been attached to an interface. ExamplesThe following example displays configurations for the class called class7 that belongs to the policy map po1. Router# show policy-map po1 class class7 Related Commands
show policy-map interfaceTo display the configuration of all classes configured for all service policies on the specified interface or to display the classes for the service policy for a specific permanent virtual circuit (PVC) on the interface, use the show policy-map interface EXEC or privileged EXEC command. show policy-map interface interface-name [vc [vpi/] vci]] Syntax Description
DefaultsNo default behavior. Command ModesEXEC or privileged EXEC. Command History
Usage GuidelinesThis command displays the configuration for classes on the specified interface or the specified PVC only if a service policy has been attached to the interface or the PVC. You can use the pvc-name argument to display output for a PVC only for Enhanced ATM port adapters (PA-A3) that support per-VC queueing. The counters displayed after the show policy-map interface command is entered are updated only if congestion is present on the interface. ExamplesThe following example displays configurations for classes on the output interface e1/1: Router# show policy-map interface e1/1 Ethernet1/1 output : po1 Output Queue: Conversation 264 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11548/0/0 Output Queue: Conversation 265 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11546/0/0 Output Queue: Conversation 266 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11546/0/0 Output Queue: Conversation 267 Bandwidth 937 (kbps) Max Threshold 64 (packets)
(total/discards/tail drops) 11702/0/0 Output Queue: Conversation 268 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11701/0/0 Output Queue: Conversation 269 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11702/0/0 Output Queue: Conversation 270 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11857/0/0 Output Queue: Conversation 271 Bandwidth 937 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 11858/1/0 The following example displays configurations for classes comprising the service policy for the output VC 0/101 on the output interface atm2/0.6: Router# show policy-map interface atm2/0.6 ATM2/0.6: VC 0/101 - output : p1 Output Queue: Conversation 264
drops: class random tail min-th max-th mark-prob Output Queue: Conversation 265 drops: class random tail min-th max-th mark-prob Output Queue: Conversation 266 drops: class random tail min-th max-th mark-prob Output Queue: Conversation 267 drops: class random tail min-th max-th mark-prob Output Queue: Conversation 268 drops: class random tail min-th max-th mark-prob Output Queue: Conversation 269 Bandwidth 146 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 50216/32696/0 Output Queue: Conversation 270 Bandwidth 216 (kbps) Max Threshold 64 (packets) (total/discards/tail drops) 74577/51994/0 Number of Hashed Queues 256 drops: class random tail min-th max-th mark-prob Related Commands
What is meant by weighted fair queuing WFQ )? Explain and discuss briefly?Weighted fair queueing (WFQ) is a method of automatically smoothing out the flow of data in packet-switched communication networks by sorting packets to minimize the average latency and prevent exaggerated discrepancies between the transmission efficiency afforded to narrowband versus broadband signals.
What is class based weighted fair queuing?CBWFQ is a scheduling mechanism used to provide a minimum bandwidth guarantee to traffic classes during times of network congestion at an interface. Each of the CBWFQ queues is assigned a weight, and the packets are served from the queues based upon the weight of the queue.
What is packet by packet fair Queueing system?Weighted fair queuing is also known as packet-by-packet GPS (PGPS or P-GPS) since it approximates generalized processor sharing "to within one packet transmission time, regardless of the arrival patterns."
Which of the following algorithm is based on queuing?Fair Queuing (FQ). The algorithm ensures that a high-data-rate flow cannot use more than its fair share of the link capacity. Packets are first classified into flows by the system and then assigned to a queue dedicated to the flow.
|