Nothing Special   »   [go: up one dir, main page]

Quality of Service (Qos) : August 2018

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 68

Quality of Service August 2018

(QoS)
Prioritizing Traffic
• QoS allows us to prioritize certain types of traffic over others
• QoS tools directly impact bandwidth, delay, jitter, and loss, which then
should have some overall good effect to influence the users’ Quality
of Experience (QoE)
• Note: A device implements QoS only when it is experiencing some
type of congestion.

2
Congestion
• Congestion: When the demand for bandwidth exceeds the amount
available.
• Examples of Congestion points:

3
Characteristics of network traffic
• 1. Bandwidth
• 2. Delay (or latency)
• 3. Jitter
• 4. Loss

4
Bandwidth
• The speed of the link. bits per second (bps). This is important for
example for FTP traffic

5
Delay
One-way: from source to destination or Two-way: from source to destination and back
• Codec delay (fixed): The fixed amount of time time it takes to compress data at the
source before transmitting to the first internetworking device; usually between 2.5 ms
to 10 ms
• Packetization delay (fixed): The IP phone or voice gateway must collect 20 ms of voice
before it can put 20 ms worth of voice payload into a packet
• Queuing delay (variable)(could be significant): the time that a packet is waiting in the
memory until resources become available to transmit it
• Serialization delay (fixed)(negligible on T3 and faster links): the time that takes to
send all bits of a frame from NIC to the PHY for transmission.
• serialization delay (milliseconds) = number of bits sent ÷ link speed (kbps). For voice should be
almost 0

6
Delay
• Propagation delay (fixed)(not significant): the variable0 amount of time it takes for bits to
cross the PHY. We cannot change this type of delay.
• Propagation delay (milliseconds) = Length of the link (meters) ÷ (2.1 × 108 meters/seconds)
• Forwarding/Processing delay (variable)(not really significant): the time for a device to
perform the tasks
• Shaping delay (variable): Sending packets more slowly, but not having them be dropped.
(traffic shaping)
• Network delay (variable): In some cases, the provider will include delay limits in the
contracted SLA
• De-jitter buffer delay (variable): At receiving side. receiving side buffers for example 2
packets (40 ms), then when the 3rd packet arrives, it delivers 1st packet. Why? to maintain
the jitter as lowest as possible. For interactive videos, this delay can be up to 70 ms. De-
jitter buffer for streaming videos can run into the tens of seconds!

7
Jitter
• Variation of one-way delay
• At the sending side, packets are sent in a continuous stream with the
packets spaced evenly apart. Due to network congestion, improper
queuing, or configuration errors, the delay between each packet can
vary instead of remaining constant. Both delay and jitter need to be
controlled and minimized to support real-time and interactive traffic.

8
Loss
• Usually as a percentage of lost packets sent. When there is a
congestion, packets will be queued but once the queue is full, packets
will be dropped. With QoS we can decide which packets drop when
this happens. In a properly designed network, packet loss should be
near zero.
• Tools that affect loss:
• Queuing: longer queue increases delay, but avoids loss
• RED (random early detection or congestion avoidance): drops packet
randomly as queues approach the point of being full, slowing some TCP
connections

9
Questions
• When the demand for bandwidth exceeds the amount available.
• This happens when congestion occurs.
• The fixed amount of time it takes to transmit a frame from the NIC to the wire.
• Holds packets in the memory until resources become available to transmit them.
• The number of bits that can be transmitted in a single second.
• The fixed amount of time it takes to compress data at the source before
transmitting to the first internetworking device.
• Caused by variation in delay.
• The variable amount of time it takes for the frame to traverse the links between
the source and the destination

