In WFQ, a scheduler handling flows is configured with one weight w_i for each flow. Then, the flow of number i will achieve an average data rate of \frac{w_i}{(w_1+w_2+...+w_N)}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. 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 / Ri with R_i = \frac{w_i}{(w_1+w_2+...+w_N)}R. == WFQ as a GPS approximation ==