0% found this document useful (0 votes)
109 views158 pages

Queuing Mechanisms: © 2001, Cisco Systems, Inc

The document discusses different queuing mechanisms used on Cisco routers including FIFO queuing. FIFO queuing uses a single queue for all traffic and services packets on a first-come, first-served basis. The document covers configuring, benefits, drawbacks, and monitoring of FIFO queuing.

Uploaded by

trinity9876
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views158 pages

Queuing Mechanisms: © 2001, Cisco Systems, Inc

The document discusses different queuing mechanisms used on Cisco routers including FIFO queuing. FIFO queuing uses a single queue for all traffic and services packets on a first-come, first-served basis. The document covers configuring, benefits, drawbacks, and monitoring of FIFO queuing.

Uploaded by

trinity9876
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 158

Queuing

Mechanisms

© 2001, Cisco Systems, Inc.


Objectives

Upon completing this module, you will be able to:


• Describe and configure FIFO queuing
• Describe and configure priority queuing (PQ)
• Describe and configure custom queuing (CQ)
• Describe and configure basic weighted fair queuing
(WFQ), distributed WFQ, ToS-based distributed WFQ,
and QoS-group-based distributed WFQ
• Describe and configure modified deficit round robin
(MDRR) queuing
• Describe and configure IP RTP Prioritization

© 2001, Cisco Systems, Inc. QOS v1.0—3-2


Queuing Overview

© 2001, Cisco Systems, Inc. QOS v1.0—3-3


Objectives

Upon completing this lesson, you will be


able to:
• Understand how queuing works on Cisco
routers
• List the most used queuing mechanisms

© 2001, Cisco Systems, Inc. QOS v1.0—3-4


Queuing in Cisco IOS

• Cisco routers running Cisco IOS have a number of


different queuing mechanisms
• This module focuses on the following:
– First In First Out (FIFO)
– Priority Queuing (PQ)
– Custom Queuing (CQ)
– Weighted Fair Queuing (WFQ) with the different
distributed versions
– Modified Deficit Round Robin (MDRR)
– IP RTP Prioritization
• These mechnisms are implemented as software queues

© 2001, Cisco Systems, Inc. QOS v1.0—3-5


Output Interface Queue Structure

Software Hardware
Output
Forwarder Queuing Queue Interface
System (TxQ)

Any supported Always FIFO


queuing mechanism

• Each interface has its hardware and software queuing system.


• The hardware queuing system (transmit queue, or TxQ)
always uses FIFO queuing.
• The software queuing system can be selected and configured
depending on the platform and Cisco IOS version.

© 2001, Cisco Systems, Inc. QOS v1.0—3-6


Bypassing the Software Queue

Hardware
Software Queue Yes Hardware Queue No
Empty? Full?
Queue
(TxQ)

No Yes
Software
Queuing
System

• When a packet is being forwarded, the router will bypass the software queue if:
– The software queue is empty, and
– The hardware queue is not full

© 2001, Cisco Systems, Inc. QOS v1.0—3-7


Hardware Queue (TxQ) Size

• Routers determine the length of the hardware


queue based on the configured bandwidth of
the interface.
• Long TxQ may result in poor performance of
the software queue.
• Short TxQ may result in a large number of
interrupts which causes high CPU use and
low link use.

© 2001, Cisco Systems, Inc. QOS v1.0—3-8


Queuing Components

Forwarded Packets

Software Queuing System

Class 1? Add/Drop Queue 1

Hardware
Queuing System
Class 2? Add/Drop Queue 2
Hardware Q Interface
Scheduler

Class n? Add/Drop Queue n

• Each queuing mechanism has three main components that define it:
– Classification (selecting the class)
– Insertion policy (determining whether a packet can be enqueued)
– Service policy (scheduling packets to be put into the hardware queue)

© 2001, Cisco Systems, Inc. QOS v1.0—3-9


Summary

Upon completing this lesson, you should


be able to:
• Understand how queuing works on Cisco
routers
• List the most used queuing mechanisms

© 2001, Cisco Systems, Inc. QOS v1.0—3-10


Lesson Review

1. Which queuing mechanisms do Cisco


routers support?
2. When are software queuing mechanisms
not used?
3. How does TxQ length affect the software
queuing system?

© 2001, Cisco Systems, Inc. QOS v1.0—3-11


FIFO Queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-12


Objectives

Upon completing this lesson, you will be


able to:
• Describe FIFO queuing
• Describe the drawbacks of FIFO queuing
• Configure FIFO queuing on Cisco routers
• Monitor and troubleshoot FIFO queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-13


FIFO Queuing

Forwarded Packets

FIFO Queuing System Hardware


Queuing System

All in one FIFO


Tail-drop Queue 1 Hardware Q Interface
queue Scheduler

Routers serve packets in the


first-come, first-serve fashion.

FIFO uses one single queue.

Newly arriving packets are


All packets are dropped if the queue is full.
classified into one
class.

• The software FIFO queue is basically an extension of the


hardware FIFO queue.
© 2001, Cisco Systems, Inc. QOS v1.0—3-14
Benefits and Drawbacks of FIFO
Queuing
+ Benefits
• Simple and fast (one single queue with a simple scheduling
mechanism)
• Supported on all platforms
• Supported in all switching paths
• Supported in all IOS versions
– Drawbacks
• Unfair allocation of bandwidth among multiple flows
• Causes starvation (aggressive flows can monopolize links)
• Causes jitter (bursts or packet trains temporarily fill the
queue)

© 2001, Cisco Systems, Inc. QOS v1.0—3-15


Configuring FIFO Queuing

Router(config-if)#
no fair-queue

• FIFO queuing is enabled by default on all interfaces.


that have a default bandwidth of more than 2 Mbps
• Weighted fair queuing is enabled if the bandwidth is
less than 2 Mbps.
• Disable WFQ to enable FIFO on interfaces that have
less than 2 Mbps of bandwidth.

© 2001, Cisco Systems, Inc. QOS v1.0—3-16


Configuring FIFO Queuing (cont.)

Router(config-if)#
hold-queue <buffers> out

• FIFO queuing allows a maximum of 40 packets to be


stored in the output queue.
• This command can be used to increase or decrease
the maximum number of buffered packets.
• A large value can be set to support longer bursts
(fewer drops, more buffer usage).
• A small value can be set to prevent bursts (more
drops).

© 2001, Cisco Systems, Inc. QOS v1.0—3-17


FIFO Example

The Ethernet interface has a default


bandwidth of 10Mbps.
FIFO is the default queuing
mechanism, and it does not need to be
configured.
interface Ethernet0/0
ip address 1.1.1.1 255.0.0.0 The serial interface (A/S) has a default
bandwidth of 128 kbps.
! WFQ is the default queuing
interface Serial0/0 mechanism, and it has to be disabled
to enable FIFO queuing.
ip address 2.2.2.2 255.0.0.0
no fair-queue
Up to 50 frames are allowed to be
hold-queue 50 out enqueued before the router will start
! tail-dropping newly arriving packets.

© 2001, Cisco Systems, Inc. QOS v1.0—3-18


Monitoring and Troubleshooting
FIFO
Router#
show interface [<interface>]
• The command displays information about the selected
interface(s).
Router#show interface Serial0/0 The queue is currently empty (0/50).
Serial0/0 is up, line protocol is up There can be a maximum of 50 frames in the
Hardware is PowerQUICC Serial queue (0/50).
Internet address is 1.1.1.1/8
MTU 1500 bytes, BW 128 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, loopback not set
Keepalive set (10 sec) FIFO queuing is enabled
Last input 00:00:02, output 00:00:04, output hang neveron an interface with a
Last clearing of "show interface" counters never default bandwidth of
128kbps.
Queueing strategy: fifo
Output queue 0/50, 0 drops; input queue 0/75, 0 drops
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec

© 2001, Cisco Systems, Inc. QOS v1.0—3-19


Summary

Upon completing this lesson, you should


be able to:
• Describe FIFO queuing
• Describe the drawbacks of FIFO queuing
• Configure FIFO queuing on Cisco routers
• Monitor and troubleshoot FIFO queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-20


Lesson Review

1. Why is FIFO the fastest queuing


mechanism?
2. Describe the classification and scheduling
of FIFO queuing.
3. List the drawbacks of FIFO queuing.

© 2001, Cisco Systems, Inc. QOS v1.0—3-21


Priority Queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-22


Objectives

