78
TÀI LIỆU HƯỚNG DẪN THỰC HÀNH QUẢN LÝ CHẤT LƯỢNG DỊCH VỤ MẠNG CHO SINH VIÊN CHUYÊN NGÀNH MẠNG MÁY TÍNH VÀ TRUYỀN THÔNG LƯ HUỆ THU

QoS Practice Labs - English

Embed Size (px)

Citation preview

Page 1: QoS Practice Labs - English

TÀI LIỆU HƯỚNG DẪN THỰC HÀNH QUẢN LÝ CHẤT LƯỢNG

DỊCH VỤ MẠNG CHO SINH VIÊN CHUYÊN NGÀNH MẠNG MÁY

TÍNH VÀ TRUYỀN THÔNG

LƯ HUỆ THU

THÀNH PHỐ HỒ CHÍ MINHNĂM 2009

Page 2: QoS Practice Labs - English

QoS Practice Labs

QoS Practice

LabsWritten by Lu Hue Thu

- 1 - Rita2610

Page 3: QoS Practice Labs - English

QoS Practice Labs

INTRODUCTIONQoS Practice Labs tends to give the students

experience on practice on the subject of Quality of

Service. All of labs were designed to ease the use of

GNS3 software for simulation, as well as other

common softwares to support practice. In every lab,

I briefly described each IP QoS mechanism before

giving you a network topology that will be changed

conforming to mechanism available in Cisco IOS.

The purpose of writing the labs is merely for the

study and I suggest the students to understand

thoroughly the features and effects of QoS

mechanisms when you implement configuration and

test in the labs.

The QoS Practice Labs is still in the process of

editing, so finding out deficiencies or errors is

unavoidable. I am looking for your contributions to

improve this document.

Please, reach me by the email :

[email protected] or [email protected]

- 2 - Rita2610

Page 4: QoS Practice Labs - English

QoS Practice Labs

***********************

- 3 - Rita2610

Page 5: QoS Practice Labs - English

QoS Practice Labs

Table of Contents

Signaling Mechnisms

RSVP – Resource Reservation Protocol....................................................................1

Queuing Mechanisms

First In First Out Queuing – Weight Fair Queuing.................................................10

Priority Queuing......................................................................................................18

Custom Queuing......................................................................................................25

Classification and Marking

Modular QoS CLI (MQC).......................................................................................30

Related Documents :

Cisco IOS Quality of Service Solutions Guide

Cisco IOS Quality of Service Solutions Command Reference

- 4 - Rita2610

Page 6: QoS Practice Labs - English

QoS Practice Labs

Administering Cisco QoS for IP Networks - Syngress

- 5 - Rita2610

Page 7: QoS Practice Labs - English

QoS Practice Labs

RSVP – Resource Reservation Protocol

1. Overview

RSVP is signaling protocol and used to reserve bandwidth for the traffic flowing in one

direction. The clients supported RSVP as the sender and the receiver that generate RSVP

messages in order to establish a session request QoS guarantee for the application flow.

* The RSVP support for the LLQ feature runs on the following platforms:

• Cisco 2600 series routers

• Cisco 3600 series routers (Cisco 3620, 3640, and 3660)

• Cisco 3810 multi-service access concentrator.

• Cisco 7200 series routers

• Cisco 7500 series routers

This scenario is designed in the context the client was not supported RSVP and the router is

configured as Proxy can send PATH or RESV messages on behalf of clients to describe the

operation of RSVP.

2. Prerequisites

The equipment that required to complete the lab is a personal computer and perform the

following works in order of precedence :

- Install WireShark software for analyzing the RSVP messages.

- Install Loopback Adapter for creating enough 2 network adapters as 2 PCs.

- Install GNS3 software and design a following network topology.

3. Configuration Commands

a. Configuring RSVP

Enable RSVP for IP on an interface

Router(config)# interface serial/fastethenet [interface-number]

Router(config-if) # ip rsvp bandwidth [interface-kbps] [single-flow-kbps]

Note : The default maximum bandwidth is up 75% of bandwidth available on the

interface and reserved bandwidth by a flow can be up to the entire

reservedbandwidth.

- 6 - Rita2610

Page 8: QoS Practice Labs - English

QoS Practice Labs

Enter the sender in the RSVP database

Router(config) # ip rsvp sender session-ip-address sender-ip-address [ tcp | udp |

ip-protocol ] session- dport sender-sport previous-hop-ip-address previous-hop-

interface [bandwidth] [burst-size].

Enter the receiver in the RSVP database

Router(config) # ip rsvp reservation session-ip-address sender-ip-address [tcp |

udp | ip-protocol] session-dport sender-sport next-hop-ip-address next-hop-interface

ff rate [bandwidth] [burst-size].

b. Verifying RSVP Configuration.

show ip rsvp interface [interface- number] Display RSVP-related interface information

show ip rsvp installed [interface- number] Display RSVP-related filters and bandwidth

information.

show ip rsvp neighbor [interface- number] Display current RSVP neighbors

show ip rsvp sender [interface- number] Display information of RSVP sender

show ip rsvp request [interface- number] Display information of RSVP request

show ip rsvp reservation [interface- number] Display information of RSVP receiver

4. Network Topology

5. Configuration Tasks

- Assign IP addresses to the devices.

- 7 - Rita2610

S1/1S1/0

S1/0S1/0

Fa0/0Fa0/0

.2

.2

.2

.1

.1

.1

.2

.1

50.0.0.0/8 70.0.0.0/8

192.168.1.0/24172.32.0.0/16R1 R3R2

R1

R3

R2

R1 R3R2

R1

R3

R2

R1 R3

Work place

R2

RSVP Sender

RSVP Reservation

RSVP Router

PC1 Loopback

PC2

R1 R3R2

