Ip Qos Principles: Theory and Practice
Ip Qos Principles: Theory and Practice
Dimitrios Kalogeras
Agenda
2
A Bit of History
5
Definitions
Actual
Intuitive
Self-similar
Random arrival
10 System Capacity
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
Delay
11
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
13
QoS Metrics – Jitter
56 Kbps WAN
14
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
15
QoS Architecture Models
16
QoS Implementation Models
1. Best Effort
2. IntServ/RSVP
3. DiffServ
4. RSVP+DiffServ+MPLS
17
Best Effort Service
18
IntServ (RFC1633)
19
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
RESV
Sender Receiver
PATH
20
IntServ – Components
Control Plane
Routing Selection Admission Control
Reservation Setup
Reservation Table
Data Plane
Flow Identification Packet Scheduler
21
IntServ – Components
Control 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
22
IntServ – Service Models
23
IntServ – Scaling Issues
24
DiffServ (RFC2474/2475)
25
Differentiated Services (DiffServ)
5 4 3 2 1 5 4 3 2 1
26
DiffServ – Compared to IntServ
27
DiffSrv – The DS Field (RFC 2474)
DS field DSCP CU
28
DiffSrv – Forwarding Classes
DSCP Codepoint
000000 CS0 (DE)
The DS Field can encode: 001000 CS1
001010 AF11
Eight Class Selector Codepoints compatible 001100 AF12
29
DiffServ – Per-Hop Behaviours
30
DiffServ – Boundary Nodes
DiffServ Domain
Classification / Conditioning
PHB
LLQ/WRED
Premium Gold Silver Bronze
32
The Trouble with DiffServ
33
RSVP-DiffServ Integration
Aggregated
No State State Per-Flow State
RSVP + DiffServ
Best Effort DiffServ IntServ
Aggregated State
Firm Guarantees
Admission Control
35
RSVP-DiffServ Integration
Border Routers implement per-flow
classification, policing, and marking The DiffServ region
aggregates the flows into
DS Forwarding Classes
DiffServ Region
37
QoS Architecture Components
Classification
Coloring
Admission Control
Traffic Shaping/Policing
Congestion Management
Congestion Avoidance
Signaling
38
Traffic Classification
39
Traffic Classification/
Admission Control Issues
40
Classification/
Admission Control Scheme
Meter
Admitted
Shaper/
Classifier Marker Policer
Packet
Dropped
41
Classification Criteria
IP header fields
TCP/UDP header fields
Routing information
Packet Content (NBAR)
i.e. HTTP, HTTPS, FTP, Napster etc.
42
Traffic Coloring Options
IP Precedence
DSCP
QoS Group
802.1p CoS
ATM CLP
Frame Relay DE
43
Type-of-Service (RFC791)
Precedence D T R Unused
0 1
D Normal Delay Low Delay
44
IP Precedence Values
45
DSCP
Diffserv Code Point
Low Drop
001010 010010 011010 100010
Precedence
Medium Drop
Precedence 001100 010100 011100 100100
High Drop
Precedence 001110 010110 011110 100110
46
Classification mechanisms
47
Modular QoS CLI
48
Basic MQC Commands
router(config)#
class-map [match-any | match-all] class-name
50
Classification Configuring Sample
MQC based IOS 12.1(5)T
class-map match-all premium
match access-group name premium
!
class-map match-any trash Traffic class definitions
match protocol napster
match protocol fasttrack
!
policy-map classify
class premium
set ip precedence priority QoS policy definition
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 ACL definition
!
interface serial 2/1
ip unnumbered loopback 0 QoS Policy attached
service-policy input classify to interface
51
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
52
Classification Configuring Sample
Route-map based
route-map classify permit 10
match ip address 100
set ip precedence flash
!
route-map classify permit 20 Route-map definitions
match ip next-hop 1
set ip precedence priority
!
interface serial 2/1
ip unnumbered loopback 0
ip policy route-map classify Route-map attached
! to interface
access-list 1 permit 192.168.0.1
access-list 100 permit tcp host 10.0.0.1 any eq http
ACL definitions
53
Shaping/Policing
54
Token Bucket Model
tc = Bc/v Incoming
Conform
packets
Exceed
55
Token Bucket Model
56
Token Bucket Model
57
Token Bucket Model
58
Excess Burst (Be)
Cisco Implementation
59
Excess Burst (Be)
Cisco Implementation
60
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
61
Excess Burst (Be)
Cisco Implementation
Packet of length
L arrived CAR Algorithm
Y Conform
Bccur – L > 0 Bccur = Bccur – L Action
Dcur = L - Bccur
Bccur = 0 Y Exceed
Dcomp = Dcomp + Dcur Dact > Be Action
Dact = Dact + Dcur
+v·t N
Y
Dcomp > Be Dcomp = 0
62
Shaping Configuration Sample
GTS Based
interface serial 2/1
ip unnumbered loopback 0
traffic-shape rate 64000 8000 1000 256
!
interface serial 2/2 Shaper Definitions
ip unnumbered loopback 0
traffic-shape group 100 64000 8000 8000 512
!
access-list 100 permit tcp host 10.0.0.1 any eq http
ACL definition
63
Policing Configuration Sample
CAR Based
IOS 12.0(5)T
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
CAR Definitions
!
interface serial 2/2
ip unnumbered loopback 0
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
ACL definition
MQI Based
IOS 12.1(5)T
class-map match-all policed
match protocol http
Class definitions
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 QoS policy definition
shape average 128000
!
interface serial 2/1 QoS Policy attached
ip unnumbered loopback 0 to interface
service-policy output bad-boy
!
ip access-list extended ftp-downloads ACL definition
permit tcp any eq ftp-data any
65
CAR Policing Problem
66
Congestion Management
67
Queuing
68
Queuing Algorithms
FIFO
Priority (Absolute)
Weighted Round Robin (WRR)
Fair
69
FIFO
70
FIFO
71
Absolute Priority Queuing
72
Simplest QoS Algorithm: Priority
Queuing
Stated requirement:
–“If <application> has traffic waiting,
send it next”
Commonly implemented
–Defined behavior of IP precedence
73
Priority Queuing Implementation
Approach
74
Priority Queuing (PQ)
Interface Hardware
• Ethernet
High • Frame Relay
• ATM
Traffic • Serial Link
Destined Medium
• Etc.
for Interface
Classify
Normal
Transmit Output
Queue Line
Low
Q Length Defined
by Q Limit
Absolute Priority
Scheduling
Interface Buffer
Classification by: Resources
• Protocol (IP, IPX, AppleTalk,
SNA, DecNet, Bridge, etc.)
• Incoming Interface
(EO, SO, S1, etc.)
75
Priority Queuing Scheme
Y Y Y Y
High Empty? Medium Empty? Normal Empty? Low Empty?
N N N N
76
Generic PQ Drawbacks
77
Generic PQ Configuration Sample
78
Custom Queuing (CQ)
(Weighted Round Robin)
Interface Hardware
• Ethernet
• Frame Relay
• ATM
1/10 • Serial Link
• Etc.
2/10
Traffic
Destined 3/10
for Interface Transmit Output
2/10 Queue Line
Classify
3/10
Up to 16
Link
Q Length Utilization Weighted Round
Deferred by Ratio Robin Scheduling
Queue Limit (byte count)
Unpredictable jitter
Fairness significantly depends on MTU and TCP
window size
Complex calculations to achieve desired traffic
proportions
80
CQ Byte-count Calculus
Distribute bandwidth to 3 queues with proportion x:y:z and packet sizes qx, qy, qz.
bci
sharei n
C
bc
j 1
j
5.For better approximation obtained byte-counts can be multiplied by some positive whole
number.
82
“Bitwise Round Robin” Fair Queuing
TDM Model
Time Division
Multiplexer
83
TDM Message Arrival Sequence
6 4 1
5 2
Time Division
3 Multiplexer
84
TDM Message Delivery Sequence
5 4 1
6 3
Time Division
Multiplexer 2
85
Fair Queuing Algorithm
86
Fair Queuing Approach
87
Effects of Fair Queuing
88
What Weighting Does
In TDM
–Channel speed determines message “duration”
In WFQ
–Multiplier on message length changes
simulated message “duration”
Result:
–Flow’s “fair” share predictably unfair
89
Weighted Fair Queuing (WFQ)
Traffic
Destined
for Interface Transmit Output
Queue Line
Classify
Weighted Fair
Scheduling
Configurable
Number of
Queues
91
Weighted Fair Queuing (WFQ)
92
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.
93
Drawbacks of Weighted Fair
Queuing
94
Weighted Fair Queuing (WFQ)
FTP
Delay
Telnet
95
Weighted Fair Queuing (WFQ)
FTP
Telnet
Delay
96
WFQ Configuration Sample
97
RTP Priority Queuing
98
RTP PQ Configuration Sample
99
Low Latency Queuing (LLQ)
100
LLQ Configuration Sample
IOS 12.0(5)T
class-map match-all voice
match access-group name voip
Class definitions
!
policy-map llq
class voip
priority 30
LLQ policy definition
class class-default
fair-queue 64
!
interface serial 2/1
ip unnumbered loopback 0 LLQ Policy attached
service-policy output llq to interface
!
ip access-list extended voip ACL definition
permit ip host 10.0.0.1 any
101
Class Based WFQ (CBWFQ)
102
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 Class definitions
match protocol napster
!
policy-map cbwfq-sample
class premium
Qos policy definition
bandwidth 512
class low-priority
shape average 128
shape peak 512
class class-default
fair-queue 64
!
interface serial 2/1 QoS Policy attached
ip unnumbered loopback 0
max-reserved-bandwidth 85
to interface
service-policy output cbwfq-sample
!
ip access-list extended premium-cust
permit ip host 10.0.0.1 any
ACL definition
103
CBWFQ Configuration Sample
Hierarchical Design
IOS 12.1(5)T
class-map match-all premium interface fastethernet 1/0
match access-group name premium-cust ip unnumbered loopback 0
class-map match-all voice max-reserved-bandwidth 85
match ip precedence flash service-policy output total-shaper
! !
policy-map total-shaper ip access-list extended premium-cust
class class-default permit ip host 10.0.0.1 any
shape average 1536
service-policy class-policy
policy-map class-policy
class premium
bandwidth 512
class voice
priority 64
class class-default
fair-queue 128
104
Hierarchical CBWFQ Limitations
105
Congestion Avoidance
106
Global Synchronization Effect
Load
Link Capacity
Avg. Throughput
107
Tail Drop and TCP Flow Control
108
Random Early Detection (RED)
Developed by Van Jacobson in 1993
109
Global Synchronization Removed
Load
Link Capacity
Avg. Throughput
110
Random Early Detection (RED)
p p
Tail Drop RED
1 1
Adjustable
0 0
qmax qavg min max qavg
111
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.
112
TCP Rate Control - 1
Example:
Transmitter Rate-control device Receiver
w: 8 000
windo
w: 2 000
windo
0 0
in d o w: 20
w
0 0
in d o w: 20
w
w: 2 000
windo
Weighted Random Early Detection
(WRED)
115
WRED Configuration Sample
Interface based
interface serial 2/1
ip unnumbered loopback 0 min
max
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
…
116
WRED Configuration Sample
MQI based
policy-map red
class class-default min
max
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
117
Link Optimization
118
Link Fragmentation and
Interleaving (LFI)
Jumbogram Voice
Packet
64 kbps
119
Link Fragmentation and
Interleaving (LFI)
64 kbps
Supported interfaces:
Multilink PPP
Frame Relay DLCI
ATM VC
120
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
…
121
Signaling
122
Resource Reservation Protocol
(RSVP)
123
Resource Reservation Protocol
(RSVP)
124
Resource Reservation Protocol
(RSVP)
125
Resource Reservation Protocol
(RSVP)
Reservation Types:
Guaranteed Rate (uses WFQ and LLQ)
Controlled Load (uses WRED)
Distinct Shared
126
Resource Reservation Protocol
(RSVP)
127
QoS Policy Propagation over BGP
128
QoS Policy Propagation over BGP
129
QPPB Configuration Sample
Router A Router B
ip bgp-community new-format ip bgp-community new-format
! !
router bgp 10 router bgp 20
neighbor 10.0.0.1 remote-as 20 neighbor 10.0.0.2 remote-as 10
neighbor 10.0.0.1 send-community table-map mark-pol
neighbor 10.0.0.1 route-map cout out !
! route-map mark-pol permit 10
route-map cout permit 10 match community 1
match ip address 20 set ip precedence flash
set community 60:9 !
! ip community-list 1 permit 60:9
access-list 20 permit 192.168.0.0 !
0.0.0.255 interface Serial 0/1
ip unnumbered loopback 0
bgp-policy source ip-prec-map
130
Topics not Covered
131
Conclusion
132
Questions???
133