Upon completing this lesson, you will be


able to:
• Describe priority queuing
• Describe the benefits and drawbacks of
priority queuing
• Configure priority queuing on Cisco routers
• Monitor and troubleshoot priority queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-23


Priority Queuing

Forwarded Packets

Priority Queuing System

High? Tail-drop Queue 1

Hardware
Medium? Tail-drop Queue 2 Queuing System
Pre-emptive
Scheduler Hardware Q Interface

Normal? Tail-drop Queue 3

Low? Tail-drop Queue 4

• Priority queuing (PQ) uses four FIFO queues.


© 2001, Cisco Systems, Inc. QOS v1.0—3-24
Priority Queuing
Classification

• Priority queuing classification for IP supports


these options:
– Source interface
– IP access list (standard and extended)
– Packet size (greater or smaller than specified)
– Fragments
– TCP source or destination port numbers
– UDP source or destination port numbers

© 2001, Cisco Systems, Inc. QOS v1.0—3-25


Priority Queuing
Classification (cont.)
• Priority queuing also supports classification of other protocols
with these options:
– Protocol-specific access list (if available for the specified
protocol)
– Packet size (greater or smaller than specified)
• Some of the supported protocols are:
– IPX
– CLNS
– DECnet
– AppleTalk
– VINES
– DLSw

© 2001, Cisco Systems, Inc. QOS v1.0—3-26


Priority Queuing
Insertion Policy

• Each queue has a maximum number of


packets that it can hold (queue size).
• After a packet is classified to one of the
following queues, the router will enqueue the
packet if the queue limit has not been
reached (tail-drop within each class).

© 2001, Cisco Systems, Inc. QOS v1.0—3-27


Scheduling Priority Queuing

Packet in No
HIGH
queue?

Packet in No
Yes
MEDIUM
queue?

Packet in No
Yes
NORMAL
queue?

Packet in No
Yes
LOW
queue?

Yes
Dispatch packet
and start checking the Hardware Q
HIGH queue again

© 2001, Cisco Systems, Inc. QOS v1.0—3-28


Benefits and Drawbacks of
Priority Queuing
+ Benefits
• Provides low-delay propagation to high-priority
packets
• Supported on most platforms
• Supported in all IOS versions (above 10.0)
– Drawbacks
• All drawbacks of FIFO queuing within a single class
• Starvation of lower-priority classes when higher-
priority classes are congested
• Manual configuration of classification on every hop

© 2001, Cisco Systems, Inc. QOS v1.0—3-29


Configuring Priority Queuing

• Configure priority lists


– Configure classification
– Select a queue
– Set maximum queue size
• Apply the priority list to outbound traffic on
an interface

© 2001, Cisco Systems, Inc. QOS v1.0—3-30


Priority Queuing Classification

Router(config)#
priority-list list-number protocol protocol-name
{high|medium|normal|low} queue-keyword keyword-value

• Selects the queue based on Layer-3 protocol


• Additional classification (queue-keyword):
– fragment (IP packets with non-zero fragment
offset)
– gt/lt <size>: based on packet size (including L2
frame)
– list <acl>: ACL classification
– tcp/udp <port>: TCP or UDP port number
• System and link-level messages are classified in
queue high by default
© 2001, Cisco Systems, Inc. QOS v1.0—3-31
Priority Queuing Classification
(cont.)

Router(config)#
priority-list list-number interface intf {high|medium|normal|low}

• Classifies the packet based on incoming interface


Router(config)#
priority-list list-number default {high|medium|normal|low}

• Classifies all unclassified packets in a default queue

© 2001, Cisco Systems, Inc. QOS v1.0—3-32


Priority Queuing Scheduling and
Dropping Parameters

Router(config)#
priority-list list-number queue-limit high medium normal low

• Specifies the maximum queue size of individual


priority queues

Router(config-if)#
priority-group list

• Assigns priority queuing definition to an interface

© 2001, Cisco Systems, Inc. QOS v1.0—3-33


Sample PQ Configuration

E0

WAN Core

Core
E1 interface serial0
Branch priority-group 1
Office
priority-list 1 protocol ip high list 101
priority-list 1 interface ethernet 0 medium
priority-list 1 default normal
priority-list 1 queue-limit 20 40 60 80

access-list 101 permit tcp any any eq 23

© 2001, Cisco Systems, Inc. QOS v1.0—3-34


Monitoring Priority Queuing

Router#
show interface interface

• Displays information and statistics about queuing


on interface
Router#
show queueing [priority|custom|fair|random-detect] interface

• Displays queuing parameters on interface

Router#
show queue interface

• Displays queue contents

© 2001, Cisco Systems, Inc. QOS v1.0—3-35


show interface

Router#show
Router#show interface
interface serial
serial 1/0
1/0
Serial1/0
Serial1/0 is up, line protocol is
is up, line protocol is up
up
Hardware
Hardware is
is M4T
M4T
Internet
Internet address is
address is 20.0.0.1/8
20.0.0.1/8
MTU
MTU 1500
1500 bytes,
bytes, BWBW 19
19 Kbit,
Kbit, DLY
DLY 20000
20000 usec,
usec, rely
rely 255/255,
255/255, load
load 93/255
93/255
Encapsulation HDLC, crc 16, loopback
Encapsulation HDLC, crc 16, loopback not setnot set
Keepalive
Keepalive set
set (10
(10 sec)
sec)
Last
Last input 00:00:00, output
input 00:00:00, output 00:00:00,
00:00:00, output
output hang
hang never
never
Last
Last clearing
clearing ofof "show
"show interface"
interface" counters
counters never
never
Input
Input queue: 0/75/0 (size/max/drops); Total output
queue: 0/75/0 (size/max/drops); Total output drops:
drops: 00
Queueing
Queueing strategy:
strategy: priority-list
priority-list 11
Output
Output queue
queue (queue
(queue priority:
priority: size/max/drops):
size/max/drops):
high:
high: 0/20/0,
0/20/0, medium:
medium: 0/40/0,
0/40/0, normal:
normal: 0/60/0,
0/60/0, low:
low: 0/80/0
0/80/0
55 minute
minute input
input rate
rate 18000
18000 bits/sec,
bits/sec, 88 packets/sec
packets/sec
55 minute
minute output
output rate
rate 7000
7000 bits/sec,
bits/sec, 88 packets/sec
packets/sec

…… rest
rest ignored
ignored ...
...

© 2001, Cisco Systems, Inc. QOS v1.0—3-36


show queueing priority

Router#show queueing priority


Current priority queue configuration:

List Queue Args


1 high protocol ip list 101
1 medium interface Ethernet6/0

• The show queueing priority command


displays only the nondefault parameters.

© 2001, Cisco Systems, Inc. QOS v1.0—3-37


Summary

Upon completing this lesson, you should


be able to:
• Describe priority queuing
• Describe the benefits and drawbacks of
priority queuing
• Configure priority queuing on Cisco routers
• Monitor and troubleshoot priority queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-38


Lesson Review

1. When would you use priority queuing?


2. What are the benefits and drawbacks of
priority queuing?
3. How many classes does priority queuing
support?
4. How does priority queuing schedule
packets?

© 2001, Cisco Systems, Inc. QOS v1.0—3-39


Custom Queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-40


Objectives

Upon completing this lesson, you will be


able to:
• Describe custom queuing
• Describe the benefits and drawbacks of
custom queuing
• Configure custom queuing on Cisco routers
• Monitor and troubleshoot Custom Queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-41


Custom Queuing

Forwarded Packets

Custom Queuing System

Class 1? Tail Drop Queue 1

Hardware
Class 2? Tail Drop Queue 2 Queuing System
Round-
Robin Hardware Q Interface
Scheduler

Class 16? Tail Drop Queue 16

• Custom queuing (CQ) uses 16 FIFO queues for user-


defined traffic classes.
© 2001, Cisco Systems, Inc. QOS v1.0—3-42
Custom Queuing
Classification

• Custom queuing classification for IP includes


these options:
– Source interface
– IP access list (standard and extended)
– Packet size (greater or smaller than specified)
– Fragments
– TCP source or destination port numbers
– UDP source or destination port numbers
• Custom queuing classification is identical to that
of Priority queuing.

© 2001, Cisco Systems, Inc. QOS v1.0—3-43


Custom Queuing
Insertion Policy

• Each queue has a maximum number of