R1 R3

Work place

R2

Page 9: QoS Practice Labs - English

QoS Practice Labs

- Configure static route on routers (by yourseft).

- Enabling RSVP on all appropriate interfaces (all router).

Router(config-if) # ip rsvp bandwidth

- Configuring RSVP-Sender router as a Proxy that can send PATH messages on behalf of client.

Sender(config) # ip rsvp sender 192.168.1.2 172.32.0.2 tcp 0 0 172.32.0.2 Fa0/0 10 5

- Configuring RSVP-Reservation router as a Proxy that can send RESV messages on behalf of

client.

Reservation(config) # ip rsvp reservation 192.168.1.2 172.32.0.2 tcp 0 0 192.168.1.2

Fa0/0 ff rate 10 5

- Verifying configuration

+ Verify that RSVP is enabled on all interfaces of each router.

+ The following shows the reservation applied for TCP traffic from 172.32.0.2 to 192.168.1.2.

RSVP traffic goes through Weight Fair Queuing on interface serial of router with weight of 6.

- 8 - Rita2610

Active reservation for traffic flowing in one direction : 10Kbps of bandwidth.

Page 10: QoS Practice Labs - English

QoS Practice Labs

+ Verify the RSVP Sender, the RSVP Reservation : show ip rsvp sender, show ip rsvp reservation.

+ Show the information about reservation is requested from the RSVP-Sender to RSVP-

Reservation.

- 9 - Rita2610

Page 11: QoS Practice Labs - English

QoS Practice Labs

+ Show neighbor of RSVP-enabled router.

+ Show ip rsvp counter is used for counting the number of RSVP messages.

- 10 - Rita2610

Page 12: QoS Practice Labs - English

QoS Practice Labs

6. Using WireShark software to analyse the RSVP messages

- 11 - Rita2610

Page 13: QoS Practice Labs - English

RSVP Packet Format

RSVP Message Header Fields

cur flags = 0 a label for all fragments of one message

MF flag is set on for all fragments of a message except the last fragment.

the byte offset of the fragment in the message

Fragment offsetMFReservedMessage IDSend TTLReservedLengthChecksumTypeFlagsVersion

bits1611532881616844

Reservation-request acknowledgment Appears when reservation-confirmation object in a reservation-request message.7

Reservation-teardown6

Path-teardown5

Reservation-request error4

Path-error3

Reservation-request Request for guarantee QoS for the session.2

Path Store the path state in each node and route reservation-request messages in the reverse direction

1

Message Type DescriptionsValue

Using Path state or Reservation state to specify Errors (Admission failure, Bandwidth unavailable, Service not supported, Bad flow specification, Ambiguous path).Remove the reservation. Path-teardown messages delete the path state.Reservation-request teardown messages delete the reservation state

Page 14: QoS Practice Labs - English

QoS Practice Labs

- 13 - Rita2610

bitsRSVP Object Fields

Specify a session, contain IP destination address and possibly a destination port.

Adspec

SenderTSPEC

SenderTemplate

Time ValueRSVP Hop

Session

Objects

Advertising data.

The traffic characteristics of a sender’s data stream.

Identify a sender, contain sender IP address and perhaps some additional demultiplexing information.

The refresh period and the state TTL

IP address of the RSVP-capable node.

Class-Num : 0, C-Type : ignored. The receiver will ignored this object contents

Types of messages Contents

Null

all RSVP messages

anywhere in a obj. sequence objects

The reservation style and style-specific information.Style Reservation-requestFlow

SpecificationReservation-request

FilterSpecification

Path

Path

Path

ErrorSpecification

Path-errorReservation-request

errorPolicy Data PathReservation-request

Scope Reservation-request

ReservationConfirmation

Reservation-request

Specify an error.

Information about local policy to decide permit an associated reservation.

Specify the scope for forwarding a reservation-request message

Reservation-requestReservation-request ack

IP address of a receiver that requested a confirmation

Specify the sessions that should receive the desired QoS.

Specify flow that define desired QoS.

Path Reservation

all RSVP messages

Object class (name)

Object type

Object contentsC-TypeClass-numLength

Variable<=65528 bytes8816

Page 15: QoS Practice Labs - English

QoS Practice Labs

- 14 - Rita2610

Path message

RSVP Header

Object Fields

Page 16: QoS Practice Labs - English

RESV message

Page 17: QoS Practice Labs - English

Path tear message

Page 18: QoS Practice Labs - English

RESV tear message

Page 19: QoS Practice Labs - English

QoS Practice Labs

Queuing Mechanisms

Queuing on router is the buffer on interfaces and is place used to contain packets when they pass

through router. Each interface has hardware and software queuing system.

* Hardware queue is considered as way out of packet, use FIFO strategy.

* Software queue can be configured depend on the platform and Cisco IOS version. It is set in front

of hardware queue and has scheduler to transfer packets into the hardware queue based on service

policy.

Queuing mechanisms is merely list of software queuing strategies that are useful in case of arrival rate

of incoming packets on one or many input interfaces is faster than the output interface.

- 18 -Rita2610

Incoming Packets

SoftwareQueue Outgoing

Packets

FIFOWFQPriority Queuing Custom Queuing. . . . .

HardwareQueue

Forwarding

Tail-drop(randomly)

FIFO

Page 20: QoS Practice Labs - English

QoS Practice Labs

- 19 -Rita2610

FIF

O

Que

uing

Dis

trib

uted

Wei

ghte

d F

air

Que

uing

Wei

ghte

d F

air

Que

uing

Cus

tom

Q

ueui

ngP

rior

ity

Que

uing

IP R

TP

Pri

orit

izat

ion

Mod

ifie

d D

efic

it

Rou

nd-r

obin

Qu

euin

g M

ech

anis

ms

