10-7 Custom Queuing (CQ)

  • 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.

Configuration

  1. Define one or more queue classifications to a custom queue list.

    1. 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 ).

    2. 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).

    3. 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).

  2. (Optional) Set the queue size parameters.

    1. 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).

    2. 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:

      Step 1. Find the queue that has the largest packet size.

      Step 2. Calculate a ratio of packet sizes for each queue by dividing the largest packet size by the actual packet size of each queue.

      Step 3. Calculate a ratio of bandwidth percentages by dividing each queue's percentage by the percentage of the queue that has the largest packet size.

      Step 4. Multiply each queue's bandwidth ratio (from Step 3) by the packet ratio (from Step 2).

      Step 5. Normalize the numbers by dividing each number from Step 4 by the lowest value. Round each number up to the next integer if the decimal portion is greater than 0.5. Otherwise, round the number down to the next lower integer. This is the number of whole packets serviced for each queue. It must be an integer.

      Step 6. Multiply the number of packets (from Step 5) by each queue's packet size. This gives you the byte count.

      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.

      Table 10-4. Calculating the Byte Count Values for Each Queue
      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%.

  3. Apply the custom queue list to an interface:

     (interface)  custom-queue-list   list-number  

Custom Queuing Example

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.

Table 10-5. Calculating the Byte Count Values for Each Queue
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  


Cisco Field Manual[c] Router Configuration
Cisco Field Manual[c] Router Configuration
ISBN: 1587050242
EAN: N/A
Year: 2005
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net