Sunteți pe pagina 1din 65

TI LIU HNG DN THC HNH QUN L CHT LNG DCH V MNG CHO SINH VIN CHUYN NGNH MNG

MY TNH V TRUYN THNG

L HU THU

THNH PH H CH MINH NM 2009

QoS Practice Labs

QoS Practice Labs


Written by Lu Hue Thu

-2Rita2610

QoS Practice Labs

INTRODUCTION
QoS 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 : ritalu2610@yahoo.com or evylu.2610@yahoo.com

-3Rita2610

QoS Practice Labs

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

-4Rita2610

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

-5Rita2610

QoS Practice Labs

Administering Cisco QoS for IP Networks - Syngress

-6Rita2610

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.

-7Rita2610

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-hopinterface [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] show ip rsvp installed [interface- number] Display RSVP-related interface information 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

RSVP Sender W o rk
.1 172.32.0.0/16 .2
W o rk p la c e W o rk p la c e
p la c e

W o rk p la c e

RSVP Reservation W o rk W o rk
p la c e
Work place

p la c e

S1/0
R 1 R 2 R 3

Fa0/0

.1
Work place

RSVP Router
R3

S1/0 place
Work

Work

.1

.2
plaWce o r k p la c e

R 1

R 2

R 3

Fa0/0 192.168.1.0/24

50.0.0.0/8 R2 S1/0
R1

W o rk p la c e

S1/1

70.0.0.0/8 R2
R1

R3

.2
R 1 R 2 R 3

.1

.2
W o rk p la c e W o rk p la c e

R 1

R 2

R 3

R 1

PC1 Loopback

PC2

R 2

R 3

5. Configuration Tasks - Assign IP addresses to the devices. - Configure static route on routers (by yourseft). - Enabling RSVP on all appropriate interfaces (all router). -8Rita2610

QoS Practice Labs 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.

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

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

-9Rita2610

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

- 10 Rita2610

QoS Practice Labs

+ Show neighbor of RSVP-enabled router.

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

- 11 Rita2610

QoS Practice Labs

6. Using WireShark software to analyse the RSVP messages

- 12 Rita2610

RSVP Packet Format


RSVP Message Header Fields
4 4 8 16 16 8 8 32 15 1 16

bits

Version

Flags Type Checksum

Length

Reserved

Send TTL

Message ID

Reserved

MF

Fragment offset

cur flags = 0

a label for all fragments of one message

the byte offset of the fragment in the message

MF flag is set on for all fragments of a message except the last fragment. Value
1 2 3 4 5 6 7

Message Type Path Reservation-request Path-error Reservation-request error Path-teardown Reservation-teardown Reservation-request acknowledgment

Descriptions Store the path state in each node and route reservation-request messages in the reverse direction Request for guarantee QoS for the session. 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 Appears when reservation-confirmation object in a reservation-request message.

QoS Practice Labs RSVP Object Fields


16 8 8 Variable<=65528 bytes bits

Length Class-num C-Type


Object class (name) Object type

Object contents

Objects Null Session RSVP Hop Time Value Style Flow Specification Filter Specification Sender Template Sender TSPEC Adspec Error Specification Policy Data Scope Reservation Confirmation

Types of messages anywhere in a obj. sequence objects all RSVP messages all RSVP messages Path Reservation Reservation-request Reservation-request Reservation-request Path Path Path Path-error Reservation-request error Path Reservation-request Reservation-request Reservation-request Reservation-request ack

Contents Class-Num : 0, C-Type : ignored. The receiver will ignored this object contents Specify a session, contain IP destination address and possibly a destination port. IP address of the RSVP-capable node. The refresh period and the state TTL The reservation style and style-specific information. Specify flow that define desired QoS. Specify the sessions that should receive the desired QoS. Identify a sender, contain sender IP address and perhaps some additional demultiplexing information. The traffic characteristics of a senders data stream. Advertising data. Specify an error. Information about local policy to decide permit an associated reservation. Specify the scope for forwarding a reservation-request message IP address of a receiver that requested a confirmation - 14 Rita2610

QoS Practice Labs

RSVP Header

Path message

Object Fields

- 15 Rita2610

RESV message

Path tear message

RESV tear message

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.

FIFO WFQ Priority Queuing Custom Queuing ..... Forwarding Incoming Packets Software Queue

FIFO

Outgoing Packets

Tail-drop (randomly)

- 19 Rita2610