QoS

-gro

up-

base

d dW

FQ

ToS

-bas

ed

dWF

QF

low

-bas

ed

dWF

Q

Flo

w-b

ased

W

FQ

Dis

trib

uted

C

lass

-bas

ed

WF

Q

Cla

ss-b

ased

W

FQ

Page 21: QoS Practice Labs - English

QoS Practice Labs

First In First Out Queuing – Weight Fair Queuing

1. Overview

FIFO Queuing is simply, supported on all platforms and in all Cisco IOS versions. It is default

queuing mechanism on all interfaces with default bandwidth >= 2Mbps. The packets did not

classify for levels of QoS, drained into the queue in order and they are dropped when the output

queue is full.

Weight Fair Queuing is already enabled by default on the Cisco router interfaces with default

bandwidth <= 2Mbps. Application flows are called conversations that differ in source and

destination address, port number, protocol number, and TOS value of packet header. The WFQ

detects the flows, create and manage automatically the queues system with allocated fair-shared

bandwidth. WFQ inspects the IP precedence value of a packet to calculate a number called a

weight used to determine how fast the packet drains. WFQ use 2 parameters to drop the packet :

the maximum number of packets in the WFQ system and congestive discard threshold.

- 20 -Rita2610

PacketIn Packet

ClassifierQueue

FIFOScheduler

HardwareQueue

PacketsOut

Queue 1WFQ

Scheduler

HardwareQueue

Queue 2

Queue N

Flow 1

Flow 2

Flow N

PacketsIn

PacketsOut

Page 22: QoS Practice Labs - English

QoS Practice Labs

In the lab, using show commands to display the information of default queuing and configuration

commands to enable FIFO Queuing and WFQ on the interfaces of router.

2. Prerequisites

The personal computer has already been installed :

- Install Loopback Adapter for creating enough 2 network adapters as 2 PCs.

- Install GNS3 software and design a following network topology.

3. Configuration Commands

a. Configuring FIFO Queuing

+ Enable FIFO on an interface (interface serial).

Router(config)#interface serial [interface-number]

Router(config-if)# no fair-queue

+ Modify the maximum number of buffered packet (queue-length)

Router(config-if)# hold-queue <buffer> in | out

in | out : Input / Output queue

b. Configuring WFQ

+ Enable WFQ on an interface (interface Fast/E).

Router(config)# interface Fast/E [interface-number]

Router(config-if)# fair-queue [threshold] [max-dynamic-queue][max-reservable-queue]

* threshold : congestive discard threshold for early dropping that should be start when the

number of packets in the WFQ system exceed the threshold. Default : 64

* max-dynamic-queue : the maximum number of dynamic conversation queues The

number of conversation queues must be a power of 2 (16, 32, 64, 128, 256, 512, 1024).

Default : 256.

* max-reservable-queue : The maximum number of reserved queues guarantees for the

reserved bandwidth such as the maximum number of RSVP reserved queues. The

number of reserved conversation is in a range 0 to 1000. Default : 0.

+ Modify the maximum number of packet in the WFQ system (queue-length)

Router(config-if)# hold-queue <max-limit> in | out .

* max-limit : the maximum of the limited packet that is hold in the WFQ system.

* in | out : Input / Output queue

c. Verifying Configuration

- 21 -Rita2610

Page 23: QoS Practice Labs - English

QoS Practice Labs

show running-config Displays commands are configured.

show interface interface Displays informations and statistics about queuing on interface

show queueing fair interface Displays queuing parameters on interface

show queue interface Displays queue contents

4. Network Topology

5. Configuration Tasks

- Assign IP addresses to devices and configure RIP routing protocol on Router.

* Using Show command to verify default queuing on R1’s Fa2/0 (FIFO Queuing)

- 22 -Rita2610

Fa2/0Fa2/0

.2

S1/0

.2

.1S1/0

.1

.2

.1

100.0.0.0/8

190.168.0.0/16 172.32.0.0/16R1 R3R2

R1 R3R2

R1 R3

Work place

R2

R1 R2

PC1 - Loopback PC2

WFQ

FIFO FIFO

R1 R3R2

R1 R3

Work place

R2

Note : Default Queuing :

Interface FastEthernet - FIFO Queuing.

Interface Serial - Weight Fair Queuing

Page 24: QoS Practice Labs - English

QoS Practice Labs

- Modify the FIFO queuing length. Default length : 40

- 23 -Rita2610

Page 25: QoS Practice Labs - English

QoS Practice Labs

* Using Show command to verify default queuing on R1’s S1/0 (WFQ)

- Using Show running-config to show WFQ that is configured on interface S1/0

- 24 -Rita2610

Page 26: QoS Practice Labs - English

QoS Practice Labs

- Show WFQ system on all Serial interfaces

- Modify the WFQ system length. Default length : 1000.

- 25 -Rita2610

Page 27: QoS Practice Labs - English

QoS Practice Labs

+ PC1 ping to FastEthernet2/0 on R2. ICMP packets are started at PC1 and go through weight fair

queue that is configured on R1’s S1/0. The following shows the current state of R1’s queue. The

weight of ICMP is 32384.

- 26 -Rita2610

Page 28: QoS Practice Labs - English

QoS Practice Labs

* Configure FIFO on S1/0

- 27 -Rita2610

Page 29: QoS Practice Labs - English

QoS Practice Labs

* Configure WFQ on Fa2/0

- 28 -Rita2610

Page 30: QoS Practice Labs - English

QoS Practice Labs

Priority Queuing

1. Overview

Priority Queuing is supported on almost platform and in all IOS versions above 10.0. There are 4

queues in the Priority Queuing : High queue (low delay), Medium queue, Normal queue, Low

queue with the priority is specified decreasingly from High to Low. The packets is classified into

