Professional Documents
Culture Documents
Cos/Qos: (Class of Service) / (Quality of Service)
Cos/Qos: (Class of Service) / (Quality of Service)
CoS/QoS
(Class of Service)/(Quality of Service)
Johnson Liu
johnsonl@juniper.net reserved. 2011 Juniper Networks, Inc. All rights
| www.juniper.net
Jan.12 , 2012
CoS Overview
Why CoS?
Convergence of voice and data networks Differentiation between applications Guaranteed bandwidth
www.juniper.net | 3
CoS Defined
www.juniper.net | 4
www.juniper.net | 5
CoS is Unidirecrional
CoS configuration is unidirectional
You must explicitly configure settings in both directions
egress
C2
fe-0/0/3
PE2
fe-1/1/1 fe-2/0/1
P1
Traffic flow
ingress
CoS Domain
egress
P2
fe-1/0/2
PE1
fe-1/1/1 fe-0/0/2
C1
Traffic flow
ingress
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 6
A Historic Perspective
Circuit-switched networks
Designed around service levels needed for telephony
Connection-oriented; one user per connection
www.juniper.net | 7
Network Advances
Packet-switched networks
Developed to optimize efficiency for machine-to-machine communications
Multiple users share a connection Unexpected delays and loss during congestion
www.juniper.net | 8
Voice Video
Data
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 9
www.juniper.net | 10
www.juniper.net | 11
Best-Effort Model
Internet initially based on a best-effort packet delivery service The default mode for all traffic No differentiation between types of traffic Like using standard mail
It will get there when it gets there.
www.juniper.net | 12
IntServ Model
Some applications have special bandwidth or delay requirements or both IntServ introduced to guarantee a predictable behavior of the network for these applications Guaranteed delivery: no other traffic can use reserved bandwidth Like having your own private courier plane
2011 Juniper Networks, Inc. All rights reserved.
www.juniper.net | 13
DiffServ Model
Network traffic identified by class Network QoS policy enforces differentiated treatment of traffic classes You choose level of service for each traffic class Like using a package delivery service
Do you want overnight delivery? Do you want two-day air delivery? Do you want three- to seven-day ground delivery?
www.juniper.net | 14
Never deployed
Scalability issues
www.juniper.net | 15
MSB
3 D
4 T
5 R
LSB
Bits
IP Precedence
Reserved
www.juniper.net | 16
DiffServ architecture
DiffServ architecture:
Defined in RFCs 2474 and 2475 Redefined the IPv4 ToS field to support a 6-bit DiffServ Code Point (DSCP) DiffServ has no signaling component
Operates on hop-by-hop basis
MSB
LSB
Bits
------------------------------------ DSCP ---------------- ------- ECN ------------------------- 2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 17
DiffServ Terminology (1 of 2)
Key DiffServ terms:
IP Precedence
3-bit value (0~7) Original IPv4 ToS byte
DSCP
6-bit value (0~63) This is the CoS value for a packet
www.juniper.net | 18
DSCP Encoding
DiffServ field: The IP version 4 header ToS octet or the IPv6 traffic class octet, when interpreted in conformance with the definition given in RFC 2474 DSCP: The first six bits of the DiffServ field, used to select a PHB (forwarding and queuing method)
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 19
DiffServ Terminology (2 of 2)
Key DiffServ terms (contd.):
Per-Hop Behavior (PHB)
Forwarding treatment associated with a given BA Packets with the same DSCP value have the same PHB
PHB group
A set of one or more PHBs with related forwarding behavior Example: assured forwarding (AF) is a PHB group, consisting of multiple PHBs : AF1, AF2, AF3, and AF4
www.juniper.net | 20
Per-Hop Behavior
Per Hop Behavior (PHB)
description of the externally observable forwarding behavior of a DS node applied to a the set of packets with the same DSCP PHB may be defined in terms of
DS nodes resources priority relative to other PHBs observable traffic characteristics (delay, loss, )
Different boxes implement PHBs in different ways which are optimised for each platform
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 21
Per-Hop Behaviors
Each AF class uses three DSCP values. Each AF class is independently forwarded with its guaranteed bandwidth.
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 23
Assured Forwarding(AF)
Primarily concerned with controlling packet loss
Four classes: AF1, AF2, AF3, and AF4 Each class supports three drop probabilities; for example, AF11 (low), AF12 (medium), and AF13 (high)
AF 11/12/13 Low Medium High
2011 Juniper Networks, Inc. All rights reserved.
www.juniper.net | 25
EF PHB Definition
RFC 2598 Expedited Forwarding PHB, June 99 EF PHB can be used to build a low loss, low latency, low jitter, assured bandwidth, end-toend service targets VoIP, Virtual Leased Lines
Assured traffic sees no (or very small) queues/delay Constraint: at every transit node, the aggregates max arrival rate is less than the aggregate min departure rate
An example of how EF can be implemented is a Priority Queue (with rate limit). Recommended DSCP=101110 (46)
www.juniper.net | 26
www.juniper.net | 27
Recommended DSCPs
IANA maintains a list of recommended DSCPs
Based on RFC recommendations for defined PHBs
Name CS0 CS1 CS2 CS3 CS4 CS5 CS6 CS7 DSCP 000000 (0) 001000 (8) 010000 (16) 011000 (24) 100000 (32) 101000 (40) 110000 (48) 111000 (56) Name AF11 DSCP 001010 (10)
AF12
AF13 AF21
001100 (12)
001110 (14) 010010 (18)
AF22
AF23 AF31 AF32 AF33 AF41 AF42 AF43 EF
010100 (20)
010110 (22) 011010 (26) 011100 (28) 011110 (30) 100010 (34) 100100 (36) 100110 (38) 101110 (46)
www.juniper.net | 28
www.juniper.net | 29
Frame Relay DTE devices can set the DE bit of a frame so that if the network becomes congested, Frame Relay devices will discard frames with the DE bit set before discarding those that do not have the DE bit set. Preserved throughout the Frame Relay network.
The CLP bit indicates that the cell should be discarded if it encounters congestion as it moves through the network. Preserved throughout the ATM network.
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 30
MPLS uses a 32-bit label field (shim header) which is inserted between Layer 2 and Layer 3 headers (frame mode). Supports up to 8 classes of service. The IP precedence or DSCP field is not directly visible to MPLS label switch routers. In most casen, routers will copy the three most significant bits of the DSCP or the IP precedence of the IP packet to the EXP field. Preserved throughout the MPLS network.
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 31
Comparison
Best-Effort Service Connectivity No isolation No guarantees End-to-end No set-up Diffserv Per aggregation isolation Per aggregation guarantee Domain Long term setup Intserv Per flow isolation Per flow guarantee
Scalability
Highly scalable Scalable (edge routers (nodes maintain maintains per only routing state) aggregate state; core routers per class state)
www.juniper.net | 32
Video
Packet A Packet B Packet C Packet B
Data
Packet C
CoS Components
CoS components:
Traffic classification Policing Queuing Scheduling Rewrite rules
www.juniper.net | 35
BA Classifier
Policing (Ingress)
Multifield Classifier
Forwarding Policy
Fabric
Multifield Classifier
Policing (Egress)
www.juniper.net | 36
Voice
Voice
Data
Data
www.juniper.net | 37
Forwarding Classes
Forwarding classes:
Identify traffic that should receive common treatment Used to assign traffic to output queues
Forwarding Class
Voice Packet A Queue 2
Output Queue
www.juniper.net | 38
Loss Priority
Loss priority:
Identifies the priority a system should give to dropping a packet Used to select the drop profile used in the RED(Random Early Detection) process
If congestion exists Voice VoIP Data Drop first Data
www.juniper.net | 39
0 1
2 3
Low
Low
95%
5%
Tail drop
Tail drop
www.juniper.net | 40
Ingress
To Fabric
Output Processing
Queue 0 (Class 0)
From Fabric
Egress
Traffic Classification
Classifiers map traffic to a forwarding class at ingress
Can match on existing CoS values
BA classification
Support for IP precedence, DSCP (IPv4 and IPv6), MPLS Basic Service EXP, and IEEE 802.1p (BE)
Packet C Packet B Packet A
Classifier
Policing
Policing limits traffic volume and burstiness
Enforces and protects CoS SLAs Excess traffic can be marked or discarded Functions at ingress, egress, or both
Ingress Interface
Interface Policer
Interface Policer
Egress Interface
MF: Multifield
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 43
Policing vs Shaping
These mechanisms must classify packets before policing or shaping the traffic rate. Shaping queues excess packets to stay within the desired traffic rate. Policing typically drops or marks excess traffic to stay within a traffic rate limit.
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 44
Out-of-profile packets are dropped Dropping causes TCP retransmits Less buffer usage (shaping requires an additional shaping queuing system)
2011 Juniper Networks, Inc. All rights reserved.
Out-of-profile packets are queued until a buffer gets full Buffering minimizes TCP retransmits Shaping supports interaction with Frame Relay congestion indication
www.juniper.net | 45
EF packet BE packet
EF packet R1 R2 R4
www.juniper.net | 46
Schedulers
Schedulers define the prioritization properties of forwarding classes (queues):
Transmission rate
Guaranteed and maximum rates
Queue priority
Support for five priority levels
Delay buffer
Storage space for traffic bursts
www.juniper.net | 47
First packet in is first packet out Simplest of all One queue All individual queues are FIFO
www.juniper.net | 48
Priority Queuing(PQ)
Uses multiple queues Allows prioritization Always empties first queue before going to the next queue:
Empty Queue 1 If Queue 1 empty, then dispatch one packet from Queue 2 If both Queue 1 and Queue 2 empty, then dispatch one packet from Queue 3
www.juniper.net | 49
Round Robin
Uses multiple queues No prioritization Dispatches one packet from each queue in each round
One packet from Queue 1
One packet from Queue 2 One packet from Queue 3 Then repeat
www.juniper.net | 50
www.juniper.net | 51
RED Modes
RED has three modes:
No drop: When the average queue size is between 0 and the minimum threshold Random drop: When the average queue size is between the minimum and the maximum threshold Full drop (tail drop): When the average queue size is at maximum threshold or above
www.juniper.net | 52
Weighted RED
Without RED
Packet Drop Probability Queue Length
Queue Max
With RED
With WRED
Queue Length
Std. Min.
Prem. Min.
Queue Max
www.juniper.net | 53
www.juniper.net | 54
TCP synchronization prevents average link utilization close to the link bandwidth. Tail drops cause TCP sessions to go into slow-start.
2011 Juniper Networks, Inc. All rights reserved. www.juniper.net | 55
Average link utilization is much closer to link bandwidth. Random drops cause TCP sessions to reduce window sizes.
www.juniper.net | 56
Scheduling Overview
Components of scheduling:
Priority Transmission rate Buffer size RED configuration
Defines the order in which packets transmit Defines the storage and dropping of packets
Queue 0
Dat a
Queue 1 Queue 2
Scheduler Map
Dat a
Queue 3
Dat a Dat a
www.juniper.net | 57
Queue Priority
Queues receive service according to their assigned priority; common priorities include:
Strict-High(might starve low priority queue) High Medium high Medium low Data Low
Queue 4 (SH) 3 Queue 3 (H) 6 4 Queue 2 (MH) 2 Queue 1 (ML) 7 Queue 0 (L) 5 1
Serviced first
Scheduler Map
5 1 7 2 6 4 3
Serviced last
www.juniper.net | 58
Rewrite Markers
The packet header rewrite sets CoS values for outbound traffic
Can be used by BA classification in downstream nodes Support for IP precedence, DSCP (IPv4 and IPv6), MPLS EXP, and IEEE 802.1p
Rewrite sets the packets DSCP coding based on the forwarding class
DSCP = 0001001 Packet
www.juniper.net | 59
BA Classifier
Policing (Ingress)
Multifield Classifier
Forwardin g Policy
Fabric
Egress
Rewrit e Marker
Scheduler
Shaper
RED
Multifiel d Classifie r
Policing (Egress )
www.juniper.net | 60