Problem
You want your routers to use the TOS/DSCP fields when forwarding packets.
Solution
The simplest way to make your routers use DSCP or TOS information is to just make sure that Weighted Fair Queuing 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)#exit Router(config)#end Router#
WFQ is enabled by default on all interfaces of E1 speeds (roughly 2 Mbps) 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)#exit Router(config)#end Router#
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 Queuing (without the weights). As we discuss in Appendix B, Fair Queuing is much more effective than FIFO queuing. 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.048 Mbps (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 multiple of 16 to a maximum of 4,096 (i.e., one of the following values: 16, 32, 64, 128, 256, 512, 1,024, 2,048, and 4,096). 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 Recipes 11.10, 11.11, and 11.12 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, you need to 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. So if you are using RSVP with WFQ, you must allocate some reserved queuing space.
See Also
Recipe 11.10; Recipe 11.11; Recipe 11.12
Router Configuration and File Management
Router Management
User Access and Privilege Levels
TACACS+
IP Routing
RIP
EIGRP
OSPF
BGP
Frame Relay
Handling Queuing and Congestion
Tunnels and VPNs
Dial Backup
NTP and Time
DLSw
Router Interfaces and Media
Simple Network Management Protocol
Logging
Access-Lists
DHCP
NAT
First Hop Redundancy Protocols
IP Multicast
IP Mobility
IPv6
MPLS
Security
Appendix 1. External Software Packages
Appendix 2. IP Precedence, TOS, and DSCP Classifications
Index