QoS Cisco Slides
QoS Cisco Slides
QoS Cisco Slides
Overview
Overview
Quality of Service
defined
Loss
Loss
TCP Header
UDP Header
Delay or latency
consecutive packets.
A jitter buffer used to smooth out arrival times.
Increases total network delay.
In general, traffic requiring low latency also requires a minimum
variation in latency.
As a design rule, voice networks cannot cope with more than 30ms of
jitter.
Jitter in excess of 30ms will result in degraded audio performance.
Excessive jitter in a streaming video environment will result in:
Jerky motion
Loss of video quality
Loss of video
10
Network availability
Provisioning
Quality of Service
requirements for data
13
Quality of Service
requirements for voice
15
16
18
Best-Effort service
(single interface outbound queue)
Best-Effort service
(single interface outbound queue)
24
Traffic marking
Traffic marking
Traffic marking
Layer 2
Layer 3
27
CoS
28
ToS
ToS
31
Interface
Interface
service-policy
output policy1
service-policy
output policy1
service-policy
output policy2
policy-map policy1
class class1
bandwidth
queue-limit
random-detect
class class2
bandwidth
queue-limit
random-detect
class-map class1
match input-interface
policy-map policy2
class class1
bandwidth
queue-limit
random-detect
class class3
bandwidth
queue-limit
random-detect
class-map class2
match access-group
class-map class3
match input-interface
access-list
32
packets.
If a packet matches the specified criteria:
Packet is considered a member of the class
Packet is forwarded according to the QoS specifications set in
the traffic policy
Packets that fail to meet any of the matching criteria:
Classified as members of the default traffic class
Subject to a separate traffic policy
34
Classification of traffic
The class-map
If more than one match statement exists in the traffic class, use:
class-map match-any
or
class-map match-all
36
40
Switch(config)#policy-map policy1
Switch(config-pmap)#class cisco
Switch(config-pmap-c)#bandwidth 3000
Switch(config-pmap)#class class-default
Switch(config-pmap-c)#bandwidth 2000
Classify traffic
Switch(config)# class-map match-any cisco
flows as
Switch(config-cmap)# match access-group name test
Switch(config-cmap)# match interface fastethernet 0/1 belonging to a
common class
of QoS.
Any traffic which does not belong to the class cisco forms part of the catch-all
class-default class will be given a default bandwidth of 2000 kbps.
41
IP Precedence
3 bits = 8 possibilities.
Network control and Internetwork control classes are
usually reserved for router-generated packets such as
routing updates, ICMP messages, etc.
To protect packets that are necessary for the health of
the network.
Only 6 usable classes for production.
43
DSCP
44
Same
DSCP
Value
IP Packet
45
IP Precedence
Packets in AF13
will get dropped
before packets in
AF12, before
packets in AF11.
Expedited Forwarding (EF) PHB defines a premium service for video and VoIP.
Recommended DSCP is 101110
Assured Forwarding (AF) PHB defines a method by which BAs can be given
different forwarding assurances.
The AFxy PHB defines four AFx classes: AF1, AF2, AF3, and AF4.
Each class is assigned a certain amount of buffer space and interface
bandwidth, dependent on the SLA with the Service Provider/policy.
Within each AFx class (AFxy) it is possible to specify 3 drop precedence
values.
47
Classification at
the Access Layer
Layer 2
Layer 3
49
CoS bits then other devices must decide whether to trust the device
or not.
The default action of switches:
Not to trust edge devices
Any frames that enter the switch have their CoS re-written to the
lowest priority of 0.
If the edge device can be trusted:
Default behaviour must be overridden
Access switch must be configured to simply switch the frame
leaving the CoS bits untouched.
50
51
Assigning CoS on
a per-port basis
53
Re-writing the
CoS
54
55
56
Example
Set the DSCP field of packets coming from a single IPPhone (called receptionphone) within a switched network.
IP-Phone MAC address is 000.0a00.0111
57
58
The creation of the class-map can be verified with the show classmap command
59
CoS
DSCP 0
16
24
32
40
48
56
IP
Prec
61
62
63
The show mls qos interface command can be used to determine the
policies that are bound to a particular interface on the switch.
64
67
68
69
map.
Note:
Both the Catalyst 2950 and the Catalyst 3550 support the setting of
the DSCP.
The 3550 does support the setting of IP precedence.
The 2950 does not support the setting of IP precedence.
This is not a serious problem as the IP Precedence field forms the
first 3 bits of the DSCP. Thus by choosing and setting the
appropriate DSCP value, the IP Precedence can still be set.
70
Having now defined the action to be taken on FTP packets, the only
remaining step is to tell the switch which interfaces to apply the policy
to.
In this case the policy will be applied to all the interfaces so that QoS
will be maintained regardless of the interface an FTP source may be
connected to.
71
Scheduling
Suggested Readings
74
Queuing overview
75
Queuing
overview
Generalizations on Queuing:
If there is no congestion on the WAN link, traffic prioritization is
not necessary.
If a WAN link is constantly congested, traffic prioritization may not
resolve the problem.
Adding bandwidth might be the appropriate solution.
77
78
Custom
CBWFQ
Priority
LLQ (PQ/CBFQ)
WFQ
79
81
FQ Fair Queuing
(single interface outbound queue)
T3
addressing.
Common conversation discriminators are as follows (based on a
hash):
Source/destination network address
Source/destination Media Access Control (MAC) address
Source/destination port or socket numbers
Frame Relay data-link connection identifier (DLCI) value
Quality of service/type of service (QoS/ToS) value
The router determines what the actual flows are, not the
administrator.
86
WFQ is IP Precedence-aware.
This is only pertinent if the IP precedence bit is used
Coming next
87
Flow #3
17
15 14
10
88
Weighted fair
queuing
Our Value
32768
16384
10920
8192
6552
5456
4680
4096
IP Precedence
89
0-8
Flow #2
3-5
Flow #3
0-8
17
15 14
10
0-8
Flow #2
3-5
Flow #3
0-8
17
15 14
0-8
0-8
3-5
10
Flow #1
0-8
Flow #2
3-5
Flow #3
3-5
20
3-5
0-8
0-8
3-5
0-8
17
15 14
10
bits?
Problem is that high-priority packet, 3-5, cannot be dispatched until
after the large packet in front of it (same flow) leaves.
Packets within a flow are handled FIFO.
92
FYI
Configuring
weighted
fair queuing
Router(config-if)#fair-queue {congestive-discard-threshold}
FYI
Configuring
weighted
fair queuing
FYI
Configuring
weighted
fair queuing
95
Flow #1
0-8
Flow #2
3-5
Flow #3
3-5
20
3-5
15 14
0-8
3-5
WFQ
0-8
17
0-8
10
Flow #1
0-8
Flow #2
3-5
3-5
Flow #3
3-5
0-8
20
17
15 14
CBWFQ
0-8
3-5
10
0-8
0-8
3-5
0-8
3-5
3-5
WFQ
should reside in the same flow, regardless of any other conditions that
might place them into separate flows, such as Source/destination
network address, Source/destination Media Access Control (MAC)
address, etc.
The WFQ algorithm is still at work, but the queue definition is now
under control.
CBWFQ can be used to guarantee that flows receive adequate
bandwidth defined by the administrator.
98
CBWFQ
FIFO Queues
CBWFQ
Class
3
1 2
Highest BW
Lowest weight
Highest priority
Bandwidth is configured in the policymap class (later)
CBWFQ (not you) assigns a weight to each configured class instead of each
flow.
Weight is proportional to the bandwidth (you) configured for each class.
Weight is equal to the interface bandwidth divided by the class bandwidth or
can be configured as a percentage.
Weight = Interface bandwidth / class bandwidth
32 = 2,048 kbps / 64 kbps (2,048 kbps = 2 Mbps)
16 = 2,048 kbps / 128 kbps
64 = 2,048 kbps / 32 kbps
A class with a higher bandwidth value will have a lower weight
101
CBWFQ
Class
3
1 2
Highest BW
Lowest weight
Highest priority
By default, the total amount of bandwidth allocated for all classes must
not exceed 75 percent of the available bandwidth on the interface.
The other 25 percent is used for control and routing traffic.
This is why when you configure a T1 link (and slower), you only get
75% of the bandwidth, unless you turn off queuing.
102
CBWFQ
Class
3
1 2
Highest BW
Lowest weight
Highest priority
1 2
Highest BW
Lowest weight
Highest priority
104
congestion when packets arrive at an output port faster than they can
be transmitted.
The router tries to handle short-term congestions by packet
buffering.
Packet buffering has a cost of delay and jitter, but the packets are
not dropped.
Jitter Any distortion of a signal or image caused by poor
synchronization.
105
Full
106
Full
Tail drop.
A router simply discards any packet that arrives at the tail end
of a queue that has completely used up its packet-holding
resources.
Default queuing response to congestion.
Tail drop treats all traffic equally and does not differentiate between
classes of service.
107
CBWFQ and
tail drops
Full
Now, there is very
little traffic that
needs to be sent
out that interface.
When using tail drop, the router drops all traffic that exceeds the queue
limit.
Many TCP sessions then simultaneously go into a slow start.
This reduces the TCP window size.
Consequently, traffic temporarily slows as much as possible.
As congestion is reduced, window sizes begin to increase in
response to the available bandwidth.
108
Full
Time
Queue
overused
Queue
underused
1. Traffic flows
enter the
queue at
different times
2. When aggregate
3. Under use causes
load exceeds queue
synched TCP window
Tail drops cause
expansion.
synched TCP window
reduction.
networking.
For more information on these topics, please see:
TCP Performance
by Geoff Huston, Telstra
http://www.cisco.com/en/US/about/ac123/ac147/ac174/ac196/abou
t_cisco_ipj_archive_article09186a00800c8417.html
TCP/IP Illustrated, Vol. 1 W. Richard Stevens Addison-Wesley Pub Co
ISBN: 0201633469
IP Quality of Service, Cisco Press
110
WRED
114
WRED
Based on the profile and the average queue size, WRED calculates
the probability for dropping the current packet and either drops it or
passes it to the output queue.
If the queue is already full, the packet is tail-dropped.
Otherwise, it is eventually sent out on the interface.
WRED monitors the average queue depth in the router and determines
when to begin packet drops based on the queue depth.
When the average queue depth crosses the user-specified
minimum threshold, WRED begins to drop both TCP and UDP
packets with a certain probability.
115
WRED
WRED
threshold, then WRED reverts to tail drop, and all incoming packets
might be dropped.
The idea behind using WRED is to maintain the queue depth at a
level somewhere between the minimum and maximum thresholds,
and to implement different drop policies for different classes of
traffic.
WRED is only useful when the bulk of the traffic is TCP traffic.
With TCP, dropped packets indicate congestion, so the packet
source reduces its transmission rate.
117
Amount of bandwidth in
proportion of the link.
Weight = int bw/ class bw
Enables WRED
119
LLQ
LLQ
No
RED/WRED
121
LLQ
122
Configuring LLQ
and
LLQ Example
router(config)# access-list 102 permit udp host 10.10.10.10 host
10.10.10.20 range 16384 20000
router(config)# access-list 102 permit udp host 10.10.10.10 host
10.10.10.20 range 53000 56000
router(config)# class-map voice
router(config-cmap)# match access-group 102
router(config)# policy-map policy1
router(config-pmap)# class voice
router(config-pmap-c)# priority 50
router(config-pmap)# class bar
router(config-pmap-c)# bandwidth 20
router(config-pmap)# class class-default
router(config-pmap-c)# fair-queue
124
Suggested Readings
125