10
Answers
• Congestion: When the demand for bandwidth exceeds the amount available.
• Loss: This happens when congestion occurs.
• Serialization delay: The fixed amount of time it takes to transmit a frame from the NIC to
the wire.
• Queue: Holds packets in the memory until resources become available to transmit them.
• Bandwidth: The number of bits that can be transmitted in a single second.
• Code delay: The fixed amount of time it takes to compress data at the source before
transmitting to the first internetworking device.
• Jitter: Caused by variation in delay.
• Propagation delay: The variable amount of time it takes for the frame to traverse the
links between the source and the destination

11
Flow
• A flow is all the data moving from one application to another over the network,
with one flow for each direction.
• For example: Listen to some music with a music app on your phone, and that
creates a flow from your app to the music app’s server, and a flow from the
server back to your phone
• From a voice perspective, a phone call between two IP phones would create a
flow for each direction.

12
QoS requirement for different traffic types:
• Noninteractive data application (historically called batch traffic) - for
instance, data backup or file transfers
• Bandwidth is nice to have
• There is a one-way delay which is not that much important
• Packet loss: Because file transfer uses TCP connection to retransmit the data,
so the packet loss doesn't matter.
• Interactive application such as SSH
• Doesn't require a lot of bandwidth
• Sensitive to delay and packet loss

13
QoS requirement for different traffic types:
Characteristics Voice Video
Bandwidth > 30 kbps > 384 kbps
Delay Latency <= 150 ms  Latency 200-400 ms
Jitter Jitter <= 30 ms Jitter <= 30 - 50 ms
Loss <= 1% Loss <= 0.1% - 1%
Tends to be Smooth and Benign Busrty and Greedy

14
Voice vs Video

15
How can QoS The three models for implementing QoS are:
be • Best-effort model: when QoS is not required
implemented • Integrated services (IntServ):
• Differentiated services (DiffServ): per hop
in a network?

16
Best-effort model
• Not really an implementation as QoS is not explicitly configured
• Use when QoS is not required
• This approach is still predominant on the Internet today and remains
appropriate for most purposes
• The model is the most scalable
• Scalability is only limited by bandwidth
• No packets have preferential treatment
• The best-effort model is similar in concept to sending a letter using standard
postal mail. Your letter is treated exactly the same as every other letter.

17
Integrated services (IntServ)
• QoS is applied per flow
• End to end QoS
• IntServ uses a connection-oriented approach
• Provides very high QoS to IP packets with guarantied delivery.
• IntServ uses the Resource Reservation Protocol (RSVP) to signal the QoS needs of
an application’s traffic along devices in the end-to-end path through the network.
• IntServ can severely limit the scalability of a network.
• The edge router performs admission control based on information from the
application and available network resources.
• Resource intensive; for example: Bandwidth reserved

18
Differentiated services (DiffServ)
• QoS per classification
• QoS per-hop
• Simple and scalable
• Network devices recognize traffic classes and provide different levels
of QoS to different traffic classes.
• The marked field will be in the IP header (a 6-bit DSCP), not a data-
link header, because the IP header is retained throughout the
network.

19
QoS Implementation Techniques

Classification and marking tools


There are three categories Congestion avoidance tools
Congestion management tools (queuing)

Note: Classification and marking can be done on ingress or egress, whereas


other QoS actions such queuing and shaping are usually done on egress.

20
Classification and marking
• A type of QoS tool that classifies packets based on their header contents, and then marks the
message by changing some bits in specific header fields.
• Like ACLs, QoS tools are enabled on an interface. Also like ACLs, QoS tools are enabled for a direction.
• In figure below:
• Step1. The router makes a forwarding (routing) decision.
• Step 2. The output queuing tool uses classification logic to determine which packets go into which
output queue.

21
Where to classify?
• Poor strategy:
• Apply QoS tools on most every device in the network, sometimes at both
ingress and egress on most of the interfaces
• requires lots of configuration.
• The work to match packets can even degrade device performance.
• A better strategy:
• Do complex matching early in the life of a packet, and then marking the
packet.

