Cisco Router Queuing Concepts

Congestion Management and Avoidance
Cisco Router Queuing Concepts
Cisco routers can be configured to perform fancy queuing for packets that are waiting to exit an
interface. For instance, if a router receives 5 Mbps of traffic every second for the next several
seconds, and all that traffic needs to exit a T1 serial link, the router can’t forward all the traffic. So,
the router places the packets into one or more software queues, which can then be managed—thus
impacting which packets get to leave next and which packets might be discarded.
Software Queues and Hardware Queues
Although many network engineers already understand queuing, many overlook some of the details
behind the concepts of a hardware queue and a software queue associated with each physical
interface. The queues created on an interface by the popularly known queuing tools are called
software queues, as these queues are implemented in software. However, when the queuing
scheduler picks the next packet to take from the software queues, the packet does not move
directly out the interface. Instead, the router moves the packet from the interface software queue
to a small hardware FIFO (first-in, first-out) queue on each interface. Cisco calls this separate, final
queue either the transmit queue (TX queue) or transmit ring (TX ring), depending on the model
of the router; generically, these queues are called hardware queues.
Hardware queues provide the following features:
■ When an interface finishes sending a packet, the next packet from the hardware queue can be
encoded and sent out the interface, without requiring a software interrupt to the CPU—
ensuring full use of interface bandwidth.
■ Always use FIFO logic.
■ Cannot be affected by IOS queuing tools.
■ IOS automatically shrinks the length of the hardware queue to a smaller length than the
default when a queuing tool is present.
■ Short hardware queue lengths mean packets are more likely to be in the controllable software
queues, giving the software queuing more control of the traffic leaving the interface.
The only function of a hardware queue that can be manipulated is the length of the queue.
Example 13-1 shows how to see the current length of the queue and how to change the length.
Example 13-1 TX Queue Length: Finding and Changing the Length
! The example begins with only FIFO queuing on the interface. For this
! router, it defaults to a TX queue length 16.
R3# show controllers serial 0/0
Interface Serial0/0
! about 30 lines omitted for brevity
tx_limited=0(16)
! lines omitted for brevity
! Next, the TX ring is set to length 1.
! (The smallest recommended value is 2.)
R3# conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)# int s 0/0
R3(config-if)# tx-ring-limit 1
R3(config-if)# ^Z