Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise:...

50
Topic 4: Quality of Service

Transcript of Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise:...

Page 1: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Topic 4: Quality of Service

Page 2: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Need for QoS

If we don’t use QoS, the following problems may arise:

Jitter Insufficient Bandwidth Delay Information Loss

Page 3: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

VoIP Call Bandwidth Requirements Different codecs use different

bandwidth requirements. G.729 bit rate is 8 Kbps To find out the total bandwidth for a

voice call, we have to add G.729 Voice Payload, RTP/UDP/IP headers, and also the Layer 2 Header ( Ethernet, Frame Relay, PPP and so on).

Page 4: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

VoIP Call Bandwidth Calculations: Voice packet size = Layer 2 header +

IP/UDP/RTP Header + voice payload size Voice packets per second (PPS) = codec

bit rate / voice payload size (in bits) Bandwidth (Kbps) = voice packet size*PPS During this calculation, make sure you

convert bytes to bits.

Page 5: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

VoIP Call Bandwidth Values

You can use the following bandwidth requirements for VoIP design:

G.729 calls use 24 Kbps G.723 calls use 24 Kbps G.711 calls use 80 Kbps

Page 6: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Serialization Delay Example

A 1500 byte packet takes (1500 * 8 / 64,000) = 187 ms of serialization delay on a 64 Kbps circuit.

If the circuit is increased to 512 Kbps, the serialization delay changes to (1500 * 8/512,000) = 23.4 ms.

Page 7: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Methods to reduce Serialization Delay Data-link fragmentation using Link Fragmentation

and Interleaving (LFI) or FRF.12 mechanisms reduces the serialization delay by reducing the size of the larger data packets.

This arrangement reduces the delay experienced by voice packets as data packet fragments are serialized and voice packets are interleaved between the fragments.

A reasonable design goal is to keep the serialization delay experienced by the largest packets or fragments on the order of 10 ms at any interface.

Page 8: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Reducing the Bandwidth

Page 9: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Network Requirements

The goal: - Ensure voice quality by designing

to minimize loss, delay, delay variation and echo.

The solution: - Use QoS tools to protect voice from

data and protect voice from voice

Page 10: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

QoS Models

Two models or Approaches: Integrated Services (Intserv) Differentiated Services (Diffserv)

Page 11: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

IntServ Model

Follows the signaled-QoS model, where the end-hosts signal their QoS need to the network

IntServ provides for a rich end-to-end QoS solution, by way of end-to-end signaling, state-maintenance (for each RSVP-flow and reservation), and admission control at each network element

Page 12: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

IntServ

The IntServ model relies on the Resource Reservation Protocol (RSVP) to signal and reserve the desired QoS for each flow in the network.

