45
WFQ
Figure 19 Weighted fair queuing (WFQ)
Before WFQ is introduced, make sure that you have understood fair queuing (FQ). FQ is designed
for fairly allocating network resources to reduce delay and jitter of each traffic flow as possible. In an
attempt to balance the interests of all parties, FQ follows these principles:
•
Different queues have fair dispatching opportunities for delay balancing among streams.
•
Short packets and long packets are fairly scheduled: if long packets and short packets exist in
queues, statistically the short packets must be scheduled preferentially to reduce the jitter
between packets on the whole.
Compared with FQ, WFQ takes weights into account when determining the queue scheduling order.
Statistically, WFQ gives high-priority traffic more scheduling opportunities than low-priority traffic.
WFQ can automatically classify traffic according to the "session" information of traffic (protocol type,
TCP or UDP source/destination port numbers, source/destination IP addresses, IP precedence bits
in the ToS field, and so on), and try to provide as many queues as possible so that each traffic flow
can be put into these queues to balance the delay of every traffic flow on a whole. When dequeuing
packets, WFQ assigns the outgoing interface bandwidth to each traffic flow by precedence. The
higher precedence value a traffic flow has, the more bandwidth it gets.
For example, assume five flows exist in the current interface with precedence 0, 1, 2, 3, and 4,
respectively. The total bandwidth quota is the sum of all the (precedence value + 1)s, 1 + 2 + 3 + 4 +
5 = 15.
The bandwidth percentage assigned to each flow is (precedence value of the flow + 1)/total
bandwidth quota. The bandwidth percentages for flows are 1/15, 2/15, 3/15, 4/15, and 5/15,
respectively.
Because WFQ can balance the delay and jitter of each flow when congestion occurs, it is suitable for
handling some special occasions. For example, WFQ is used in the assured forwarding (AF)
services of the RSVP. In GTS, WFQ schedules buffered packets.