four queues depend on QoS levels that the criteria is defined by user and they will be drop when

the number of packets in queue exceed queue size. One of the drawbacks of Priority Queuing is

queue starvation. It means that the situation of congestion is occur, there are too much traffics to be

generated, the packets in high queue is always served and the packets in lower queues can not

drain.

To practice the lab, you must to create the traffics with levels of priorities, configure and verify the

Priority Queuing on router.

2. Prerequisites

- Using copper Cross-over cable to connect 2 PCs.

PC1 :

- Install Loopback Adapter for creating one more network adapter.

- Install GNS3 software and design a following network topology.

- 29 -Rita2610

Queue 1Re-emptyScheduler

HardwareQueue

Queue 2

Queue 3

Queue 4

High

Medium

Normal

Low

PacketClassifier

PacketsOut

PacketsIn

Page 31: QoS Practice Labs - English

QoS Practice Labs

3. Configuration Commands

a. Classify traffics into four classes <identify with a common number (list-number)>

Classifies the packet based on protocol and other protocol-specific criteria

Router(config) # priority-list list-number protocol protocol-name { high | medium |

normal | low} queue-keyword keyword-value

fragment IP packets with non-zero fragment offset ( Match fragments)

gt/lt <size> Based on packet size (including L2 frame)( Match packets

based on their size)

list <acl> ACL classification (standard or extended)

tcp/udp <port> TCP or UDP port number (Match packets based on their

source or destination TCP/UDP port number)

Classifies the packet based on incoming interface

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

low}

Classifies all unclassified packets in a default queue (The default is to use the normal queue

for all unclassified packets)

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

b. Configure PQ Scheduling and Dropping Parameters

Specifies the maximum queue sizes of individual priority queues

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

Note : Default maximum queue sizes for the four queues: High ( 20 ), Medium ( 40 ),

Normal ( 60 ), Low ( 80 )

c. Assign PQ definition to an interface

Router(config)# interface serial/fastethenet [interface-number]

Router(config-if)# priority-group list

d. Verifying Priority Queuing

show interface interface Displays information and statistics about

queuing on interface

show queueing [ priority | custom |

fair | random-detect] interface

Displays queuing parameters on interfaces

debug priority Displays the current state of priority Queuing

- 30 -Rita2610

Page 32: QoS Practice Labs - English

QoS Practice Labs

4. Network Topology

5. Configuration Tasks

- Assign IP addresses to devices.

- Configure RIP routing protocol on Router (by yourself).

- Configuring Priority Queue on R1’s S1/0 interface with the following policy

a. The policy is applied to the traffics by classifying into 4 queues with levels of priority.

HIGH : Telnet, Remote Desktop

R1(config) # priority-list 1 protocol ip high tcp 3389

R1(config) # priority-list 1 protocol ip high tcp telnet

MEDIUM : http

R1(config) # priority-list 1 protocol ip medium tcp www

NORMAL : ftp + other traffics

R1(config) # priority-list 1 protocol ip normal tcp ftp

R1(config) # priority-list 1 protocol ip normal tcp ftp-data

R1(config) # priority-list 1 default normal (default)

LOW : PING

R1(config) # access-list 100 permit icmp any any echo

R1(config) # priority-list 1 protocol ip low list 100

b. Assign the policy on R1’s S1/0

- 31 -Rita2610

Remote DesktopFTP Server

Telnet+HTTP

Fa2/0

.2

.1

20.0.0.0/8

R1 R3

Work place

R2PC2Loopback

S1/0

Fa2/0

.2

.1

10.0.0.0/8

R1 R3

Work place

R2

.2

S1/0

.1100.0.0.0/8

R1 R3R2R1 R3R2

R2

Priority Queue

High (size = 2 ) : Telnet, Remote DesktopMedium (size = 4): HTTPNormal (size = 6): FTP, other trafficLow (size = 8) : PING

R1 R3R2

R1

PC1

Page 33: QoS Practice Labs - English

QoS Practice Labs

R1(config) # int S1/0

R1(config-if) # priority-group 1

c. Verifying Configuration

+ The following shows Priority Queuing is configured on interface S1/0 of R1.

- 32 -Rita2610

Page 34: QoS Practice Labs - English

QoS Practice Labs

+ When the traffics pass through the interface S1/0 of R1, they classify to the queues. Using the

command show queueing interface S1/0 to display the number of packets contained in each queue on

R1’s S1/0.

+ Using the debug command to display the current state of each queue .

- 33 -Rita2610

Page 35: QoS Practice Labs - English

QoS Practice Labs

- 34 -Rita2610

Page 36: QoS Practice Labs - English

QoS Practice Labs

d. Configure the queue sizes in Priority Queuing on R1’s S1/0 when you need to adjust the maximum

number of packets that can held in a queue and using show command to verify.

R1(config) # priority-list 1 queue-limit 2 4 6 8

- 35 -Rita2610

Page 37: QoS Practice Labs - English

QoS Practice Labs

- 36 -Rita2610

Page 38: QoS Practice Labs - English

QoS Practice Labs

Custom Queuing

1. Overview

Custom Queuing is similar to Priority Queuing that is supported on almost platform and in all IOS

versions above 10.0. Custom Queuing uses 16 FIFO queues per interface for traffic classes that

user defined and a 17th queue (queue 0) is used to serve packets of system such as routing protocol

control packets, link-level messages.

* Queue 1 to 16 is used by user. The packets are classified and places into the queues that user

defined and dropped when queue is full. Default size of each queue is 20 packets to hold. And you

can configure the byte-count threshold parameter (the number of bytes in queue) and change this

size by specifying limited-packets. Service policy of Custom Queuing is round-robin, mean

that the router serve each queue in queue-number order by draining the number of bytes, the cycle

