Theory and Practice Dimitrios Kalogeras

Slides:



Advertisements
Similar presentations
Top-Down Network Design Chapter Thirteen Optimizing Your Network Design Copyright 2010 Cisco Press & Priscilla Oppenheimer.
Advertisements

Tiziana Ferrari Differentiated Services Test: Report1 Differentiated Service Test REPORT TF-TANT Tiziana Ferrari Frankfurt, 1 Oct.
CS640: Introduction to Computer Networks Aditya Akella Lecture 20 – QoS.
© 2006 Cisco Systems, Inc. All rights reserved. Module 4: Implement the DiffServ QoS Model Lesson 4.7: Introducing Traffic Policing and Shaping.
Theory and Practice Dimitrios Kalogeras
Chapter 30 Quality of Service
Real-Time Protocol (RTP) r Provides standard packet format for real-time application r Typically runs over UDP r Specifies header fields below r Payload.
© 2006 Cisco Systems, Inc. All rights reserved. Module 4: Implement the DiffServ QoS Model Lesson 4.10: Deploying End-to-End QoS.
© 2006 Cisco Systems, Inc. All rights reserved. Optimizing Converged Cisco Networks (ONT) Module 4: Implement the DiffServ QoS Model.
CPSC Topics in Multimedia Networking A Mechanism for Equitable Bandwidth Allocation under QoS and Budget Constraints D. Sivakumar IBM Almaden Research.
Differentiated Services. Service Differentiation in the Internet Different applications have varying bandwidth, delay, and reliability requirements How.
ACN: IntServ and DiffServ1 Integrated Service (IntServ) versus Differentiated Service (Diffserv) Information taken from Kurose and Ross textbook “ Computer.
CS Summer 2003 Lecture 8. CS Summer 2003 Populating LFIB with LDP Assigned/Learned Labels Changes in the LFIB may be triggered routing or.
CSE 401N Multimedia Networking-2 Lecture-19. Improving QOS in IP Networks Thus far: “making the best of best effort” Future: next generation Internet.
School of Information Technologies IP Quality of Service NETS3303/3603 Weeks
Internet QoS Syed Faisal Hasan, PhD (Research Scholar Information Trust Institute) Visiting Lecturer ECE CS/ECE 438: Communication Networks.
CSc 461/561 CSc 461/561 Multimedia Systems Part C: 3. QoS.
An Architecture for Differentiated Services
24-1 Chapter 24. Congestion Control and Quality of Service part Quality of Service 23.6 Techniques to Improve QoS 23.7 Integrated Services 23.8.
Tiziana FerrariQuality of Service for Remote Control in the High Energy Physics Experiments CHEP, 07 Feb Quality of Service for Remote Control in.
© 2006 Cisco Systems, Inc. All rights reserved. Module 4: Implement the DiffServ QoS Model Lesson 4.1: Introducing Classification and Marking.
Optimizing Converged Cisco Networks (ONT)
© 2006 Cisco Systems, Inc. All rights reserved. Module 4: Implement the DiffServ QoS Model Lesson 4.5: Configuring CBWFQ and LLQ.
Deploying Quality of Service Technologies
3.4: Using MQC for Implementing QoS
© 2006 Cisco Systems, Inc. All rights reserved. Optimizing Converged Cisco Networks (ONT) Module 4: Implement the DiffServ QoS Model.
© 2001, Cisco Systems, Inc. Classification and Marking.
QoS in MPLS SMU CSE 8344.
Integrated Services (RFC 1633) r Architecture for providing QoS guarantees to individual application sessions r Call setup: a session requiring QoS guarantees.
CHAPTER 8 Quality of Service. Integrated services (IntServ) Ensure that a specific flow of traffic is going to receive the appropriate level of bandwidth.
CSE679: QoS Infrastructure to Support Multimedia Communications r Principles r Policing r Scheduling r RSVP r Integrated and Differentiated Services.
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 23 - Multimedia Network Protocols (Layer 3) Klara Nahrstedt Spring 2011.
Tiziana Ferrari Quality of Service Support in Packet Networks1 Quality of Service Support in Packet Networks Tiziana Ferrari Italian.
CSE QoS in IP. CSE Improving QOS in IP Networks Thus far: “making the best of best effort”
IP QoS for 3G. A Possible Solution The main focus of this network QoS mechanism is to provide one, real time, service in addition to the normal best effort.
Quality of Service (QoS)
QOS مظفر بگ محمدی دانشگاه ایلام. 2 Why a New Service Model? Best effort clearly insufficient –Some applications need more assurances from the network.
CSC 336 Data Communications and Networking Lecture 8d: Congestion Control : RSVP Dr. Cheer-Sun Yang Spring 2001.
Top-Down Network Design Chapter Thirteen Optimizing Your Network Design Oppenheimer.
1 Quality of Service Outline Realtime Applications Integrated Services Differentiated Services MPLS.
© 2001, Cisco Systems, Inc. Modular QoS CLI Classification.
ACL & QoS.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 21 – Case Studies for Multimedia Network Support (Layer 3) Klara Nahrstedt Spring 2009.
Multimedia Wireless Networks: Technologies, Standards, and QoS Chapter 3. QoS Mechanisms TTM8100 Slides edited by Steinar Andresen.
© 2006 Cisco Systems, Inc. All rights reserved. Optimizing Converged Cisco Networks (ONT) Module 3: Introduction to IP QoS.
© 2006 Cisco Systems, Inc. All rights reserved. Optimizing Converged Cisco Networks (ONT) Module 3: Introduction to IP QoS.
Network Support for QoS – DiffServ and IntServ Hongli Luo CEIT, IPFW.
Mr. Mark Welton.  Quality of Service is deployed to prevent data from saturating a link to the point that other data cannot gain access to it  QoS allows.
© 2006 Cisco Systems, Inc. All rights reserved. Optimizing Converged Cisco Networks (ONT) Module 4: Implement the DiffServ QoS Model.
An End-to-End Service Architecture r Provide assured service, premium service, and best effort service (RFC 2638) Assured service: provide reliable service.
Differentiated Services IntServ is too complex –More focus on services than deployment –Functionality similar to ATM, but at the IP layer –Per flow QoS.
Queue Scheduling Disciplines
© 2006 Cisco Systems, Inc. All rights reserved. Module 4: Implement the DiffServ QoS Model Lesson 4.6: Congestion Avoidance.
© 2006 Cisco Systems, Inc. All rights reserved. 3.2: Implementing QoS.
Lecture 8 -Traffic Management
An End-to-End Service Architecture r Provide assured service, premium service, and best effort service (RFC 2638) Assured service: provide reliable service.
Providing QoS in IP Networks
Mar-16 1 Cairo University Faculty of Engineering Electronics &Communication dpt. 4th year Linux-based Implementation Of a Router (B.Sc Graduation project)
1 Lecture 15 Internet resource allocation and QoS Resource Reservation Protocol Integrated Services Differentiated Services.
Multicast and Quality of Service Internet Technologies and Applications.
Chapter 30 Quality of Service Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Instructor Materials Chapter 6: Quality of Service
Topics discussed in this section:
Top-Down Network Design Chapter Thirteen Optimizing Your Network Design Copyright 2010 Cisco Press & Priscilla Oppenheimer.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 6: Quality of Service Connecting Networks.
EE 122: Lecture 18 (Differentiated Services)
EE 122: Differentiated Services
CIS679: Two Planes and Int-Serv Model
Presentation transcript:

Theory and Practice Dimitrios Kalogeras IP QoS Principles Theory and Practice Dimitrios Kalogeras

Agenda Introduction – History – Background QoS Metrics QoS Architecture QoS Architecture Components Applications in Cisco Routers

A Bit of History The Internet, originally designed for U. S. government use, offered only one service level: Best Effort. No guarantees of transit time or delivery Rudimentary prioritization was available, but it was rarely used. Commercialization began in early 1990’s Private (intranet) networks using Internet technology appeared. Commercial users began paying directly for Internet use. Commerce sites tried to attract customers by using graphics. Industry used the Internet and intranets for internal, shared communications that combined previously-separate, specialized networks -- each with its own specific technical requirements. New technologies (voice over the Internet, etc.) appeared, designed to capitalize on inexpensive Internet technologies.

The Demands on Modern Networks Network flexibility is becoming central to enterprise strategy Rapidly-changing business functions no longer carried out in stable ways, in unchanging locations, or for long time-periods Network-enabled applications often crucial for meeting new market opportunities, but there’s no time to custom-build a network Traffic is bursty Interactive voice, video applications have stringent bandwidth and latency demands Multiple application networks are being combined into consolidated corporate utility networks Bandwidth contention as critical transaction traffic is squeezed by web browsing, file transfers, or other low-priority or bulk traffic Latency problems as interactive voice and video are squeezed by transaction, web browsing, file transfer, and bulk traffic

QoS Background QoS development inspired by new types of applications in IP environment: Video Streaming Services Video Conferencing VoIP Legacy SNA / DLSw

Definitions Quality of Service (QoS) classifies network traffic and then ensures that some of it receives special handling. May track each individual dataflow (sender:receiver) separately. May include attempts to provide better error rates, lower network transit time (latency), and decreased latency variation (jitter). Differentiated Class of Service (CoS) is a simpler alternative to QoS. Doesn't try to distinguish among individual dataflows; instead, uses simpler methods to classify packets into one of a few categories. All packets within a particular category are then handled in the same way, with the same quality parameters. Policy-Based Networking provides end-to-end control. The rules for access and for management of network resources are stored as policies and are managed by a policy server.

Statistical Behavior: Random Arrival In random arrival, the time that each packet arrives is completely independent of the time that any other packet arrives. If the true situation is that arrivals tend to be evenly spaced, then random arrival calculations will overestimate the queuing delay. If the true situation is that arrivals are bunched in groups (typical of data flows, such as packets and acknowledgements), then random arrival calculations will underestimate the queuing delay. Our intuition is usually misleading when we think of random processes. We tend to assume that queue size increases linearly as the number of customers increases. But, with random arrival, there is a drastic increase in queue size as the customer arrival rate approaches 80% of the theoretical server capacity. There’s no way to store the capacity that is unused by late customers, but early customers increase the queue.

Random Arrival and Intuition The surprising increase in queue length is best shown by a graph:

Random Arrival vs. Self-Similar Although random arrival is very convenient mathematically (it’s relatively simple to do random arrival calculations), it has been shown that much data traffic is self-similar. Ethernet and Internet traffic flows, in particular, are self-similar. The rate of initial connections is still random, however. Self-similar traffic shows the same pattern regardless of changes in scale. Fractal geometry (e.g., a coastline) is an example. Self-similar traffic has a heavy tail. The probabilities of extremely large values (e.g., file lengths of a gigabyte or more) don’t decrease as rapidly, as they would with random distributions of file lengths. This matches real data traffic behaviours. Long file downloads mixed with short acknowledgements Compressed video with action scenes mixed with static scenes

