Home » QoS » Queuing and WFQ

Queuing and WFQ

Queuing comes into action when the interfaces are congested. Queuing techniques are used to manage the congestion. The reasons for a physical interface to experience congestion may be
1. Speed mismatched (traffic moving from LAN to WAN)
2. Traffic aggregation ( Traffic coming to one location from multiple locations)
3. Oversubscription
4. Insufficient packet buffers to handle traffic.

By using different Queuing techniques you can manage congestion more efficiently and provide bandwidth and delay guarantees.

Note: Queuing is always done on the outbound direction of the interface, there can be no queuing control locally on the input direction of the physical interface.

Physical Interfaces and Queues on most Cisco Switches

Each physical interface will have two directions
1. Input Direction
2. Output Direction

There can be two types of Queues
1. Hardware Queue – This is by default FIFO and cannot be changed
2. Software Queue – This can be manipulated using one of the many congestion management techniques

Output Direction:
There are 2 Queues on each interface in output direction
1. hardware Queue
2. Software Queue

The Hardware Queue always runs FIFO algorithm and cannot be manipulated.
The Software Queue is the area where we can run one of the different algorithms (Queueing Techniques) to manage congestion.

Input Direction:
In Input Direction of the interface there is only one Queue – which is the hardware Queue.
The Algorithm which runs by default is FIFO and that is the only algorithm which runs on all hardware queues- so this cannot be manipulated.

This implies there is not control or queuing over the packets coming into the device, but you can queue the packets leaving the device to manage congestion.

FIFO-First In First Out Queuing
First In First Out (FIFO) is a complete Fair Queuing method, the first packet to get to the router will be the first packet to be sent out.There is only one queue with FIFO, One Queue for received traffic and one queue for traffic being sent out of the interface. This is essentially the best effort queuing strategy which gives no priority to any traffic types and  is not recommended for voice and video applications deployments.

This will also be the default for the outbound software queues of some interfaces where no other custom Queuing techniques are applied. This is default in the hardware Queues and it can cause starvation, increased delay and Jitter on slow speed interfaces.

Understanding  Flows
A Flow can also be viewed as a Conversation  between 2 parties.
A Flow is always unidirectional from router’s perspective.
Router will use few parameters to determine a flow and those parameters can be
1. Source and Destination IP address in the IP Header
2. Protocol Number
3. ToS Field values
4. Source and Destination Port numbers.

WFQ – Weighted Fair Queue
WFQ Can be applied on the Software Queue of the outbound interface.
Cisco enables this queuing method by default on all slow speed interfaces – T1s and interfaces less than 2.048 Mbps
WFQ is also placed on interfaces which are Multilink PPP.

How WFQ Works
With WFQ the Traffic is sorted into flows. The sorting of traffic into different flows is automatic, and once the flows are identified then WFQ will dedicate bandwidth to each of these Flows. WFQ will try to allocate the bandwidth fairly, but it also uses IP Precedence to mange the unfairness, where one flow gets more bandwidth than another.

WFQ takes a look at IPP and the packet size, and puts the smaller packets in the front of software queue which are usually for interactive traffic. This makes sure that big packet sizes like bulk data transfers do not monopolize the traffic Queues all the time.

As an Example- If queue 1 has 100-byte packets and queue 2 has 50-byte packets, then WFQ algorithm will take two packets from queue 2 for every1 packet from queue 1. This makes service fair for each queue: 100 bytes each time the queue is serviced.

In WFQ you have
One Hardware Queue – Which is always FIFO
Software Queues – Makes different Queue for each Flow(conversations)
The Software Queue with WFQ has a WFQ Scheduler process that makes decision on which traffic goes first to the hardware Queue.

There is a WFQ Dropping at the end of each queue, which is used to avoid the tail drop and to manage the the dropping of packets more efficiently rather than just doing tail drop.

Note: WFQ is not recommended for voice and video traffic.
Reason: because even though the voice or video packets are small they are always sending some packets (always talking) and are considered high talkers per flow, so if someone does a telnet or ssh in between then those packets will get priority over voice and video packets since ssh/telnet packets will be considered as low talkers per number of flows.

How many Queues used in WFQ?
8 Queues are always reserved for System Packets – that is packets with IPP values of 6,7.
If RSVP is used then up to 1000 Queues can be used for RSVP
With DiffServ approach being used, the number of Queues will be dependent on the bandwidth of the link
Bandwidth Less Than 64K  will have up to 16 Queues
Bandwidth Less Than 512K will have up to 256 Queues

Note: Each Queue (Software Queue) can hold multiple Flows (Conversations), but WFQ always attempts to make a separate Queue for each and every Flow or conversation. Also with WFQ one of the major issues is that multiple flows can end up sharing the same queue. Per Cisco the probability of multiple Flows ending up in same Queue is 15% for 5 concurrent Flows and 64 Queues.

WFQ Dropping
You can set the Congestive Discard Threshold (CDT) which will allow early dropping of packets from the top talkers.
There is also a configurable  Hold Queue Out (HQO) which will allow you to control the limit the maximum packets.

Weight Calculations In WFQ
Weight in WFQ is calculated from the IPP values and packet lengths. The packets with lower Finish times are chosen first to be transmitted. The Finish times are calculated based on
1. Packet Length
2. IPP Values.

End-to-End QoS Network Design: Quality of Service for Rich-Media & Cloud Networks (2nd Edition) (Networking Technology)

Configuring WFQ

There is only one command you need under the interface to configure WFQ   –> # fair-queue
There are other optional configurable options with this command which are CDT, HQO, Number of Dynamic Queues, Number of Reservable Queues.
So the Entire command will be
# fair-queue [Congestive-discard-threshold  [Dynamic-Queues [reservable-queues]]]  hold-queue <max-limit-number> out

The Congestive Discard Threshold (CDT)  is defaulted to 64 and can be configured between 1 -4096
The Hold Queue Out (HQO) max-limit default is 1000, but you can also change the max-limit.
You can also set the number of Dynamic Queues even though it depends bandwidth by default.
The Dynamic Queues can be configured as  16,32,64,128,256,512… up to 4096 in the order of increment values
The Reservable Queues are For RSVP, the default is 0, but you can set this value up to 1000 for 1000 RSVP Queues.

Verifying WFQ
Commands to Verify WFQ are
# show interface
# Show Queue
# Show policy-map interface

End-to-End QoS Network Design: Quality of Service for Rich-Media & Cloud Networks (2nd Edition) (Networking Technology)



Incoming search terms for the article:

Leave a Reply