Class-based weighted fair queuing for better traffic management
In this blog, we'll cover class-based weighted fair queuing (CBWFQ) for effective traffic shaping and bandwidth management in a busy or congested network.
To understand CBWFQ, you first need to understand standard weighted fair queuing (WFQ).
What is WFQ?
A flow is defined as a stream of packets with a unique source IP, destination IP, input interface, port, protocol, etc.WFQ is a flow-based queuing algorithm commonly used in quality of service for effective delivery of business-critical applications. WFQ sends the less weighted (volume) traffic first and lets the high-volume traffic share the remaining bandwidth.WFQ ensures effective traffic management and reduces congestion due to the transmission of packets in the network.
There are three types of WFQ:
Flow-based WFQ
VIP distributed WFQ
CBWFQ
WFQ is reliable, fast, and easy to implement.
What is CBWFQ?
CBWFQ is an advanced form of WFQ that supports user-defined traffic classes, i.e., protocols, access control lists (ACLs), or input interfaces. A flow satisfying the match criteria for a class contributes the traffic for that particular defined class. A queue is allocated for each class, and the traffic belonging to a class is directed to the queue for that class.Prerequisites for configuring CBWFQ
Before implementing CBWFQ in the network, an admin must do the following:
Create traffic classes
Define characteristics for each class
Attach policies to interfaces
Once the traffic class is created, admins create policy maps by associating the following characteristics with that class:
- Bandwidth
- Weight
- Maximum packet limit
Traffic allocated for each class is guaranteed bandwidth. The queue limit is also specified while creating the traffic class, which is the maximum number of packets that can be in the queue. If the queue limit is reached, the enqueuing of additional packets will cause tail drop or packet drop, depending on how the traffic class is configured.
Tail drop is often carried out; however, if the user specifies a weight for the packets, Weighted Random Early Detection will occur to drop packets.
Attaching policies to interfaces:
Once the class map and related policy map are defined for the created class, the next step is to associate it with the interfaces where CBWFQ is being deployed.
Example configuration
Class creation:
Router(config)# access-list 101 permit tcp host 10.10.10.10 host 10.10.10.20 range
16384 20000
Router(config)# access-list 102 permit tcp host 10.10.10.10 host 10.10.10.20 range
53000 56000
Router(config)# class-map Host1
Router(config-cmap)# match access-group 101
Router(config-cmap)# class-map Host2
Router(config-cmap)# match access-group 102
Policy map creation:
Router(config)# policy-map CBWFQ
Router(config-pmap)# class Host1
Router(config-pmap-c)# bandwidth 3000
Router(config-pmap-c)# queue-limit 30
Router(config-pmap)# class Host2
Router(config-pmap-c)# bandwidth 2000
Policy attachment to interfaces:
Router(config)# interface fa1/0/0
Router(config-if)# service output CBWFQ
Advantages of implementing CBWFQ in your network
Efficient delivery of business-critical applications
Effective management of available bandwidth
Critical traffic can be given higher priority
Bandwidth optimization and traffic shaping
Comments