A flow is defined as an individual, unidirectional data stream between two applications, and is uniquely identified by the 5-tuple (Source IP address, Source Port#, Destination IP address, Destination Port#, and the Transport Protocol).

Page 13: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

IntServ Drawbacks

Every device along a packet's path, including the end systems like servers and PCs, need to be fully aware of RSVP and capable of signaling the required QoS.

Reservations in each device along the path are "soft," which means they need to be refreshed periodically, thereby adding to the traffic on the network and increasing the chance that the reservation may time out if refresh packets are lost.

Page 14: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

IntServ Drawbacks

Maintaining soft-states in each router, combined with admission control at each hop adds to the complexity of each network node along the path, along with increased memory requirements, to support large number of reservations.

Since state information for each reservation needs to be maintained at every router along the path, scalability with hundreds of thousands of flows through a network core becomes an issue.

Page 15: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Simpler Middle Ground

IETF realized that per-flow QoS (IntServ) is difficult to achieve end-to-end in a network without adding significant complexity.

Instead, classifying flows into aggregates (classes), and providing appropriate QoS for the aggregates should minimize signaling and state maintenance requirements on each network node.

Page 16: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

ToS/IP Precedence Solution

The three precedence bits in Type of Service (TOS) byte of the IP Header are used to classify packets in eight possible categories.

Packets of lower precedence (lower values) can be dropped in favor of higher precedence when there is congestion on a network. Further, each packet may be marked to receive one of two levels of delay, throughput, and reliability (DTR) in its forwarding (RFC-791).

Page 17: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

ToS in IPv4 and IPv6 Headers

Page 18: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

The Original IPv4/ToS Field

Page 19: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Limitations of ToS/IP Precedence Not granular enough The 3 bits restrict the number of

possible priority classes to eight. Neither IP-Precedence, nor the DTR

bits are implemented consistently by network vendors today.

Page 20: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Solution: DiffServ Type of Service (ToS) Field In order to deliver end-to-end QoS, this

architecture (RFC-2475) has two major components—Packet Marking using the IPv4 ToS byte, and Per Hop Behaviors (PHBs).

Packet Marking done using a 6-bit bit-pattern (called the Differentiated Services Code Point [DSCP]) in the IPv4 ToS Octet or the IPv6 Traffic Class Octet is used to this end as shown in Figure on next slides

Page 21: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Diffserv Code Point (DSCP) Field

Page 22: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

DiffServ Components

Two major components of DiffServ Traffic Classification

Classification Policing Marking Shaping

Per-Hop Behaviour Queuing Dropping

Page 23: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

DiffServ

Classify Shape(optional)

QueuingDropPolicy

Edge Device(CED or SED)

Traffic Classification

Ingress Interfaces

Per-Hop BehaviourEgress Interfaces

Every Node in Network

Police&

Mark

Page 24: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification:Classification Trust boundary Define “interesting” traffic Create “classes” of traffic Determine service level required for

each class (DSCP) Determine how to group traffic in classes

Match on IP source or destination address, access-control list, protocol (port) number, RTP port range (for voice)

Oldest and most common is ACL

Page 25: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification:IPv4 ToS vs. DS-Field

DSCP bits

Page 26: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification:Classification (cont.) As mentioned earlier, the DSCP

indicates the PHB throughout the entire network 4 types of classifications

Default (all bits set to 0) Class Selector

Backwards compatible with IP Prec Assured Forwarding (AF) Expedited Forwarding (EF)

Page 27: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification:Classification (cont.) Class Selector DSCP

Upper 3 bits map to IP Prec levels Lower 3 bits are all set to 0

Class Selectors DSCPIP Prec 1 001 000IP Prec 2 010 000IP Prec 3 011 000IP Prec 4 100 000IP Prec 5 101 000IP Prec 6 110 000IP Prec 7 111 000

Page 28: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification:Classification (cont.)

Assured Forwarding Four services classes are defined

AF1, AF2, AF3, AF4 AF1 maps to IP Prec 1, AF2, maps to IP Prec 2,

etc.

Upper 3 bits define the class and class priority, the next 2 bits define packet drop precedence, and the last bit is always 0.

Page 29: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification:Classification (cont.)

Expedited Forwarding Highest level of service Single class also known as EF DSCP value is 101110

Page 30: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification:Classification (cont.)

Example DiffServ values Gold – EF (DSCP 46) Silver – AF31 (DSCP 26) Bronze – AF11 (DSCP 10)

Page 31: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification: Policing and Marking Involves defining a “policer” that

specifies BW limits for each traffic class Traffic that exceeds configuration Known as out-of-profile or nonconforming

traffic Actions include:

Forwarding packet without changes Dropping packet Modifying (remarking or marking down) the

packet before forwarding Assigning a different DSCP

Page 32: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification: Policing and Marking (cont.) Types of Policers

Individual Apply BW limits separately to an individual traffic

class Aggregate

Apply BW limits in a cumulative manner to all traffic classes

Policing Mechanisms Committed Access Rate Class-Based Policing

Page 33: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Traffic Classification:Shaping Used to rate-limit previously created

classes of traffic Requirement is to meter traffic rate Shaping involves delaying excess

traffic in order to remain within acceptable limit

Shaping Mechanisms Generic Traffic Shaping Class-Based Shaping

Page 34: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Per-Hop Behaviour:Queuing

Two locations: Ingress (on a Catalyst 3750)

Due to fact that aggregate BW on ports may exceed BW of switch stack, traffic may be queued before reaching switch fabric

Egress (all switches that support QoS) Due to fact that multiple ports sending

packets to uplink port can cause congestion

Page 35: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Per-Hop Behaviour:Queuing Mechanisms

Weighted Tail Drop (WTD) If congestion occurs, packets are dropped at

intervals depending on their DSCP value Example (below)

When queue is 40% full, Bronze traffic begins to be dropped

When queue is 60% full, Silver traffic then is eligible to be dropped

Not until the queue is 100% full can Gold traffic be dropped

An option to configure on ingress switch ports in LAN or workgroup egress switch ports

Page 36: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Other Queuing Mechanisms

Weighted Fair Queuing – no classes defined by user, the IOS instead uses weights assigned by itself

Class Based Weighted Fair Queuing (CBWFQ) – classes for each traffic type configured by user and appropriate QoS parameters assigned

Low Latency Queuing (LLQ) – Same as CBWFQ but has a priority queue. Suitable for VoIP traffic as VoIP traffic is assigned the priority queue

Page 37: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

50%

35%

15%

Gold

Silver

Bronze

Step 1: Define bufferingStep 2: Define bandwidth

CBWFQPer Hop Behaviour

Guaranteed: latency, deliveryGuaranteed: latency, delivery

Guaranteed: deliveryGuaranteed: delivery

Best effortBest effort

Page 38: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

LLQ/CBWFQ + Traffic Shaping

shapeaverage

CBWFQ

LLQ

CBWFQ

Child Policy

Gold

Silver

Bronze

Traffic

Parent Policy

Page 39: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

QoS on Cisco Devices

Three basic steps Classify the traffic – create a class map Create a policy map – associate a class

map with one or more QoS policies Assign the policy to an interface

Use Modular QoS Command-Line-Interface (MQC)

Page 40: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Catalyst Switch QoS Configuration

Step 1: Enable QoS globallyinterface range port-range

Disabling flowcontrol on all ports is a prerequisite and the above command allows you to configure multiple ports at a time

flowcontrol receive offflowcontrol send offmls qos

Page 41: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Catalyst SwitchQoS Configuration (cont.)

Step 2: Trust Boundaries If you have a number of workgroup

switches connecting to a central core switch you may wish to configure a trust boundary

interface interface-idmls qos trust |cos | dscp | ip-precedence}