Hardware Queue

QoS Practice Labs

Queuing Mechanisms

IP RTP Modified Prioritization Deficit Round-robin

Distributed Weighted Weighted Fair Custom Fair Queuing Queuing Queuing

Priority FIFO Queuing Queuing

- 20 Rita2610

Flow-based WFQ ToS-based dWFQ Distributed Class-based WFQ Flow-based dWFQ Class-based WFQ

QoS-groupbased dWFQ

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.

Flow N

- 21 Rita2610

Hardware Queue

Packets In

Queue N

Queue 2

Flow 2

Queue 1

Flow 1

Queue
WFQ Scheduler

Packet Classifier

Hardware Queue

Packet In

FIFO Scheduler

Packets Out

Packets Out

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 * in | out : Input / Output queue c. Verifying Configuration - 22 Rita2610 . * max-limit : the maximum of the limited packet that is hold in the WFQ system.

QoS Practice Labs show running-config Displays commands are configured. show interface interface Displays informations and statistics about queuing on interface show queueing fair Displays queuing parameters on interface interface show queue interface 4. Network Topology
W o rk p la c e

Displays queue contents

R1
W ork pla ce

W o rk p la c e

.1

100.0.0.0/8
R 1 R 2 R 3

.2 S1/0

W o rk p la c e
W rk o pla ce

R2
R 2 R 3

W o rk p la c e

.1

.1 190.168.0.0/16 .2
W o rk p la c e W o rk p la c e

R 1

R 2

R 3

S1/0

R 1

Fa2/0

Fa2/0

172.32.0.0/1 6 .2
W o rk p la c e W o rk p la c e

WFQ FIFO FIFO

PC1 - Loopback Note : Default Queuing : Interface FastEthernet - FIFO Queuing. Interface Serial - Weight Fair Queuing

R 1

R 2

R 3

R 1

R 2

R 3

PC2

5. Configuration Tasks - Assign IP addresses to devices and configure RIP routing protocol on Router. * Using Show command to verify default queuing on R1s Fa2/0 (FIFO Queuing)

- 23 Rita2610

QoS Practice Labs

- Modify the FIFO queuing length. Default length : 40

- 24 Rita2610

QoS Practice Labs

* Using Show command to verify default queuing on R1s S1/0 (WFQ)

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

QoS Practice Labs

- Show WFQ system on all Serial interfaces

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

- 26 Rita2610

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 R1s S1/0. The following shows the current state of R1s queue. The weight of ICMP is 32384.

- 27 Rita2610

QoS Practice Labs * Configure FIFO on S1/0

- 28 Rita2610

QoS Practice Labs * Configure WFQ on Fa2/0

- 29 Rita2610

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

Low

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.

Queue 3

Normal

- 30 Rita2610

Hardware Queue

Queue 2 Queue 4

Packets In

Medium

Queue 1
Re-empty Scheduler Packets Out

High

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 gt/lt <size> list <acl> tcp/udp <port> IP packets with non-zero fragment offset ( Match fragments) Based on packet size (including L2 frame)( Match packets based on their size) ACL classification (standard or extended) 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 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 )

queue for all unclassified packets)

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 show queueing [ priority | custom | fair | random-detect] interface debug priority 4. Network Topology Displays information and statistics about queuing on interface Displays queuing parameters on interfaces Displays the current state of priority Queuing

- 31 Rita2610

QoS Practice Labs

Telnet+HTTP
W o rk p la c e
W ork pla ce

W o rk p la c e

.1

100.0.0.0/8
R 1 R 2 R 3

.2 S1/0

W o rk p la c e
W rk o pla ce

W o rk p la c e

.1 10.0.0.0/8 .2

R 1

Fa2/0

R 2 R1

R 3

S1/0

R 1

R 2 R2

R 3

.1 20.0.0.0/8 .2
W o rk p la c e W o rk p la c e

Fa2/0

W o rk p la c e

W o rk p la c e

Priority Queue
R 1 R 2 R 3

PC1 Remote Desktop FTP Server

High (size = 2 ) : Telnet, Remote Desktop Medium (size = 4): HTTP Normal (size = 6): FTP, other traffic Low (size = 8) : PING

R 1

R 2

R 3

PC2 Loopback

5. Configuration Tasks - Assign IP addresses to devices. - Configure RIP routing protocol on Router (by yourself). - Configuring Priority Queue on R1s 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 R1s S1/0 R1(config) # int S1/0 R1(config-if) # priority-group 1 - 32 Rita2610

