73
Queuing Mechanisms

Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives Upon completing this module, you will be able to: Describe and configure FIFO

Embed Size (px)

Citation preview

Page 1: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Queuing Mechanisms

Page 2: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-2

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

Page 3: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Queuing Overview

Page 4: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-4

Objectives

Upon completing this lesson, you will be able to: Understand how queuing works on Cisco routers List the most used queuing mechanisms

Page 5: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University5QOS v1.0—3-5

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

Page 6: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University6QOS v1.0—3-6

Output 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

Page 7: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University7QOS v1.0—3-7

Bypassing 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

Page 8: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University8QOS v1.0—3-8

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.

Page 9: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University9QOS v1.0—3-9

Software Queuing SystemSoftware Queuing System

Hardware Queuing System

Hardware Queuing System

Queuing 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

Page 10: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-10

Summary

Upon completing this lesson, you should be able to: Understand how queuing works on Cisco routers List the most used queuing mechanisms

Page 11: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-11

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?

Page 12: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

FIFO Queuing

Page 13: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-13

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

Page 14: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University14QOS v1.0—3-14

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

Page 15: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University15QOS v1.0—3-15

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)

Page 16: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University16QOS v1.0—3-16

Configuring 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

Page 17: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University17QOS v1.0—3-17

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

Page 18: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University18QOS v1.0—3-18

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

Page 19: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University19QOS v1.0—3-19

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>]

Page 20: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-20

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

Page 21: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-21

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.

Page 22: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Priority QueuingPriority Queuing

Page 23: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-23

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

Page 24: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University24QOS v1.0—3-24

Priority 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

Page 25: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University25QOS v1.0—3-25

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

Page 26: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University26QOS v1.0—3-26

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

Page 27: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University27QOS v1.0—3-27

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

Page 28: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University28QOS v1.0—3-28

Scheduling 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

Page 29: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University29QOS v1.0—3-29

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

Page 30: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University30QOS v1.0—3-30

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

Page 31: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University31QOS v1.0—3-31

Priority 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

Page 32: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS 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}

Page 33: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University33QOS v1.0—3-33

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

Page 34: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University34QOS v1.0—3-34

Core

WAN Core

BranchOffice

E0

E1

Sample 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

Page 35: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University35QOS v1.0—3-35

show interface interfaceshow interface interface

Router#

• Displays information and statistics about queuing on interface

Monitoring 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

Page 36: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University36QOS v1.0—3-36

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

Page 37: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University37QOS v1.0—3-37

show 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

Page 38: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-38

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

Page 39: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-39

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?

Page 40: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Weighted Fair QueuingWeighted Fair Queuing

Page 41: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-41

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

Page 42: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University42QOS v1.0—3-42

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.

Page 43: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University43QOS v1.0—3-43

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

Page 44: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University44QOS v1.0—3-44

Weighted Fair Queuing Implementations

Implementation parameters:• Queuing platform: central CPU or VIP

• Classification mechanism

• Weighted fairness Modified tail drop within each queue

Page 45: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University45QOS v1.0—3-45

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

Page 46: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University46QOS v1.0—3-46

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.

Page 47: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-47

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.

Page 48: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-48

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

Page 49: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University49QOS v1.0—3-49

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.

Page 50: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University50QOS v1.0—3-50

Case Study:Interface Congestion

Absolute maximum (HQO=10) exceeded; new packet is the last in the TDM system and is dropped

Page 51: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University51QOS v1.0—3-51

Case Study:Interface Congestion

Absolute maximum exceeded (HQO=10); new packet is not the last in the TDM system, so last packet is dropped

Page 52: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University52QOS v1.0—3-52

Case Study:Flow Congestion

CDT exceeded (CDT=8); new packet would be the last in the TDM system and is dropped

Page 53: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University53QOS v1.0—3-53

Case Study:Flow Congestion

CDT exceeded (CDT=8); new packet would not be the last, and packet is enqueued

Page 54: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-54

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.

Page 55: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University55QOS v1.0—3-55

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

Page 56: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-56

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

Page 57: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University57QOS v1.0—3-57

Weight 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)

Page 58: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-58

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

Page 59: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University59QOS v1.0—3-59

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

0

IP Precedence

4 (RSVP)

128 (PAK-Priority)

512

585

682

819

1024

1365

2048

4096

Weight

Page 60: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University60QOS v1.0—3-60

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)

Page 61: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University61QOS v1.0—3-61

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

Page 62: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-62

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)#

Page 63: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-63

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)#

Page 64: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University64QOS v1.0—3-64

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 Parameters

Page 65: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University65QOS v1.0—3-65

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

Page 66: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University66QOS v1.0—3-66

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

Page 67: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University67QOS v1.0—3-67

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

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

Page 68: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University68QOS v1.0—3-68

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

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

Page 69: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia University69QOS v1.0—3-69

Queuing 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

Page 70: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-70

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

Page 71: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-71

Lesson Review

1.How does WFQ classify packets?

2.When does WFQ drop packets?

3.How does WFQ schedule packets?

Page 72: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

Inner Mongolia UniversityQOS v1.0—3-72

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

Page 73: Queuing Mechanisms. QOS v1.0—3-2 Inner Mongolia University Objectives  Upon completing this module, you will be able to:  Describe and configure FIFO

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