Implications of Self-Similar Behaviour “If high levels of utilization are required, drastically larger buffers are needed for self-similar traffic than would be predicted based on classical queuing analysis [i.e., assuming random behaviour].” [Stallings] Combining self-similar traffic streams doesn’t quickly result in smoother traffic patterns; it’s only at the highest levels of aggregation that random-arrival statistics can be used.

QoS Metrics: What are we trying to control? Four metrics are used to describe a packet’s transmission through a network – Bandwidth, Delay, Jitter, and Loss Using a pipe analogy, then for each packet: Bandwidth is the perceived width of the pipe Delay is the perceived length of the pipe Jitter is the perceived variation in the length of the pipe Loss is the perceived leakiness if the pipe Bandwidth The path as perceived by a packet! A B Delay

QoS Metrics – Bandwidth The amount of bandwidth available to a packet is affected by: The slowest link found in the transmission path The amount of congestion experienced at each hop – TCP slow-start and windowing The forwarding speed of the devices in the path The queuing priority given to the packet flow 2Mb/s 10 Mb/s 2 Mb/s Maximum Bandwidth 100 Mb/s

QoS Metrics – Delay The amount of delay experienced by a packet is the sum of the: Fixed Propagation Delays Bounded by the speed of light and the path distance Fixed Serialization Delays The time required to physically place a packet onto a transmission medium Variable Switching Delays The time required by each forwarding engine to resolve the next-hop address and egress interface for a packet Variable Queuing Delays The time required by each switching engine to queue a packet for transmission

QoS Metrics – Jitter The amount of Jitter experienced by a packet is affected by: Serialization delays on low-speed interfaces Variations in queue-depth due to congestion Variations in queue cycle-times induced by the service architectures – First-Come, First-Served, for example ~214ms Serialization Delay for a 1500-byte packet at 56Kb/s 60B every 20ms 60B every 214ms 60B every 214ms Voice 1500 Bytes of Data Voice Voice 1500 Bytes of Data Voice Voice 1500 Bytes of Data Voice 10 Mbps Ethernet 10 Mbps Ethernet 56 Kbps WAN

QoS Metrics – Loss The amount of loss experienced by a packet flow is affected by: Buffer exhaustion due to congestion caused by oversubscription or rate-decoupling Intentional packet drops due to congestion control mechanism such as Random Early Discard GE DS-3 GE GE Oversubscribed Buffer Exhaustion

QoS Architecture Models Best Effort Service Integrated Service Differentiated Service

QoS Implementation Models No State 1. Best Effort Per-Flow State Aggregated State 2. IntServ/RSVP 3. DiffServ 4. RSVP+DiffServ+MPLS

Best Effort Service What exactly IP does: All packets treated equally Unpredictable bandwidth Unpredictable delay and jitter

IntServ (RFC1633)

Integrated Services (IntServ) The Integrated Services (IntServ) model builds upon Resource Reservation Protocol (RSVP) Reservations are made per simplex flow Applications request reservations for network resources which are granted or denied based on resource availability Senders specify the resource requirements via a PATH message that is routed to the receiver Receivers reserve the resources with a RESV message that follows the reverse path Sender Receiver PATH RESV

IntServ – Components The Integrated Services Model can be divided into two parts – the Control and Data Planes Routing Selection Admission Control Reservation Setup Reservation Table Flow Identification Packet Scheduler Control Plane Data Plane

IntServ – Components Control Plane Data Plane Route Selection – Identifies the route to follow for the reservation (typically provided by the IGP processes) Reservation Setup – Installs the reservation state along the selected path Admission Control – Ensures that resources are available before allowing a reservation Data Plane Flow Identification – Identifies the packets that belong to a given reservation (using the packet’s 5-Tuple) Packet Scheduling – Enforces the reservations by queuing and scheduling packets for transmission

IntServ – Service Models Applications using IntServ can request two basic service-types: Guaranteed Service Provides guaranteed bandwidth and queuing delays end-to-end, similar to a virtual-circuit Applications can expect hard-bounded bandwidth and delay Controlled-Load Service Provides a Better-than-Best-Effort service, similar to a lightly-loaded network of the required bandwidth Applications can expect little to zero packet loss, and little to zero queuing delay These services are mapped into policies that are applied via CB-WFQ, LLQ, or MDRR

IntServ – Scaling Issues IntServ routers need to examine every packet to identify and classify the microflows using the 5-tuple IntServ routers must maintain a token-bucket per microflow Guaranteed Service requires the creation of a queue for each microflow Data structures must be created and maintained for each reservation

DiffServ (RFC2474/2475)

Differentiated Services (DiffServ) The DiffServ Model specifies an approach that offers a service better than Best-Effort and more scalable than IntServ Traffic is classified into one of five forwarding classes at the edge of a DiffServ network Forwarding classes are encoded in the Differentiated Services Codepoint (DSCP) field of each packet’s IP header DiffServ routers apply pre-provisioned Per-Hop Behaviors (PHBs) to packets according to the encoded forwarding class 5 4 3 2 1 5 4 3 2 1

DiffServ – Compared to IntServ DiffServ allocates resources to aggregated rather than to individual flows DiffServ moves the classification, policing, and marking functions to the boundary nodes – the core simply forwards based on aggregate class DiffServ defines Per-Hop forwarding behaviors, not end-to-end services DiffServ guarantees are based on provisioning, not reservations The DiffServ focus is on individual domains, rather than end-to-end deployments

