WFQ

Fair Weighted Queue


HOME

Introduction

GPS

WF2Q

Recourses


WFQ is an approximation of GPS, which does not make the assumption of infinitesimal packet size. GPS is the ideal method for best-effort and interactive connections but it is impossible to implement due to its requirement of infinitesimal sized packets. Weighted round-robin and deficit round-robin emulates GPS but they both fall short. Weighted round-robin does not work well when there are packets of different sizes, or when a fair allocation of bandwidth at small time scales is needed. Deficit round-robin works well with packets of different sizes but it also does not allot fair bandwidth at short time scales. WFQ overcomes the shortcomings posed by weighted round-robin and deficit round-robin by serving the packets in order of service tags, which are computed by simulating GPS in parallel.

Weighted Fair Queuing (WFQ) is a complex scheduler used for various size packets. It provides traffic priority management that automatically sorts among individual traffic streams without requiring an access list. Its basis is on fluid-flow fair queuing. WFQ services each queue fairly in terms of byte count creating bit-wise fairness. WFQ is used under conditions, which requires a consistent response time to heavy and light network users alike without adding excessive bandwidth (BW). Two categories of WFQ sessions are interactive traffic, low bandwidth, and best effort traffic, high bandwidth. Low BW traffic has priority over high BW traffic. WFQ also ensures that queues do not starve for BW, which provides predictable service. Any bandwidth not used by a flow will be proportionally divided up among remaining flows.

WFQ schedualar

In WFQ, packets are classified by flow. Packets with the same source IP address, destination IP address, source TCP or UDP port, or the destination TCP or UDP port determine flows. The virtual finish time number of a packet that’s arriving in WFQ is equal to the sum of the largest finish number of a packet in its queue and the arriving packet’s size (in bits). If an arriving packet of size 10 reaches a queue, which is occupied by a packet with a virtual finishing time of 20, it will have a virtual finishing time of 30. This is summarized in the following equation:

F(i,k,t) = MAX{F(i,k-1,t), R(t)} + P(i,k,t)
where:
i = connection number
k = packet number
t = time
R(t) = round number (virtual time)
P(i,k,t) = time to transmit kth packet that arrives on connection i at time t with connection i's bandwidth
F(i,k-1,t) = finish number of the (k-1)th packet on that connection

Once the virtual finishing time is calculated. The scheduler will select the packet with the smallest virtual finishing time.

WFQ helps solve problems with round-trip delay variability. One problem addressed by WFQ is when multiple high-volume flows are active, without WFQ, transfer rates and inter-arrival periods are sporadic. Also when bursty traffic is added to the network response time is still predictable. Using WFQ increases predictability in throughput, response time and predictable inter-arrival periods. The following diagram shows an example of interactive traffic delay:

non-WFQ vs WFQ RTT's

WFQ works with both the IP precedence and Resource Reservation Protocol (RSVP) to help provide QoS. RSVP can uses WFQ to allot buffer space, schedule packets, and guarantee BW for a reserved flow. WFQ is also IP precedence aware, and detect higher-priority packets marked with precedence by the IP header and schedule them with a higher weight. The IP precedence values range form 0 to 7. More BW is allotted to a flow as its precedence value increases. This provides faster service for the flow when congestion occurs. The following describes the effect of IP precedence settings:

If there are eight active flows, precedence levels of 0,1,2,3,4,5,6,7, then they will get 1/36 (1+2+3+4+5+6+7+8=36), 2/36, 3/36, and so forth of the total bandwidth. However, if there are 18 precedence – 1 flows and 1 of each of the others, then the flows will get 1/70 (1+2(18)+3+4+5+6+7+8=70), 2/70,2/70,….,3/70, and so forth.


Pictures from Cisco http://www.cisoc.com/univercd/cc/td/doc/cisintwk/ito_doc/qos.html