Weighted fair queueing explained

Weighted fair queueing (WFQ) is a network scheduling algorithm. WFQ is both a packet-based implementation of the generalized processor sharing (GPS) policy, and a natural extension of fair queuing (FQ). Whereas FQ shares the link's capacity in equal subparts, WFQ allows schedulers to specify, for each flow, which fraction of the capacity will be given.

Weighted fair queuing is also known as packet-by-packet GPS (PGPS or P-GPS) since it approximates generalized processor sharing "to within one packet transmission time, regardless of the arrival patterns."[1]

Parametrization and fairness

Like other GPS-like scheduling algorithms, the choice of the weights is left to the network administrator. There is no unique definition of what is "fair" (see for further discussion).

By regulating the WFQ weights dynamically, WFQ can be utilized for controlling the quality of service, for example, to achieve guaranteed data rate.

Proportionally fair behavior can be achieved by setting the weights to

wi=1/ci

, where

ci

is the cost per data bit of data flow

i

. For example, in CDMA spread spectrum cellular networks, the cost may be the required energy (the interference level), and in dynamic channel allocation systems, the cost may be the number of nearby base station sites that can not use the same frequency channel, in view to avoid co-channel interference.

Algorithm

In WFQ, a scheduler handling flows is configured with one weight

wi

for each flow. Then, the flow of number

i

will achieve an average data rate of
wi
(w1+w2+...+wN)

R

, where

R

is the link rate. A WFQ scheduler where all weights are equal is a FQ scheduler.

Like all fair-queuing schedulers, each flow is protected from the others, and it can be proved that if a data flow is leaky bucket constrained, an end-to-end delay bound can be guaranteed.[2]

The algorithm of WFQ is very similar to the one of FQ. For each packet, a virtual theoretical departure date will be computed, defined as the departure date if the scheduler was a perfect GPS scheduler. Then, each time the output link is idle, the packet with the smallest date is selected for emission.

The pseudo code can be obtained simply from the one of FQ by replacing the computation of the virtual departure time by packet.virFinish = virStart + packet.size / Riwith

Ri=

wi
(w1+w2+...+wN)

R

.

WFQ as a GPS approximation

WFQ, under the name PGPS, has been designed as "an excellent approximation to GPS", and it has been proved that it approximates GPS "to within one packet transmission time, regardless of the arrival patterns."[1]

Since WFQ implementation is similar to fair queuing, it has the same O(log(n)) complexity, where n is the number of flows. This complexity comes from the need to select the queue with the smallest virtual finish time each time a packet is sent.

After WFQ, several other implementations of GPS have been defined.

History

The introduction of parameters to share the bandwidth in an arbitrary way in mentioned at the end of [4] as a possible extension to FQ. The term weighted first appears in.[1]

See also

Notes and References

  1. Parekh . A. K. . Gallager . R. G. . Robert G. Gallager. 10.1109/90.234856 . A generalized processor sharing approach to flow control in integrated services networks: The single-node case . IEEE/ACM Transactions on Networking. 1 . 3 . 344 . 1993 . 52808341 .
  2. Stiliadis . D. . Varma . A. . 10.1109/90.731196 . Latency-rate servers: A general model for analysis of traffic scheduling algorithms . IEEE/ACM Transactions on Networking. 6 . 5 . 611 . 1998 .
  3. Book: 10.1109/INFCOM.1996.497885. WF/sup 2/Q: Worst-case fair weighted fair queueing. Proceedings of IEEE INFOCOM '96. Conference on Computer Communications. 1. 120. 1996. Bennett . J. C. R. . Hui Zhang. 978-0-8186-7293-4. 17558577.
  4. Demers . A. . Keshav . S.. Shenker . S. . Scott Shenker. 10.1145/75247.75248 . Analysis and simulation of a fair queueing algorithm . ACM SIGCOMM Computer Communication Review . 19 . 4 . 1 . 1989 . free .