packets that it can hold (queue size).
• After a packet is classified to one of the
following queues, the router will enqueue the
packet if the queue limit has not been
reached (tail-drop within each class).

© 2001, Cisco Systems, Inc. QOS v1.0—3-44


Custom Queuing
Scheduling

No

Is Queue N
Packet in No Next Queue Yes
over the
Queue N? (increase N)
threshold?

Yes

Dispatch
Packet Hardware Q

• Custom queuing uses a round-robin service policy.


• Each queue is allowed to forward a configurable
amount of bytes (threshold) in one round.

© 2001, Cisco Systems, Inc. QOS v1.0—3-45


Custom Queuing
Scheduling Parameters

1500 1499 1500

Threshold (byte-count) = 3000

Up to 4499 bytes can be forwarded


in one round in the worst case.

• The threshold (byte-count) parameter specifies the lower


boundary on how many bytes the system allows to be delivered
from a given queue during a particular cycle.
• The router is allowed to send the entire packet even if the sum
of all bytes is more than the threshold.

© 2001, Cisco Systems, Inc. QOS v1.0—3-46


CQ Design Guideline

• Configure the amount to remove from a


queue in each round to configure the
proportional “weight” of the queue.
• The amounts to remove should approximate
a small multiple of the interface’s MTU.
• The ratio between largest and smallest queue
should be a small positive integer, not more
than 10:1.

© 2001, Cisco Systems, Inc. QOS v1.0—3-47


Delay vs. Bandwidth Allocation

Queue 1

5999 4500
Round-
Queue 2 Robin 64 kbps
Scheduler
4499 3000
MTU=1500

Queue 3

2999 1500

BW (Queue 1) = bc1/(bc1+bc2+bc3) = 4500/9000 = 50%


Delay (Queue 1) = (bc2+bc3)/Bandwidth = 562ms

Worst-case Delay (Queue 1) = [(bc2+1499) +(bc3+1499)]/Bandwidth = 937ms

© 2001, Cisco Systems, Inc. QOS v1.0—3-48


Worst-Case Delay

• MTU=1500, byte count (4500, 3000, 1500)


Max(delay)=(5999+4499)*8/64000=1312 ms
• MTU=1000, byte count (4500, 3000, 1500)
Max(delay)=(5499+3999)*8/64000=1187 ms
• MTU=250, byte count (450, 300, 150)
Max(delay)=(699+549)*8/64000=156 ms
Expected delay=(500+500)*8/64000=125 ms
Custom queuing is not appropriate for a low-
delay environment. Changing the MTU and
byte counts might be a workaround.

© 2001, Cisco Systems, Inc. QOS v1.0—3-49


Benefits and Drawbacks of
Custom Queuing
+ Benefits
• Guarantees throughput to traffic classes (prevents
starvation between traffic classes)
• Supported on most platforms
• Supported in all IOS versions (above 10.0)
– Drawbacks
• All drawbacks of FIFO queuing within a single class
• Manual configuration of classification on every hop
• Inaccurate bandwidth allocation
• High jitter due to implementation of scheduling

© 2001, Cisco Systems, Inc. QOS v1.0—3-50


Custom Queuing Classification

Router(config)#
queue-list list-number protocol protocol-name
queue-number queue-keyword keyword-value

• Classifies the packet into a custom queue based on


protocol and other protocol-specific criteria
• Selection criteria identical to priority queuing

Router(config)#
queue-list list-number interface incoming-intf queue-number

• Classifies the packet into a custom queue based on


incoming interface

© 2001, Cisco Systems, Inc. QOS v1.0—3-51


Custom Queuing Classification
(cont.)

Router(config)#
queue-list list-number default queue-number

• Classifies all unclassified packets into a default


queue
Router(config-if)#
custom-queue list-number

• Starts custom queuing on an interface and assigns


a specified CQ definition to the interface

© 2001, Cisco Systems, Inc. QOS v1.0—3-52


Custom Queuing
Scheduling Parameters
Router(config)#
queue-list list queue queue-number byte-count bc

• Specifies the lower boundary on how many bytes


the system allows to be delivered from a given
queue during one round-robin cycle
Default: 1500 bytes
Router(config)#
queue-list list queue queue-number limit limit

• Specifies the maximum number of packets in a


queue
• Incoming packets are tail-dropped if the limit is
exceeded
• Default: 20
© 2001, Cisco Systems, Inc. QOS v1.0—3-53
Custom Queuing with
Pre-emptive Queues
Forwarded Packets
Custom queuing has Queue
Custom Queuing System 0 for system and link-level
messages that use pre-
emptive scheduling.
Class 0? Tail Drop Queue 0

Class 1? Tail Drop Queue 1 Hardware


Queuing System

Pre-emptive
Pre-emptive
Scheduler
Scheduler
Hardware Q Inter-face
Class 2? Tail Drop Queue 2
Round-
Robin
Scheduler

Queue 1 is the lowest


custom queue that is
Class 16? Tail Drop Queue 16 serviced by the round-
robin scheduler.

© 2001, Cisco Systems, Inc. QOS v1.0—3-54


Custom Queuing with
Pre-emptive Queues (cont.)
Forwarded Packets

Custom Queuing System


Custom queues can be
configured to use the
Class 0? Tail Drop Queue 0 pre-emptive scheduler.

Class 1? Tail Drop Queue 1 Hardware


Queuing System

Pre-emptive
Pre-emptive
Scheduler
Scheduler Hardware Q Inter-face
Class 2? Tail Drop Queue 2

Queue 2 is now the


Round- lowest custom queue
Robin that is serviced by the
Scheduler round-robin
scheduler.

Class 16? Tail Drop Queue 16

© 2001, Cisco Systems, Inc. QOS v1.0—3-55


Custom Queuing
Scheduling Parameters

Router(config)#
queue-list list-number lowest-custom queue-number

• Set the lowest queue to be treated as the custom


queue.
• Queues below the specified queue are pre-emptive
priority queues (Q1 having the highest priority).
• Queue 0 is always treated as pre-emptive.
– System and link-level messages are classified in
Q0 by default.

© 2001, Cisco Systems, Inc. QOS v1.0—3-56


Custom Queuing
Example

E0

WAN Core

interface serial 1/0


E1 custom-queue-list 5 Core
Branch !
queue-list 5 protocol ip 1 list 101
Office
queue-list 5 queue 1 limit 40
queue-list 5 lowest-custom 2
queue-list 5 interface ethernet 0/0 2
queue-list 5 queue 2 byte-count 3000
queue-list 5 protocol ip 3
queue-list 5 queue 3 byte-count 5000
queue-list 5 default 4
!
access-list 101 permit ip any any precedence 5

© 2001, Cisco Systems, Inc. QOS v1.0—3-57


Custom Queuing–show interface

Router#show interface serial 1/0