repeats and starting again with the first queue.

Queue 0 is not use round-robin scheduling, so the packets in this queue is served before the

packets in all other queues.

In the Network Topology of this lab, your task is configuring the Custom Queuing, creating the

traffics to verify the operation of Custom Queuing.

2. Prerequisites

- Using copper Cross-over cable to connect 2 PCs.

- 37 -Rita2610

PacketsOut

PacketsIn

Queue 1Round Robin

Scheduler

HardwareQueue

Queue 2

Queue N

1

2

N

PacketClassifier

Page 39: QoS Practice Labs - English

QoS Practice Labs

PC1 :

- Install Loopback Adapter for creating one more network adapter.

- Install GNS3 software and design a following network topology.

3. Configuration Commands

a. Custom Queuing Classification < Using names queues are numbered (1 to 16)>.

Classifies the packet based on protocol and other protocol-specific criteria

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

keyword keyword-value

Classifies the packet based on incoming interface

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

Classifies all unclassified packets into a default queue (change the default queue)

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

Note : All traffic that is not specifically classified is put into Queue 1.

b. Custom Queuing Scheduling Parameters

Router(config)# queue-list list queue queue-number byte-count byte-count

byte-count : depth of a queue (default equals MTU size - 1500 bytes ) – specifies how many

bytes the system allows to be delivered during one round-robin cycle.

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

limit : the maximum number of packets in a queue. Incoming packets are tail-dropped if the

limit is exceeded (default of 20 packets).

c. Assigns custom queue list to the intended interface

Router(config)# interface serial/fastethenet [interface-number]

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

d. Verifying Custom Queuing

show interface interface Displays information and statistics about queuing

on interface

show queueing [ priority | custom |

fair | random-detect] interface

Displays queuing parameters on interfaces

debug custom-queue Displays the current state of Custom Queuing

4. Network Topology

- 38 -Rita2610

Page 40: QoS Practice Labs - English

QoS Practice Labs

5. Configuration Tasks

- Assign IP addresses to devices.

- Configure RIP routing protocol on Router.

- Configuring Custom Queuing

a. Define the packet types and the queues, configure the number of bytes that R1 can drain from each

queue per cycle (default of 1500 bytes per cycle) for classifying traffic :

Queue 1 : Remote Desktop (10000 bytes per cycle)

R1(config) # queue-list 1 protocol ip 1 tcp 3389

R1(config) # queue-list 1 queue 1 byte-count 10000

Queue 2 : HTTP (5000 bytes per cycle)

R1(config) # queue-list 1 protocol ip 2 tcp www

R1(config) # queue-list 1 queue 2 byte-count 5000

Queue 3 : PING (1000 bytes per cycle)

R1(config) # access-list 100 permit icmp any any echo

R1(config) # queue-list 1 protocol ip 3 list 100

R1(config) # queue-list 1 queue 3 byte-count 500

Queue 16 : Other traffic (1500 bytes per cycle)

R1(config)# queue-list 1 default 16

b. Assign the custom queue list 1 on R1’s S1/0

- 39 -Rita2610

Fa2/0Fa2/0

.2

S1/0

.2

.1S1/0

.1

.2

.1100.0.0.0/8

10.0.0.0/820.0.0.0/8

R1 R3R2

R1 R3

Work place

R2PC2Loopback

R1 R3R2

R1 R3

Work place

R2

Custom Queuing

Queue 1 (size = 10 ) : Remote Desktop (10000 bytes)

Queue 2 (size = 25) : HTTP (5000 bytes)Queue 3 (size = 4) : Ping (500 bytes)Queue 16 (size = 20 ) : default (1500 bytes)

R1 R3R2

HTTP

R1 R2

PC1

Remote Desktop

Page 41: QoS Practice Labs - English

QoS Practice Labs

R1(config) # int S1/0

R1(config-if) # Custom-queue-list 1

c. Verifying Configuration

+ The following show Custom Queuing is configured on interface S1/0 of R1

- 40 -Rita2610

Page 42: QoS Practice Labs - English

QoS Practice Labs

+ Display the current state of custom queue list 1 on interface s1/0 of R1 when the traffics go

through by using commands : debug custom-queue, show queueing interface s1/0

d. Configure the list with following command to change the default queue depth of 20 packets. And

using show command to verify

R1(config) # queue-list 1 queue 1 limit 10

R1(config) # queue-list 1 queue 2 limit 25

R1(config) # queue-list 1 queue 3 limit 4

- 41 -Rita2610

Page 43: QoS Practice Labs - English

QoS Practice Labs

- 42 -Rita2610

Page 44: QoS Practice Labs - English

QoS Practice Labs

Classification and Marking

Classification is the basis for the implementing and applying QoS policy in the network. The traffics

are identified and grouped into different categories that are called classes of service when they flow

through router. The identification bases on the various match criteria, such as source/destination

address, source port/destination port, packet size, input interface, to place traffic into classes.

To implement Classification, you should take place at the network edge, typically end system.

In the network core, Classification is performed by values in different field of packet, the type of

service (ToS) byte in the IP header for applying the appropriate Per-hop Behavior ( PHB ) to packets

based on DS code point value.

The three most significant bits of ToS byte are called IP Precedence and the six most significant bits of

ToS byte are called Differentiated Services Code Point (DSCP). Both values are set by Marking.

Marking set value in field of packet depend on the layer 2 and layer 3 techniques : IP

precedence/DSCP ( IP layer ), three Ethernet 802.1p CoS bit ( Ethernet ), three MPLS Experimental

bits (MPLS), one ATM cell loss probability bit (ATM).

- 43 -Rita2610

Output ProcessingInput Processing

Forwarding

Classification

Marking Classification

Marking

IncomingPackets

OutgoingPackets