22
Where to classify?
• SW1 does some complex comparisons and marks the packet’s Differentiated
Services Code Point (DSCP) field
• The next three devices that process this message, use simpler matching to
classify the packet by comparing the packet’s DSCP value

23
Classification with ACLs
Version IHL Type of Service Total length

Identification Flags Fragment Offset

Time to Live IP Protocol Header Checksum

Source Address

Destination Address

Options Padding

Source Port Destination Port

Sequence Number

Acknowledgment Number

Data Offset Reserved URG ACK PSH RST SYN FIN Window

Checksum Urgent Pointer

Options Padding 24
Classification with ACLs
• Classification with Five Fields Used by Extended ACLs
• For instance, if all the IP phones sit in subnets within the range of
addresses 10.3.0.0/16, then the QoS plan should state that.
• Then the network engineer could configure an extended ACL to match
all packets to/from IP addresses inside 10.3.0.0/16 and apply
appropriate QoS actions to that voice traffic.
(config)#ip access-list extended TELNET
(config-ext-nacl)#permit tcp any any eq 23
(config)class-map TELNET
(config-cmap)#match access-group name TELNET

25
Classification with NBAR
• Network-Based Application Recognition (NBAR) version 2
• NBAR provides easy built-in matching ability for WebEx, plus well over
1000 different subcategories of applications.
• NBAR refers to this idea of defining the characteristics of different
applications as application signatures.
(config)#class-map NBAR-TELNET
(config-cmap)#match protocol telnet

26
Marking IP DSCP

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Version Length TOS Total length

Identifier Flags Fragment offset

TTL Protocol Header checksum

Source Address

Destination Address

27
Marking IP DSCP
• Marking the IP Header
• IP header exists for the entire trip from the source host to the destination host.
• IPv6 has a similar field to mark as well. DSCP in IPv6 Traffic Class byte
IP Precedence and Differentiated Services Code Point Fields:

28
IP Header DS Field and DSCP PHBs

29
DSCP
• The first 6 bits of the DS field are used to set a codepoint that will
affect the PHB (Per Hop Behavior) at each node. The codepoint is also
what we call the DSCP value.
• When we configure QoS to prioritize the VoIP packets, we have to do
it on all devices. When R1 and R3 are configured to prioritize VoIP
packets while R2 treats it as any other IP packet, we can still
experience issues with the quality of our phone call when there is
congestion on R2.
• Default PHB: DSCP value of 000000

30
DiffServ Suggested Marking Values
• Expedited Forwarding PHB (EF)
• 2 functions
• Queueing
• Policing
• For use for packets that need low latency (delay), low jitter, and low loss
• we use something called a priority queue. Whenever there are packets in the priority
queue, they will be sent before all other queues.
• This is also a risk, there’s a chance that the other queues won’t get a chance to send their
packets so we need to set a “rate limit” for this queue, this is done with policing.
• DSCP value is called EF ( DCSP decimal 46, binary 101110, TOS Decimal 184)

31
DiffServ Suggested Marking Values
• Assured Forwarding PHB (AF)
• 2 functions:
• Queuing
• Congestion Avoidance
• Four separate queues
• Three levels of drop priority
• Queue 4 has the highest priority
• () The values in decimal
• 8x+2y

32
DiffServ Suggested Marking Values
• Class-Selector PHB (CS)
• There was a time when some older network devices would only support IP
precedence and newer network devices would use differentiated services. To
make sure the two are compatible, we have the class-selector codepoints.
IPP Value IPP name
000 Routine
001 Priority
010 Immediate
011 Flash
100 Flash Override
101 Critic/Critical
110 Internetwork Control
111 Network Control
33
Marking voice packets by Cisco IP phones
• Cisco IP Phones mark voice payload with EF (IP Precedence value 5),
and mark voice signaling packets sent by the phone with another
value called CS3 (binary: 011000) (or IPP value 3 or AF31)
• CS: Class-Selector PHB: There was a time when some older network devices
would only support IP precedence and newer network devices would use
differentiated services. To make sure the two are compatible, we have the
class-selector codepoints.