Serial1/0 is up, line protocol is up
Hardware is M4T
Internet address is 20.0.0.1/8
MTU 1500 bytes, BW 19 Kbit, DLY 20000 usec, rely 255/255, load 107/255
Encapsulation HDLC, crc 16, loopback not set
Keepalive set (10 sec)
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: custom-list 5
Output queues: (queue #: size/max/drops)
0: 0/20/0 1: 0/40/0 2: 0/20/0 3: 0/20/0 4: 0/20/0
5: 0/20/0 6: 0/20/0 7: 0/20/0 8: 0/20/0 9: 0/20/0
10: 0/20/0 11: 0/20/0 12: 0/20/0 13: 0/20/0 14: 0/20/0
15: 0/20/0 16: 0/20/0

… rest ignored ...

© 2001, Cisco Systems, Inc. QOS v1.0—3-58


show queueing custom

Router#show queueing custom


Current custom queue configuration:

List Queue Args


5 3 default
5 1 protocol ip list 101
5 2 interface Ethernet0/0
5 1 byte-count 3000 limit 40
5 2 byte-count 5000

• The show queueing custom command


displays only the nondefault parameters.

© 2001, Cisco Systems, Inc. QOS v1.0—3-59


Summary

Upon completing this lesson, you should


be able to:
• Describe custom queuing
• Describe the benefits and drawbacks of
custom queuing
• Configure custom queuing on Cisco routers
• Monitor and troubleshoot custom queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-60


Lesson Review

1. When would you use custom queuing?


2. What are the benefits and drawbacks of
custom queuing?
3. How many classes does custom queuing
support?
4. How does custom queuing schedule
packets?

© 2001, Cisco Systems, Inc. QOS v1.0—3-61


Weighted Fair Queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-62


Objectives

Upon completing of this lesson, you will


be able to:
• Describe WFQ
• Describe the benefits and drawbacks of WFQ
• Configure WFQ on Cisco routers
• Monitor and troubleshoot WFQ

© 2001, Cisco Systems, Inc. QOS v1.0—3-63


Weighted Fair Queuing

• Queuing algorithm should fairly share the


bandwidth among flows by:
– Reducing response time for interactive flows
by scheduling them to the front of the queue
– Preventing high volume conversations from
monopolizing an interface
• Implementation: Messages are sorted into
conversations (flows) and transmitted by the
order of the last bit crossing the flow channel.
• Unfairness is reinstated by introducing “weight”
(IP Precedence) to give proportionately more
bandwidth to flows with higher weight.
© 2001, Cisco Systems, Inc. QOS v1.0—3-64
Weighted Fair Queuing (cont.)

Forwarded Packets

Weighted Fair Queuing System

Flow 1? WFQ drop Queue 1

Hardware
Flow 2? WFQ drop Queue 2 Queuing System
WFQ
Scheduler Hardware Q Interface

Flow N? WFQ drop Queue N

• WFQ uses per-flow FIFO queues.

© 2001, Cisco Systems, Inc. QOS v1.0—3-65


Weighted Fair Queuing
Implementations

• Implementation parameters:
– Queuing platform: central CPU or VIP
– Classification mechanism
– Weighted fairness
• Modified tail drop within each queue

© 2001, Cisco Systems, Inc. QOS v1.0—3-66


WFQ Classification

IP TCP Payload WFQ classification uses these


parameters:
• Source IP address
• Destination IP address
• Source TCP or UDP port
Src. Dest. Protocol ToS Src. Dest. • Destination TCP or UDP
Addr. Addr. Port Port port
• Transport protocol
• Type of service (ToS) field

A hash algorithm is used to


Hash Algorithm produce the index of the
queue where the packet is
enqueued.

#queue (index of the queue)


• Packets of the same flow end up in the same queue.
• The ToS field is the only parameter that might change, causing
packets of the same flow to end up in different queues.
© 2001, Cisco Systems, Inc. QOS v1.0—3-67
WFQ Classification
Details

• A fixed number of per-flow queues is configured.


• A hash function is used to translate flow
parameters into queue number.
• System packets (eight queues) and RSVP flows
(if configured) are mapped into separate queues.
• Two or more flows could map into the same
queue, resulting in lower per-flow bandwidth.
• Important: The number of queues configured
has to be larger than the expected number of
flows.

© 2001, Cisco Systems, Inc. QOS v1.0—3-68


WFQ Insertion and Drop Policy

• WFQ has two modes of dropping:


– Early dropping when the congestive
discard threshold (CDT) is reached
– Aggressive dropping when the hold-queue
out limit (HQO) is reached
• WFQ always drops packets of the most
aggressive flow.

© 2001, Cisco Systems, Inc. QOS v1.0—3-69


WFQ Insertion and Drop Policy
(cont.)

No No Enqueue
Nth Packet N>HQO? N>CDT?
Packet

Yes Yes

Worst Worst
Yes No
Finish Finish
Time? Time?

No Yes
Old
Drop the packet with
the worst finish time
(old) and enqueue the
Nth packet (new).

New

• HQO (hold-queue out limit) is the maximum. number of packets that the WFQ system can
hold.
• CDT (congestive discard threshold) is the threshold when WFQ starts dropping packets of
the most aggressive flow.
• N is the number of packets in the WFQ system when the Nth packet arrives.

© 2001, Cisco Systems, Inc. QOS v1.0—3-70


Case Study

• The WFQ system can hold a maximum of ten


packets (hold-queue limit).
• Early dropping (of aggressive flows) should
start when there are eight packets
(congestive discard threshold) in the WFQ
system.

© 2001, Cisco Systems, Inc. QOS v1.0—3-71


Case Study:
Interface Congestion

• Absolute maximum (HQO=10) exceeded; new


packet is the last in the TDM system and is
dropped

© 2001, Cisco Systems, Inc. QOS v1.0—3-72


Case Study:
Interface Congestion

• Absolute maximum exceeded (HQO=10); new


packet is not the last in the TDM system, so
last packet is dropped

© 2001, Cisco Systems, Inc. QOS v1.0—3-73


Case Study:
Flow Congestion

• CDT exceeded (CDT=8); new packet would be


the last in the TDM system and is dropped

© 2001, Cisco Systems, Inc. QOS v1.0—3-74


Case Study:
Flow Congestion

• CDT exceeded (CDT=8); new packet would


not be the last, and packet is enqueued

© 2001, Cisco Systems, Inc. QOS v1.0—3-75


Drop Mechanism Within WFQ:
Exception

• Exception: A packet classified into an empty


subqueue is never dropped.
• The packet precedence has no effect on the
dropping scheme.

© 2001, Cisco Systems, Inc. QOS v1.0—3-76


WFQ Scheduling

• Each packet is tagged with its finish time in a


virtual TDM system.
• The scheduler selects the packets with the
earliest finish time tag (thus, the packet that
leaves the virtual TDM the earliest).

Reference: “On the Efficient Implementation of Fair Queuing,"


Keshav, Berkeley, 1994

© 2001, Cisco Systems, Inc. QOS v1.0—3-77


Fair Queuing
Finish Time Calculation
If Flow F active,
then FT(Pk+1) = FT(Pk) + Size(Pk+1)
otherwise FT(P0) = Now + Size(P0)
FT(A1)=0+100

FT(B1)=50+300 A1[100]
B1[300]

FT(A2)=100+20 A2[20]
FT(B2)=350+300 FT(A3)=120+10 A3[10]
B2[300]

T
100 70 60 50 0

Thus the resulting scheduling is:

B2 B1 A3 A2 A1
© 2001, Cisco Systems, Inc. QOS v1.0—3-78
Weight in WFQ Scheduling

WFQ System (Real-Size Packets)


Flow with P=001 2 1

Flow with P=000 3 2 1

Virtual Packet Size = Real Packet Size / (IP Precedence + 1) Precedence-1


packets appear
half the real size.

WFQ System (Virtual-Size Packets)


Flow with P=001 4 3 2 1
Precedence-1 flow
gets twice as much
Flow with P=000 3 2 1 bandwidth as
Precedence-0 flow.

Hardware FIFO Queue


3 3 2 2 1 1

© 2001, Cisco Systems, Inc. QOS v1.0—3-79


Weighted Fair Queuing
Finish Time Calculation

The finish time is adjusted based on the IP precedence of the packet.


If Flow F Active,
Then FT(Pk+1) = FT(Pk) + Size(Pk+1)/(IPPrec+1)
Otherwise FT(P0) = Now + Size(P0)/(IPPrec+1)

IOS implementation scales the finish time to allow integer


arithmetic.
If Flow F active,
then FT(Pk+1) = FT(Pk) + Size(Pk+1)*4096/(IPPrec+1)
otherwise FT(P0) = Now + Size(P0)*4096/(IPPrec+1)
RSVP packets and high-priority internal packets (PAK-Priority)
have special weights (4 and 128).

© 2001, Cisco Systems, Inc. QOS v1.0—3-80


IP Precedence to Weight
Mapping

IP Precedence Weight
0 4096
1 2048
2 1365
3 1024
4 819
5 682
6 585
7 512
32 (virtual IP Precedence) 128 (PAK-Priority)
1024 (virtual IP Precedence) 4 (RSVP)

• RSVP packets and high-priority internal packets (PAK-Priority) have


special weights (4 and 128).
• Lower weight makes packets appear smaller (preferred).

© 2001, Cisco Systems, Inc. QOS v1.0—3-81


Weighted Fair Queuing
Voice and Data Integration

• WAN link speed 128 kbps


• Voice requirements 30 kbps
• VoIP is Precedence 5 (counts as 6 data
sessions)
• 1 VoIP session, 5 data sessions
– Voice gets up to 6/(6+5)*128 = 69 kbps (enough)
• 1 VoIP session, 20 data sessions
– Voice gets up to 6/(6+20)*128 = 29 kbps (problem)

© 2001, Cisco Systems, Inc. QOS v1.0—3-82


Benefits and Drawbacks of
Weighted Fair Queuing
+ Benefits
• Simple configuration (classification does not have to be configured)
• Guarantees throughput to all flows
• Drops packets of most aggressive flows
• Supported on most platforms
• Supported in all IOS versions (above 11.0)
– Drawbacks
• All drawbacks of FIFO queuing within a single queue
• Multiple flows can end up in one queue
• Does not support the configuration of classification
• Can not provide fixed bandwidth guarantees
• Performance limitations due to complex classification and scheduling
mechanisms

© 2001, Cisco Systems, Inc. QOS v1.0—3-83


Weighted Fair Queuing
Configuration

Router(config-intf)#
fair-queue [cdt [dynamic-queues [reservable-queues]]]

• Congestive discard threshold (CDT)


– Number of messages allowed in the WFQ
system before the router starts dropping
new packets for the longest queue
– Value can range from 1 to 4096 (default is
64)

© 2001, Cisco Systems, Inc. QOS v1.0—3-84


Weighted Fair Queuing
Configuration (cont.)

Router(config-intf)#
fair-queue [cdt [dynamic-queues [reservable-queues]]]

• dynamic-queues
– Number of dynamic queues used for best-effort
conversations (values are: 16, 32, 64, 128, 256,
512, 1024, 2048, and 4096–the default is 256)
• reservable-queues
– Number of reservable queues used for reserved
conversations in the range 0 to 1000 (used for
interfaces configured for features such as RSVP -
the default is 0)

© 2001, Cisco Systems, Inc. QOS v1.0—3-85


Weighted Fair Queuing
Additional Parameters

Router(config-if)#
hold-queue max-limit out

• Specifies the maximum number of packets that can


be in all output queues on the interface at any time
• The default value for WFQ is 1000
• Under special circumstances WFQ can consume a
lot of buffers, which may require lowering this limit

© 2001, Cisco Systems, Inc. QOS v1.0—3-86


Fair Queuing Defaults

• Fair queuing is enabled by default on:


– Physical interfaces whose bandwidth is less than
or equal to 2.048 Mbps
– Interfaces configured for Multilink PPP
• Fair queuing is disabled:
– If you enable the autonomous or silicon switching
engine mechanisms
– For any sequenced encapsulation: X.25, SDLC,
LAPB, reliable PPP

© 2001, Cisco Systems, Inc. QOS v1.0—3-87


Monitoring and Troubleshooting
WFQ
Router#
show interface interface

• Displays interface delays, including the activated


queuing mechanism with the summary information

Router#
show queue interface

• Displays detailed information about the WFQ system


of the selected interface

© 2001, Cisco Systems, Inc. QOS v1.0—3-88


show interface

Router#show interface serial 1/0


Hardware is M4T
Internet address is 20.0.0.1/8
MTU 1500 bytes, BW 19 Kbit, DLY 20000 usec, rely 255/255, load 147/255
Encapsulation HDLC, crc 16, loopback not set
Keepalive set (10 sec)
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/4/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 18000 bits/sec, 8 packets/sec
5 minute output rate 11000 bits/sec, 9 packets/sec

… rest deleted ...

© 2001, Cisco Systems, Inc. QOS v1.0—3-89


show queue

Router#show queue serial 1/0


Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 2/1000/64/0 (size/max total/threshold/drops)
Conversations 2/4/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)

