© 2001, Cisco Systems, Inc. Queuing Mechanisms. © 2001, Cisco Systems, Inc. QOS v1.0—3-2...
-
Upload
rhoda-cameron -
Category
Documents
-
view
215 -
download
1
Transcript of © 2001, Cisco Systems, Inc. Queuing Mechanisms. © 2001, Cisco Systems, Inc. QOS v1.0—3-2...
© 2001, Cisco Systems, Inc.
Queuing Mechanisms
© 2001, Cisco Systems, Inc. QOS v1.0—3-2
ObjectivesObjectives
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
Queuing Overview
© 2001, Cisco Systems, Inc. QOS v1.0—3-3
© 2001, Cisco Systems, Inc. QOS v1.0—3-4
ObjectivesObjectives
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-5
Queuing in Cisco IOSQueuing 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-6
Output Interface Queue StructureOutput Interface Queue Structure
• 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.
HardwareQueue(TxQ)
HardwareQueue(TxQ)
SoftwareQueuingSystem
SoftwareQueuingSystem
OutputInterfaceForwarderForwarder
Any supported queuing mechanism
Always FIFO
© 2001, Cisco Systems, Inc. QOS v1.0—3-7
Bypassing the Software QueueBypassing the Software Queue
• 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
Software Queue Empty?
Software Queue Empty?
Hardware QueueFull?
Hardware QueueFull?
HardwareQueue(TxQ)
HardwareQueue(TxQ)
Yes No
SoftwareQueuingSystem
SoftwareQueuingSystem
YesNo
© 2001, Cisco Systems, Inc. QOS v1.0—3-8
Hardware Queue (TxQ) SizeHardware 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-9
Software Queuing SystemSoftware Queuing System
Hardware Queuing System
Hardware Queuing System
Queuing ComponentsQueuing Components
• 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)
Class 1?Class 1?
Class 2?Class 2?
Class n?Class n?
Queue 1Queue 1
Queue 2Queue 2
Queue nQueue n
SchedulerScheduler InterfaceInterface
Forwarded Packets
Hardware Q Hardware Q
Add/DropAdd/Drop
Add/DropAdd/Drop
Add/DropAdd/Drop
© 2001, Cisco Systems, Inc. QOS v1.0—3-10
SummarySummary
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-11
Lesson ReviewLesson 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?
FIFO Queuing
© 2001, Cisco Systems, Inc. QOS v1.0—3-12
© 2001, Cisco Systems, Inc. QOS v1.0—3-13
ObjectivesObjectives
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-14
FIFO QueuingFIFO Queuing
• The software FIFO queue is basically an extension of the hardware FIFO queue.
FIFO Queuing SystemFIFO Queuing System Hardware Queuing System
Hardware Queuing System
All in onequeue
All in onequeue Queue 1Queue 1 FIFO
SchedulerFIFO
Scheduler InterfaceInterface
Forwarded Packets
Hardware Q Hardware QTail-dropTail-drop
All packets are classified into one
class.
All packets are classified into one
class.
Newly arriving packets are dropped if the queue is full.Newly arriving packets are dropped if the queue is full.
FIFO uses one single queue.FIFO uses one single queue.
Routers serve packets in the first-come, first-serve fashion.Routers serve packets in the
first-come, first-serve fashion.
© 2001, Cisco Systems, Inc. QOS v1.0—3-15
Benefits and Drawbacks of FIFO Queuing
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-16
Configuring FIFO QueuingConfiguring FIFO Queuing
Router(config-if)#
• 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.
no fair-queueno fair-queue
© 2001, Cisco Systems, Inc. QOS v1.0—3-17
Configuring FIFO Queuing (cont.)Configuring FIFO Queuing (cont.)
Router(config-if)#
• 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).
hold-queue <buffers> outhold-queue <buffers> out
© 2001, Cisco Systems, Inc. QOS v1.0—3-18
FIFO ExampleFIFO Example
interface Ethernet0/0 ip address 1.1.1.1 255.0.0.0!interface Serial0/0 ip address 2.2.2.2 255.0.0.0 no fair-queue hold-queue 50 out!
interface Ethernet0/0 ip address 1.1.1.1 255.0.0.0!interface Serial0/0 ip address 2.2.2.2 255.0.0.0 no fair-queue hold-queue 50 out!
The serial interface (A/S) has a default bandwidth of 128 kbps.WFQ is the default queuing mechanism, and it has to be disabled to enable FIFO queuing.
The serial interface (A/S) has a default bandwidth of 128 kbps.WFQ is the default queuing mechanism, and it has to be disabled to enable FIFO queuing.
The Ethernet interface has a default bandwidth of 10Mbps.FIFO is the default queuing mechanism, and it does not need to be configured.
The Ethernet interface has a default bandwidth of 10Mbps.FIFO is the default queuing mechanism, and it does not need to be configured.
Up to 50 frames are allowed to be enqueued before the router will start tail-dropping newly arriving packets.
Up to 50 frames are allowed to be enqueued before the router will start tail-dropping newly arriving packets.
© 2001, Cisco Systems, Inc. QOS v1.0—3-19
Monitoring and Troubleshooting FIFO
Monitoring and Troubleshooting FIFO
Router#
• The command displays information about the selected interface(s).
Router#show interface Serial0/0Serial0/0 is up, line protocol is up Hardware is PowerQUICC Serial 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) Last input 00:00:02, output 00:00:04, output hang never Last clearing of "show interface" counters never 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 …
Router#show interface Serial0/0Serial0/0 is up, line protocol is up Hardware is PowerQUICC Serial 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) Last input 00:00:02, output 00:00:04, output hang never Last clearing of "show interface" counters never 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 …
The queue is currently empty (0/50). There can be a maximum of 50 frames in the queue (0/50).
FIFO queuing is enabled on an interface with a default bandwidth of 128kbps.
show interface [<interface>]show interface [<interface>]
© 2001, Cisco Systems, Inc. QOS v1.0—3-20
SummarySummary
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-21
Lesson ReviewLesson 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.
Priority QueuingPriority Queuing
QOS v1.0—3-22
© 2001, Cisco Systems, Inc. QOS v1.0—3-23
ObjectivesObjectives
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-24
Priority QueuingPriority Queuing
• Priority queuing (PQ) uses four FIFO queues.
Priority Queuing SystemPriority Queuing System
Hardware Queuing System
Hardware Queuing System
High?High? Queue 1Queue 1
Pre-emptiveScheduler
Pre-emptiveScheduler InterfaceInterface
Forwarded Packets
Hardware Q Hardware Q
Tail-dropTail-drop
Medium?Medium? Queue 2Queue 2Tail-dropTail-drop
Normal?Normal? Queue 3Queue 3Tail-dropTail-drop
Low?Low? Queue 4Queue 4Tail-dropTail-drop
© 2001, Cisco Systems, Inc. QOS v1.0—3-25
Priority QueuingClassification
Priority QueuingClassification
• 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-26
Priority QueuingClassification (cont.)
Priority QueuingClassification (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-27
Priority QueuingInsertion PolicyPriority QueuingInsertion 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-28
Scheduling Priority QueuingScheduling Priority Queuing
Packet in HIGH
queue?
Packet in HIGH
queue?
Packet in MEDIUM queue?
Packet in MEDIUM queue?
Packet in NORMAL queue?
Packet in NORMAL queue?
Packet in LOW
queue?
Packet in LOW
queue?
Hardware Q Hardware Q
Yes
Yes
Yes
Yes
No
No
No
No
Dispatch packetand start checking the
HIGH queue again
Dispatch packetand start checking the
HIGH queue again
© 2001, Cisco Systems, Inc. QOS v1.0—3-29
Benefits and Drawbacks of Priority Queuing
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-30
Configuring Priority QueuingConfiguring 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-31
Priority Queuing ClassificationPriority Queuing Classification
• 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
Router(config)#
priority-list list-number protocol protocol-name {high|medium|normal|low} queue-keyword keyword-value
priority-list list-number protocol protocol-name {high|medium|normal|low} queue-keyword keyword-value
© 2001, Cisco Systems, Inc. QOS v1.0—3-32
Priority Queuing Classification (cont.)
Router(config)#
Router(config)#
• Classifies all unclassified packets in a default queue
• Classifies the packet based on incoming interface
priority-list list-number interface intf {high|medium|normal|low}priority-list list-number interface intf {high|medium|normal|low}
priority-list list-number default {high|medium|normal|low}priority-list list-number default {high|medium|normal|low}
© 2001, Cisco Systems, Inc. QOS v1.0—3-33
Priority Queuing Scheduling and Dropping Parameters
Priority Queuing Scheduling and Dropping Parameters
Router(config)#
priority-list list-number queue-limit high medium normal lowpriority-list list-number queue-limit high medium normal low
• Specifies the maximum queue size of individual priority queues
• Assigns priority queuing definition to an interface
Router(config-if)#
priority-group listpriority-group list
© 2001, Cisco Systems, Inc. QOS v1.0—3-34
Core
WAN Core
BranchOffice
E0
E1
Sample PQ ConfigurationSample PQ Configuration
interface serial0 priority-group 1
priority-list 1 protocol ip high list 101priority-list 1 interface ethernet 0 mediumpriority-list 1 default normalpriority-list 1 queue-limit 20 40 60 80
access-list 101 permit tcp any any eq 23
interface serial0 priority-group 1
priority-list 1 protocol ip high list 101priority-list 1 interface ethernet 0 mediumpriority-list 1 default normalpriority-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-35
show interface interfaceshow interface interface
Router#
• Displays information and statistics about queuing on interface
Monitoring Priority QueuingMonitoring Priority Queuing
show queueing [priority|custom|fair|random-detect] interfaceshow queueing [priority|custom|fair|random-detect] interface
Router#
• Displays queuing parameters on interface
show queue interfaceshow queue interface
Router#
• Displays queue contents
© 2001, Cisco Systems, Inc. QOS v1.0—3-36
show interfaceshow interface
Router#show interface serial 1/0Serial1/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 93/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: priority-list 1 Output queue (queue priority: size/max/drops): high: 0/20/0, medium: 0/40/0, normal: 0/60/0, low: 0/80/0 5 minute input rate 18000 bits/sec, 8 packets/sec 5 minute output rate 7000 bits/sec, 8 packets/sec
… rest ignored ...
Router#show interface serial 1/0Serial1/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 93/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: priority-list 1 Output queue (queue priority: size/max/drops): high: 0/20/0, medium: 0/40/0, normal: 0/60/0, low: 0/80/0 5 minute input rate 18000 bits/sec, 8 packets/sec 5 minute output rate 7000 bits/sec, 8 packets/sec
… rest ignored ...
© 2001, Cisco Systems, Inc. QOS v1.0—3-37
show queueing priorityshow queueing priority
• The show queueing priority command displays only the nondefault parameters.
Router#show queueing priorityCurrent priority queue configuration:
List Queue Args1 high protocol ip list 1011 medium interface Ethernet6/0
Router#show queueing priorityCurrent priority queue configuration:
List Queue Args1 high protocol ip list 1011 medium interface Ethernet6/0
© 2001, Cisco Systems, Inc. QOS v1.0—3-38
SummarySummary
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-39
Lesson ReviewLesson 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.
Custom QueuingCustom Queuing
QOS v1.0—3-40
© 2001, Cisco Systems, Inc. QOS v1.0—3-41
ObjectivesObjectives
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-42
Custom QueuingCustom Queuing
• Custom queuing (CQ) uses 16 FIFO queues for user-defined traffic classes.
Custom Queuing SystemCustom Queuing System
Hardware Queuing System
Hardware Queuing System
Class 1?Class 1? Queue 1Queue 1
Round-Robin
Scheduler
Round-Robin
SchedulerInterfaceInterface
Forwarded Packets
Hardware Q Hardware Q
Tail DropTail Drop
Class 2?Class 2? Queue 2Queue 2Tail DropTail Drop
Class 16?Class 16? Queue 16Queue 16Tail DropTail Drop
© 2001, Cisco Systems, Inc. QOS v1.0—3-43
Custom QueuingClassification
Custom QueuingClassification
• 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-44
Custom QueuingInsertion Policy
Custom QueuingInsertion 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-45
Custom QueuingScheduling
Custom QueuingScheduling
• Custom queuing uses a round-robin service policy.
• Each queue is allowed to forward a configurable amount of bytes (threshold) in one round.
Packet in Queue N?Packet in Queue N?
Hardware Q Hardware Q
Yes
No
DispatchPacket
DispatchPacket
Is Queue N over the
threshold?
Is Queue N over the
threshold?
No
Next Queue(increase N)Next Queue(increase N)
Yes
© 2001, Cisco Systems, Inc. QOS v1.0—3-46
Custom Queuing Scheduling Parameters
Custom Queuing Scheduling Parameters
• 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.
150014991500
Threshold (byte-count) = 3000Threshold (byte-count) = 3000
Up to 4499 bytes can be forwarded in one round in the worst case.
Up to 4499 bytes can be forwarded in one round in the worst case.
© 2001, Cisco Systems, Inc. QOS v1.0—3-47
CQ Design GuidelineCQ 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-48
BW (Queue 1) = bc1/(bc1+bc2+bc3) = 4500/9000 = 50%Delay (Queue 1) = (bc2+bc3)/Bandwidth = 562msBW (Queue 1) = bc1/(bc1+bc2+bc3) = 4500/9000 = 50%Delay (Queue 1) = (bc2+bc3)/Bandwidth = 562ms
Delay vs. Bandwidth AllocationDelay vs. Bandwidth Allocation
4500
3000
1500
5999
4499
2999
Worst-case Delay (Queue 1) = [(bc2+1499) +(bc3+1499)]/Bandwidth = 937msWorst-case Delay (Queue 1) = [(bc2+1499) +(bc3+1499)]/Bandwidth = 937ms
Round-Robin
Scheduler
Round-Robin
Scheduler64 kbps 64 kbps
Queue 1
Queue 2
Queue 3
MTU=1500
© 2001, Cisco Systems, Inc. QOS v1.0—3-49
Worst-Case DelayWorst-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 msExpected 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-50
Benefits and Drawbacks of Custom Queuing
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-51
Custom Queuing ClassificationCustom Queuing Classification
queue-list list-number protocol protocol-name queue-number queue-keyword keyword-valuequeue-list list-number protocol protocol-name queue-number queue-keyword keyword-value
Router(config)#
• Classifies the packet into a custom queue based on protocol and other protocol-specific criteria
• Selection criteria identical to priority queuing
queue-list list-number interface incoming-intf queue-numberqueue-list list-number interface incoming-intf queue-number
Router(config)#
• Classifies the packet into a custom queue based on incoming interface
© 2001, Cisco Systems, Inc. QOS v1.0—3-52
Custom Queuing Classification (cont.)
Custom Queuing Classification (cont.)
queue-list list-number default queue-numberqueue-list list-number default queue-number
Router(config)#
• Classifies all unclassified packets into a default queue
custom-queue list-numbercustom-queue list-number
Router(config-if)#
• Starts custom queuing on an interface and assigns a specified CQ definition to the interface
© 2001, Cisco Systems, Inc. QOS v1.0—3-53
Custom Queuing Scheduling Parameters
Custom Queuing Scheduling Parameters
queue-list list queue queue-number byte-count bcqueue-list list queue queue-number byte-count bc
Router(config)#
• 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
queue-list list queue queue-number limit limitqueue-list list queue queue-number limit limit
Router(config)#
• 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-54
Custom Queuing with Pre-emptive Queues
Custom Queuing with Pre-emptive Queues
Custom Queuing SystemCustom Queuing System
Hardware Queuing System
Hardware Queuing System
Class 1?Class 1? Queue 1Queue 1
Round-Robin
Scheduler
Round-Robin
Scheduler
Inter-faceInter-face
Forwarded Packets
Hardware Q Hardware Q
Tail DropTail Drop
Class 2?Class 2? Queue 2Queue 2Tail DropTail Drop
Class 16?Class 16? Queue 16Queue 16Tail DropTail Drop
Class 0?Class 0? Queue 0Queue 0Tail DropTail Drop
Pre-emptiveScheduler
Pre-emptiveScheduler
Custom queuing has Queue 0 for system and link-level
messages that use pre-emptive scheduling.
Custom queuing has Queue 0 for system and link-level
messages that use pre-emptive scheduling.
Queue 1 is the lowest custom queue that is
serviced by the round-robin scheduler.
Queue 1 is the lowest custom queue that is
serviced by the round-robin scheduler.
© 2001, Cisco Systems, Inc. QOS v1.0—3-55
Custom Queuing with Pre-emptive Queues (cont.)
Custom Queuing with Pre-emptive Queues (cont.)
Custom Queuing SystemCustom Queuing System
Hardware Queuing System
Hardware Queuing System
Class 1?Class 1? Queue 1Queue 1
Round-Robin
Scheduler
Round-Robin
Scheduler
Inter-faceInter-face
Forwarded Packets
Hardware Q Hardware Q
Tail DropTail Drop
Class 2?Class 2? Queue 2Queue 2Tail DropTail Drop
Class 16?Class 16? Queue 16Queue 16Tail DropTail Drop
Custom queues can be configured to use the
pre-emptive scheduler.
Queue 2 is now the lowest custom queue that is serviced by the
round-robin scheduler.
Class 0?Class 0? Queue 0Queue 0Tail DropTail Drop
Pre-emptiveScheduler
Pre-emptiveScheduler
© 2001, Cisco Systems, Inc. QOS v1.0—3-56
Custom Queuing Scheduling Parameters
Custom Queuing Scheduling Parameters
• 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.
queue-list list-number lowest-custom queue-numberqueue-list list-number lowest-custom queue-number
Router(config)#
© 2001, Cisco Systems, Inc. QOS v1.0—3-57
Core
WAN Core
BranchOffice
E0
E1
Custom QueuingExample
Custom QueuingExample
interface serial 1/0 custom-queue-list 5!queue-list 5 protocol ip 1 list 101queue-list 5 queue 1 limit 40queue-list 5 lowest-custom 2queue-list 5 interface ethernet 0/0 2queue-list 5 queue 2 byte-count 3000queue-list 5 protocol ip 3queue-list 5 queue 3 byte-count 5000queue-list 5 default 4!access-list 101 permit ip any any precedence 5
interface serial 1/0 custom-queue-list 5!queue-list 5 protocol ip 1 list 101queue-list 5 queue 1 limit 40queue-list 5 lowest-custom 2queue-list 5 interface ethernet 0/0 2queue-list 5 queue 2 byte-count 3000queue-list 5 protocol ip 3queue-list 5 queue 3 byte-count 5000queue-list 5 default 4!access-list 101 permit ip any any precedence 5
© 2001, Cisco Systems, Inc. QOS v1.0—3-58
Custom Queuing–show interfaceCustom Queuing–show interface
Router#show interface serial 1/0Serial1/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 ...
Router#show interface serial 1/0Serial1/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-59
show queueing customshow queueing custom
Router#show queueing customCurrent custom queue configuration:
List Queue Args5 3 default5 1 protocol ip list 1015 2 interface Ethernet0/05 1 byte-count 3000 limit 405 2 byte-count 5000
Router#show queueing customCurrent custom queue configuration:
List Queue Args5 3 default5 1 protocol ip list 1015 2 interface Ethernet0/05 1 byte-count 3000 limit 405 2 byte-count 5000
• The show queueing custom command displays only the nondefault parameters.
© 2001, Cisco Systems, Inc. QOS v1.0—3-60
SummarySummary
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-61
Lesson ReviewLesson 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.
Weighted Fair QueuingWeighted Fair Queuing
QOS v1.0—3-62
© 2001, Cisco Systems, Inc. QOS v1.0—3-63
ObjectivesObjectives
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-64
Weighted Fair QueuingWeighted 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-65
Weighted Fair Queuing (cont.)Weighted Fair Queuing (cont.)
• WFQ uses per-flow FIFO queues.
Weighted Fair Queuing SystemWeighted Fair Queuing System
Hardware Queuing System
Hardware Queuing System
Flow 1?Flow 1? Queue 1Queue 1
WFQScheduler
WFQScheduler InterfaceInterface
Forwarded Packets
Hardware Q Hardware Q
Flow 2?Flow 2? Queue 2Queue 2
Flow N?Flow N? Queue NQueue N
WFQ dropWFQ drop
WFQ dropWFQ drop
WFQ dropWFQ drop
© 2001, Cisco Systems, Inc. QOS v1.0—3-66
Weighted Fair Queuing Implementations
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-67
WFQ ClassificationWFQ Classification
IP TCP PayloadIP TCP Payload
Src.Addr.
Dest.Addr.
Protocol ToS Src.Port
Dest.Port
Hash AlgorithmHash Algorithm
#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.
WFQ classification uses these parameters:
• Source IP address• Destination IP address• Source TCP or UDP port• Destination TCP or UDP
port• Transport protocol• Type of service (ToS) field
WFQ classification uses these parameters:
• Source IP address• Destination IP address• Source TCP or UDP port• Destination TCP or UDP
port• Transport protocol• Type of service (ToS) field
A hash algorithm is used to produce the index of the queue where the packet is enqueued.
A hash algorithm is used to produce the index of the queue where the packet is enqueued.
© 2001, Cisco Systems, Inc. QOS v1.0—3-68
WFQ ClassificationDetails
WFQ ClassificationDetails
• 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-69
WFQ Insertion and Drop PolicyWFQ 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-70
WFQ Insertion and Drop Policy (cont.)
WFQ Insertion and Drop Policy (cont.)
• 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.
N>CDT?N>CDT?N>HQO?N>HQO?
Worst Finish Time?
Worst Finish Time?
Worst Finish Time?
Worst Finish Time?
EnqueuePacket
EnqueuePacketNth PacketNth Packet
Drop the packet with the worst finish time
(old) and enqueue the Nth packet (new).
Drop the packet with the worst finish time
(old) and enqueue the Nth packet (new).
No No
Yes
Yes Yes
No
No
Yes
New
Old
© 2001, Cisco Systems, Inc. QOS v1.0—3-71
Case StudyCase 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-72
Case Study:Interface Congestion
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-73
Case Study:Interface Congestion
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-74
Case Study:Flow Congestion
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-75
Case Study:Flow Congestion
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-76
Drop Mechanism Within WFQ:Exception
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-77
WFQ SchedulingWFQ 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-78
FT(B2)=350+300
B2[300]
FT(A3)=120+10 A3[10]
FT(A2)=100+20 A2[20]
FT(B1)=50+300
B1[300]
A1[100]
FT(A1)=0+100
T100 70 60 50 0
B2 B1 A3 A2 A1
Thus the resulting scheduling is:
If Flow F active, If Flow F active, then FT(P then FT(Pk+1k+1) = FT(P) = FT(Pkk) + Size(P) + Size(Pk+1k+1) )
otherwise FT(P otherwise FT(P00) = Now + Size(P) = Now + Size(P00))
Fair QueuingFinish Time Calculation
Fair QueuingFinish Time Calculation
© 2001, Cisco Systems, Inc. QOS v1.0—3-79
Weight in WFQ SchedulingWeight in WFQ Scheduling
Flow with P=001
Flow with P=000
WFQ System (Real-Size Packets)
1
1
2
23
Flow with P=001
Flow with P=000
WFQ System (Virtual-Size Packets)
1
1
2
23
Precedence-1 packets appear
half the real size.
Hardware FIFO Queue123 12
34
3
Precedence-1 flow gets twice as much
bandwidth as Precedence-0 flow.
Virtual Packet Size = Real Packet Size / (IP Precedence + 1)
© 2001, Cisco Systems, Inc. QOS v1.0—3-80
If Flow F Active, If Flow F Active, Then FT(P Then FT(Pk+1k+1) = FT(P) = FT(Pkk) + Size(P) + Size(Pk+1k+1)/(IPPrec+1) )/(IPPrec+1)
Otherwise FT(P Otherwise FT(P00) = Now + Size(P) = Now + Size(P00)/(IPPrec+1))/(IPPrec+1)
Weighted Fair QueuingFinish Time CalculationWeighted Fair QueuingFinish Time Calculation
If Flow F active, If Flow F active, then FT(P then FT(Pk+1k+1) = FT(P) = FT(Pkk) + Size(P) + Size(Pk+1k+1)*4096/(IPPrec+1) )*4096/(IPPrec+1)
otherwise FT(P otherwise FT(P00) = Now + Size(P) = Now + Size(P00)*4096/(IPPrec+1))*4096/(IPPrec+1)
The finish time is adjusted based on the IP precedence of the packet.
IOS implementation scales the finish time to allow integerarithmetic.
RSVP packets and high-priority internal packets (PAK-Priority)have special weights (4 and 128).
© 2001, Cisco Systems, Inc. QOS v1.0—3-81
IP Precedence to WeightMapping
IP Precedence to WeightMapping
• RSVP packets and high-priority internal packets (PAK-Priority) have special weights (4 and 128).
• Lower weight makes packets appear smaller (preferred).
1024 (virtual IP Precedence)
32 (virtual IP Precedence)
7
6
5
4
3
2
1
0IP Precedence
4 (RSVP)
128 (PAK-Priority)
512
585
682
819
1024
1365
2048
4096Weight
© 2001, Cisco Systems, Inc. QOS v1.0—3-82
Weighted Fair QueuingVoice and Data Integration
Weighted Fair QueuingVoice 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-83
Benefits and Drawbacks of Weighted Fair Queuing
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-84
Weighted Fair Queuing Configuration
Weighted Fair Queuing Configuration
• 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)
fair-queue [cdt [dynamic-queues [reservable-queues]]]fair-queue [cdt [dynamic-queues [reservable-queues]]]
Router(config-intf)#
© 2001, Cisco Systems, Inc. QOS v1.0—3-85
Weighted Fair Queuing Configuration (cont.)
Weighted Fair Queuing Configuration (cont.)
• 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)
fair-queue [cdt [dynamic-queues [reservable-queues]]]fair-queue [cdt [dynamic-queues [reservable-queues]]]
Router(config-intf)#
© 2001, Cisco Systems, Inc. QOS v1.0—3-86
hold-queue max-limit outhold-queue max-limit out
Router(config-if)#
• 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
Weighted Fair QueuingAdditional ParametersWeighted Fair QueuingAdditional Parameters
© 2001, Cisco Systems, Inc. QOS v1.0—3-87
Fair Queuing Defaults 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-88
Monitoring and Troubleshooting WFQ
Monitoring and Troubleshooting WFQ
show interface interfaceshow interface interface
Router#
• Displays interface delays, including the activated queuing mechanism with the summary information
show queue interfaceshow queue interface
Router#
• Displays detailed information about the WFQ system of the selected interface
© 2001, Cisco Systems, Inc. QOS v1.0—3-89
show interfaceshow 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 ...
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-90
show queueshow 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
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-91
Queuing ComparisonQueuing Comparison
Weighted Fair Queuing Priority Queuing Custom Queuing
No queue lists
Low-volume traffic given priority
Conversation dispatching
Interactive trafficgets priority
Works well on speedsup to 2 Mbps
Enabled by default
4 queues
High-priority queue serviced first
Packet-by-packetdispatching
Critical traffic getsthrough
Designed forlow-bandwidth links
Must configure
16 queues
Round-robin service
Threshold dispatching
Proportional allocation of bandwidth
Designed for medium-speed links
Must configure
© 2001, Cisco Systems, Inc. QOS v1.0—3-92
SummarySummary
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-93
Lesson ReviewLesson Review
1. How does WFQ classify packets?
2. When does WFQ drop packets?
3. How does WFQ schedule packets?
© 2001, Cisco Systems, Inc.
Distributed Weighted Fair Queuing
Distributed Weighted Fair Queuing
QOS v1.0—3-94
© 2001, Cisco Systems, Inc. QOS v1.0—3-95
ObjectivesObjectives
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-96
Distributed WFQDistributed 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-97
Flow-Based DWFQFlow-Based DWFQ
• Flow-based DWFQ looks the same as RSP/low-end WFQ, but ...
Flow-based dWFQ SystemFlow-based dWFQ System
Hardware Queuing System
Hardware Queuing System
Flow 1?Flow 1? Queue 1Queue 1
WFQScheduler
WFQScheduler InterfaceInterface
Forwarded Packets
Hardware Q Hardware Q
Flow 2?Flow 2? Queue 2Queue 2
Flow N?Flow N? Queue NQueue N
WFQ dropWFQ drop
WFQ dropWFQ drop
WFQ dropWFQ drop
© 2001, Cisco Systems, Inc. QOS v1.0—3-98
Flow-Based DWFQ ClassificationFlow-Based DWFQ Classification
IP TCP PayloadIP TCP Payload
Src.Addr.
Dest.Addr.
Protocol Src.Port
Dest.Port
Hash AlgorithmHash Algorithm
#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).
WFQ classification uses these parameters:
• Source IP address• Destination IP address• Source TCP or UDP port• Destination TCP or UDP
port• Transport protocol
A hash algorithm is used to produce the index of the queue where the packet is enqueued.
© 2001, Cisco Systems, Inc. QOS v1.0—3-99
DWFQ Insertion and Drop PolicyDWFQ 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-100
DWFQ Insertion and Drop Policy (cont.)
DWFQ Insertion and Drop Policy (cont.)
M>IQL?M>IQL?
N>AQL?N>AQL? Enqueuepacket
EnqueuepacketNth packetNth packet
No
No
Yes
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.
M>QL?M>QL?
Yes
No
© 2001, Cisco Systems, Inc. QOS v1.0—3-101
Flow-Based DWFQ SchedulingFlow-Based DWFQ Scheduling
• 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)
Flow-Based DWFQ SystemFlow-Based DWFQ System
Hardware Queuing System
Hardware Queuing System
Queue 1Queue 1
DWFQScheduler(CalendarQueuing)
DWFQScheduler(CalendarQueuing)
InterfaceInterface Hardware Q Hardware Q
Queue 2Queue 2
Queue NQueue N
Calendar QueueCalendar Queue
Packets are scheduled (ordered) in advance for
faster transfer to the hardware queue.
© 2001, Cisco Systems, Inc. QOS v1.0—3-102
Configuring Flow-Based DWFQConfiguring Flow-Based DWFQ
fair-queuefair-queue
Router(config-if)#
• 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-103
Configuring Flow-Based DWFQ (cont.)
Configuring Flow-Based DWFQ (cont.)
fair-queue aggregate-limit aggregate-packetsfair-queue aggregate-limit aggregate-packets
Router(config)#
• The total number of packets in all output queues before some packets may be dropped
fair-queue individual-limit individual-packets fair-queue individual-limit individual-packets
Router(config)#
• 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-104
Flow-Based DWFQExample
Flow-Based DWFQExample
• 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
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!
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!
© 2001, Cisco Systems, Inc. QOS v1.0—3-105
show interfaceshow interface
Router#show interfaces FastEthernet1/1/0FastEthernet1/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 ...
Router#show interfaces FastEthernet1/1/0FastEthernet1/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-106
show interface fair-queue
Router#show interface fastethernet 1/1/0 fairFastEthernet 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
Router#show interface fastethernet 1/1/0 fairFastEthernet 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-107
Benefits and Drawbacks of Flow-Based DWFQ
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-108
ToS-Based DWFQToS-Based DWFQ
• ToS-based DWFQ has four classes
ToS-based dWFQ SystemToS-based dWFQ System
Hardware Queuing System
Hardware Queuing System
Class 1?Class 1? Queue 1Queue 1
DWFQScheduler
DWFQScheduler InterfaceInterface
Forwarded Packets
Hardware Q Hardware Q
Class 2?Class 2? Queue 2Queue 2
Class 4?Class 4? Queue 4Queue 4
WFQ dropWFQ drop
WFQ dropWFQ drop
WFQ dropWFQ drop
Class 3?Class 3? Queue 3Queue 3WFQ dropWFQ drop
© 2001, Cisco Systems, Inc. QOS v1.0—3-109
ToS-based dWFQ ClassificationToS-based dWFQ Classification
IP PayloadIP Payload
XXX 00000
#queue (2-bit index of the queue)
• The number of queues is 4 (fixed)
• Classification is based on the two low-order IP precedence bits
ToS-based dWFQ Classification uses the two low-order IP precedence bits to classify packets
IPPrec.
IP precedence
Queue 1 0 and 4
Queue 2 1 and 5
Queue 3 2 and 6
Queue 4 3 and 7
© 2001, Cisco Systems, Inc. QOS v1.0—3-110
ToS-Based DWFQ SchedulingToS-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-111
• Enables ToS-based distributed WFQ
Configuring ToS-Based DWFQConfiguring ToS-Based DWFQ
fair-queue tosfair-queue tos
Router(config-intf)#
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
fair-queue tos num weight weight fair-queue tos num weight weight
Router(config-intf)#
© 2001, Cisco Systems, Inc. QOS v1.0—3-112
• 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
Configuring ToS-Based DWFQ (cont.)
fair-queue tos num limit class-packets fair-queue tos num limit class-packets
Router(config-if)#
fair-queue aggregate-limit aggregate-packetsfair-queue aggregate-limit aggregate-packets
Router(config-if)#
• If aggregate limit is not configured, it is set to the number of available buffers
fair-queue individual-limit individual-packet fair-queue individual-limit individual-packet
Router(config-if)#
• If individual limit is not configured, it is set to one-quarter of the number of available buffers
© 2001, Cisco Systems, Inc. QOS v1.0—3-113
ToS-Based DWFQConfiguration Example
ToS-Based DWFQConfiguration 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!
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-114
show interface fair-queueshow 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
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-115
Benefits and Drawbacks of ToS-Based DWFQ
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-116
QoS-Group-Based DWFQQoS-Group-Based DWFQ
• QoS-group-based DWFQ supports 100 classes.
QoS-Group-Based DWFQ SystemQoS-Group-Based DWFQ System
Hardware Queuing System
Hardware Queuing System
Class 1?Class 1? Queue 1Queue 1
DWFQScheduler
DWFQScheduler InterfaceInterface
Forwarded Packets
Hardware Q Hardware Q
Class 2?Class 2? Queue 2Queue 2
Class 100?Class 100? Queue 100Queue 100
WFQ dropWFQ drop
WFQ dropWFQ drop
WFQ dropWFQ drop
© 2001, Cisco Systems, Inc. QOS v1.0—3-117
BufferHeaderBufferHeader
QoS-Group-Based DWFQ Classification
QoS-Group-Based DWFQ Classification
• 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
PacketBuffer
FrameHeaderFrameHeader
IPHeaderIPHeader PayloadPayload
QoSGroupQoSGroup
© 2001, Cisco Systems, Inc. QOS v1.0—3-118
QoS-Group-Based DWFQ Scheduling
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-119
Configuring QoS-Group-Based DWFQ
Configuring QoS-Group-Based DWFQ
• Enables ToS-based distributed WFQ
fair-queue qos-groupfair-queue qos-group
Router(config-intf)#
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
fair-queue qos-group num weight weight fair-queue qos-group num weight weight
Router(config-intf)#
© 2001, Cisco Systems, Inc. QOS v1.0—3-120
Configuring QoS-Group-Based DWFQ (cont.)
Configuring QoS-Group-Based DWFQ (cont.)
• 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
fair-queue qos-group num limit class-packetsfair-queue qos-group num limit class-packets
Router(config-intf)#
fair-queue aggregate-limit aggregate-packetsfair-queue individual-limit individual-packet fair-queue aggregate-limit aggregate-packetsfair-queue individual-limit individual-packet
Router(config-intf)#
© 2001, Cisco Systems, Inc. QOS v1.0—3-121
QoS-Group-Based DWFQ Example
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-122
QoS-Group Based DWFQConfiguration Example
QoS-Group Based DWFQConfiguration 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!
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-123
Monitoring QoS-Group-Based DWFQ
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
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-124
Benefits and Drawbacks of QoS-Group-Based DWFQ
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-125
DWFQ SummaryDWFQ Summary
VIPManual100QoS groupQoS DWFQ
RSP/low-end/VIPRSP/low-end/VIP
ManualManual6464ManualManualCBWFQ*CBWFQ*
VIPManual4IP PrecedenceToS DWFQ
VIPNo512Per-flowDWFQ
RSP/low-endYes (IP Precedence)
16 to 4096Per-flowWFQ
ImplementationWeighted
Fairness
ClassesClassification
* Class-based WFQ is covered in the module “Modular QoS CLI Service Policy”
© 2001, Cisco Systems, Inc. QOS v1.0—3-126
SummarySummary
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-127
Lesson ReviewLesson 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.
Modified Deficit Round Robin
Modified Deficit Round Robin
QOS v1.0—3-128
© 2001, Cisco Systems, Inc. QOS v1.0—3-129
ObjectivesObjectives
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-130
Modified Deficit Round RobinModified 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-131
MDRR ArchitectureMDRR Architecture
• 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).
Modified Deficit Round RobinModified Deficit Round Robin
Hardware Queuing System
orCrossbar
Switching Fabric
Hardware Queuing System
orCrossbar
Switching Fabric
Class 1?Class 1? VOQ 1VOQ 1
MDRRScheduler
MDRRScheduler
Forwarded Packets
Class 2?Class 2? VOQ 2VOQ 2
Class 8?Class 8? VOQ 8VOQ 8
Tail-dropWRED
Tail-dropWRED
Tail-dropWRED
Tail-dropWRED
Tail-dropWRED
Tail-dropWRED
© 2001, Cisco Systems, Inc. QOS v1.0—3-132
MDRR FeaturesMDRR 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-133
MDRR ClassificationMDRR Classification
• 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.
IPPrecedence
0
IPPrecedence
0
IPPrecedence
1
IPPrecedence
1
IPPrecedence
7
IPPrecedence
7
VOQ 0VOQ 0
VOQ 1VOQ 1
VOQ 2VOQ 2
VOQ 7VOQ 7
© 2001, Cisco Systems, Inc. QOS v1.0—3-134
MDRR Insertion and Drop PolicyMDRR Insertion and Drop Policy
• MDRR uses a traditional tail-drop scheme if a queue is congested.
• MDRR can also use weighted random early detection (WRED) to prevent congestion.
Virtual Output Queue Virtual Output QueueTail Drop
orWRED
Tail Dropor
WRED
© 2001, Cisco Systems, Inc. QOS v1.0—3-135
DRR SchedulingDRR Scheduling
• 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.
VOQ 0VOQ 0
VOQ 1VOQ 1
VOQ 7VOQ 7
Each queue can transmit a configured amount of bytes in one round:
MTU + (weight-1)*512
Round
Robin
Scheduler
© 2001, Cisco Systems, Inc. QOS v1.0—3-136
MDRR Scheduling withStrict Priority Queue
MDRR Scheduling withStrict Priority Queue
• 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.
VOQ 0VOQ 0
VOQ 1VOQ 1
VOQ 7VOQ 7
The strict priority, low-latency queue is not limited by the token bucket mechanism.
Round-Robin
Scheduler
LL Queue LL QueueStrict PriorityQueuing
© 2001, Cisco Systems, Inc. QOS v1.0—3-137
MDRR Scheduling withAlternate Priority QueueMDRR Scheduling with
Alternate Priority Queue
• 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.
VOQ 0VOQ 0
VOQ 1VOQ 1
VOQ 7VOQ 7
The alternate priority queue is using the token bucket to limit the amount of bytes it can transmit in one round.
Round-Robin
Scheduler
LL Queue LL QueueAlternatePriorityQueuing
© 2001, Cisco Systems, Inc. QOS v1.0—3-138
Benefits and Drawbacks of MDRRBenefits 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-139
Configuring Interface MDRRConfiguring Interface MDRR
cos-queue-group cos-queue-group-namecos-queue-group cos-queue-group-name
Router(config)#
• Create a queue group template and enter CoS queue group configuration mode.
precedence precedence queue {queue-number|low-latency}precedence precedence queue {queue-number|low-latency}
Router(config-cos-que)#
• Map IP Precedence to a queue.
queue queue-number weightqueue queue-number weight
Router(config-cos-que)#
• Set the weight of a queue.
© 2001, Cisco Systems, Inc. QOS v1.0—3-140
Configuring Interface MDRR (cont.)
Configuring Interface MDRR (cont.)
tx-cos cos-queue-group-name tx-cos cos-queue-group-name
Router(config-if)#
• Associate a CoS queue group name with the transmit queues on an interface.
queue low-latency {alternate-priority weight|strict-priority}queue low-latency {alternate-priority weight|strict-priority}
Router(config-cos-que)#
• Specify the type of low-latency queue.
© 2001, Cisco Systems, Inc. QOS v1.0—3-141
Configuring Receive MDRRConfiguring Receive MDRR
slot-table-cos slot-table-name slot-table-cos slot-table-name
Router(config)#
• Define a slot table name and enter slot table configuration mode.
destination slot {slot-number|all} cos-queue-group-namedestination slot {slot-number|all} cos-queue-group-name
Router(config-slot-cos)#
• Define destination slot parameters for this slot table name.
rx-cos-slot line-card-number cos-queue-group-namerx-cos-slot line-card-number cos-queue-group-name
Router(config)#
• Link a slot-table-cos template to a line card.
© 2001, Cisco Systems, Inc. QOS v1.0—3-142
MDRR ExampleMDRR 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!
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-143
Monitoring and Troubleshooting MDRR
Monitoring and Troubleshooting MDRR
Router#show cos statisticsSlot 3---------------Dest slot 5cos-queue-group: C7template... Queue Lengths To Fabric Queues (DRR configured) C7templateQueue Average High Water Mark Weight0 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 ...
Router#show cos statisticsSlot 3---------------Dest slot 5cos-queue-group: C7template... Queue Lengths To Fabric Queues (DRR configured) C7templateQueue Average High Water Mark Weight0 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 ...
show cos statisticsshow cos statistics
Router#
• Display MDRR statistics
© 2001, Cisco Systems, Inc. QOS v1.0—3-144
SummarySummary
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-145
Lesson ReviewLesson 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.
IP RTP PrioritizationIP RTP Prioritization
QOS v1.0—3-146
© 2001, Cisco Systems, Inc. QOS v1.0—3-147
ObjectivesObjectives
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-148
IP RTP PrioritizationIP 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-149
IP RTP Prioritization (cont.)IP RTP Prioritization (cont.)
• IP RTP prioritization adds one high-priority queue to WFQ.
Hardware Queuing System
Hardware Queuing System
InterfaceInterface
Forwarded Packets
Hardware Q
Weighted Fair Queuing SystemWeighted Fair Queuing System
Flow 1? Queue 1
WFQScheduler
Flow 2? Queue 2
Flow N? Queue N
WFQ drop
HighPriority?
HighPriority?
RTPScheduler
RTPScheduler
WFQ drop
WFQ drop
© 2001, Cisco Systems, Inc. QOS v1.0—3-150
IP RTP Priority ClassificationIP RTP Priority Classification
• IP RTP Prioritization classifies packets based on the UDP Port number.
• Classification is specified by a range of UDP port numbers.
UDP portIn range?UDP portIn range?
IPIP UDPUDP PayloadPayload
UDP Destination port
RTP QueueRTP Queue
WFQQueuingSystem
WFQQueuingSystem
Yes
No
Forwarded Packets
© 2001, Cisco Systems, Inc. QOS v1.0—3-151
IP RTP Priority Insertion and Drop Policy
IP RTP Priority Insertion and Drop Policy
• IP RTP Prioritization limits the amount of high-priority traffic.
• Excess traffic is dropped.
Packetwithin
contract?
Packetwithin
contract?RTP QueueRTP Queue
Yes
No
TokenBucketTokenBucket
Classified Packets
© 2001, Cisco Systems, Inc. QOS v1.0—3-152
Benefits and Drawbacks of IP RTP Prioritization
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-153
ip rtp priority starting-port port-range bandwidthip rtp priority starting-port port-range bandwidth
Router(config-if)#
• 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
Configuring IP RTP PrioritizationConfiguring IP RTP Prioritization
max-reserved-bandwidth percentmax-reserved-bandwidth percent
Router(config-if)#
• 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-154
IP RTP Prioritization Example
IP RTP Prioritization Example
interface Serial0/0 bandwidth 128 ip address 10.0.0.1 255.255.255.252 encapsulation ppp fair-queue ip rtp priority 16384 16383 50!
interface Serial0/0 bandwidth 128 ip address 10.0.0.1 255.255.255.252 encapsulation ppp fair-queue ip rtp priority 16384 16383 50!
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/secRouter#
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/secRouter#
Up to 75% of configured bandwidth is reservable.
BWavail = BW * 0.75 - BWRTP
© 2001, Cisco Systems, Inc. QOS v1.0—3-155
SummarySummary
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-156
Lesson ReviewLesson 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-157
Module SummaryModule 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. Queuing Mechanisms-158