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:
VIP distributed WFQ
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
Creating a traffic class:
By studying the traffic on their network, admins can determine which traffic deserves the highest priority. They can then create a class based on match criteria like protocols, ACLs, or input interfaces. Next, they create a class map to define the name of the class and which traffic will be associated with the class.
Defining characteristics for each class:
Once the traffic class is created, admins create policy maps by associating the following characteristics with that class:
- 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.
Router(config)# access-list 101 permit tcp host 10.10.10.10 host 10.10.10.20 range
Policy map creation:
Router(config)# policy-map CBWFQ
Router(config-pmap)# class Host1
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