Process SwtchingFast SwitchingAutonomous SwitchingOptimum SwitchingNetflow SwitchingCEF Switching

Page 45: QoS Practice Labs - English

QoS Practice Labs

Mechanisms of Classification

QOS Mechanism Classification Options

Committed Access Rate (CAR) Access list

Rate limit access list

QoS-group

DSCP

QoS Policy Propagation through BGP (QPPB) Route map

Policy-based Routing Route map

Generic Traffic Shaping Access list

Priority Queuing / Custom Queuing Access list

Packet size

Input interface

Protocol

The Cisco IOS Modular QoS CLI (MQC) Class-map

Mechanisms of Marking

QOS Mechanism Available Markers

Committed Access Rate (CAR) IP precedence

DSCP

QoS group

MPLS experimental bits

QoS Policy Propagation through BGP QPPB) IP precedence

QoS group

Policy-based Routing (PBR) IP precedence

QoS group

Class-based Marking IP precedence/ DSCP

QoS group

MPLS experimental bits

ATM CLP bit

Frame Relay DE bit

802.1Q/ISL cos/priority

- 44 -Rita2610

Page 46: QoS Practice Labs - English

QoS Practice Labs

IP Precedence and DSCP values

IP Precedence DSCP

Binary Priority Application Binary Name Application

0 000 Routine Best Effort0 -

7000000 BE 0-7

1 001 Priority Bulk Data

8

10

12

14

001000

001010

001100

001110

CS1

AF11

AF12

AF13

8-15

2 010 Immediate Transactional

16

18

20

22

010000

010010

010100

010110

CS2

AF21

AF22

AF23

16-23

3 011 Flash Call Signaling

24

26

28

30

011000

011010

011100

011110

CS3

AF31

AF32

AF33

24-31

4 100 Flash override

Streaming

Video

32

34

36

38

100000

100010

100100

100110

CS4

AF41

AF42

AF43

32-39

5 101 CriticalVoice

46 101110 EF 40-47 (EF)

6 110Internetwork

ControlRouting 48 110000 Reserved 48-55

7 111 Network Control Reserved 56 111000 Reserved 56-63

- 45 -Rita2610

Page 47: QoS Practice Labs - English

QoS Practice Labs

Modular QoS CLI (MQC)

1. Overview

The Modular Quality of Service Command Line Interface (Modular QoS CLI) breaks down 2 part :

* Classification : Creating the class for each traffic.

* Service Policy : Applying one or more QoS mechanisms to the class such as Class-based

Weighted Fair Queuing, Class-based Low-latency Queuing, Class-based Policing, Class-based

Shaping, Class-based Marking.

* The functions of Class-based mechanisms

PHB Mechanism QoS Function

Class-based Weighted Fair Queuing guarantees bandwidth within the CB-WFQ system

Class-based Low-latency Queuing guarantees bandwidth and provide low latency to

time-critical traffic

Class-based Policing performs rate limiting by traffic policing

Class-based Shaping performs rate limiting by traffic shaping

Class-based Marking performs packet and frame marking

- 46 -Rita2610

IncomingPackets

Classification 256 class

Service Policy

OutgoingPackets

CB WFQ (64)CB LLQ (64)CB PolicingCB ShapingCB Marking

Classification 256 class

Service Policy CB PolicingCB ShapingCB Marking

Forwarding

Page 48: QoS Practice Labs - English

QoS Practice Labs

* The combination of Class-based mechanisms

CB Mechanism Command Direction Combination

WFQ Bandwidth Output WRED, Shaping, Policing, Marking

LLQ Priority Output Shaping, Policing, Marking

WRED Random-detect Output WFQ, LLQ

Policing Police Input/Output WRED, Shaping, WFQ, LLQ, Marking

Shaping Shape Output WRED, Policing, WFQ, LLQ, Marking

Marking Set Input/Output WRED, Policing, Shaping, WFQ, LLQ

+ Class-based Marking : is used for marking of packets by setting the values in the layer 2,3,4

header of inbound and outbound packets on the input/output interface of router. The values can be

IP precedence, DSCP, QoS group, MPLS experimental bits, ATM CLP bit, Frame Relay DE bit,

802.1Q/ISL cos/priority.

Marker Types of Network (To get through) Value range

IP Precedence IP network 8 ( 0 – 7 )

DSCP IP network 64 ( 0 – 63 ), 32 standard

QoS Group Local to a router

( internal parameter in the router and it

is lost the moment a packet is sent )

100 ( 0 -99 )

MPLS experimental bits MPLS network 8 ( 0 – 7 )

Frame Relay DE bit Frame Relay network 2 ( 0 - 1 )

ATM CLP bit ATM network 2 ( 0 - 1 )

IEEE 802.1Q/ISL CoS LAN switched network 8 ( 0 – 7)

+ Class-based Weighted Fair Queuing :

- 47 -Rita2610

Page 49: QoS Practice Labs - English

QoS Practice Labs

+ Class-based Low-latency Queuing : separates 2 kinds of queue

Priority scheduler only serves the priority queue which guarantees low-latency propagation

of packets and bandwidth. You can create one or more priority queue for performing

different policies of traffic.

WFQ-like scheduler attaches the service policy to other queues which can only guarantee

bandwidth.

2. Purpose of lab

With the lab of the MCQ, you practice on classification and applying 2 service policies in policy

for each router. Go through the lab, you will use the Class-based Marking to mark packets with

DSCP values and verify result by capturing with Wireshark software. After that, you will configure

Class-based Low-latency Queuing for applying the traffic policies with percent of guaranteed

- 48 -Rita2610

Class-based Weighted Fair Queuing

PacketsOut

PacketsIn

Queue 1CB -WFQScheduler

HardwareQueue

Queue 2

Def. Queue

