Flow-Based Weighted Fair Queueing

What’s so “fair” about Weighted Fair Queueing (WFQ)? WFQ prevents one particular stream of network traffic, or flow, from using most or all of the available bandwidth while forcing other streams of traffic to sit and wait.

These flows are defined by WFQ and require no access list configuration. Flow-based WFQ is the default queueing scheme for Serial interfaces running at E1 speed or below.

Flow-Based WFQ takes these packet flows and classifies them into conversations. WFQ gives priority to the interactive, low-bandwidth conversations, and then splits the remaining bandwidth fairly between the non-interactive, high-bandwidth conversations.

In the following exhibit, a Telnet flow reaches the router at the same time as two FTP flows. Telnet is low-volume, so the Telnet transmission will be forwarded first. The two remaining file transfers will then be assigned a comparable amount of bandwidth. The packets in the two file transfers will be interleaved – that is, some packets for Flow 1 will be sent, then some for Flow 2, and so on. The key here is that one file transfer flow will not have priority over the other.

WFQ Flow-Based

Enabling flow-based WFQ is simple enough. We don’t even have to configure it on the following Serial interface, since WFQ is enabled by default on all serial interfaces running at or below E1 speed, but let’s walk through the steps:

R1(config)#int serial0
R1(config-if)#fair-queue ?
<1-4096> Congestive Discard Threshold

<cr>

The Congestive Discard Threshold dictates the number of packets that can be held in a single queue. The default is 64. Let’s change it to 200.

R1(config)#int serial0
R1(config-if)#fair-queue ?
<1-4096> Congestive Discard Threshold
<cr>

R1(config-if)#fair-queue 200

To verify your queuing configuration, run show queue followed by the interface type and number.

R1#show queue serial0
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/200/0 (size/max total/threshold/drops)
Conversations 0/0/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec

IOS Help shows other WFQ Options:

R1(config-if)#fair-queue 200 ?
<16-4096> Number Dynamic Conversation Queues
<cr>

The Dynamic Conversation Queues are used for normal, best-effort conversations. We’ll change that to 200 as well.

R1(config-if)#fair-queue 200 200
Number of dynamic queues must be a power of 2 (16, 32, 64, 128, 256, 512, 1024)

Then again, maybe we won’t. Let’s change it to 256 instead and use IOS Help to show any other options.

R1(config-if)#fair-queue 200 256 ?
<0-1000> Number Reservable Conversation Queues

The final WFQ option is the number of Reservable Conversation Queues. The default here is zero. These queues are used for specialized queueing and Quality of Service features like the Resource Reservation Protocol (RSVP). We’ll set this to 100.

R1(config-if)#fair-queue 200 256 100

show queue verifies that all three of these values have been successfully set, as does show queueing fair.

R1#show queue serial 0
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/200/0 (size/max total/threshold/drops)
Conversations 0/0/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec

Earlier in this section, I mentioned that serial interfaces running at E1 speed or lower will run WFQ by default. However, if any of the following features are running on the interface, WFQ will not be the default.

eq:

 

CBWFQ

ip access-list extended VoIP_ACL
permit udp any host 1.1.1.1
permit udp host 192.168.1.2 any
exit
!
class-map VoIP
match access-group name VoIP_ACL
!
policy-map VoIP_MAP
class VoIP
priority percent 50
!
interface ATM 0
service-policy output VoIP-MAP
int vlan 1
service-policy output VoIP-MAP

eq:

WFQ (Cisco 857)

Enable Fair-Queue on Interface as FIFO is the default Queuing :

Interface Vlan 1  
fair-queue 

From here you will need to make a route-map and set ip precedence or TOS values :
!

route-map qos-outbound
match ip address 101
set ip tos 8
match ip address 102
set ip tos 6
match ip address 103
set ip tos 4
!

we then need to apply this route map to any LAN interfaces we have ( VLAN , etc)
!

int vlan 1
ip policy route-map qos-outbound
!
!

Its important to understand what you have exactly done here.

You haven’t enabled QOS, there is no flow more important then any other flow ( nothing is guarantee).
What you have done is match traffic into que’s, when the link is congested, WFQ will serve each que equally. What you have done is stop starvation of flows.

If your link is under T1 ( 1.544Mbit) then don’t enable CBWFQ as it should automatically do WFQ and in the route maps set ip precedence instead of TOS. If its above T1 then you cant enable WFQ because the required command aren’t there.

This is for the outboud traffic, you cant control incoming) with Fair Queing/TOS there is no priority, by adding a TOS value to the header you helping to create more granular flows. which in turn when congested will service each QUE equally and stop starvation of flows.

The WFQ method has the advantage of being fast, reliable and easy to implement.

WFQ follows these main criteria:

Dedicated queues for each flow (referred to as conversations), messages are sorted into conversations
reducing starvation, delay, and jitter within the queue.
Allocating bandwidth fairly and accurately among all flows, reducing scheduling delay and
guaranteeing service.

IP Precedence is used as weight when allocating bandwidth.
Although bandwidth is allocated fairly among all flows, unfairness is reinstated by giving proportionately
more bandwidth to flows with higher IP precedence or lower weight.

WFQ has to classify individual flows using the following information taken from the IP/TCP/UDP headers.
These parameters are used as input for a hash algorithm that produces a fixed length number that is
used as the index of the queue.

Source IP address
Destination IP address
Protocol number to identify TCP or UDP
Type of service field
Source TCP/UDP port number
Destination TCP/UDP port number.

On A 857 you can’t set the cue to be CBWFQ.