QoS Practice Labs c. Verifying Configuration + The following shows Priority Queuing is configured on interface S1/0 of R1.

+ 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 R1s S1/0.

- 33 Rita2610

QoS Practice Labs

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

- 34 Rita2610

QoS Practice Labs

- 35 Rita2610

QoS Practice Labs

d. Configure the queue sizes in Priority Queuing on R1s 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

- 36 Rita2610

QoS Practice Labs

- 37 Rita2610

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

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.

- 38 Rita2610

Hardware Queue

Queue N

Queue 2

Packets In

Queue 1
Round Robin Scheduler Packets Out

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 queuekeyword 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 show queueing [ priority | custom | fair | random-detect] interface debug custom-queue 4. Network Topology Displays information and statistics about queuing on interface Displays queuing parameters on interfaces Displays the current state of Custom Queuing

- 39 Rita2610

QoS Practice Labs

HTTP
.1 10.0.0.0/8
W o rk p la c e W o rk p la c e
W o rk p la c e
W ork p lace

W o rk p la c e

.1

100.0.0.0/8
R 1 R 2 R 3

.2 S1/0

W o rk p la c e
W rk o p ce la

W o rk p la c e

.1

R 1

Fa2/0

R 2 R1

R 3

S1/0

R 1

R R2 2

R 3

Fa2/0

20.0.0.0/8 .2
W o rk p la c e W o rk p la c e

.2

R 1

R 2

R 3

PC1 Remote Desktop

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)

R 1

R 2

R 3

PC2 Loopback

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 R1s S1/0 - 40 Rita2610

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

- 41 Rita2610

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

- 42 Rita2610

QoS Practice Labs

- 43 Rita2610

QoS Practice Labs

Classification and Marking


Marking Input Processing Classification Classification Output Processing Marking

Incoming Packets

Forwarding Process Swtching Fast Switching Autonomous Switching Optimum Switching Netflow Switching CEF Switching

Outgoing Packets

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

- 44 Rita2610

QoS Practice Labs

Mechanisms of Classification QOS Mechanism Committed Access Rate (CAR) Classification Options Access list Rate limit access list QoS-group QoS Policy Propagation through BGP (QPPB) Policy-based Routing Generic Traffic Shaping Priority Queuing / Custom Queuing DSCP Route map Route map Access list Access list Packet size Input interface The Cisco IOS Modular QoS CLI (MQC) Protocol Class-map

Mechanisms of Marking QOS Mechanism Committed Access Rate (CAR) Available Markers IP precedence DSCP QoS group QoS Policy Propagation through BGP QPPB) Policy-based Routing (PBR) Class-based Marking MPLS experimental bits IP precedence QoS group IP precedence QoS group IP precedence/ DSCP QoS group MPLS experimental bits ATM CLP bit Frame Relay DE bit 802.1Q/ISL cos/priority IP Precedence and DSCP values

IP Precedence - 45 Rita2610

DSCP

QoS Practice Labs Binary 0 000 Priority Routine Application Best Effort 07 Binary 00000 0 00100 0 8 1 001 Priority Bulk Data 10 12 14 00101 0 00110 0 00111 0 01000 0 16 2 010 Immediate Transactional 18 20 22 01001 0 01010 0 01011 0 01100 0 24 3 011 Flash Call Signaling 26 28 30 01101 0 01110 0 01111 4 100 Flash override Streaming Video 32 34 36 38 0 10000 0 10001 0 10010 0 10011 - 46 Rita2610 CS4 AF41 AF42 AF43 32-39 CS3 AF31 AF32 AF33 24-31 CS2 AF21 AF22 AF23 16-23 CS1 AF11 AF12 AF13 8-15 Name BE Application 0-7

QoS Practice Labs

5 6 7

101 110 111

Critical Internetwork Control Network Control

Voice

46 48 56

10111 0 11000 0 11100 0

EF Reserved Reserved

40-47 (EF) 48-55 56-63

Routing Reserved

- 47 Rita2610

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. Classification 256 class Service Policy Classification 256 class Service Policy

CB Policing CB Shaping CB Marking

CB WFQ (64) CB LLQ (64) CB Policing CB Shaping CB Marking

Incoming Packets

Forwarding

Outgoing Packets