1

2

Default

PacketClassifier

WFQScheduler

PacketsIn

Class-based Low-latency Queuing

PacketsOut

Priority Queue

HardwareQueue

Queue 2

Def. Queue WFQ/FIFO

Priority

1

N

Default

PacketClassifier

Queue N

Page 50: QoS Practice Labs - English

QoS Practice Labs

bandwidth in difference and using software of monitoring or measuring bandwidth, such as

Netflow Manager to test the policies.

3. Prerequisites

- Using copper Cross-over cable to connect 2 PCs.

PC1 :

- Install Wireshark software.

- Install Loopback Adapter for creating enough 2 network adapters.

- Install GNS3 software and design a following network topology.

4. Configuration Commands

a. Classification by using class-map command

LLQ(config)#class-map [class-name]

LLQ(config-cmap)#match < Classification Options >

- 49 -Rita2610

Page 51: QoS Practice Labs - English

QoS Practice Labs

Classification Option Command

Access lists Router (config-cmap)#match access-group [ACL-ID]

IP precedence Router(config-cmap)# match ip precedence precedence [prec [prec [prec]]]

(4 IP Precedence values)

DSCP Router(config-cmap)#match ip dscp dscp [dscp ...] (8 DSCP values)

Input interface Router(config-cmap)# match input-interface intf

QoS group Router(config-cmap)# match ip qos-group qos-group

Source / Destination

MAC address

Router(config-cmap)# match source-address mac mac-address

Router(config-cmap)# match destination-address mac mac-address

IEEE 802.1Q/ISL CoS Router(config-cmap)# match cos cos [cos [cos [cos ]]]

(4 CoS/Priority values)

MPLS experimental bitsRouter(config-cmap)# match mpls experimental exp [exp ...] (8 MPLS

experimental values)

Frame Relay DE bit Router(config-cmap)# match fr-de (match frames with the FR DE bit set )

RTP port - a UDP Port

RangeRouter(config-cmap)# match ip rtp starting-port port-range

Another class map,

negation or any keyword

Router(config-cmap)# match not condition

( The “not” keyword inverts the condition )

router(config-cmap)# match class-map class-map

router(config-cmap)# match any ( match all packets )

b. Creating traffic policy for the traffic class by using policy-map command

Router(config)#policy-map [policy-name]

Router(config-pmap)#class [class-name]

Router(config-pmap-c)# < PHB mechanism >

Class-based Marking

Marking(config)#policy-map [policy-name]

Marking(config-pmap)#class [class-name]

Marking(config-pmap-c)#set dscp [dscp]

- 50 -Rita2610

Page 52: QoS Practice Labs - English

QoS Practice Labs

Class-based Low-latency Queuing

LLQ(config)#policy-map [policy-name]

LLQ(config-pmap)#class [class-name]

LLQ(config-pmap-c)#priority percent [%]

LLQ(config-pmap-c)#priority [kbits/s]

LLQ(config-pmap)#class [class-name]

LLQ(config-pmap-c)#bandwidth percent [%]

LLQ(config-pmap-c)#bandwidth [kbits/s]

c. Attaching the traffic policy to inbound or outbound traffic on interfaces by using service policy

command

Router(config)#interface serial/fastethenet [interface-number]

Router(config-if)#service-policy {input | output} [policy-map-name]

d. Verifying Configuration

Displays informations and statistics about queuing on interface

show interface interface

show queueing

show queueing fair

show queue interface

- 51 -Rita2610

Page 53: QoS Practice Labs - English

QoS Practice Labs

5. Network Topology

6. Configuration Tasks

- Assign IP addresses to devices.

- Configure RIP routing protocol on routers.

- Configure Class-based Marking on R1 and LLQ on R2 to provide guarantees of bandwidth.

R1 :

Configure Class-based Marking with name of Marking-1

The traffic classification based on Access Control List

+ Create Access Control Lists to specify each traffic.

R1(config)# access-list 100 permit tcp any any eq telnet

R1(config)# access-list 101 permit tcp any any eq www

R1(config)# access-list 102 permit udp any any eq 9996

R1(config)# access-list 103 permit icmp any any echo

- 52 -Rita2610

Netflow -PC2

Telnet+HTTP

PC1 Loopback

200.0.0.0/24

Fa2/0

Fa2/0

.1 .2

S1/0

S1/0

S1/0

.2

.2

.1S1/1

.1

.2 .1

100.0.0.0/8

20.0.0..0/8

10.0.0.0/8

R1 R3R2

PC2

R1 R3R2 R1 R3

Work place

R2

R1

R3

R2

R1 R3

Work place

R2R1 R3R2

R1

R3

R2

R1

R3

R2

Telnet HTTP RIP Netflow Ping AF21 AF31 CS6 CS2 CS1

LLQ

Classification

LLQ – R2Telnet : 35% (Priority) HTTP : 50 kbits/sNetflow : 15 kbits/sRIP : 10 kbits/sPing : 8 kb/sDefault : fair-queue

Classification Marking

Page 54: QoS Practice Labs - English

QoS Practice Labs

+ Create traffic class to match each Access Control Lists.

* Class Telnet :

R1(config)# class-map telnet

R1(config-cmap)# match access-group 100

* Class HTTP :

R1(config)# class-map http

R1(config-cmap)# match access-group 101

* Class Netflow :

R1(config)# class-map netflow

R1(config-cmap)# match access-group 102

* Class RIP :

R1(config)# class-map ping

R1(config-cmap)# match access-group 103

Marking packets with DSCP values and applying to inbound interface

+ The DSCP value is set with policy of each traffic as in the network topology

R1(config)# policy-map Marking-IN-1

* Class telnet ( dscp AF21)

R1(config-pmap)# class telnet

R1(config-pmap-c)# set dscp af21