DiffSrv – The DS Field (RFC 2474) DSCP CU The DS field is composed of the 6 high-order bits of the IP ToS field The DS field is functionally similar to the IPv4 TOS and IPv6 Traffic Class fields The DS field is divided into three pools: nnnnn0 – Standards Use nnnn11 – Experimental / Local Use nnnn01 – Experimental / Local Use, possible Standards Use Class Selector Codepoints occupy the high-order bits (nnn000) and map to the IPv4 Precedence bits

DiffSrv – Forwarding Classes DSCP Codepoint 000000 CS0 (DE) 001000 CS1 001010 AF11 001100 AF12 001110 AF13 010000 CS2 010010 AF21 010100 AF22 010110 AF23 011000 CS3 011010 AF31 011100 AF32 011110 AF33 100000 CS4 100010 AF41 100100 AF42 100110 AF43 101000 CS5 101110 EF 110000 CS6 111000 CS7 The DS Field can encode: Eight Class Selector Codepoints compatible with legacy systems (CS0-7) An Expedited Forwarding (EF) Class Four Assured Forwarding Classes, each with three Drop Precedence (AFxy, where x=1-4, and y=1-3) Packets in a higher AF Classes have a higher transmit priority Packets with a higher Drop Precedence are more likely to be dropped

DiffServ – Per-Hop Behaviours A Per-Hop Behaviour (PHB) is an observable forwarding behaviour of a DS node applied to all packets with the same DSCP PHBs do NOT mandate any specific implementation mechanisms The EF PHB should provide a low-loss, low-delay, low-jitter, assured bandwidth service The AF PHBs should provide increasing levels or service (higher bandwidth) for increasing AF levels The Default PHB (CS0) should be equivalent to Best-Effort Service Packets within a given PHB should not be re-ordered

DiffServ – Boundary Nodes DiffServ Boundary Nodes are responsible for classifying and conditioning packets as they enter a given DiffServ Domain Classifier Marker Meter Remarker Shaper Dropper Classification Conditioning Classifier Examine each packet and assign a Forwarding Class Marker Set the DS Field to match the Forwarding Class Meter Measure the traffic flow and compare it to the traffic profile Remarker Remark (lower) the DS Field for out-of-profile traffic Shaper Shape the traffic to match the traffic profile Dropper Drop out of profile traffic

DiffServ – Summary DiffServ Domain Classification / Conditioning PHB Premium Gold Silver Bronze PHB LLQ/WRED Classification / Conditioning

The Trouble with DiffServ As currently formulated, DiffServ is strong on simplicity and weak on guarantees Virtual wire using EF is OK, but how much can be deployed? DiffServ has no topology-aware admission control mechanism

RSVP-DiffServ Integration The best of both worlds – Aggregated RSVP integrated with DiffServ No State Best Effort Per-Flow State IntServ Aggregated State DiffServ Firm Guarantees Admission Control RSVP + DiffServ But – given the presence of a DiffServ domain in a network, how do we support RSVP End-to-End?

RSVP-DiffServ Integration – How? Routers at edge of a DS cloud perform microflow classification, policing, and marking Guaranteed Load set to the EF, Controlled load set to AFx, and Best Effort set to CS0 Service Model to Forwarding Class mapping is arbitrary RSVP signaling is used in both the IntServ and DiffServ regions for admission control The DiffServ core makes and manages aggregate reservations for the DS Forwarding Classes based on the RSVP microflow reservations The core then schedules and forwards packets based only on the DS Field

RSVP-DiffServ Integration Border Routers implement per-flow classification, policing, and marking The DiffServ region aggregates the flows into DS Forwarding Classes DiffServ Region RSVP Signaling is propagated End-to End The IntServ regions contain Guaranteed or Controlled Load Microflows

RSVP-DiffServ Integration – Summary The forwarding plane is still DiffServ We now make a small number of aggregated reservations from ingress to egress Microflow RSVP messages are carried across the DiffServ cloud Aggregate reservations are dynamically adjusted to cover all microflows RSVP flow-classifiers and per-flow queues are eliminated in the core Scalability is improved – only the RSVP flow states are necessary – Tested to 10K flows

QoS Architecture Components Classification Coloring Admission Control Traffic Shaping/Policing Congestion Management Congestion Avoidance Signaling

Traffic Classification Most fundamental QoS building block The component of a QoS feature that recognizes and distinguishes between different traffic streams Without classification, all packets are treated the same

Traffic Classification/ Admission Control Issues Always performed at the network perimeter Makes traffic conform to the internal network policy Marks packets with special flags (colors) Colors used afterwards inside the network for QoS management

Classification/ Admission Control Scheme Classifier Meter Marker Shaper/ Policer Packet Admitted Dropped

Classification Criteria IP header fields TCP/UDP header fields Routing information Packet Content (NBAR) i.e. HTTP, HTTPS, FTP, Napster etc.

Traffic Coloring Options IP Precedence DSCP QoS Group 802.1p CoS ATM CLP Frame Relay DE

Type-of-Service (RFC791) Precedence D T R Unused Version Length ToS Field Total Length … 8 15 31 1 D Normal Delay Low Delay T Normal Throughput High Throughput R Normal Reliability High Reliability

IP Precedence Values 111 Network Control 110 Internetwork Control 101 Critical 100 Flash Override 011 Flash 010 Immediate 001 Priority 000 Routine