(depth/weight/discards/tail drops/interleaves) 1/4096/0/0/0


Conversation 124, linktype: ip, length: 580
source: 193.77.3.244, destination: 20.0.0.2, id: 0x0166, ttl: 254,
TOS: 0 prot: 6, source port 23, destination port 11033

(depth/weight/discards/tail drops/interleaves) 1/4096/0/0/0


Conversation 127, linktype: ip, length: 585
source: 193.77.4.111 destination: 40.0.0.2, id: 0x020D, ttl: 252,
TOS: 0 prot: 6, source port 23, destination port 11013

© 2001, Cisco Systems, Inc. QOS v1.0—3-90


Queuing Comparison

Weighted Fair Queuing Priority Queuing Custom Queuing

No queue lists 4 queues 16 queues

Low-volume traffic High-priority queue Round-robin service


given priority serviced first
Conversation Packet-by-packet Threshold dispatching
dispatching dispatching
Interactive traffic Critical traffic gets Proportional allocation
gets priority through of bandwidth
Works well on speeds Designed for Designed for
up to 2 Mbps low-bandwidth links medium-speed links
Enabled by default Must configure Must configure

© 2001, Cisco Systems, Inc. QOS v1.0—3-91


Summary

Upon completing this lesson, you


should be able to:
• Describe WFQ
• Describe the benefits and drawbacks of
WFQ
• Configure WFQ on Cisco routers
• Monitor and troubleshoot WFQ

© 2001, Cisco Systems, Inc. QOS v1.0—3-92


Lesson Review

1. How does WFQ classify packets?


2. When does WFQ drop packets?
3. How does WFQ schedule packets?

© 2001, Cisco Systems, Inc. QOS v1.0—3-93


Distributed Weighted
Fair Queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-94


Objectives

Upon completing this lesson, you will be


able to:
• Describe and configure DWFQ
• Describe and configure ToS-based DWFQ
• Describe and configure QoS-group-based
DWFQ
• Monitor and troubleshoot DWFQ

© 2001, Cisco Systems, Inc. QOS v1.0—3-95


Distributed WFQ

• The term “distributed” is used primarily for


features available on Versatile Interface
Processors (VIPs) on Cisco 7x00 routers.
• Cisco IOS supports four versions of DWFQ:
– Flow-based DWFQ
– ToS-based DWFQ
– QoS-group-based DWFQ
– Distributed class-based WFQ
• This lesson focuses on the first three
versions of DWFQ.

© 2001, Cisco Systems, Inc. QOS v1.0—3-96


Flow-Based DWFQ

Forwarded Packets

Flow-based dWFQ System

Flow 1? WFQ drop Queue 1

Hardware
Flow 2? WFQ drop Queue 2 Queuing System
WFQ
Scheduler Hardware Q Interface

Flow N? WFQ drop Queue N

• Flow-based DWFQ looks the same as RSP/low-end


WFQ, but ...
© 2001, Cisco Systems, Inc. QOS v1.0—3-97
Flow-Based DWFQ Classification

IP TCP Payload
WFQ classification uses these
parameters:
• Source IP address
• Destination IP address
• Source TCP or UDP port
Src. Dest. Protocol Src. Dest. • Destination TCP or UDP
Addr. Addr. Port Port port
• Transport protocol

A hash algorithm is used to


Hash Algorithm produce the index of the
queue where the packet is
enqueued.

#queue (9-bit index of the queue)

• The number of queues is 512 (not tunable).


• ToS is not used for classification (except in IOS version 11.1CC).

© 2001, Cisco Systems, Inc. QOS v1.0—3-98


DWFQ Insertion and Drop Policy

• DWFQ drops packets when both the individual


queue limit and aggregate queue limit are
reached.
• DWFQ is not as strict with aggressive flows as
nondistributed WFQ.
• This insertion and drop policy is the same for
all three versions of DWFQ
(flow-based, ToS-based, and QoS-group-
based).

© 2001, Cisco Systems, Inc. QOS v1.0—3-99


DWFQ Insertion and Drop Policy
(cont.)

No No Enqueue
Nth packet M>QL? N>AQL?
packet

Yes Yes

No
M>IQL?

Yes

• QL (queue limit) is the maximum number of packets the selected queue can hold.
• AQL (aggregate queue limit) is the maximum number of packets that the DWFQ system
can hold.
• IQL (individual queue limit) is the maximum number of packets that an individual queue of
a congested DWFQ system can hold.
• N is the number of packets in the DWFQ system when the Nth packet arrives.
• M is the number of packets in the queue into which the packet is classified.

© 2001, Cisco Systems, Inc. QOS v1.0—3-100


Flow-Based DWFQ Scheduling

Flow-Based DWFQ System Packets are scheduled


(ordered) in advance for
faster transfer to the
Queue 1
hardware queue.

Hardware
Queue 2 Queuing System
DWFQ
Scheduler
(Calendar Calendar Queue Hardware Q Interface
Queuing)

Queue N

• Uses calendar queuing (optimized version of scheduling based


on finish time; more jitter)
• Weight (IP Precedence) is not used for scheduling purposes
(pure fair queuing)
© 2001, Cisco Systems, Inc. QOS v1.0—3-101
Configuring Flow-Based DWFQ

Router(config-if)#
fair-queue

• The command enables DWFQ on an interface