* Class HTTP ( dscp AF31)

R1(config-pmap)# class http

R1(config-pmap-c)# set dscp af31

* Class Netflow ( dscp CS21)

R1(config-pmap)# class netflow

R1(config-pmap-c)# set dscp cs2

* Class Ping

R1(config-pmap)# class ping

R1(config-pmap-c)# set dscp cs1

+ Apply Class-based Marking to inbound interface Fa2/0 on R1

R1(config)#int fa2/0

R1(config-if)# service-policy input Making-IN-1

- 53 -Rita2610

Page 55: QoS Practice Labs - English

QoS Practice Labs

- The configuration of Classification on R2 can do or not, cause that the traffics only went in one

direction and did not mark again. You can repeat as same as the R1 but don’t need. So, only

configure Class-based Low-Latency Queuing and apply to outbound interface on R2

+ The traffic classification based on DSCP values that were marked on R1.

R2(config)# policy-map LLQ-OUT-2

* Class HTTP

R2(config-pmap)# class telnet

R2(config-pmap-c)# priority percent 35

* Class HTTP, RIP, Netflow, Ping

R2(config-pmap)# class http

R2(config-pmap-c)# bandwidth 50

R2(config-pmap)# class netflow

R2(config-pmap-c)# bandwidth 15

R2(config-pmap)# class rip

R2(config-pmap-c)# bandwidth 10

R2(config-pmap)# class ping

R2(config-pmap-c)# bandwidth 8

* The traffic that is unclassed to guarantee the quality of service is assigned to Fair Queue

R2(config-pmap)# class class-default

R2(config-pmap-c)# fair-queue

+ Apply Class-based Low-Latency Queuing to outbound interface S1/1 on R2

R2(config)#int S1/1

R2(config-if)# service-policy output LLQ-OUT-2

7. Verifying Configuration

a. Class-based Marking

Show policy-map Marking-IN-1 on R1

- 54 -Rita2610

Page 56: QoS Practice Labs - English

QoS Practice Labs

Using Wireshark to capture the marked packets.

- 55 -Rita2610

Page 57: QoS Practice Labs - English

QoS Practice Labs

- 56 -Rita2610

Telnet : AF21

HTTP : AF31

Page 58: QoS Practice Labs - English

QoS Practice Labs

b. Class-based Low-latency Queuing.

- 57 -Rita2610

Netflow: CS2

Page 59: QoS Practice Labs - English

QoS Practice Labs

- 58 -Rita2610

Page 60: QoS Practice Labs - English

QoS Practice Labs

- 59 -Rita2610

Page 61: QoS Practice Labs - English

QoS Practice Labs

Advanced Network Topologies

Some Network Topology in advance are combination of the queuing mechanisms to revise.

- 60 -Rita2610

Page 62: QoS Practice Labs - English

QoS Practice Labs

- 61 -Rita2610

Netflow -PC2

Telnet+HTTP

PC1 Loopback

200.0.0.0/24

Fa2/0

Fa2/0

.1 .2

S1/0

S1/0

S1/0

.2

.2

.1S1/1

.1

.2 .1

100.0.0.0/8

20.0.0..0/8

10.0.0.0/8

R1 R3R2

PC2

R1 R3R2 R1 R3

Work place

R2

R1

R3

R2

R1 R3

Work place

R2R1 R3R2

R1

R3

R2

R1

R3

R2

Telnet HTTP RIP Netflow(R1) Ping AF41 AF21 CS6 CS2 CS1

Telnet HTTP RIP Netflow Ping AF41 AF21 CS6 CS2 CS1

Classification

Telnet HTTP RIP Netflow Ping AF21 AF31 CS6 0 0

Marking

LLQ

Classification

LLQ

Marking

Classification

LLQ – R1HTTP : 45% (Priority) Netflow : 2%RIP : 13%Telnet : 15%LLQ – R2Telnet : 35% (Priority) HTTP : 50 kbits/sNetflow : 15 kbits/sRIP : 10 kbits/sPing : 8 kb/sDefault : fair-queue

Classification

Page 63: QoS Practice Labs - English

QoS Practice Labs

- 62 -Rita2610

.1

S0/0S0/2

S0/1

12.0.0.0/8

200.0.0.0/24

10.0.0.0/8

.1

.2

.1

.2Telnet

PC1 Loopback

110.0.0.0/8

Fa2/0

Fa2/0

.1 .2

S1/0

S0/0

S1/0

.2

.2

.1

S1/0

.1

.2 .1

90.0.0.0/8

172.32.0..0/16

192.168.1.0/24

R1 R3R2

FTP server

R1

R3

R2

R1 R3

Work place

R2R1 R3R2

R1

R3

R2

Telnet HTTP RIP FTP Ping AF21 AF31 CS6 AF12 0

Priority

LLQ – R2Telnet (R1) : 35% (Priority) HTTP : 50 kbits/sRIP : 10 kbits/sTelnet (R4) : 40 kbit/sPing (R1): 8 kb/sPing (R4): 16 kb/sDefault : fair-queue

R1

R3

R2

R1

R3

R2

R1

R3R2

HTTP RIP FTP PingAF31 CS6 AF12 0

R1 R3R2R1 R3R2 R1 R3

Work place

R2

Classification

Marking

R1 R4

Classification Marking

Priority – R1High : Telnet Medium : HTTPNormal (Def.) : RIP, othersLow : Ping 8 kb/s

.2

R1 R3R2

R5

R1

R3

R2

S0/1

S0/0

HTTP

LLQ

Classification

HTTP RIP FTP Ping(R2) Ping(R5) CS5 CS6 AF11 AF1 CS1

Ping 0

Page 64: QoS Practice Labs - English

QoS Practice Labs

- 63 -Rita2610