* The functions of Class-based mechanisms PHB Mechanism Class-based Weighted Fair Queuing Class-based Low-latency Queuing Class-based Policing Class-based Shaping Class-based Marking QoS Function guarantees bandwidth within the CB-WFQ system guarantees bandwidth and provide low latency to time-critical traffic performs rate limiting by traffic policing performs rate limiting by traffic shaping performs packet and frame marking

* The combination of Class-based mechanisms

- 48 Rita2610

QoS Practice Labs

CB Mechanism WFQ LLQ WRED Policing Shaping Marking

Command Bandwidth Priority Random-detect Police Shape Set

Direction Output Output Output Input/Output Output Input/Output

Combination WRED, Shaping, Policing, Marking Shaping, Policing, Marking WFQ, LLQ WRED, Shaping, WFQ, LLQ, Marking WRED, Policing, WFQ, LLQ, Marking 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 IP Precedence DSCP QoS Group Types of Network (To get through) IP network IP network Local to a router
( internal parameter in the router and it is lost the moment a packet is sent ) MPLS network Frame Relay network ATM network LAN switched network

Value range 8(07) 64 ( 0 63 ), 32 standard 100 ( 0 -99 )

MPLS experimental bits Frame Relay DE bit ATM CLP bit IEEE 802.1Q/ISL CoS

8(07) 2(0-1) 2(0-1) 8 ( 0 7)

+ Class-based Weighted Fair Queuing : Packet Classifier

Default

Class-based Weighted Fair Queuing + Class-based Low-latency Queuing : separates 2 kinds of queue - 49 Rita2610

Hardware Queue

Def. Queue

Queue 2

Packets In

Queue 1
CB -WFQ Scheduler Packets Out

QoS Practice Labs 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. Packet Classifier Priority Packets In 1

N Default

Class-based Low-latency Queuing 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 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 - 50 Rita2610

Hardware Queue

Def. Queue WFQ/FIFO

Queue N

Queue 2

Priority Queue
WFQ Scheduler Packets Out

QoS Practice Labs LLQ(config)#class-map [class-name] LLQ(config-cmap)#match < Classification Options >

- 51 Rita2610

QoS Practice Labs

Classification Option Access lists IP precedence DSCP Input interface QoS group Source / Destination MAC address IEEE 802.1Q/ISL CoS MPLS experimental bits Frame Relay DE bit RTP port - a UDP Port Range Another class

Command Router (config-cmap)#match access-group [ACL-ID] Router(config-cmap)# match ip precedence precedence [prec [prec [prec]]] (4 IP Precedence values) Router(config-cmap)#match ip dscp dscp [dscp ...] (8 DSCP values) Router(config-cmap)# match input-interface intf Router(config-cmap)# match ip qos-group qos-group Router(config-cmap)# match source-address mac mac-address Router(config-cmap)# match destination-address mac mac-address Router(config-cmap)# match cos cos [cos [cos [cos ]]] (4 CoS/Priority values) Router(config-cmap)# match mpls experimental exp [exp ...] (8 MPLS experimental values) Router(config-cmap)# match fr-de (match frames with the FR DE bit set ) Router(config-cmap)# match ip rtp starting-port port-range Router(config-cmap)# match not condition

map, ( The not keyword inverts the condition ) router(config-cmap)# match class-map class-map router(config-cmap)# match any ( match all packets )

negation or any keyword

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] Class-based Low-latency Queuing LLQ(config)#policy-map [policy-name] LLQ(config-pmap)#class [class-name]

- 52 Rita2610

QoS Practice Labs 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

- 53 Rita2610

QoS Practice Labs 5. Network Topology

20.0.0..0/8
W o rk p la c e W o rk p la c e

Netflow -PC2 W o rk W o rk
.1
Fa2/0
R 1 p la c e p la c e

.2

LLQ R2 Telnet : 35% (Priority)


Work place

R1 R 2

R 3

PC1 Loopback

R 1

R 2

R 3

S1/0

.1

Classification

Marking

Work

100.0.0.0/8
place R2 R3

HTTP : 50 kbits/s Netflow : 15 kbits/s RIP : 10 kbits/s Ping : 8 kb/s Default : fair-queue

Telnet HTTP RIP Netflow Ping AF21 AF31 CS6 CS2 CS1R1

S1/0 p l a c e
R 1

W o rk

.2 R2 R 2

W o rk p la c e

Classification
Work LLQ place

R 3

S1/1
Work

