Previous section   Next section

Recipe 11.6 Using Weighted Fair Queueing

11.6.1 Problem

You want your routers to use the TOS/DSCP fields when forwarding packets.

11.6.2 Solution

The simplest way to make your routers use DSCP or TOS information is to just make sure that Weighted Fair Queueing (WFQ) is enabled:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface Serial0/0
Router(config-if)#fair-queue
Router(config-if)#end
Router#

WFQ is enabled by default on all interfaces of E1 speeds (roughly 2Mbps) or less. You can enable WFQ on higher speed interfaces as well, but we don't recommend it.

To configure more specific behavior, you can tell WFQ how to allocate its queues:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface Serial0/0
Router(config-if)#fair-queue 64 512 10
Router(config-if)#end
Router#

11.6.3 Discussion

Before we discuss these examples in any detail, we should mention that WFQ works well even if you don't use any TOS/DSCP marking. In this case, it simply gives the same default weighting to every flow, which is the same as conventional Fair Queueing (without the weights). As we discuss in Appendix B, Fair Queueing is much more effective than FIFO queueing. However, with TOS/DSCP marking, WFQ really shows its value, giving higher priority flows more of the bandwidth, and preventing high volume flows from starving low volume flows regardless of their TOS markings.

The first example just enables WFQ on the interface. In fact, this is the default for all interfaces that operate slower than 2.048Mbps (E1 speed), except for interfaces that use LAPB or SDLC. WFQ does not work with LAPB or SDLC.

The second example is a little bit more interesting, though, because it changes the default queues. The fair-queue command has three optional parameters. In the example, we specified:

Router(config-if)#fair-queue 64 512 10

The first number specifies the congestive discard threshold. This just means that if there are more than 64 packets in any given queue, the router will start to discard any new packets. The default threshold is 64.

The second number is the number of dynamic queues. The values must be a power of 2 multiplied of 16 to a maximum of 4096 (i.e., one of the following values: 16, 32, 64, 128, 256, 512, 1024, 2048, or 4096). The default value is 256. If this interface must support a large number of flows, then it is a good idea to choose a larger value.

The last number (10 in this case) is the number of queues that the router will set aside for RSVP reservation requests. Please see Recipe 11.9 for more information about RSVP.

In most cases, the default parameters are good enough. However, there are two times in particular when it is useful to modify them. First, if the interface must support an extremely large number of flows, you will get better performance by using a larger number of queues. However, be careful doing this on faster interfaces because the router may start to have trouble processing the additional queues. In that case, you could actually get a performance improvement by decreasing the number of queues. In this case, each queue could wind up simultaneously handling a few distinct flows.

You will also need to change the default queue parameters if you are using RSVP to reserve queues. By default, this parameter is zero. If you are using RSVP with WFQ, you must allocate some reserved queuing space.

11.6.4 See Also

Recipe 11.9


  Previous section   Next section
Top