34
Marking Ethernet CoS
• in the 802.1Q header (in a 3-bit field originally defined by the IEEE
802.1p standard)

35
Useful Life of CoS Marking
• QoS tools can only make use of the CoS field for QoS features enabled
on interfaces that use trunking

36
CoS values
Values 0-7: higher value, higher priority.

Value Description
7 Reserved
6 Reserved
5 Voice bearer (voice traffic)
4 Videoconferencing
3 Call Signaling
2 High-Priority Data
1 Medium-Priority Data
0 Best-Effort Data

37
Into the command line
When configuring QoS we have to use the MQC (Modular Quality of Service Command-Line Interface).
• class-map: where we specify the traffic
• policy-map: where we configure the QoS actions we want to perform
• marking, queueing, policing, shaping, etc.
(config)#policy-map CLASSIFY
(config-pmap)#class NBAR-TELNET
(config-pmap-c)#?
bandwidth Bandwidth
priority Strict Scheduling Priority for this Class
queue-limit Queue Max Threshold for Tail Drop
random-detect Enable Random Early Detection as drop policy
service-policy Configure Flow Next
set Set QoS values
shape Traffic Shaping
• Before the policy-map does anything, we have to attach it to an interface by (config-if)#service-policy
command

38
Example:
Block website with NBAR on Cisco Router
Classification
R1(config)#class-map match-any BLOCKED
R1(config-cmap)#ip nbar protocol-discovery !it’s a great way to see the traffic on
the !interface but it’s not a requirement for NBAR to work in a class-map. Using
“match !protocol” in the class-map is enough for NBAR to work.
R1(config-cmap)#match protocol http host "*youtube.com*"
R1(config-cmap)#exit
Marking, policing, and queue type
R1(config)#policy-map DROP
R1(config-pmap)#class BLOCKED
R1(config-pmap-c)#drop
R1(config-pmap-c)#exit
Apply policy
R1(config)#interface fastEthernet 0/1
R1(config-if)#service-policy output DROP

39
Example
class-map match-all VOICE
match ip dscp ef
class-map match-all VOICE-SIGNALING
match ip dscp cs3
class-map match-all HTTP
match protocol http

policy-map QOS
class VOICE
priority 2000 ! We have created a priority queue guarantee for 2000 Kbps
class VOICE-SIGNALING
bandwidth 1000 ! We have configured a bandwidth guarantee of 1000 Kbps
class HTTP
shape average 256000

(config-if)# service-policy output QOS

40
QoS Marking on Cisco IOS Router
R2(config)#ip access-list extended TELNET-TRAFFIC
R2(config-ext-nacl)#permit tcp any any eq telnet
R2(config)#class-map TELNET-TRAFFIC
R2(config-cmap)#match access-group name TELNET-TRAFFIC
R2(config-cmap)#exit
R2(config)#policy-map MARKING
R2(config-pmap)#class TELNET-TRAFFIC
R2(config-pmap-c)#set ?
cos Set IEEE 802.1Q/ISL class of service/user priority
dscp Set DSCP in IP(v4) and IPv6 packets
precedence Set precedence in IP(v4) and IPv6 packets
R2(config)#interface FastEthernet 0/0
R2(config-if)#service-policy input MARKING

41
Verification
show class-map
show ip nbar protocol-discovery
show policy-map
show policy-map interface GigabitEthernet 0/1

ping 192.168.23.3 tos 184 repeat 100 !DSCP EF (46)


ping 192.168.23.3 tos 96 repeat 200 !CS3 (24)
Then see if traffic matched:
show policy-map interface GigabitEthernet 0/2

42
Defining Trust Boundaries
• The end-user device can mark the DSCP field, and even the CoS field if
trunking is used on the link. Would you, as the network engineer,
trust those settings, and let your networking devices trust and react
to those markings for their various QoS actions?
• The trust boundary refers to the point in the path of a packet flowing
through the network at which the networking devices can trust the
current QoS markings.