connected to a VIP2-40 or newer interface processor.
• For all other interfaces, this command enables RSP-
based WFQ.
• DWFQ can be configured on interfaces but not on
subinterfaces.
• DWFQ is not supported on Fast EtherChannel,
tunnel, or other logical or virtual interfaces (MPPP).

© 2001, Cisco Systems, Inc. QOS v1.0—3-102


Configuring Flow-Based DWFQ
(cont.)
Router(config)#
fair-queue aggregate-limit aggregate-packets

• The total number of packets in all output queues


before some packets may be dropped
Router(config)#
fair-queue individual-limit individual-packets

• The maximum individual per-flow queue size during


periods of congestion
• Defaults: Aggregate limit depends on the
transmission rate and the available buffer space on
the VIP; individual limit is half of the aggregate limit
• Don’t change the defaults unless necessary
© 2001, Cisco Systems, Inc. QOS v1.0—3-103
Flow-Based DWFQ
Example

interface FastEthernet 1/1/0


ip address 80.0.2.70 255.255.255.0
fair-queue
fair-queue aggregate-limit 200
fair-queue individual-limit 30
!

• DWFQ on a Fast Ethernet interface


• DWFQ system should not contain more than 200 packets
• No queue should accept new packets when the DWFQ
system is congested and the queue is longer than 30
packets

© 2001, Cisco Systems, Inc. QOS v1.0—3-104


show interface

Router#show interfaces FastEthernet1/1/0


FastEthernet1/1/0 is up, line protocol is up
Hardware is cyBus FastEthernet Interface, address is 0007.f618.4448
Description: pkt input i/f for WRL tests (to pagent)
Internet address is 80.0.2.70/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, rely 255/255, load 1/255
Encapsulation ARPA, loopback not set, keepalive not set, 100BaseTX/FX
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output 01:11:01, output hang never
Last clearing of "show interface" counters 01:12:31
Queueing strategy: VIP-based fair queuing
Output queue 0/40, 0 drops; input queue 0/75, 0 drops
30 second input rate 0 bits/sec, 0 packets/sec
30 second output rate 0 bits/sec, 0 packets/sec

… rest deleted ...

© 2001, Cisco Systems, Inc. QOS v1.0—3-105


show interface fair-queue

Router#show interface fastethernet 1/1/0 fair


FastEthernet 1/1/0 queue size 0
pkts output 0, wfq drops 0, nobuffer drops 0
WFQ: aggregate queue limit 200 individual queue limit 30
max available buffers 0

• Displays DWFQ statistics

© 2001, Cisco Systems, Inc. QOS v1.0—3-106


Benefits and Drawbacks of Flow-
Based DWFQ

+ Benefits
• Automatic classification
• High performance
– Drawbacks
• Does not support the configuration of classification
• Does not use IP Precedence as weight
• Only supported on Cisco 7x00 series routers with
VIP2-40 or newer

© 2001, Cisco Systems, Inc. QOS v1.0—3-107


ToS-Based DWFQ

Forwarded Packets

ToS-based dWFQ System

Class 1? WFQ drop Queue 1

Hardware
Class 2? WFQ drop Queue 2 Queuing System
DWFQ
Scheduler Hardware Q Interface

Class 3? WFQ drop Queue 3

Class 4? WFQ drop Queue 4

• ToS-based DWFQ has four classes


© 2001, Cisco Systems, Inc. QOS v1.0—3-108
ToS-based dWFQ Classification

IP Payload
ToS-based dWFQ
IP Classification uses the two
Prec. low-order IP precedence bits
to classify packets
XXX 00000
IP precedence
Queue 1 0 and 4
#queue
(2-bit index of Queue 2 1 and 5
the queue)
Queue 3 2 and 6
Queue 4 3 and 7

• The number of queues is 4 (fixed)


• Classification is based on the two low-order IP
precedence bits
© 2001, Cisco Systems, Inc. QOS v1.0—3-109
ToS-Based DWFQ Scheduling

• One weight per class configured as a


percentage
– Sum of all weights must be =< 99
– Some bandwidth needed for Class 0
• Tail drop within each queue
• First release: 11.1cc, 12.0

© 2001, Cisco Systems, Inc. QOS v1.0—3-110


Configuring ToS-Based DWFQ

Router(config-intf)#
fair-queue tos

• Enables ToS-based distributed WFQ

Router(config-intf)#
fair-queue tos num weight weight

tos number - two low-order precedence bits (only Classes 1, 2, and 3 can be
configured with weight; Class 0 takes the remaining bandwidth)
weight - percentage of the output link bandwidth allocated to this class
(the sum for all classes cannot exceed 99)
Defaults:
unclassified traffic is assigned to Class 0
Class 1 - 20, Class 2 - 30, Class 3 - 40
Class 0 has the remaining weight (100%-W1-W2-W3); default 10

© 2001, Cisco Systems, Inc. QOS v1.0—3-111


Configuring ToS-Based DWFQ
(cont.)
Router(config-if)#
fair-queue tos num limit class-packets
• Configures maximum number of packets allowed in the selected queue
• If not configured, the default is individual limit
• If queue limit is not configured, it is set to the number of available buffers
multiplied by weight
Router(config-if)#
fair-queue individual-limit individual-packet

• If individual limit is not configured, it is set to one-quarter of the


number of available buffers
Router(config-if)#
fair-queue aggregate-limit aggregate-packets
• If aggregate limit is not configured, it is set to the number of
available buffers

© 2001, Cisco Systems, Inc. QOS v1.0—3-112


ToS-Based DWFQ
Configuration Example

interface Hssi0/0/0
ip address 188.1.3.70 255.255.255.0
fair-queue tos
fair-queue tos 1 weight 20
fair-queue tos 1 limit 27
fair-queue tos 2 weight 30
fair-queue tos 2 limit 27
fair-queue tos 3 weight 40
fair-queue tos 3 limit 27
!

© 2001, Cisco Systems, Inc. QOS v1.0—3-113


show interface fair-queue

Router#show interfaces fair-queue


Hssi0/0/0 queue size 0
pkts output 947, wfq drops 0, nobuffer drops 0
WFQ: aggregate queue limit 386 individual queue limit 96
max available buffers 386

Class 0: weight 10 limit 20 qsize 0 pkts output 947 drops 0


Class 1: weight 20 limit 27 qsize 0 pkts output 0 drops 0
Class 2: weight 30 limit 27 qsize 0 pkts output 0 drops 0
Class 3: weight 40 limit 27 qsize 0 pkts output 0 drops 0

© 2001, Cisco Systems, Inc. QOS v1.0—3-114


Benefits and Drawbacks of ToS-
Based DWFQ
+ Benefits
• Automatic classification
• Guarantees throughput to all classes
• High performance
– Drawbacks
• All drawbacks of FIFO queuing within a single class
• Does not support the configuration of classification
• Only four classes are supported
• Unusual interpretation of IP Precedence (high-priority packets
with IP Precedence 6 and 7 share queues with lower-priority
packets with IP Precedence 2 and 3)
• Only supported on Cisco 7x00 Series routers with VIP2-40 or
newer
© 2001, Cisco Systems, Inc. QOS v1.0—3-115
QoS-Group-Based DWFQ

Forwarded Packets

QoS-Group-Based DWFQ System

Class 1? WFQ drop Queue 1

Hardware
Class 2? WFQ drop Queue 2 Queuing System
DWFQ
Scheduler Hardware Q Interface

Class 100? WFQ drop Queue 100

• QoS-group-based DWFQ supports 100 classes.

© 2001, Cisco Systems, Inc. QOS v1.0—3-116


QoS-Group-Based DWFQ
Classification

Packet Buffer Frame IP


Payload
Buffer Header Header Header

QoS
Group

• The number of queues is 100.


• Classification is based on the QoS group parameter.
• The parameter is local to the router, and it has to be set by
some other QoS mechanism:
– Policy-based routing (PBR)
– Committed access rate (CAR)
– QoS Policy Propagation on BGP (QPPB)
– Class-based marking
– Class-based policing
© 2001, Cisco Systems, Inc. QOS v1.0—3-117
QoS-Group-Based DWFQ
Scheduling

• Scheduling is identical to that of ToS-based


DWFQ
• One weight per class configured as a
percentage
– Sum of all weights must be =< 99
– Some bandwidth needed for Class 0
• Tail drop within each queue

© 2001, Cisco Systems, Inc. QOS v1.0—3-118


