Custom Queuing assigns traffic to user -configurable queues, each with a specific size and number of bytes to be forwarded.
CQ services 16 user queues and one system queue in a round- robin fashion. As each queue is serviced, a configured number of bytes (a byte count) is forwarded.
The bandwidth on an interface can be divided up proportionally, as a ratio of each queue's byte count to the sum of the byte counts.
The system queue (queue 0) is emptied before any other queue is serviced. It contains high-priority traffic such as keepalives and signaling packets.
CQ is statically configured and does not adapt to changing network conditions.
Define one or more queue classifications to a custom queue list.
Classify traffic according to protocol:
(global) queue-list list-number protocol protocol-name queue-number [ queue-keyword [ keyword-value ]]
The custom queue list is assigned a list-number (1 to 16). Traffic matching the protocol-name is placed in the specified queue-number (1 to 16).
The protocol-name field can be aarp, apollo, appletalk, arp, bridge, clns, clns_es, clns_is, compressedtcp, cmns, decnet, decnet_node, decnet_router-l1, decnet_router-l2, dlsw (direct encapsulation only), ip, ipx, pad, rsrb (direct encapsulation only), stun (direct encapsulation only), vines, xns, or x25.
The queue-keyword can be fragments (noninitial fragmented IP packets), gt byte-count (a packet size greater than byte-count bytes), list list-number (packets permitted by access list list-number; for protocols appletalk, bridge, ip, ipx, vines, and xns ), lt byte-count (a packet size less than byte-count bytes), tcp port (to or from TCP port ), or udp port (to or from UDP port ).
Queue traffic according to the inbound interface:
(global) queue-list list-number interface type number queue-number
The custom queue list is assigned a list-number (1 to 16). Traffic entering on the interface type and number is assigned to the specified queue-number (1 to 16).
Classify all other traffic by default:
(global) priority-list list-number default queue-number
All unclassified traffic for list-number (1 to 16) is assigned to the specified queue (1 to 16).
(Optional) Set the queue size parameters.
Set the maximum size of the queue:
(global) queue-list list-number queue queue-number limit packets
The depth of custom queue queue-number (1 to 16) is set to packets (0 to 32767; 0 is unlimited size; the default is 20 packets) for the custom queue list list-number (1 to 16).
Set the byte count for queue servicing :
(global) queue-list list-number queue queue-number byte-count bytes
Each time custom queue queue-number (1 to 16) is serviced, the router attempts to forward the byte count number of bytes (the default is 1500 bytes). However, if the byte count is less than the packet size, the whole packet is forwarded instead. The byte count defines a proportional amount of the overall interface bandwidth that a particular queue will receive.
To calculate the byte count values for each queue, follow these steps:
The result is a byte count for each queue that is a multiple of its packet size. The actual bandwidth percentages are fairly accurate, but due to packet rounding, they don't always give you the exact desired value. To calculate the actual percentages, add up the total byte counts of all queues from Step 6 of this calculation process. For each queue, divide the byte count from Step 6 by the sum of all byte counts.
If the actual bandwidth percentages are not close enough to your target values, you can make some adjustments to the calculations as follows : Multiply each value in Step 5 (before rounding) by an integer value, such as 2. Then evaluate each number, rounding up or down as necessary. Compute the values for Step 6, and check the resulting bandwidth percentages. If the values are still not desirable, you can increase the integer used to multiply in Step 5 and repeat this procedure.
For example, suppose Queue 1 contains packets that are 800 bytes, and it should get 10% of the interface bandwidth. Queue 2 contains packets that are 1500 bytes for 30% of the bandwidth. Queue 3 contains packets that are 250 bytes for 60% of the bandwidth. Table 10-4 shows the calculations for each step.
Queue | Packet Size | % BW | Step 1 | Step 2 | Step 3 | Step 4 | Step 5 | Step 6 |
---|---|---|---|---|---|---|---|---|
1 | 800 | 10% | 1500 / 800 = 1.875 | 10 / 30 = 0.33 | 1.875 * 0.33 = 0.61875 | 0.61875 / 0.61875 = 1.0 | 1.0 * 800 = 800 | |
2 | 1500 | 30% | 1500 | 1500 / 1500 = 1.0 | 30 / 30 = 1.0 | 1.0 * 1.0 = 1.0 | 1.0 / 0.61875 = 1.6 (round to 2.0) | 2.0 * 1500 = 3000 |
3 | 250 | 60% | 1500 / 250 = 6.0 | 60 / 30 = 2.0 | 6.0 * 2.0 = 12.0 | 12.0 / 0.61875 = 19.39 (round to 20.0) | 20.0 * 250 = 5000 |
The results give the following byte counts: 800 (Queue 1), 3000 (Queue 2), and 5000 (Queue 3). The actual bandwidth percentages are 800/(800+3000+5000), 3000/(800+3000+5000), and 5000/(800+3000+5000), resulting in 9.09%, 34.09%, and 56.8%, respectively.
If these values are not close enough to the desired 10%, 30%, and 60%, you can adjust them by trying different multipliers in Step 5. Using a multiplier of 3, the values in Step 5 would be 3.0 (no rounding), 4.8 (round up to 5), and 58.17 (round down to 58). The byte counts in Step 6 would be 2400, 7500, and 14500. The actual bandwidth percentages are now 2400/24400, 7500/24400, and 14500/24400, resulting in 9.8%, 30.7%, and 59.4%.
Apply the custom queue list to an interface:
(interface) custom-queue-list list-number
Custom queuing is configured so that HTTP traffic is assigned to Queue 1, SMTP traffic is assigned to Queue 2, and all other traffic defaults to Queue 3. For the sake of this example, assume that all three queues have traffic that consists of 1500 byte packets. HTTP traffic is to get 30% of the interface bandwidth, SMTP gets 10%, and all other traffic gets 60%. Table 10-5 shows the calculations for each step of the queue size computation.
Queue | Packet Size | % BW | Step 1 | Step 2 | Step 3 | Step 4 | Step 5 | Step 6 |
---|---|---|---|---|---|---|---|---|
1 | 1500 | 30% | 1500 | 1500 / 1500 = 1.0 | 30 / 60 = 0.5 | 1.0 * 0.5 = 0.5 | 0.5 / 0.167 = 3.0 | 3.0 * 1500 = 4500 |
2 | 1500 | 10% | 1500 | 1500 / 1500 = 1.0 | 10 / 60 = 0.167 | 1.0 * 0.167 = 0.167 | 0.167 / 0.167 = 1.0 | 1.0 * 1500 = 1500 |
3 | 1500 | 60% | 1500 | 1500 / 1500 = 1.0 | 60 / 60 = 1.0 | 1.0 * 1.0 = 1.0 | 1.0 / 0.167 = 5.98 (round to 6.0) | 6.0 * 1500 = 9000 |
queue-list 5 protocol ip 1 tcp 80 queue-list 5 protocol ip 2 tcp 25 queue-list 5 default 3 queue-list 5 queue 1 byte-count 4500 queue-list 5 queue 2 byte-count 1500 queue-list 5 queue 3 byte-count 9000 interface serial 8/1 priority-group 2