ONT Chapter 4 – Conegstion Management and Queuing

Also available as a PDF here

Introduction to Congestion Management and Queuing

  • Congestion occurs when the rate of input to an interface exceeds the rate of output
  • Speed mismatch problem – when traffic on a high speed interface enters the router but exits on a low speed interface
  • Aggregation problem – when traffic from multiple interfaces aggregates into a single interface
  • Tail drop – occurs when buffers fill up and new incoming traffic is dropped
  • Default queuing method is FIFO (first in first out)
  • Queuing mechanisms consist of hardware and software components
    • Hardware queue is called the transmit queue (TxQ)
    • If TxQ becomes full, packets are held in the software queue and release to the TxQ based on the queuing mechanism
    • TxQ is always FIFO
  • Software queuing has a number of queues – one for each class of traffic
    • If the software queue is full, the packet is dropped
    • If TxQ is full, packet is held in software queue based on it’s class
    • Even if a packet is in one of the software queues, it can still be dropped if WRED is applied to that queue
  • The IOS determines the hardware queue based on the configured bandwidth on the interface
    • You can manually set the queue size with the tx-ring-limit command

FIFO, Priority Queuing, Round Robin, Weighted Rounded Robin Queuing

First in First out (FIFO)

  • Default queuing mechanism on all interfaces > 2Mb

Priority Queuing

  • Priority queue has 4 queues (predefined and pre-created)
    • High (20 packet capacity)
    • Medium (40 packet capacity)
    • Normal (60 packet capacity)
    • Low (80 packet capacity)
  • If packets are unassigned, they go to the normal queue
  • If the high priority queue has packets, only the high priority queue has packets being forwarded, none of the other queues are moving packets
  • If high priority queue is empty, it checks the medium queue. If medium queue is empty, it checks the normal queue, etc.
  • After 1 packet exits any queue, the high priority queue is checked again
  • Potential to starve lower priority queues
  • Often recommend for lower-bandwidth interfaces where you want to give absolute priority to certain traffic

Configuring a Priority Queue

Create the priority list and set the default to low

router(config)#priority-list 1 default low

Show the queuing priority (only shows what was changed from default)

router#show queuing priority

Configure all traffic coming in on an interface to a specified queue

router(config)#priority-list 1 interface s0/0 low

Assign a priority list to an interface

router(config-if)#priority-group 1 (or whatever number priority-list was created)

Round Robin Queuing

  • RR schedules 1 packet from each queue and then a packet from the next, etc.
  • No queue has priority over others queues
  • If a queue has larger packets then the other queues, that queue may take up more bandwidth
  • Effectively there is no mechanism for prioritization

Weighted Round Robin

  • Similar to RR, but you can assign a weight to a queue
  • Each queue receives a portion of the interface bandwidth
    • Not necessarily equal to the others
  • Common queuing (CQ) – example of WRR where you can configure the number of bytes to be processed before moving to the next queue
  • If byte count (weight) is too close to the MTU of the interface, that queue might take up more bandwidth than intended
  • If the weight is much greater than the MTU, queuing delays will increase

WRR Commands

Create a custom queue list (1) and create a queue (1) and match an ACL to put traffic into that queue – (a queue list contains queues – For example, we create custom queue list 1 which contains 4 queues)

router(config)#queue-list 1 protocol ip 1 list ACLNUMBER

Apply the custom queue list created above to an interface

router(config-if)#custom-queue-list 1

Show custom queue list info

router(config)#show queuing custom

Weighted Fair Queuing (WFQ)

  • Default queuing on serial interfaces < 2.048 Mbps
  • Basis for CBWFQ and LLQ
  • Benefits include
    • Divides traffic into flows
    • Provide fair bandwidth allocation to active flows
    • Provide faster scheduling to low-volume interactive flows
    • Provide more bandwidth to higher priority flows
  • Packets dropped from “aggressive flows” first

WFQ Classification and Scheduling

  • Arriving packets are classified into flows – flows are identified by:
    • Source IP
    • Destination IP
    • Protocol number
    • ToS
    • Source port
    • Destination port
  • WFQ generates as hash based on these fields – WFQ places packets with the same hash value (in the same flow) into a queue based on the hash value
    • If no queue exists, a new one is created
  • If all flows have the same weight, WFQ divides the bandwidth equally
    • Packets in a high volume queue may end up being dropped
  • WFQ dynamically creates and destroys queues – 256 max by default
  • Does not offer precise control of bandwidth allocation between flows
  • Does not work with tunneled or encrypted packets – WFQ needs access to original IP header info to form the hash
  • If number of flows > number of queues available, new flows are assigned to existing queues – multiple flows might end up sharing the same queue

