Configuring Class-Based Weighted Fair Queuing (CBWFQ)

Configuring Class-Based Weighted Fair Queuing (CBWFQ)

Figure 4-4 shows a flowchart for the configuration that follows, which shows how to configure Class-Based Weighted Fair Queuing. Note that in the diagram, a set of bandwidths is shown to illustrate the queuing that would occur in CBWFQ. The following configuration example might show other syntax that may be used in a production environment.

Figure 4-4. Class-Based Weighted Fair Queuing


The tasks to configure Class-Based Weighted Fair Queuing are

STEP 1.
STEP 2.
STEP 3.
STEP 4.
STEP 5.


STEP 6.
STEP 7.
STEP 8.

Step 1: Define One or More Class Maps

Router(config)# class-map match-any MAPNAME Creates class map MAPNAME using Logical-OR for all matching statements.
OR
Router(config)# class-map match-all MAPNAME Creates class map MAPNAME using Logical-AND for all matching statements.


Step 2: Specify Traffic Using Match Statements

Router(config-cmap)# match access-group name LETWEBIN Selects traffic by access control list (ACL) name or number.
Router(config-cmap)# match input-interface serial0/0/0 Selects traffic by input interface name.
Router(config-cmap)# match vlan 55-59 82 Selects traffic in a single VLAN, a range of VLANs, or both.


Step 3: Create a Policy

Router(config)# policy-map MARKINGPOLICY Creates the marking policy MARKINGPOLICY.


Step 4: Add Class Maps to the Policy

Router(config-pmap)#class MAPNAME Specifies the interesting traffic.


Step 5: Apply Guaranteed Bandwidth and Maximum Packet Limits for Each Class

Router(config-pmap-c)# bandwidth 128 Sets the guaranteed bandwidth to 128 kbps.
OR
Router(config-pmap-c)# bandwidth percent 20 Sets the guaranteed bandwidth to 20% of available bandwidth of the interface.

NOTE: This number can be from 1 to 100.

NOTE: By default, only 75% of bandwidth can be reserved. The remaining 25% is for network overhead. You can modify the default value for maximum reserved bandwidth with this interface command:

Router(config-if)# max-reserved-bandwidth 85

where 85 is the new maximum reserved bandwidth. Do not do this unless you are aware of the consequences that might occur on your network.
OR
Router(config-pmap-c)# bandwidth remaining percent 20 Sets the guaranteed bandwidth to 20% of remaining bandwidth of the interface.

NOTE: When you configure the reserved bandwidth for each traffic class in a policy map, you cannot use the bandwidth command on one class and the bandwidth percent command on another class—you must use one or the other for all classes. If you use the percent keyword, the sum of the percentages cannot exceed 100.
Router(config-pmap-c)# queue-limit 55 Specifies the maximum number of packets in the queue as 55.
Router(config-pmap-c)# exit Finishes defining the policy for traffic filtered by class map MAPNAME.


Step 6: Specify How Unclassified Traffic Is Handled

Router(config-pmap)# class class-default Creates a class to select the remaining traffic (not specified by any other class).
Router(config-pmap-c)# fair-queue 16 Specifies the number of reserved dynamic queues for unclassified traffic at 16.
Router(config-pmap-c)# exit Finishes defining the policy.


Step 7: Apply the Policy to an Interface

Router(config)# interface fastethernet 0/0 Moves to interface configuration mode.
Router(config-if)# service-policy output MARKINGPOLICY Applies the marking policy to outbound traffic.


Step 8: Verify Policy Configuration

Router# show policy-map interface fastethernet 0/0 Displays the configurations and statistics of policy maps applied at fastethernet 0/0.