Page 42: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Catalyst SwitchQoS Configuration (cont.)

Step 3: Trusting IP Phone Trafficcdp run

interface [range] interface-idcdp enablemls qos trust device cisco- phone

Note: Auto-QoS available as well for configuring QoS parameters automatically (not recommended)

Page 43: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Catalyst Switch QoS Configuration (cont.)

Step 4: Define “interesting traffic” using extended ACLs

access-list number {deny | permit} protocol source source-wildcard destination destination-wildcard

Page 44: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Catalyst SwitchQoS Configuration (cont.)

Step 5: Define and create class-maps and policy-maps

class-map [match-all | match-any] class-map-name match {access-group acl-number-or-name | ip dscp dscp-list | ip precedence ip-precedence-list

Create as many class maps as required

Page 45: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Catalyst SwitchQoS Configuration (cont.)

Step 5 (cont.) create the policy map

policy-map policy-map-nameclass class-map-name

set {cos new-cos-value | ip dscp new-dscp- value | ip precedence new-ip-precedence- value

police {aggregate name | rate-bps burst-byte exceed-action {drop | policed-dscp-transmit}}

Page 46: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

Catalyst SwitchQoS Configuration (cont.)

Step 6: Apply policy map to an interface

interface interface-idservice-policy {input policy-

map- name output policy-map-name}

Page 47: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

QoS Router Configuration

Step 1: Create class mapsclass-map class-map-

name match ip dscp

[dscp-value |dscp-name] There can be multiple dscp

values entered in same line

Page 48: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

QoS Router Configuration

Step 2: Define and create policy map for inbound interfacepolicy-map policy-map-name

class class-name

interface f 0/0.2service-policy input policy-map-name

Page 49: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

QoS Router Configuration

Step 3: Define and create policy map for outbound interface Create a priority queue

policy-map policy-map-nameclass class-namepriority kilobits-per-second burst-in –bits-per-second

Assign BW to other classesclass class-namebandwidth percent percentage-of-remaining-bandwidth

Page 50: Topic 4: Quality of Service. Need for QoS If we don’t use QoS, the following problems may arise: Jitter Insufficient Bandwidth Delay Information Loss.

QoS Router Configuration

Step 4: Apply to an outbound interface

interface interface-type interface-number

service-policy {input | output} policy-map- name

An option is to Traffic shape on the egress interfacetraffic-shape rate bits-per-second