Configuring QoS-Group-Based
DWFQ

Router(config-intf)#
fair-queue qos-group

• Enables ToS-based distributed WFQ

Router(config-intf)#
fair-queue qos-group num weight weight

qos-group number - Classes 1 through 99 can be configured with weight;


Class 0 takes the remaining bandwidth
weight - percentage of the output link bandwidth allocated to this Class (the
sum for all Classes cannot exceed 99)
Defaults:
unclassified traffic is assigned to class 0
Class 1 - 20, Class 2 - 30, Class 3 - 40
Class 0 has the remaining weight (100%-W1-W2-W3); default 10
© 2001, Cisco Systems, Inc. QOS v1.0—3-119
Configuring QoS-Group-Based
DWFQ (cont.)
Router(config-intf)#
fair-queue qos-group num limit class-packets

• Configures individual queue depth


– Class packets–maximum number of packets allowed in the
queue for the class during periods of congestion
• If not configured, the default is individual limit,
which is half of the aggregate queue limit
Router(config-intf)#
fair-queue aggregate-limit aggregate-packets
fair-queue individual-limit individual-packet

© 2001, Cisco Systems, Inc. QOS v1.0—3-120


QoS-Group-Based DWFQ
Example

• QoS-group-based dWFQ can be used to


implement mapping of different parameters
into the QoS group:
– Assume another mechanism has been configured
to translate QoS class information into the QoS
group (e.g., QPPB).
– Use QoS-group-based DWFQ output queuing.
• Example:
– allocate 10% to class 1 traffic.
– allocate 30% to class 2 traffic.
– allocate 60% to other traffic.

© 2001, Cisco Systems, Inc. QOS v1.0—3-121


QoS-Group Based DWFQ
Configuration Example

interface FastEthernet1/0/0
bgp-policy destination ip-qos-map
!
...
!
interface Hssi0/0/0
ip address 188.1.3.70 255.255.255.0
bgp-policy destination ip-prec-map
fair-queue qos-group
fair-queue aggregate-limit 60
fair-queue qos-group 1 weight 10
fair-queue qos-group 2 weight 30
fair-queue qos-group 2 limit 27
!

© 2001, Cisco Systems, Inc. QOS v1.0—3-122


Monitoring QoS-Group-Based
DWFQ

Router#show interfaces fair-queue


Hssi0/0/0 queue size 0
pkts output 4, wfq drops 0, nobuffer drops 0
WFQ: aggregate queue limit 60 individual queue limit 96
max available buffers 386

Class 0: weight 60 limit 231 qsize 0 pkts output 4 drops 0


Class 1: weight 10 limit 38 qsize 0 pkts output 0 drops 0
Class 2: weight 30 limit 27 qsize 0 pkts output 0 drops 0

© 2001, Cisco Systems, Inc. QOS v1.0—3-123


Benefits and Drawbacks of QoS-
Group-Based DWFQ

+ Benefits
• Guarantees throughput to all classes
• A large number of classes (100)
• High performance
– Drawbacks
• All drawbacks of FIFO queuing within a single class
• Requires other QoS mechanisms to set QoS group
• Only supported on Cisco 7x00 Series routers with
VIP2-40 or newer

© 2001, Cisco Systems, Inc. QOS v1.0—3-124


DWFQ Summary

Classification Classes Weighted Implementation


Fairness

WFQ Per-flow 16 to 4096 Yes (IP RSP/low-end


Precedence)

DWFQ Per-flow 512 No VIP

IP
ToS DWFQ Precedence 4 Manual VIP

QoS DWFQ QoS group 100 Manual VIP

CBWFQ* Manual 64 Manual RSP/low-


end/VIP

* Class-based WFQ is covered in the module “Modular QoS CLI Service Policy”

© 2001, Cisco Systems, Inc. QOS v1.0—3-125


Summary

Upon completing this lesson, you should


be able to:
• Describe and configure DWFQ.
• Describe and configure ToS-based DWFQ
• Describe and configure QoS-group-based
DWFQ
• Monitor and troubleshoot DWFQ

© 2001, Cisco Systems, Inc. QOS v1.0—3-126


Lesson Review

1. What are the different DWFQ mechanisms?


2. What are the main differences between the
different versions of DWFQ?
3. What platforms support DWFQ?

© 2001, Cisco Systems, Inc. QOS v1.0—3-127


Modified Deficit
Round Robin

© 2001, Cisco Systems, Inc. QOS v1.0—3-128


Objectives

Upon completing this lesson, you will be


able to:
• Describe MDRR queuing
• Describe the benefits and drawbacks of
MDRR queuing
• Configure MDRR queuing on Cisco GSR
routers
• Monitor and troubleshoot MDRR

© 2001, Cisco Systems, Inc. QOS v1.0—3-129


Modified Deficit Round Robin

• Deficit round robin (DRR) is a class-based


queuing mechanism available on Cisco
GSRs.
• MDRR supports eight classes.
• Low-latency queuing is introduced in the
MDRR.

© 2001, Cisco Systems, Inc. QOS v1.0—3-130


MDRR Architecture
Forwarded
Packets

Modified Deficit Round Robin

Tail-drop
Class 1? VOQ 1
WRED

Hardware
Tail-drop
Class 2? VOQ 2 Queuing System
WRED
or
MDRR
Crossbar
Scheduler
Switching Fabric

Tail-drop
Class 8? VOQ 8
WRED

• MDRR supports eight classes (8 round robin queues; one can be high-
priority).
• MDRR is implemented on the receive side (in front of the crossbar
switching fabric) and on the transmit side (in front of an interface).
© 2001, Cisco Systems, Inc. QOS v1.0—3-131
MDRR Features

• Deficit round robin (DRR) uses eight virtual output


queues (VOQs) to prevent head-of-line blocking.
• DRR can use weighted random early detection
(WRED) within each class to prevent congestion
within the class.
• Modified DRR (MDRR) can have one high-priority
queue for delay-sensitive traffic being serviced in
either of the two supported modes:
– Strict priority
– Alternate priority

© 2001, Cisco Systems, Inc. QOS v1.0—3-132


MDRR Classification

IP
Precedence
0

VOQ 0

IP
Precedence VOQ 1
1

VOQ 2

IP VOQ 7
Precedence
7

• MDRR supports classification of any IP Precedence into any of the


eight virtual output queues.
• One of the eight queues can be used as low-latency queue.

© 2001, Cisco Systems, Inc. QOS v1.0—3-133


MDRR Insertion and Drop Policy

Tail Drop
or Virtual Output Queue
WRED

• MDRR uses a traditional tail-drop scheme if a


queue is congested.
• MDRR can also use weighted random early
detection (WRED) to prevent congestion.

© 2001, Cisco Systems, Inc. QOS v1.0—3-134


DRR Scheduling

Each queue can transmit a configured


amount of bytes in one round:
MTU + (weight-1)*512
VOQ 0

Round
VOQ 1
Robin
Scheduler

VOQ 7

• Service policy for one queue in one round:


1. Add MTU+(Weight-1)*512 tokens to the token bucket.
2. Transmit packets until tokens are used up or the queue is empty.
3. Reset the token bucket to 0 if the queue is empty. Otherwise
remember the deficit (how much more tokens were used than
available).
4. Start serving the next queue.

© 2001, Cisco Systems, Inc. QOS v1.0—3-135


MDRR Scheduling with
Strict Priority Queue
Str The strict priority, low-latency queue
LL Queue ic t is not limited by the token bucket
Qu Prio mechanism.
eu r
ing ity
VOQ 0

Round-
VOQ 1
Robin
Scheduler

VOQ 7

• Service policy for MDRR with strict priority:


1. Transmit packets from the strict priority low-latency queue until the
queue is empty.
2. Serve the next-in-line round-robin queue.
3. Start serving the low-latency queue again.

© 2001, Cisco Systems, Inc. QOS v1.0—3-136


MDRR Scheduling with
Alternate Priority Queue
Alt The alternate priority queue is using
LL Queue e the token bucket to limit the amount
Pri rnate
Qu ority of bytes it can transmit in one round.
eu
VOQ 0 in g

Round-
VOQ 1
Robin
Scheduler

VOQ 7

• Service policy for MDRR with alternate priority:


1. Transmit packets from the alternate priority, low-latency queue until
the tokens are used up or the queue is empty.
2. Serve the next-in-line round-robin queue
3. Start serving the low-latency queue again.