DSCP Diffserv Code Point DSCP (6 bits) Unused Class 1 Class 2 Class 3 Class 4 Low Drop Precedence 001010 010010 011010 100010 Medium Drop Precedence 001100 010100 011100 100100 High Drop Precedence 001110 010110 011110 100110

Classification mechanisms MQC ( Modular Qos Command Line Interface) CAR ( Commited Access Rate)

Modular QoS CLI Modular QoS CLI (MQC) Command syntax introduced in 12.0(5)T Reduces configuration steps and time Uniform CLI across all main Cisco IOS-based platforms Uniform CLI structure for all QoS features

Basic MQC Commands class-map [match-any | match-all] class-name router(config)# 1. Create Class Map - a traffic class ( match access list, input interface, IP Prec, DSCP, protocol (NBAR) src/dst MAC address, mpls exp). policy-map policy-map-name router(config)# 2. Create Policy Map (Service Policy) - Associate a class map with one or more QoS policies (bandwidth, police, queue-limit, random detect, shape, set prec, set DSCP, set mpls exp). service-policy {input | output} policy-map-name router(config-if)# 3. Attach Service Policy - Associate the policy map with an input or output interface.

Basic MQC Commands 1. Create Class Map – defines traffic selection criteria Router(config)# class-map class1 Router(config-cmap)# match ip precedence 5 Router(config-cmap)# exit 2. Create Policy Map- associates classes with actions Router(config)# policy-map policy1 Router(config-pmap)# class class1 Router(config-pmap-c)# set mpls experimental 5 Router(config-pmap-c)# bandwidth 3000 Router(config-pmap-c)# queue-limit 30 Router(config-pmap)# exit 3. Attach Service Policy – enforces policy to interfaces Router(config)# interface e1/1 Router(config-if)# service-policy output policy1 Router(config-if)# exit

Classification Configuring Sample IOS 12.1(5)T MQC based class-map match-all premium match access-group name premium ! class-map match-any trash match protocol napster match protocol fasttrack policy-map classify class premium set ip precedence priority class trash police 64000 conform-action set-prec-transmit 1 excess-action drop ip access-list extended premium permit tcp host 10.0.0.1 any eq telnet interface serial 2/1 ip unnumbered loopback 0 service-policy input classify Traffic class definitions QoS policy definition ACL definition QoS Policy attached to interface

Classification Configuring Sample CAR based ip cef ! interface serial 2/1 ip unnumbered loopback 0 rate-limit input access-group 100 64000 8000 8000 conform-action set-prec-transmit 1 exceed-action set-prec-transmit 0 access-list 100 permit tcp host 10.0.0.1 any eq http CAR definition ACL definition

Classification Configuring Sample Route-map based route-map classify permit 10 match ip address 100 set ip precedence flash ! route-map classify permit 20 match ip next-hop 1 set ip precedence priority interface serial 2/1 ip unnumbered loopback 0 ip policy route-map classify access-list 1 permit 192.168.0.1 access-list 100 permit tcp host 10.0.0.1 any eq http Route-map definitions Route-map attached to interface ACL definitions

Shaping/Policing Used to assign more predictive behavior to traffic Uses Token Bucket model

Token Bucket Model Token Bucket characterizes traffic source tc = Bc/v Overflow Tokens Tokens Incoming packets Conform Exceed Bc v C Token Bucket main parameters: Token Arrival Rate - v Bucket Depth - Bc Time Interval – tc Link Capacity - C tc = Bc/v

Token Bucket Model Bucket is being filled with tokens at a rate v token/sec. When bucket is full all the excess tokens are discarded. When packet of size L arrives, bucket is checked for availability of corresponding amount of tokens. If several packets arrive back-to-back and there are sufficient tokens to serve them all, they are accepted at peak rate (usually physical link speed). If enough tokens available, packet is optionally colored and accepted to the network and corresponding amount of tokens is subtracted from the bucket. If not enough tokens, special action on packet is performed.

Token Bucket Model Actions performed on nonconforming packets: Dropped (Policing) Delayed in queue either FIFO or WFQ (Shaping) Colored/Recolored

Token Bucket Model Bucket depth variation effect: Bc = 0 Constant Bit Rate (CBR) Bc No Regulation Bucket depth is characteristic of traffic burstiness Maximum number of bytes transmitted over period of time t: A(t)max = Bc+v·t

Excess Burst (Be) Cisco Implementation GTS ( Generic Traffic Shaping) If during previous tcn-1 interval bucket Bc was not depleted (there is no congestion), in the next interval tcn Bc+Be bytes are available for burst. In frame relay implementations packets admitted via Be tokens are marked with DE bit.

Excess Burst (Be) Cisco Implementation CBTS (Class Based Traffic Shaping) allows higher throughput in uncongested environment up to peak rate calculated as vPeak = vCIR(1+Be/Bc) Peak rate can be set up manually.

Excess Burst (Be) Cisco Implementation CAR allows RED like behavior: traffic fitting into Bc always conforms traffic fitting into Be conforms with probability proportional to amount of tokens left in the bucket traffic not fitting into Be always exceeds CAR uses the following parameters: t – time period since the last packet arrival Current Debt (Dcur) – Amount of debt during current time interval Compound Debt (Dcomp) – Sum of all Dcur since the last drop Actual Debt (Dact) – Amount of tokens currently borrowed

