Week - 9 - Quality of Service Part 2 Module
Week - 9 - Quality of Service Part 2 Module
1
Week 9: Quality of Service Part 2
QoS Mechanism
Objectives
After completing this course, students will be able to
Explain the purpose and characteristics of QoS.
Explain how network transmission characteristics impact quality.
Describe minimum network requirements for voice, video, and data traffic.
Describe the queuing algorithms used by networking devices.
Explain how networking devices implement QoS.
Describe the different QoS models.
Explain how QoS uses mechanisms to ensure transmission quality.
Introduction
In today's networks, users expect content to be immediately available. But if the traffic
exceeds the bandwidth of the links between the source of the content and the user, how do
network administrators ensure a quality experience? Quality of Service (QoS) tools can be
designed into the network to guarantee that certain traffic types, such as voice and video, are
prioritized over traffic that is not as time-sensitive, such as email and web browsing.
Qos Models
Best-effort model
Integrated services (IntServ)
Differentiated services (DiffServ)
The table in the figure 9.1 summarizes these three models. QoS is really implemented in a
network using either IntServ or DiffServ. While IntServ provides the highest guarantee of
QoS, it is very resource-intensive and therefore, limited in scalability. In contrast, DiffServ is
less resource-intensive and more scalable. The two are sometimes co-deployed in network
QoS implementations.
Best-Effort
The basic design of the Internet provides for best-effort packet delivery and provides no
guarantees. This approach is still predominant on the Internet today and remains
appropriate for most purposes. The best-effort model treats all network packets in the same
way, so an emergency voice message is treated the same way a digital photograph attached
to an email is treated. Without QoS, the network cannot tell the difference between packets
and, as a result, cannot treat packets preferentially.
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. With the best-effort model, the
letter may never arrive, and, unless you have a separate notification arrangement with the
letter recipient, you may never know that the letter did not arrive.
The table in the figure 9.2 lists the benefits and drawbacks of the best effort model.
Integrated Services
The needs of real-time applications, such as remote video, multimedia conferencing,
visualization, and virtual reality, motivated the development of the IntServ architecture
model in 1994 (RFC 1633, 2211, and 2212). IntServ is a multiple-service model that can
accommodate multiple QoS requirements.
IntServ provides a way to deliver the end-to-end QoS that real-time applications require by
explicitly managing network resources to provide QoS to specific user packet streams,
sometimes called microflows. It uses resource reservation and admission-control
mechanisms as building blocks to establish and maintain QoS. This practice is similar to a
concept known as “hard QoS.” Hard QoS guarantees traffic characteristics, such as
bandwidth, delay, and packet-loss rates, from end to end. Hard QoS ensures both predictable
and guaranteed service levels for mission-critical applications.
IntServ uses a connection-oriented approach inherited from telephony network design. Each
individual communication must explicitly specify its traffic descriptor and requested
resources to the network. The edge router performs admission control to ensure that
available resources are sufficient in the network. The IntServ standard assumes that routers
along a path set and maintain the state for each individual communication.
In the IntServ model, the application requests a specific kind of service from the network
before sending data. The application informs the network of its traffic profile and requests a
particular kind of service that can encompass its bandwidth and delay requirements. 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. If network devices along
the path can reserve the necessary bandwidth, the originating application can begin
transmitting. If the requested reservation fails along the path, the originating application
does not send any data.
The edge router performs admission control based on information from the application and
available network resources. The network commits to meeting the QoS requirements of the
application as long as the traffic remains within the profile specifications. The network
fulfills its commitment by maintaining the per-flow state and then performing packet
classification, policing, and intelligent queuing based on that state.
The table in Figure 9.4 lists the benefits and drawbacks of the IntServ model.
Differentiated Services
The differentiated services (DiffServ) QoS model specifies a simple and scalable mechanism
for classifying and managing network traffic and providing QoS guarantees on modern IP
networks. For example, DiffServ can provide low-latency guaranteed service to critical
network traffic such as voice or video while providing simple best-effort traffic guarantees
to non-critical services such as web traffic or file transfers.
The DiffServ design overcomes the limitations of both the best-effort and IntServ models.
The DiffServ model is described in RFCs 2474, 2597, 2598, 3246, 4594. DiffServ can provide
an “almost guaranteed” QoS while still being cost-effective and scalable.
The DiffServ model is similar in concept to sending a package using a delivery service. You
request (and pay for) a level of service when you send a package. Throughout the package
network, the level of service you paid for is recognized and your package is given either
preferential or normal service, depending on what you requested.
DiffServ is not an end-to-end QoS strategy because it cannot enforce end-to-end guarantees.
However, DiffServ QoS is a more scalable approach to implementing QoS. Unlike IntServ and
hard QoS in which the end-hosts signal their QoS needs to the network, DiffServ does not use
signaling. Instead, DiffServ uses a “soft QoS” approach. It works on the provisioned-QoS
model, where network elements are set up to service multiple classes of traffic each with
varying QoS requirements.
As a host forwards traffic to a router, the router classifies the flows into aggregates (classes)
and provides the appropriate QoS policy for the classes. DiffServ enforces and applies QoS
mechanisms on a hop-by-hop basis, uniformly applying global meaning to each traffic class
to provide both flexibility and scalability. For example, DiffServ could be configured to group
all TCP flows as a single class, and allocate bandwidth for that class, rather than for the
individual flows as IntServ would do. In addition to classifying traffic, DiffServ minimizes
signaling and state maintenance requirements on each network node.
Specifically, DiffServ divides network traffic into classes based on business requirements.
Each of the classes can then be assigned a different level of service. As the packets traverse a
network, each of the network devices identifies the packet class and services the packet
according to that class. It is possible to choose many levels of service with DiffServ. For
example, voice traffic from IP phones is usually given preferential treatment over all other
application traffic, email is generally given best-effort service, and nonbusiness traffic can
either be given very poor service or blocked entirely.
Figure 9.6 lists the benefits and drawbacks of the DiffServ model.
Note: Modern networks primarily use the DiffServ model. However, due to the increasing
volumes of delay- and jitter-sensitive traffic, IntServ and RSVP are sometimes co-deployed.
QoS Tools
There are three categories of QoS tools, as described in the table in Figure 1:
Refer to Figure 9.8 to help understand the sequence of how these tools are used when QoS is
applied to packet flows.
As shown in the figure9.8, ingress packets (gray squares) are classified and their respective
IP header is marked (colored squares). To avoid congestion, packets are then allocated
resources based on defined policies. Packets are then queued and forwarded out the egress
interface based on their defined QoS shaping and policing policy.
Note: Classification and marking can be done on ingress or egress, whereas other QoS actions
such queuing and shaping are usually done on egress.
How a packet is classified depends on the QoS implementation. Methods of classifying traffic
flows at Layer 2 and 3 include using interfaces, ACLs, and class maps. Traffic can also be
classified at Layers 4 to 7 using Network Based Application Recognition (NBAR).
Note: NBAR is a classification and protocol discovery feature of Cisco IOS software that
works with QoS features. NBAR is out of scope for this course.
Marking means that we are adding a value to the packet header. Devices receiving the packet
look at this field to see if it matches a defined policy. Marking should be done as close to the
source device as possible. This establishes the trust boundary.
How traffic is marked usually depends on the technology. The table in the figure describes
some the marking fields used in various technologies. The decision of whether to mark traffic
at Layers 2 or 3 (or both) is not trivial and should be made after consideration of the
following points:
Marking at Layer 2
802.1Q is the IEEE standard that supports VLAN tagging at layer 2 on Ethernet networks.
When 802.1Q is implemented, two fields are added to the Ethernet Frame. As shown in
Figure 9.9, these two fields are inserted into the Ethernet frame following the source MAC
address field.
The 802.1Q standard also includes the QoS prioritization scheme known as IEEE 802.1p. The
802.1p standard uses the first three bits in the Tag Control Information (TCI) field. Known
as the Priority (PRI) field, this 3-bit field identifies the Class of Service (CoS) markings. Three
bits means that a Layer 2 Ethernet frame can be marked with one of eight levels of priority
(values 0–7) as displayed in Figure 9.10.
Marking at Layer 3
IPv4 and IPv6 specify an 8-bit field in their packet headers to mark packets. As shown in
Figure 9.11, both IPv4 and IPv6 support an 8-bit field for marking, the Type of Service (ToS)
field for IPv4 and the Traffic Class field for IPv6.
These fields are used to carry the packet marking as assigned by the QoS classification tools.
The field is then referred to by receiving devices to forward the packets based on the
appropriate assigned QoS policy.
Figure 9.12 displays the contents of the 8-bit field. In RFC 791, the original IP standard
specified the IP Precedence (IPP) field to be used for QoS markings. However, in practice,
these three bits did not provide enough granularity to implement QoS.
RFC 2474 supersedes RFC 791 and redefines the ToS field by renaming and extending the
IPP field. The new field, as shown in Figure 9.12, has 6-bits allocated for QoS. Called the
Differentiated Services Code Point (DSCP) field, these six bits offer a maximum of 64 possible
classes of service. The remaining two IP Extended Congestion Notification (ECN) bits can be
used by ECN-aware routers to mark packets instead of dropping them. The ECN marking
informs downstream routers that there is congestion in the packet flow.
Best-Effort (BE) - This is the default for all IP packets. The DSCP value is 0. The per-hop
behavior is normal routing. When a router experiences congestion, these packets will be
dropped. No QoS plan is implemented.
Expedited Forwarding (EF) - RFC 3246 defines EF as the DSCP decimal value 46 (binary
101110). The first 3 bits (101) map directly to the Layer 2 CoS value 5 used for voice traffic.
At Layer 3, Cisco recommends that EF only be used to mark voice packets.
Assured Forwarding (AF) - RFC 2597 defines AF to use the 5 most significant DSCP bits to
indicate queues and drop preference. As shown in Figure 9.13, the first 3 most significant
bits are used to designate the class. Class 4 is the best queue and Class 1 is the worst queue.
The 4th and 5th most significant bits are used to designate the drop preference. The 6th most
significant bit is set to zero. The AFxy formula shows how the AF values are calculated. For
example, AF32 belongs to class 3 (binary 011) and has a medium drop preference (binary
10). The full DSCP value is 28 because you include the 6th 0 bit (binary 011100).
Because the first 3 most significant bits of the DSCP field indicate the class, these bits are also
called the Class Selector (CS) bits. As shown in Figure 9.14, these 3 bits map directly to the 3
bits of the CoS field and the IPP field to maintain compatibility with 802.1p and RFC 791.
The table in Figure 9.15 shows how the CoS values map to the Class Selectors and the
corresponding DSCP 6-bit value. This same table can be used to map IPP values to the Class
Selectors.
Trust Boundaries
Where should markings occur? Traffic should be classified and marked as close to its source
as technically and administratively feasible. This defines the trust boundary as shown in the
figure 9.16.
Trusted endpoints have the capabilities and intelligence to mark application traffic to the
appropriate Layer 2 CoS and/or Layer 3 DSCP values. Examples of trusted endpoints include
IP phones, wireless access points, videoconferencing gateways and systems, IP conferencing
stations, and more.
Secure endpoints can have traffic marked at the Layer 2 switch.
Traffic can also be marked at Layer 3 switches / routers.
Re-marking of traffic is typically necessary. For example, re-marking CoS values to IP
Precedent or DSCP values.
Congestion Avoidance
Congestion management includes queuing and scheduling methods where excess traffic is
buffered or queued (and sometimes dropped) while it waits to be sent on an egress interface.
Congestion avoidance tools are simpler. They monitor network traffic loads in an effort to
anticipate and avoid congestion at common network and internetwork bottlenecks before
congestion becomes a problem. These tools can monitor the average depth of the queue, as
represented in the figure 9.17. When the queue is below the minimum threshold, there are
no drops. As the queue fills up to the maximum threshold, a small percentage of packets are
dropped. When the maximum threshold is passed, all packets are dropped.
Some congestion avoidance techniques provide preferential treatment for which packets
will get dropped. For example, Cisco IOS QoS includes weighted random early detection
(WRED) as a possible congestion avoidance solution. The WRED algorithm allows for
congestion avoidance on network interfaces by providing buffer management and allowing
TCP traffic to decrease, or throttle back, before buffers are exhausted. Using WRED helps
avoid tail drops and maximizes network use and TCP-based application performance. 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.
Traffic shaping retains excess packets in a queue and then schedules the excess for later
transmission over increments of time. The result of traffic shaping is a smoothed packet
output rate, as shown in Figure 9.18.
Shaping implies the existence of a queue and of sufficient memory to buffer delayed packets,
while policing does not.
Ensure that you have sufficient memory when enabling shaping. In addition, shaping
requires a scheduling function for later transmission of any delayed packets. This scheduling
function allows you to organize the shaping queue into different queues. Examples of
scheduling functions are CBWFQ and LLQ.
Shaping is an outbound concept; packets going out an interface get queued and can be
shaped. In contrast, policing is applied to inbound traffic on an interface. When the traffic
rate reaches the configured maximum rate, excess traffic is dropped (or remarked).
Summary
The quality of network transmission is impacted by the bandwidth of the links between the
source and destination, the sources of delay as packets are routed to the destination, and
jitter or the variation in delay of the received packets. Without QoS mechanisms in place,
packets are processed in the order in which they are received. When congestion occurs, time-
sensitive packets will be dropped with the same frequency as packets that are not time-
sensitive.
Voice packets require latency of no more than 150 milliseconds (ms). Jitter should be no
more than 30 ms, and voice packet loss should be no more than 1%. Voice traffic requires at
least 30 Kb/s of bandwidth.
Video packets require latency no more than 400 milliseconds (ms). Jitter should be no more
than 50 ms, and video packet loss should be no more than 1%. Video traffic requires at least
384 Kb/s of bandwidth.
For data packets, two factors impact the Quality of Experience (QoE) for end users:
First in First Out (FIFO) - Packets are forwarded in the order in which they are received.
Weighted Fair Queuing (WFQ) - Packets are classified into different flows based on header
information including the ToS value.
Class-Based Weighted Fair Queuing (CBWFQ) - Packets are assigned to user-defined classes
based on matches to criteria such as protocols, ACLs, and input interfaces. The network
administrator can assign bandwidth, weight, and maximum packet limit to each class.
Low Latency Queuing (LLQ) - Delay-sensitive data such as voice is added to a priority queue
so that it can be sent first (before packets in other queues).
The three queuing models discussed in the chapter are as follows:
Best-Effort - This is the default queuing model for interfaces. All packets are treated in the
same way. There is no QoS.
Integrated Services (IntServ) - IntServ provides a way to deliver the end-to-end QoS that
real-time applications require by explicitly managing network resources to provide QoS to
specific user packet streams, sometimes called microflows.
Differentiated Services (DiffServ) - DiffServ uses a soft QoS approach that depends on
network devices that are set up to service multiple classes of traffic each with varying QoS
requirements. Although there is no QoS guarantee, the DiffServ model is more cost-effective
and scalable than IntServ.
QoS tools include the following:
Classification and Marking - Classification determines the class of traffic to which packets or
frames belong. Marking means that we are adding a value to the packet header. Devices
receiving the packet look at this field to see if it matches a defined policy.
Congestion Avoidance - Congestion avoidance tools monitor network traffic loads in an effort
to anticipate and avoid congestion. As queues fill up to the maximum threshold, a small
percentage of packets are dropped. Once the maximum threshold is passed, all packets are
dropped.
Shaping and Policing - Shaping retains excess packets in a queue and then schedules the
excess for later transmission over increments of time. Shaping is used on outbound traffic.
Policing either drops or remarks excess traffic. Policing is often applied to inbound traffic.