.1

200.0.0.0/24
place R2 R1 R3

S1/0

W o rk p la c e

.2 R3 R 2

W o rk p la c e

10.0.0.0/8
W o rk p la c e

.1

.2

W o rk p la c e

R 1

R 3

Fa2/0
R 1 R 2 R 3

Telnet+HTTP

PC2

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 - 54 Rita2610

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

- 55 Rita2610

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

- 56 Rita2610

QoS Practice Labs

Using Wireshark to capture the marked packets.

- 57 Rita2610

QoS Practice Labs

Telnet : AF21

HTTP : AF31

- 58 Rita2610

QoS Practice Labs

Netflow: CS2

b. Class-based Low-latency Queuing.

- 59 Rita2610

QoS Practice Labs

- 60 Rita2610

QoS Practice Labs

- 61 Rita2610

QoS Practice Labs

Advanced Network Topologies


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

- 62 Rita2610

QoS Practice Labs

Classification

Marking

20.0.0..0/8
W o rk p la c e W o rk p la c e

.2

.1
Fa2/0

W o rk p la c e

W o rk p la c e

Classification
Work

R 1

R1
R 2

R 3

PC1 Loopback

R 1

R 2

R 3

Netflow -PC2

S1/0
Work

.1

place

LLQ

100.0.0.0/8
place R2 R1 R3

LLQ R1 HTTP : 45% (Priority) Netflow : 2% RIP : 13% Telnet : 15% LLQ R2 Telnet : 35% (Priority) HTTP : 50 kbits/s Netflow : 15 kbits/s RIP : 10 kbits/s Ping : 8 kb/s Default : fair-queue

Telnet HTTP RIP Netflow Ping AF21 AF31 CS6 0 0

S1/0 p l a c e
R 1

W o rk

.2 R2 R 2

W o rk p la c e

Marking

Classification

R 3

S1/1

.1

ork WLLQ place

Classification

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

Work

200.0.0.0/24
place R2 R1 R3

S1/0

W o rk p la c e

.2 R3 R 2

W o rk p la c e

10.0.0.0/8
W o rk p la c e

.1

.2

W o rk p la c e

R 1

R 3

Fa2/0
R 1 R 2 R 3

Telnet+HTTP
Telnet HTTP RIP Netflow Ping AF41 AF21 CS6 CS2 CS1

PC2

- 63 Rita2610

QoS Practice Labs Classification Marking

172.32.0..0/16
W o rk p la c e W o rk p la c e

.2

.1
Fa2/0

W o rk p la c e

W o rk p la c e

W o rk p la c e

W o rk p la c e

R 1

R1 R1 R 2
S1/0

R 3

PC1 Loopback

R 1

R 2

R 3

.1

Wo Priority

rk place

R 1

R4 R 2

R 3

.1

Work place
Telnet HTTP RIP FTP Ping AF21 AF31 CS6 AF12 0

Classification
90.0.0.0/8

LLQ R2 Telnet (R1) : 35% (Priority) HTTP : 50 kbits/s RIP : 10 kbits/s Telnet (R4) : 40 kbit/s Ping (R1): 8 kb/s Ping (R4): 16 kb/s Default : fair-queue

Work place R1
10.0.0.0/8

LLQ
Work place

R2
Priority R1 High : Telnet Medium : HTTP Normal (Def.) : RIP, others Low : Ping 8 kb/s

R3
S0/0
W o rk p la c e

R2
S0/1
W o rk p Work e la c place

R1

.2 R2 R 2

.2 .1 .1

S0/2
R1

Work place

S0/0 W

o rk p la c e

W o rk p la c e

R3
R2 R3

R 1

R 3

200.0.0.0/24

.2
R 1

Telnet

S1/0

Work place

R5 R 2
S0/1

R 3

Work place

.1 Ping 0

110.0.0.0/8

12.0.0.0/8
R1

Work place
HTTP RIP FTP Ping AF31 CS6 AF12 0

Classification
Work

R2

R3 R2
.2 o r k W
p la c e

.2 .1 R3 R 2
R 3

Marking
W o rk p la c e

place

R3
W p la c e

S0/0 o rk

R1

S1/0
R 1

192.168.1.0/24
Fa2/0

.2

W o rk p la c e

HTTP

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

R 1

R 2

R 3

- 64 Rita2610

QoS Practice Labs

- 65 Rita2610

S-ar putea să vă placă și