Excess Burst (Be) Cisco Implementation Packet of length L arrived CAR Algorithm Y Conform Action Bccur – L > 0 Bccur = Bccur – L N Dcur = L - Bccur Bccur = 0 Dcomp = Dcomp + Dcur Dact = Dact + Dcur +v·t Y Exceed Action Dact > Be N Y Dcomp > Be Dcomp = 0 N

Shaping Configuration Sample GTS Based interface serial 2/1 ip unnumbered loopback 0 traffic-shape rate 64000 8000 1000 256 ! interface serial 2/2 traffic-shape group 100 64000 8000 8000 512 access-list 100 permit tcp host 10.0.0.1 any eq http Shaper Definitions ACL definition Shaper can be only used to control egress traffic flow!

Policing Configuration Sample IOS 12.0(5)T CAR Based ip cef interface serial 2/1 ip unnumbered loopback 0 rate-limit output access-group 100 64000 8000 16000 conform-action transmit excess-action drop ! interface serial 2/2 rate-limit input 128000 16000 32000 conform-action transmit excess-action drop access-list 100 permit tcp host 10.0.0.1 any eq http CAR Definitions ACL definition Policer can be used to control ingress traffic flow!

Shaping/Policing Configuration Sample IOS 12.1(5)T MQI Based class-map match-all policed match protocol http class-map match-all shaped match access-group name ftp-downloads ! policy-map bad-boy class policed police 64000 8000 8000 conform-action transmit exceed-action drop class shaped shape average 128000 interface serial 2/1 ip unnumbered loopback 0 service-policy output bad-boy ip access-list extended ftp-downloads permit tcp any eq ftp-data any Class definitions QoS policy definition QoS Policy attached to interface ACL definition

CAR Policing Problem Why cannot my traffic reach CIR value? Cause: Improper setting of Bc and Be values CAR is aggressive, as drops excessive packets and the lost data needs to be retransmitted by upper layers (mainly TCP) after timeout. This also causes TCP to shrink its window reducing flow throughput. Cisco Systems recommends the following settings: Bc = 1.5xCIR/8 Be = 2xBc

Congestion Management

Queuing Traffic burst may temporarily exceed interface capacity Without queuing this excess traffic will be lost Queuing allows bursty traffic to be transmitted without drops Queuing strategy defines order in which packets are transmitted through egress interface Queuing introduced additional delay which signals to adaptive flows (like TCP) to back off their throughput

Queuing Algorithms FIFO Priority (Absolute) Weighted Round Robin (WRR) Fair

FIFO Simplest queuing method with the least CPU overhead No congestion control Transmits packets in the order of arrival High volume traffic can suppress interactive flows Default queuing for interfaces > 2Mbps (i.e. Ethernet)

FIFO average queue depth dependence on load

Absolute Priority Queuing Generic Priority Queuing Custom Queuing RTP Priority Queuing Low Latency Queuing (LLQ)

Simplest QoS Algorithm: Priority Queuing Stated requirement: “If <application> has traffic waiting, send it next” Commonly implemented Defined behavior of IP precedence 11

Priority Queuing Implementation Approach Identify interesting traffic Access lists Place traffic in various queues Dequeue in order of queue precedence 12

Q Length Defined by Q Limit Interface Buffer Resources Priority Queuing (PQ) Interface Hardware Ethernet Frame Relay ATM Serial Link Etc. High Traffic Destined for Interface Medium Classify Normal Transmit Queue Output Line Low Q Length Defined by Q Limit Absolute Priority Scheduling Interface Buffer Resources Classification by: Protocol (IP, IPX, AppleTalk, SNA, DecNet, Bridge, etc.) Incoming Interface (EO, SO, S1, etc.) 13

Priority Queuing Scheme High Empty? Medium Empty? Normal Empty? Low Empty? N N N N Send packet from High Send Packet from Medium Send Packet from Normal Send Packet from Low