© 2001, Cisco Systems, Inc. QOS v1.0—3-137


Benefits and Drawbacks of MDRR

+ Benefits
• Accurate bandwidth allocation (takes into account the deficit
from the previous round as opposed to custom queuing)
• Prevents head-of-line blocking in front of the crossbar
switching fabric
• Supports low-latency queuing (strict priority and alternate
priority)
• High performance
– Drawbacks
• Limited classification tools (only IP Precedence)
• Limited number of classes (only eight)
• Supported only on Cisco 12000 Series GSRs

© 2001, Cisco Systems, Inc. QOS v1.0—3-138


Configuring Interface MDRR

Router(config)#
cos-queue-group cos-queue-group-name

• Create a queue group template and enter CoS queue group


configuration mode.
Router(config-cos-que)#
precedence precedence queue {queue-number|low-latency}

• Map IP Precedence to a queue.

Router(config-cos-que)#
queue queue-number weight

• Set the weight of a queue.

© 2001, Cisco Systems, Inc. QOS v1.0—3-139


Configuring Interface MDRR
(cont.)

Router(config-cos-que)#
queue low-latency {alternate-priority weight|strict-priority}

• Specify the type of low-latency queue.

Router(config-if)#
tx-cos cos-queue-group-name

• Associate a CoS queue group name with the transmit queues


on an interface.

© 2001, Cisco Systems, Inc. QOS v1.0—3-140


Configuring Receive MDRR

Router(config)#
slot-table-cos slot-table-name

• Define a slot table name and enter slot table configuration


mode.
Router(config-slot-cos)#
destination slot {slot-number|all} cos-queue-group-name

• Define destination slot parameters for this slot table name.

Router(config)#
rx-cos-slot line-card-number cos-queue-group-name

• Link a slot-table-cos template to a line card.

© 2001, Cisco Systems, Inc. QOS v1.0—3-141


MDRR Example

interface POS3/0
ip address 1.0.0.1 255.0.0.0
tx-cos C4template
!
cos-queue-group C4template
precedence 0 queue 0
precedence 1 queue 1
precedence 2 queue 1
precedence 3 queue 2
precedence 4 queue 2
precedence 5 queue low-latency
precedence 6 queue 3
precedence 7 queue 3
queue 0 10
queue 1 20
queue 2 40
queue low-latency alternate-priority 80
exit
!

© 2001, Cisco Systems, Inc. QOS v1.0—3-142


Monitoring and Troubleshooting
MDRR
Router#
show cos statistics
• Display MDRR statistics
Router#show cos statistics
Slot 3
---------------
Dest slot 5
cos-queue-group: C7template
...
Queue Lengths

To Fabric Queues (DRR configured) C7template


Queue Average High Water Mark Weight
0 712.000 5562.000 10
1 702.000 7716.000 10
2 702.000 11540.000 10
3 753.000 14368.000 10
4 0.000 0.000 10
5 0.000 0.000 10
6 0.000 0.000 10
Low latency 0.000 0.000 10
...

© 2001, Cisco Systems, Inc. QOS v1.0—3-143


Summary

Upon completing this lesson, you should


be able to:
• Describe MDRR queuing
• Describe the benefits and drawbacks of
MDRR queuing
• Configure MDRR queuing on Cisco GSR
routers
• Monitor and troubleshoot MDRR

© 2001, Cisco Systems, Inc. QOS v1.0—3-144


Lesson Review

1. Describe the scheduling mechanism of


MDRR.
2. Which two types of low-latency queuing
does MDRR support?
3. What are the benefits and drawbacks of
MDRR?
4. Where can MDRR be applied?

© 2001, Cisco Systems, Inc. QOS v1.0—3-145


IP RTP Prioritization

© 2001, Cisco Systems, Inc. QOS v1.0—3-146


Objectives

Upon completing this lesson, you will


be able to:
• Describe IP RTP Prioritization
• Describe the benefits and drawbacks of IP
RTP Prioritization
• Configure IP RTP Prioritization on Cisco
routers
• Monitor and troubleshoot IP RTP
Prioritization

© 2001, Cisco Systems, Inc. QOS v1.0—3-147


IP RTP Prioritization

• IP RTP Prioritization provides low-latency


queuing when used in combination with WFQ
or CBWFQ.
• It can be used only for UDP traffic with
predictable port numbers.
• It is usually used for VoIP traffic.
• IP RTP Prioritization is limited to prevent
starvation of other traffic.

© 2001, Cisco Systems, Inc. QOS v1.0—3-148


IP RTP Prioritization (cont.)

Forwarded Packets

High
Priority?

Weighted Fair
Fair Queuing
Queuing System
System

Flow 1? WFQ drop Queue 1


Hardware
Queuing System

RTP
Flow 2? WFQ drop Queue 2 Hardware Q Interface
WFQ
Scheduler
Scheduler

Flow N? WFQ drop Queue N

• IP RTP prioritization adds one high-priority


queue to WFQ.
© 2001, Cisco Systems, Inc. QOS v1.0—3-149
IP RTP Priority Classification

Forwarded Packets
IP UDP Payload
UDP
Destination port

UDP port Yes


RTP Queue
In range?

No WFQ
Queuing
System

• IP RTP Prioritization classifies packets based


on the UDP Port number.
• Classification is specified by a range of UDP
port numbers.
© 2001, Cisco Systems, Inc. QOS v1.0—3-150
IP RTP Priority Insertion and Drop
Policy
Classified Packets

Packet
Token Yes
within RTP Queue
Bucket
contract?

No

• IP RTP Prioritization limits the amount of


high-priority traffic.
• Excess traffic is dropped.
© 2001, Cisco Systems, Inc. QOS v1.0—3-151
Benefits and Drawbacks of IP RTP
Prioritization

+ Benefits
• Adds low-latency queuing to WFQ and CB-
WFQ
• Prevents starvation of other traffic
– Drawbacks
• Poor classification options
• Obsoleted by class-based low-latency
queuing

© 2001, Cisco Systems, Inc. QOS v1.0—3-152


Configuring IP RTP Prioritization

Router(config-if)#
ip rtp priority starting-port port-range bandwidth

• Creates a separate priority queue for VoIP packets and specifies


maximum bandwidth available to voice traffic
• Maximum bandwidth shall always be slightly larger than the actually
required bandwidth due to jitter in the network and the Layer 2
overhead
• Only UDP packets with a destination port number in the configured
range are classified into this queue
Router(config-if)#
max-reserved-bandwidth percent

• Specifies the maximum bandwidth percentage that can be allocated


to class-based WFQ and priority RTP traffic
• The remaining bandwidth is available to flow-classified, best-effort
traffic and control packets
• Default: 75% of the interface bandwidth can be reserved

© 2001, Cisco Systems, Inc. QOS v1.0—3-153


IP RTP Prioritization
Example

interface Serial0/0
bandwidth 128
ip address 10.0.0.1 255.255.255.252
encapsulation ppp
fair-queue Up to 75% of configured bandwidth is
ip rtp priority 16384 16383 50 reservable.
!
BWavail = BW * 0.75 - BWRTP

Router#show queue serial0/0


Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 46 kilobits/sec
Router#

© 2001, Cisco Systems, Inc. QOS v1.0—3-154


Summary

Upon completing this lesson, you should


be able to:
• Describe IP RTP Prioritization
• Describe the benefits and drawbacks of IP
RTP Prioritization
• Configure IP RTP Prioritization on Cisco
routers
• Monitor and troubleshoot IP RTP
Prioritization

© 2001, Cisco Systems, Inc. QOS v1.0—3-155


Lesson Review

1. When would you use IP RTP Prioritization?


2. What are the drawbacks of IP RTP
Prioritization?
3. How many high-priority queues does IP RTP
Prioritization support?

© 2001, Cisco Systems, Inc. QOS v1.0—3-156


Module Summary

Upon completing this module, you should be able


to:
• Describe and configure FIFO queuing
• Describe and configure priority queuing (PQ)
• Describe and configure custom queuing (CQ)
• Describe and configure basic weighted fair queuing
(WFQ), distributed WFQ, ToS-based distributed WFQ,
and QoS-group-based distributed WFQ
• Describe and configure modified deficit round robin
(MDRR) queuing
• Describe and configure IP RTP Prioritization

© 2001, Cisco Systems, Inc. QOS v1.0—3-157


© 2001, Cisco Systems, Inc. Queuing Mechanisms-158

You might also like