43
Trusting devices

44
Congestion avoidance
Buffer Management
• It is best to drop packets as soon as there is congestion
• If there is congestion in a particular port, it is difficult to know whose fault it is (Or
who is the source that has caused the congestion)
• Random Early Detection (RED): This is a proactive approach in which the router
discards one or more packets before the buffer becomes completely full
• The congestion avoidance tool can randomly drop packets from output queue, or we
can configure it to give certain packets a different treatment based on their marking.
Main tool is weighted random early detection or WRED by providing buffer
management and allowing TCP traffic to decrease, or throttle back, before buffers are
exhausted.
• There is no congestion avoidance for User Datagram Protocol (UDP)-based traffic, such
as voice traffic. In case of UDP-based traffic, methods such as queuing and
compression techniques help to reduce and even prevent UDP packet loss.

45
Mechanisms of Congestion Avoidance
• When the queue depth is low, below the
minimum threshold values, the congestion
avoidance tool does nothing.
• When the queue depth is between the
minimum and maximum thresholds, the
congestion avoidance tool discards a
percentage of the packets—usually a small
percentage, like 5, 10, or 20 percent.
• If the queue depth passes the maximum
threshold, the tool drops all packets, in an
action called full drop

46
Congestion Management (Queuing)
• Queue: All networking devices use queues. Network devices receive messages, make a
forwarding decision, and then send the message—but sometimes the outgoing
interface is busy. So, the device keeps the outgoing message in a queue, waiting for
the outgoing interface to be available—simple enough.
• Congestion management: QoS toolset for managing the queues that hold packets
while they wait their turn to exit an interface.

47
First In First Out (FIFO)
• The queuing system may use a
single output queue, with a
first-in, first-out (FIFO)
scheduler
• FIFO, which is the fastest
method of queuing, is effective
for large links that have little
delay and minimal congestion.
If your link has very little
congestion, FIFO queuing may
be the only queuing you need
to use.

48
Scheduler
• The queuing system needs a scheduler, to decide which message to
take next when the interface becomes available.
• Of all these components of the queuing system, the scheduler can be
the most interesting part, because it can perform prioritization.
• Prioritization refers to the concept of giving priority to one queue over
another in some way

49
Multiple queues
• Most networking devices can have a queuing system with multiple
queues.
• To use multiple queues, the queuing system needs a classifier
function to choose which packets are placed into which queue.

50
Round Robin Scheduling (Prioritization)
• In its most basic form, round robin cycles through the queues in order,
taking turns with each queue.
• the scheduler either takes one message or takes a number of bytes from each
queue by taking enough messages to total that number of bytes.

51
Weighted Fair Queuing (WFQ)
• Round robin scheduling also includes the concept of weighting
• The scheduler takes a different number of packets (or bytes) from each
queue, giving more preference to one queue over another.
• WFQ classifies traffic into different flows based on packet header
addressing, including such characteristics as source and destination IP
addresses, MAC addresses, port numbers, protocol, and Type of Service
(ToS) value. The ToS value in the IP header can be used to classify traffic.
• Limitation: WFQ is not supported with tunneling and encryption because
these features modify the packet content information required by WFQ
for classification.

52
Class-Based Weighted Fair Queuing
(CBWFQ)
• CBWFQ extends the standard WFQ functionality while letting the
network engineer define the weightings as a percentage of link
bandwidth
• To guarantee a minimum amount of bandwidth to each class
• Each class receives at least the amount of bandwidth configured
during times of congestion
• Internally, CBWFQ uses a weighted round robin scheduling algorithm,
while letting the network engineer define the weightings as a
percentage of link bandwidth.

53
Class-Based Weighted Fair Queuing
(CBWFQ)
With the queuing system shown in the figure, if the outgoing link is congested, the
scheduler guarantees the percentage bandwidth shown in the figure to each queue.
That is, queue 1 gets 20 percent of the link even during busy times.