WFQ Insertion and Drop Policy

  • WFQ has a queue for all packets of all flows – this is the sum of all the memory taken by packets present in the WFQ system
  • Aggressive dropping — If hold queue is full, and a packet arrives – the packet is dropped
    • Unless the packet is assigned to an empty queue
  • Each flow has a congestive discharge threshold (CDT)
  • WFQ early drop — If a packet arrives and the hold queue is not full but the CDT of that flow is reached, the packet is dropped

Benefits and Drawbacks of WFQ

  • Benefits include
    • Easy to configure
    • Does not starve flows
    • Guarantees throughput to all flows
    • Drops packets from most aggressive flows and provides faster service to nonaggressive flows
    • Standard and simple queuing mechanism – support on most Cisco platforms
  • Limitations and Drawbacks
    • Classification and scheduling are not configurable
    • Supported only on slow links (< 2.048 Mbps)
    • Cannot guarantee bandwidth or delay
    • Multiple flows may be assigned to same queue
    • Cannot be used on serial interfaces using:
      • Virtual interfaces, including loopbacks and dialer interfaces
      • Bridging or tunneling
      • LAPB, X.25, SDLC

WFQ Commands

Enable WFQ on an interface

router(config-if)#fair-queue

Change number of dynamic queues (to 64 – must be in power of 2)

router(config-if)#fair-queue 100 64 200 (100 is the congestive discard threshold and 200 is the number of reservable queues)

Show queuing info

router#show queuing interface s0/0

Class-Based Weighted Fair Queuing

  • Allows creation of user defined classes – each assigned its own queue (up to 64 queues)
  • Each queue receives its own minimum bandwidth guarantee, but can use more if it becomes available
  • Each queue is FIFO with a defined bandwidth guarantee and maximum packet limit
    • If queue is full, tail drop may occur
    • Can be offset with WRED
  • Default queue is “class-default” – packets that don’t match any other queues are put here
    • Can configure class-default queue to be WFQ, but not the other queues (only in 7500 series routers)
    • Class-default queue uses remaining bandwidth (unless specified)
  • Does not address low-delay requirements

Classification, Scheduling, and Bandwidth Guarantee

  • Accomplished using the MQC using class maps
  • Scheduling and bandwidth guarantee offered to each queue is based on the weight assigned to it
    • Weight is computed by IOS based on the values you enter for:
      • Bandwidth, bandwidth percent, or bandwidth remaining percent
    • Bandwidth
      • Allocates (reserves) a certain amount of bandwidth (in Kbps) to the queue of a class
      • Default maximum reserved bandwidth on an interface is 75% of the total bandwidth of that interface – can be modified using max-reserved-bandwidth command
    • Bandwidth percent
      • Allocates an amount of bandwidth equal to a certain percentage of the interface bandwidth
    • Bandwidth remaining percent
      • Allocates a percentage of the remaining available bandwidth to the queue
    • Note: You cannot use the bandwidth on one queue and bandwidth percent on another queue – it’s either one or the other on all queues
    • Available bandwidth = (Interface bw x max reserved bandwidth) – (sum of all existing reservations)

Benefits and Drawbacks of CBWFQ

  • Benefits include:
    • Allows creation of user defined classes
    • Allows allocation of bandwidth for each traffic class based on user policies/preferences
    • Finer granularity than WFQ
  • Drawbacks include:
    • No suitable queue for real-time traffic – real-time applications expect low-delay queue in addition to bandwidth guarantee

Configuring and Monitoring CBWFQ

  1. Define traffic classes using class maps
  2. Create a policy map and link class maps to it
  3. Define the bandwidth, queue-limit (packet limit), etc. for each queue (class)

Low-Latency Queuing

  • Includes a strict-priority queue that is given priority over other queues
    • Strict-priority queue is policed, so that other queues won’t starve – meaning it cannot transmit more data than its bandwidth permits
    • If more traffic arrives than the strict-priority queue can transmit, the traffic is dropped
  • LLQ is essentially CBWFQ with one or more strict-priority queues added to it
    • If more than 1 strict-priority queue exists, the queues are policed separately, but after policing, the traffic is not separated

Benefits of LLQ

  • Offers all benefits of CBWFQ
  • Offers ability to define a high priority queue (strict-priority)
  • Strict-priority queue is policed (Unlike PQ)
  • Strict-priority queue can accept any traffic, not just RTP

Leave a Reply