Implementation of Worst-case Weighted fair Queueing (wf2q+)

WF2Q+ is a queueing discipline developed by Jon Bennett and Hui Zhang [1].

With WF2Q+, each flow is associated a weight, such that the sum of the weights of all flows is no larger than a predefined value W, i.e., if there are n flows, then

           weight[1] + weight[2] + ... + weight[n] <= W
A flow's weight specifies how much share of the capacity of the output link a flow is entitled to receive. For example, if one flow has weight 1, and another flow has weight 2, then the second flow will get twice as much bandwidth as the first flow.  Note that if W is equal to the capacity of the link, then the weights are actual bandwidth given to each flow. By keeping track of eligible times and finishing times of flows, we can schdule the packets according to WF2Q+.

 WF2Q+ has been implemented for ns version 2.1 (beta-5) UCB/LBNL/VINT ns web page.  The file contains the code.  You need to add wf2q+.o to the Makefile for this discipline to be complied.  A sample script in wf2q.tcl together with utils.tcl demonstrates the use of wf2q+.  The resulting throughput graph from this script looks like this.

Jon C.R. Bennett and H. Zhang, Hierarchical Packet Fair Queueing Algorithms. IEEE/ACM Transactions on Networking, 5(5):675-689, Oct 1997. Also in Proceedings of SIGCOMM'96, Aug, 1996. [.ps.gz][.pdf]

Shahzad Ali <>