Dimitrios Kalogeras
A Bit of History
5
QoS Architecture Models
6
Best Effort Service
7
IntServ (RFC1633)
8
DiffServ (RFC2474/2475)
9
QoS Architecture Components
Classification
Coloring
Admission Control
Traffic Shaping/Policing
Congestion Management
Congestion Avoidance
Signaling
10
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
Actual
Intuitive
14
Traffic Classification/
Admission Control Issues
15
Classification/
Admission Control Scheme
Meter
Admitted
Shaper/
Classifier Marker Policer
Packet
Dropped
16
Classification Criteria
IP header fields
TCP/UDP header fields
Routing information
Packet Content (NBAR)
i.e. HTTP, HTTPS, FTP, Napster etc.
17
Traffic Coloring Options
IP Precedence
DSCP
QoS Group
802.1p CoS
ATM CLP
Frame Relay DE
18
Type-of-Service (RFC791)
Precedence D T R Unused
0 1
19
IP Precedence Values
101 Critical
011 Flash
010 Immediate
001 Priority
000 Routine
20
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
21
Classification mechanisms
22
Modular QoS CLI
23
Basic MQC Commands
router(config)#
class-map [match-any | match-all] class-name
25
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
ACL definition
permit tcp host 10.0.0.1 any eq telnet
!
interface serial 2/1 QoS Policy attached
ip unnumbered loopback 0
to interface
service-policy input classify
26
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
27
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
Route-map attached
ip policy route-map classify
!
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
28
Shaping/Policing
29
Token Bucket Model
tc = Bc/v Incoming
Conform
packets
Exceed
30
Token Bucket Model
31
Token Bucket Model
32
Token Bucket Model
33
Excess Burst (Be)
Cisco Implementation
34
Excess Burst (Be)
Cisco Implementation
35
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
36
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
N
+v·t
Y
Dcomp > Be Dcomp = 0
37
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
38
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
40
CAR Policing Problem
41
Congestion Management
42
Queuing
43
Queuing Algorithms
FIFO
Priority (Absolute)
Weighted Round Robin (WRR)
Fair
44
FIFO
45
FIFO
46
Absolute Priority Queuing
47
Simplest QoS Algorithm: Priority
Queuing
Stated requirement:
–“If
<application> has traffic waiting,
send it next”
next
Commonly implemented
–Defined behavior of IP precedence
48
Priority Queuing Implementation
Approach
49
Priority Queuing (PQ)
Interface Hardware
• Ethernet
High • Frame Relay
• ATM
Traffic • Serial Link
Destined Medium
• Etc.
for Interface
Classify
Normal
Transmit Output
Low Queue Line
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.)
50
Priority Queuing Scheme
Y Y Y Y
High Empty? Medium Empty? Normal Empty? Low Empty?
N N N N
51
Generic PQ Drawbacks
52
Generic PQ Configuration Sample
53
Custom Queuing (CQ)
(Weighted Round Robin)
Interface Hardware
• Ethernet
• Frame Relay
• ATM
1/10 • Serial Link
• Etc.
2/10
Traffic
Destined 3/10
Transmit Output
for Interface Queue Line
2/10
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
55
CQ Byte-count Calculus
Distribute bandwidth to 3 queues with proportion x:y:z and packet sizes qx, qy, qz.
5.For
better approximation obtained byte-counts can be multiplied by some positive whole
number.
57
“Bitwise Round Robin” Fair Queuing
TDM Model
Time Division
Multiplexer
58
TDM Message Arrival Sequence
6 4 1
5 2
Time Division
3 Multiplexer
59
TDM Message Delivery Sequence
5 4 1
6 3
Time Division
Multiplexer 2
60
Fair Queuing Algorithm
61
Fair Queuing Approach
62
Effects of Fair Queuing
High-bandwidth flows
–Interleavetraffic
–Cooperatively share bandwidth
–Absorb latency
63
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
64
Weighted Fair Queuing (WFQ)
Traffic
Destined
for Interface Transmit Output
Queue Line
Classify
Weighted Fair
Scheduling
Configurable
Number of
Queues
66
Weighted Fair Queuing (WFQ)
67
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.
68
Drawbacks of Weighted Fair
Queuing
Requiresmore sorting
than other approaches
69
Weighted Fair Queuing (WFQ)
FTP
Delay
Telnet
70
Weighted Fair Queuing (WFQ)
FTP
Telnet
Delay
71
WFQ Configuration Sample
72
RTP Priority Queuing
73
RTP PQ Configuration Sample
74
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
75
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
76
Class Based WFQ (CBWFQ)
77
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
to interface
max-reserved-bandwidth 85
service-policy output cbwfq-sample
!
ip access-list extended premium-cust
permit ip host 10.0.0.1 any
ACL definition
78
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
79
Hierarchical CBWFQ Limitations
80
Congestion Avoidance
81
Global Synchronization Effect
Load
Link Capacity
Avg. Throughput
82
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
83
Random Early Detection (RED)
Developed by Van Jacobson in 1993
84
Global Synchronization Removed
Load
Link Capacity
Avg. Throughput
85
Random Early Detection (RED)
p p
Tail Drop RED
1 1
Adjustable
0 0
qmax qavg min max qavg
86
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.
87
TCP Rate Control - 1
Example:
Transmitter Rate-control device Receiver
0
ow: 800
win d
0
ow: 200
wind
w: 2000
o
wind
w: 2000
o
wind
0
ow: 200
wind
Weighted Random Early Detection
(WRED)
90
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
…
91
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
92
Link Optimization
93
Link Fragmentation and
Interleaving (LFI)
Jumbogram Voice
Packet
64 kbps
94
Link Fragmentation and
Interleaving (LFI)
64 kbps
Supported interfaces:
Multilink PPP
Frame Relay DLCI
ATM VC
95
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
…
96
Signaling
97
Resource Reservation Protocol
(RSVP)
98
Resource Reservation Protocol
(RSVP)
99
Resource Reservation Protocol
(RSVP)
10
Resource Reservation Protocol
(RSVP)
Reservation Types:
Guaranteed Rate (uses WFQ and LLQ)
Controlled Load (uses WRED)
Distinct Shared
10
Resource Reservation Protocol
(RSVP)
10
QoS Policy Propagation over BGP
10
QoS Policy Propagation over BGP
10
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
10
Topics not Covered
10
Conclusion
10
?
Questions???
10