Cisco routers offer three basic queuing strategies:
WFQ raises the priority level of packets that are smaller above the priority level of large packets. This process tends to benefit traffic generated by applications where the user would notice a lag. An example is Telnet traffic. Telnet sends small TCP packets containing a single character. Once the packet is returned to the user, the character is placed on the screen. A user notices the delay if this placement does not happen quickly, and in many cases, productivity suffers. As of Cisco IOS version 11.3, WFQ is the default on serial interfaces up to 2.048Mbps, assuming the interface supports it. PQ places traffic in groups according to the configured priority of the traffic in question. It is possible to place Internetwork Packet Exchange (IPX) traffic in a higher priority group than IP and vice versa. CQ is an extension of PQ. The administrator has more options available and can differentiate to a greater degree than with PQ. Determining the Necessary Queuing StrategyThe first thing to determine when it comes to traffic queuing is what type of traffic deserves priority. This decision depends on the needs of the organization. Typically, any traffic generated by some sort of terminal or terminal emulator is a prime candidate to benefit from traffic queuing. These applications are susceptible to perceived delays from the user. In other cases, the administrator might decide that all IPX traffic has priority because it is mission-critical, whereas IP is not. What type of traffic the administrator determines is important has a big impact on the appropriate selection of a queuing strategy. To determine which type of queuing is appropriate, administrators should ask themselves the following questions:
The following three sections describe each type of queuing in detail and provide an example. WFQWFQ follows a modified "first in, first out" (FIFO) strategy. Normally, a router routes traffic based on the standard definition of FIFO, except on slow serial links. Unfortunately, this process often means that a router spends its time waiting for a large packet to finish arriving when a small packet is sitting there waiting its turn. WFQ ConceptsThe modified FIFO strategy tells the router to route the first packet that arrives completely. When a small packet and a large one head toward the router and they start arriving at close to the same time, the small packet finishes arriving long before the large packet. Rather than wait for the large packet to finish arriving, the router routes the small packet. Figure 12.1 shows an example. Figure 12.1. WFQWFQ also breaks up streams of packets into conversations. Because packet streams can hog the available bandwidth, the router breaks up the stream and inserts other packets that need to be routed. An example of a packet stream is an FTP transfer. WFQ breaks up the megabytes associated with the download and allows time-sensitive traffic to be routed. The router can break up streams into several different types of conversations, including the following:
WFQ is enabled by default on all physical interfaces that have bandwidth of not more than 2,048Mbps and that do not use Synchronous Data Link Control (SDLC) Protocol; Point-to-Point Protocol (PPP) with compression; X.25; or Link Access Procedure, Balanced (LAPB) encapsulation. WFQ might not be enabled on interfaces that have these items configured. WFQ ConfigurationYou use the fair-queue command to establish WFQ on an interface. In addition, this command sets a congestive-discard-threshold value. This value controls how many packets in a given conversation are queued before the router discards new packets. This setting is what helps alleviate the effects of packet streams. The following code illustrates how to configure WFQ, as well as provides a sample configuration statement: Router(config-if)#fair-queue congestive-discard-threshold-number dynamic-queues reservable-queues Router(config-if)fair-queue 128 256 0 If the congestive-discard-threshold-number is set to 128, up to 128 packets are placed in the queue for a given conversation. Once the 128 packet limit is reached, the router discards packets arriving for that conversation until the number of packets queued for that conversation falls below one-fourth of the value, in this case 32. The default value for the congestive-discard-threshold-number is 64. Its range is 1 through 512, inclusive. The number of dynamic queues determines the number of ongoing conversations that don't require any special resource reservations. The minimum number is 16 with options doubling until a maximum of 4096. The default is a function of the bandwidth configured on the interface: a 64Kbps interface has a default of 16, and a 512Kbps interface has 256 queues by default. The reservable queues are used for conversations that have some sort of bandwidth reservation attached to them, such as a Resource Reservation Protocol (RSVP) conversation. The available range is 0 through 1000 with a default of 0. If you are using RSVP but haven't specifically configured it on an WFQ interface, normal queues are used for reserved bandwidth traffic. PQPQ allows the administrator to tell the router to send all packets of a certain type before moving on to other packets. For example, an administrator can configure PQ to send all Telnet traffic before sending any other type. PQ ConceptsPQ consists of four queues where packets can be placed while waiting to be routed, as shown in Figure 12.2. These queues and their default packet sizes are Figure 12.2. PQs
The more important queues don't require as large a buffer because the router always services those queues before servicing lower queues. Once the High queue is empty, the router moves on to the lower queues. When the router examines a queue, it routes any packets whose times-to-live (TTLs) have not yet expired. The router then checks the High queue again and works its way down the list. If the High queue contains too much traffic, there is a risk that the router will not service the lower-level queues. PQ ConfigurationOnce you decide to use PQ, you must decide what protocols go to what queues. More than one protocol may inhabit a queue, and you must assign a default queue to capture any traffic not specified. You do so via a priority list. You can configure a priority list by both interface and protocol: a single list might state that all TCP/IP traffic goes to the High queue, and all traffic coming in interface Ethernet 2 goes to the Medium queue. The following command strings, in order, show how to configure a priority list by protocol and by interface, followed by syntax explanations in Table 12.1 and value descriptions in Table 12.2: Router(config)#priority-list list-number protocol protocol-name (high | medium | normal | low) queue-keyword keyword-value Router(config)#priority-list list-number interface interface-type interface-number (high | medium | normal | low)
The following commands, in order, show how to specify which queue is the default, change the queue sizes, and attach the priority list to an interface. Each command is then explained in Table 12.3: Router(config)#priority-list list-number default (high | medium | normal | low) Router(config)#priority-list list-number queue-limit high-queue-limit medium-queue-limit normal-queue-limit low-queue-limit Router(config-if)#priority-group list-number
Cisco put a lot of effort into making the default queue values efficient. Think carefully before changing the values. A change might leave lower queues not serviced as often or at all. A PQ ExampleThe following is an example of a PQ configuration and interface application. The following command places all Telnet traffic into the High queue: Router(config)#priority-list 1 protocol ip high tcp 23 The next command places all IP traffic allowed by access list 1 into the High queue: Router(config)#priority-list 1 protocol ip high list 1 This command places all other IP traffic into the Medium queue: Router(config)#priority-list 1 protocol ip medium The next command places all non-IP traffic arriving from Serial 1 into the Normal queue. Previous statements already placed any IP traffic into queues: Router(config)#priority-list 1 interface serial 1 normal This command places all AppleTalk traffic into the Low queue: Router(config)#priority-list 1 protocol appletalk low The following line places all IPX traffic into the Low queue: Router(config)#priority-list 1 protocol ipx low The next line establishes the Low queue as the queue where all nonspecified traffic will go: Router(config)#priority-list 1 default low The next line changes the default settings for how many packets each queue can hold from 20 for the High, 40 for the Medium, 60 for the Normal, and 80 for the Low to 20 for the High, 50 for the Medium, 60 for the Normal, and 80 for the Low: Router(config)#priority-list 1 queue-limit 20 50 60 80 This line is the access list referenced earlier: Router(config)#access-list 1 permit 192.168.72.6 The following command moves from global configuration mode to interface configuration mode for Ethernet 0: Router(config)#interface Ethernet 0 The next command applies the priority group to interface Ethernet 0: Router(config-if)#priority-group 1 CQCQ allows the administrator to prioritize traffic so that important traffic is serviced more frequently. At the same time, this queuing strategy does not ignore certain protocols because it is too busy handling others. Whereas PQ handles all traffic in an upper queue before moving to a lower queue, CQ handles a certain amount of data in a given queue and then moves on to the next queue. CQ ConceptsCQ allocates traffic to up to 16 queues via a queue list, 10 queues if using an IOS version prior to 11.0. The list chooses a queue for a packet according to the protocol, the interface the packet arrived from, the TCP/IP application the packet is for, and other characteristics. When the router begins handling queued packets, it looks in the first queue available. The first queue, queue 0, handles router system traffic such as keepalives. Once the first queue is empty, certain rules take over. The first rule is that traffic is handled in a "round robin" fashion. Once the router is finished with a given queue, it moves on to the next. The CQ router does not start at the beginning as it does with PQ. The second rule is that the router is finished servicing a queue once it pulls a certain number of packets or a certain number of bytes out of that queue, regardless of whether more packets are waiting to be serviced. CQ ConfigurationThe following commands show how to configure custom queuing based on protocol and interface and the details appear in Table 12.4: Router(config)#queue-list list-number protocol protocol-name queue-number queue-keyword keyword-value Router(config)#queue-list list-number interface interface-type interface-number queue-number
The administrator must also assign a default queue for packets that are not covered by the queue list. The administrator can change the number of packets each queue will hold. Those commands follow, with explanations in Table 12.5: Router(config)#queue-list list-number default queue-number Router(config)#queue-list list-number queue queue-number limit limit-number
The administrator can specify how long the router remains forwarding packets from any one queue. You do so by configuring how many bytes the router may forward before moving on to the next queue. Assuming that z queue contains more packets than the router is configured to forward at any one time, the router forwards enough packets to reach the configured limit, even if the last packet forces the router over that limit. Once it reaches the limit, the router moves on to the next queue. When customizing how many packets the router may forward from any one queue, it is a good idea to pay attention to the packet size of the topology. If you configure the first queue for 2000 bytes and all remaining queues for 1500 bytes, Ethernet packets in the first queue will get twice the attention of Ethernet packets in any other queue. Ethernet packets are slightly larger than 1500 bytes. The router forwards one packet from each queue with a limit of 1500 bytes, but forwards two packets from the first queue. Following is the command to configure how many bytes are transferred from each queue every time the router accesses that queue and the command to set the queue list on an interface. Table 12.6 explains the options that you can use here: Router(config)#queue-list list-number queue queue-number byte-count byte-count-number Router(config-if)#custom-queue-list list
A CQ ExampleThis example shows how you can give Telnet traffic the highest priority, followed by other IP traffic and anything entering the router via interface Serial 1; AppleTalk, IPX, and all other traffic is considered less critical. It is important to note that when a packet fits more than one queue, it is placed in the queue with the higher priority. The first command puts all Telnet (TCP port 23) traffic in queue 1: Router(config)#queue-list 1 protocol ip 1 tcp 23 The next command places all other IP traffic in queue 2: Router(config)#queue-list 1 protocol ip 2 This command puts all traffic that is not IP traffic, but is traffic arriving from Serial 0/1, in queue 3: Router(config)#queue-list 1 interface s0/1 3 The following command puts all AppleTalk traffic in queue 4: Router(config)#queue-list 1 protocol appletalk 4 This line puts all IPX traffic in queue 5: Router(config)#queue-list 1 protocol ipx 5 The next line creates a default queue for all other traffic that the router might be configured to support: Router(config)#queue-list 1 default 6 This command raises the number of packets that queue 1 can store from 20 to 40: Router(config)#queue-list 1 queue 1 limit 40 The next command raises the number of bytes that the router can forward when handling queue 1 from 1,500 to 3,000: Router(config)#queue-list 1 queue 1 byte-count 3000 The following line reduces the number of bytes that the router will forward for AppleTalk traffic in queue 5 from 1500 to 500. This setting can be useful if you do not want the router to spend much time forwarding many small packets for network informational purposes: Router(config)#queue-list 1 queue 5 byte-count 500 The next line is a duplicate of the preceding line, affecting IPX packets in queue 6: Router(config)#queue-list 1 queue 6 byte-count 500 The following line moves from global configuration mode to interface configuration mode for Ethernet 0/0: Router(config)#interface Ethernet 0/0 This command applies the list to interface Ethernet 0: Router(config-if)#custom-queue-list 1 |