Generic PQ Drawbacks Needs thorough admission control No upper limit for each priority level High risk of low priority queues` starvation effect

Generic PQ Configuration Sample priority-list 1 protocol ip high tcp telnet priority-list 1 protocol ip high list 100 priority-list 1 protocol ip medium lt 1000 priority-list 1 interface ethernet 0/0 medium priority-list 1 default low ! interface serial 2/1 ip unnumbered loopback 0 priority-group 1 access-list 100 permit tcp host 10.0.0.1 any eq http PQ Definition PQ Attached to Interface ACL definition

Custom Queuing (CQ) (Weighted Round Robin) Interface Hardware Ethernet Frame Relay ATM Serial Link Etc. 1/10 2/10 Traffic Destined for Interface 3/10 Transmit Queue Output Line 2/10 Classify 3/10 Up to 16 Link Utilization Ratio Weighted Round Robin Scheduling (byte count) Q Length Deferred by Queue Limit Classification by: Protocol (IP, IPX, AppleTalk, SNA, DecNet, Bridge, etc.) Incoming interface (EO, SO, S1, etc.) Interface Buffer Resources Allocate Proportion of Link Bandwidth)

WRR Drawbacks Unpredictable jitter Fairness significantly depends on MTU and TCP window size Complex calculations to achieve desired traffic proportions

CQ Byte-count Calculus Distribute bandwidth to 3 queues with proportion x:y:z and packet sizes qx, qy, qz. Calculate ax=x/qx, ay=y/qy, az=z/qz. Normalize and round ax, ay, az. ax’= round(ax/min(ax, ay, az)); ay’= round(ay/min(ax, ay, az)); az’= round(az/min(ax, ay, az)). Convert obtained packet proportion into byte count bcx = ax’·qx; bcy = ay’·qy; bcz = az’·qz. Actual bandwidth share of i-th queue can be calculated with the following formula: For better approximation obtained byte-counts can be multiplied by some positive whole number. Starting with IOS 12.1 CQ employs Deficit Round Robin algorithm and there is no need in such byte-count tuning.

CQ Configuration Sample queue-list 1 protocol ip 1 tcp telnet queue-list 1 protocol ip 2 list 100 queue-list 1 protocol ip 3 udp 53 queue-list 1 interface ethernet 0/0 4 queue-list 1 queue 1 byte-count 3000 queue-list 1 queue 2 byte-count 4500 queue-list 1 queue 3 byte-count 3000 queue-list 1 queue 4 byte-count 1500 queue-list 1 default 4 ! interface serial 2/1 ip unnumbered loopback 0 custom-queue-list 1 access-list 100 permit tcp host 10.0.0.1 any eq http CQ List Definition CQ Attached to Interface ACL Definition

“Bitwise Round Robin” Fair Queuing TDM Model Time Division Multiplexer Keshav, Demers, Shenker, and Zhang Simulates a TDM One flow per channel 22

TDM Message Arrival Sequence 6 4 1 5 2 Time Division Multiplexer 3 23

TDM Message Delivery Sequence 5 4 1 6 3 Time Division Multiplexer 2 24

Fair Queuing Algorithm Employs virtual bit-by-bit round robin model (BRR) BRR dynamics are described by the equation: i-th packet from flow a arriving at time t0 is services at time t : Servicing of i-th packet from flow a will start at Sia and finish at Fia : Additional  parameter is added for priority assignment to inactive flows : Packets are ordered for transmission according to Bia values.

Fair Queuing Approach Enqueue traffic in the sequence the TDM would deliver it As a result, be as fair as the TDM 25

Effects of Fair Queuing Low-bandwidth flows get As much bandwidth as they can use Timely service High-bandwidth flows Interleave traffic Cooperatively share bandwidth Absorb latency 26

What Weighting Does In TDM In WFQ Result: Channel speed determines message “duration” In WFQ Multiplier on message length changes simulated message “duration” Result: Flow’s “fair” share predictably unfair 27

Weighted Fair Queuing (WFQ) Traffic Destined for Interface Transmit Queue Output Line Classify Weighted Fair Scheduling Configurable Number of Queues Flow-Based Classification by: Source and destination address Protocol Session identifier (port/socket) Interface Buffer Resources Weight Determined by: Requested QoS (IP Procedure, RSVP) Frame Relay FECN, BECN, DE (For FR Traffic) Flow throughput (weighted-fair)

Weighted Fair Queuing (WFQ) Fair bandwidth per flow allocation Low delay for interactive applications Protection from ill-behaved sources

Weighted Fair Queuing (WFQ) Flow classified by the following fields: Source address Source port Destination address Destination port ToS Weight of each flow (queue) depends on ToS: weight = 1/(precedence+1) Bandwidth distributed in 1/weight proportions

Weighted Fair Queuing (WFQ) Packets are ordered according to the expected virtual departure time of their last bit. Low volume flows have preference over high volume transfers. Low volume flow is identified as using less than its share of bandwidth. The special queue length threshold value is established, after which only low volume flows can enqueue. All the packets, that belong to high volume flows are dropped.

Drawbacks of Weighted Fair Queuing Requires more sorting than other approaches 31

Weighted Fair Queuing (WFQ) FTP Telnet t Delay

Weighted Fair Queuing (WFQ) FTP Telnet t Delay

WFQ Configuration Sample interface serial 2/1 ip unnumbered loopback 0 fair-queue 32 128 0 Queue Threshold (packets) Number of reservable queues Maximal number of queues

RTP Priority Queuing Classifies only by UDP port range Only even ports from the range are classified Establishes upper limit via integrated policer Excess traffic dropped during congestion periods RTP PQ has priority over LLQ

RTP PQ Configuration Sample interface serial 2/1 ip unnumbered loopback 0 ip rtp priority 16384 16383 256 Starting UDP port Bandwidth Limit (kbps) Range length

Low Latency Queuing (LLQ) Implemented using MQI Very rich classification criteria (class-map) Establishes upper limit via integrated policer Excess traffic dropped during congestion periods

LLQ Configuration Sample IOS 12.0(5)T class-map match-all voice match access-group name voip ! policy-map llq class voip priority 30 class class-default fair-queue 64 interface serial 2/1 ip unnumbered loopback 0 service-policy output llq ip access-list extended voip permit ip host 10.0.0.1 any Class definitions LLQ policy definition LLQ Policy attached to interface ACL definition

Class Based WFQ (CBWFQ) Based on the same algorithm as WFQ Weights can be manually configured Allows to easily specify guaranteed bandwidth for a class Configuration based on Cisco MQI

CBWFQ Configuration Sample IOS 12.0(5)T class-map match-all premium match access-group name premium-cust class-map match-all low-priority match protocol napster ! policy-map cbwfq-sample class premium bandwidth 512 class low-priority shape average 128 shape peak 512 class class-default fair-queue 64 interface serial 2/1 ip unnumbered loopback 0 max-reserved-bandwidth 85 service-policy output cbwfq-sample ip access-list extended premium-cust permit ip host 10.0.0.1 any Class definitions Qos policy definition QoS Policy attached to interface ACL definition

CBWFQ Configuration Sample IOS 12.1(5)T Hierarchical Design class-map match-all premium match access-group name premium-cust class-map match-all voice match ip precedence flash ! policy-map total-shaper class class-default shape average 1536 service-policy class-policy policy-map class-policy class premium bandwidth 512 class voice priority 64 fair-queue 128 interface fastethernet 1/0 ip unnumbered loopback 0 max-reserved-bandwidth 85 service-policy output total-shaper ! ip access-list extended premium-cust permit ip host 10.0.0.1 any

Hierarchical CBWFQ Limitations Only two levels of hierarchy are supported set command not supported in child policy Shaping allows only in parent policy LLQ can be configured only either in child or parent policies but not in both FQ allowed only in child policy

Congestion Avoidance

Global Synchronization Effect Load t Link Capacity Avg. Throughput

Tail Drop and TCP Flow Control Packet drops from all TCP sessions simultaneously High probability of multiple drops from the same TCP session Uniformly distributed drops from high volume and interactive flows Result: Low average throughput!

Random Early Detection (RED) Developed by Van Jacobson in 1993 Starts randomly dropping packets before actual congestion occurs Keeps average queue depth low Increases average throughput

Global Synchronization Removed Load t Link Capacity Avg. Throughput

Random Early Detection (RED) p 1 qavg  max  min  RED Adjustable p 1 qavg qmax Tail Drop

Random Early Detection (RED) RED Parameters: min – Minimal threshold after which RED starts packet drops. Minimal recommended value is 5 packets. max – Maximal threshold after which all packets are dropped. Recommended value is 2-3 times min.  - Mark probability denominator denotes packet drop probability at max average queue depth. Optimal value – 0.1 .  - Exponential weighting factor determines the level of backward value-dependence in average queue depth calculation: qavg = (qold · (1 - 2-)) + (qcur · 2-) General recommendation  = 9.

TCP Rate Control - 1 In TCP, the spacing of ACKs and the window size in the ACKs controls the transmitter’s rate. Rate Control manipulates the ACKs as they pass through the rate control device by: Adjusting the size of TCP ACK window Inserting new ACKs Re-spacing existing ACKs Rate Control works only with TCP; other methods, such as Token Bucket, must be used with UDP. Rate Control violates the protocol layering design, as it allows network devices to manipulate a higher-layer protocol’s operation. Nevertheless, it usually functions well and provides fine-grained control.

TCP Rate Control - 2 Example:

Weighted Random Early Detection (WRED) Modified version of RED Weights determine the set of parameters: min , max and  . Weight depends on ToS field value Interactive flows are preserved

WRED Configuration Sample Interface based interface serial 2/1 ip unnumbered loopback 0 random-detect random-detect 0 32 64 20 random-detect 1 32 64 20 random-detect 2 32 64 20 random-detect 3 32 64 20 … min max 

WRED Configuration Sample MQI based policy-map red class class-default random-detect random-detect 0 32 64 20 random-detect 1 32 64 20 random-detect 2 32 64 20 random-detect 3 32 64 20 … interface Serial2/1 ip unnumbered loopback 0 service-policy output red min max  WRED is incompatible with LLQ feature!

Link Optimization

Link Fragmentation and Interleaving (LFI) For links < 128kbps Voice Packet Jumbogram 64 kbps 1500 bytes  190ms

Link Fragmentation and Interleaving (LFI) 64 kbps Supported interfaces: Multilink PPP Frame Relay DLCI ATM VC

LFI Configuration Sample MLP version interface virtual-template 1 ip unnumbered loopback 0 ppp multilink ppp multilink interleave ppp multilink fragment-delay 30 ip rtp interleave 16384 1024 512 …

Signaling

Resource Reservation Protocol (RSVP) End-to-end QoS signaling protocol Used to establish dynamic reservations over the network Always establishes simplex reservation Supports unicast and multicast traffic Actually uses WFQ and WRED mechanisms

Resource Reservation Protocol (RSVP)

Resource Reservation Protocol (RSVP)

Resource Reservation Protocol (RSVP) Reservation Types: Guaranteed Rate (uses WFQ and LLQ) Controlled Load (uses WRED) Distinct Shared Explicit Fixed Filter (FF) Shared Explicit (SE) Wildcard X Wildcard Filter (WF)

Resource Reservation Protocol (RSVP)

QoS Policy Propagation over BGP QoS policy can be shared inside single AS or among different ASs. Community attribute is usually used for color assignments Prevents manual policy changes in network devices

QoS Policy Propagation over BGP

QPPB Configuration Sample Router A Router B ip bgp-community new-format ! router bgp 10 neighbor 10.0.0.1 remote-as 20 neighbor 10.0.0.1 send-community neighbor 10.0.0.1 route-map cout out route-map cout permit 10 match ip address 20 set community 60:9 access-list 20 permit 192.168.0.0 0.0.0.255 ip bgp-community new-format ! router bgp 20 neighbor 10.0.0.2 remote-as 10 table-map mark-pol route-map mark-pol permit 10 match community 1 set ip precedence flash ip community-list 1 permit 60:9 interface Serial 0/1 ip unnumbered loopback 0 bgp-policy source ip-prec-map

Topics not Covered Multiprotocol Label Switching (MPLS) Frame Relay QoS ATM QoS Distributed Queuing Algorithms Multicast

Conclusion QoS is not an exotic feature any more QoS allows specific applications (VoIP, VC) to share network infrastructure with best-effort traffic QoS in IP networks simplifies their functionality avoiding Frame Relay and ATM usage

? Questions???