54
CBWFQ
• A FIFO queue is reserved for each class, and traffic belonging to a
class is directed to the queue for that class
• After a queue has reached its configured queue limit, adding more
packets to the class causes tail drop or packet drop to take effect,
depending on how class policy is configured

55
WFQ vs
CBWFQ

56
Round Robin Not Good for Voice Delay
(Latency) and Jitter
Even though the voice queue has been given 50 percent of the link
bandwidth, the scheduler does not send that voice message until it sends some
messages from the other three queues—adding delay and jitter.

57
Low Latency Queuing (LLQ)
• Voice and Video Applications particularly interactive voice and video
like phone calls and videoconferencing, need low latency (low delay),
low jitter, and low loss.
• Unfortunately, a round robin scheduler does not provide low enough
delay, jitter, or loss.
• The solution: add Low Latency Queuing (LLQ) to the scheduler.

58
LLQ Always Schedules Voice Packet Next
• LLQ tells the scheduler to treat one or more queues as special priority queues. The
LLQ scheduler always takes the next message from one of these special priority
queues.

59
Do you see the problem with LLQ?
• Queue starvation: The scheduler never services the other queues
• When the speed of the interface is X bits/second, but more than X
bits/second come into the voice queue
• Solution: limit the amount of traffic placed into the priority queue,
using a feature called policing.
• Think of a policer as a cap on the bandwidth used by the priority queue.
• The maximum bandwidth for that queue instead of minimum bandwidth

60
Yet another problem!
• But it causes yet another problem!
• We put the voice and video into a priority queue that will discard the
excess messages beyond the bandwidth limit.
• Call Admission Control (CAC): Out of scope of CCNA topic

61
• Both policing and shaping monitor the
bit rate of the combined messages that
flow through a device.
• Both policing and shaping monitor the
Policing and bit rate of the combined messages that
Shaping flow through a device.
• Policers discard packets.
• Shapers hold packets in queues to
delay the packets.

62
Policer

63
Where to Use Policing
• It can be best used at the edge between two networks
• The SP can police incoming packets, setting the policing rate to match
the CIR that the customer chooses for that link

64
Policer
• Policers can discard excess traffic, but they can also re-mark packets
as well.
1. Re-mark packets that exceed the policing rate, but let them into the
SP’s network.
2. If other SP network devices are experiencing congestion when they
process the packet, the different marking means that device can
discard the packet. However…
3. if no other SP network devices are experiencing congestion when
forwarding that re-marked packet, it gets through the SP network
anyway
65
Shaping
• The SP has told you that they always discard incoming traffic that
exceeds the CIR.
• The solution?
• Use a shaper to slow the traffic down, in this case to a 200-Mbps shaping rate.
• Because shapers create queues where messages wait, you should
apply a congestion management tool to those queues.

66
Shaping downsides
• Adding more delay and probably more jitter
• 1 Second Shaping Time Interval, Shaping at 20% of Line Rate
• The solution to this problem: configure a short time interval.
• By recommendation, use a 10-ms time interval to support voice and video.

67
A Prioritization Strategy for Data, Voice, and
Video
1. Use a round robin queuing method like CBWFQ for data classes and for noninteractive voice
and video.
2. If faced with too little bandwidth compared to the typical amount of traffic, give data classes
that support business-critical applications much more guaranteed bandwidth than is given to
less important data classes.
3. Use a priority queue with LLQ scheduling for interactive voice and video, to achieve low
delay, jitter, and loss.
4. Put voice in a separate queue from video, so that the policing function applies separately to
each.
5. Define enough bandwidth for each priority queue so that the built-in policer should not
discard any messages from the priority queues.
6. Use Call Admission Control (CAC) tools to avoid adding too much voice or video to the
network, which would trigger the policer function.

68

You might also like