18-345: Introduction To Telecommunication Networks Lectures 20: Quality of Service
18-345: Introduction To Telecommunication Networks Lectures 20: Quality of Service
18-345: Introduction to
Telecommunication Networks • What is QoS?
Lectures 20: Quality of Service
• Queuing discipline and scheduling
Peter Steenkiste
• Traffic Enforcement
Spring 2015
www.cs.cmu.edu/~prs/nets-ece
• Integrated services
1 2
1
Performance versus
Utility Curve Shapes
Satisfaction
User U Elastic U Hard real-time
Satisfaction
No longer
Unacceptable Matters
BW BW
U Delay- or Rate-adaptive
Does equal
allocation of
Stay to the right and you
are fine for all curves bandwidth maximize
total utility?
Service Level BW
6
BW BW
Bandwidth
2
Quality of Service
Inelastic Applications
versus Fairness
• Continuous media applications
– Lower and upper limit on acceptable • Traditional definition of fairness: treat all users
performance. equally.
– BW below which video and audio are not – E.g., share bandwidth on bottleneck link equally
intelligible • QoS: treat users differently.
– Internet telephones, teleconferencing with high – For example, some users get a bandwidth guarantee, while
delay (200 - 300ms) impair human interaction others have to use best effort service
– Sometimes called “tolerant real-time” since they • The two are not in conflict
can adapt to the performance of the network – All else being equal, users are treated equally
• Hard real-time applications – Unequal treatment is based on policies, price:
• Administrative policies: rank or position
– Require hard limits on performance
• Economics: extra payment for preferential treatment
– E.g. control applications
9
QoS Analogy:
How to Provide QoS?
Surface Mail
• Admission control limits number of flows
• The defaults if “first class mail”. – You cannot provide guarantees if there are too many flows
– Usually gets there within a few days sharing the same set of resources (bandwidth)
– Sufficient for most letters – For example, telephone networks - busy tone
– This implies that your request for service can be rejected
• Many “guaranteed” mail delivery services:
• Traffic enforcement limits how much traffic flows can
next day, 2-day delivery, next day am, …..
inject based on predefined limits.
– Provide faster and more predictable service at a – Make sure user respects the traffic contract
higher cost – Data outside of contract can be dropped (before entering the
– Providers differentiate their services: target network!) or can be sent at a lower priority
specific markets with specific requirements and • Scheduling support in the routers guarantee that
budgets users get their share of the bandwidth.
• Why don’t we do the same thing in networks? – Again based on pre-negotiated bounds
3
QoS Framework What is a flow?
Traffic • Defines the granularity of QoS and fairness
Packet
Enforcement Scheduling – TCP flow
C H J – Traffic to or from a device, user, or network
B
I – Bigger aggregates for traffic engineering purposes
A
• Flows are defined using a packet classifier
– Classifier uses a set of fields in the packet header
Admission G to generate a flow ID
Control
– Example: (src IP, dest IP, src port, dest port,
E H
protocol)
F D – Or: (src prefix, dest prfix)
14
4
Overview Queuing Disciplines
• Each router must implement some queuing
• What is QoS? discipline
• Queuing allocates both bandwidth and
• Queuing discipline and scheduling buffer space:
– Bandwidth: which packet to serve (transmit)
• Traffic Enforcement next
– Buffer space: which packet to drop next (when
• Integrated services required)
• Queuing also affects latency
17 18
19 20
5
Problems in Achieving fairness An Example
• In the Internet, fairness is only achieved • 1 UDP (10 Mbps) and 31 TCPs sharing a 10
if all flows play by the rules Mbps line
• In practice: most sources must use
TCP or be “TCP friendly” UDP (#1) - 10 Mbps UDP (#1)
7
6 source
5 FIFO
– Still needs e2e congestion control
4
3 • Still achieve statistical multiplexing
2
– One flow can fill entire pipe if no contenders
1
0 – Work conserving scheduler never idles link
1 3 5 7 9 11 13 15 17
Flow Number
19 21 23 25 27 29 31
if it has a packet
24
23
6
What is Fairness? Max-min Fairness
• Allocate user with “small” demand what it
• At what granularity?
wants, evenly divide unused resources to
– Flows, connections, domains?
“big” users
• What if users have different RTTs/links/etc.
– Should it share a link fairly or be TCP fair? • Formally:
• Maximize fairness index? • Resources allocated in terms of increasing demand
– Fairness = (xi)2/n(xi2) 0<fairness<1 • No source gets resource share larger than its demand
• Sources with unsatisfied demands get equal share of
• Basically a tough question to answer! resource
• Good to separate the design of the mechanisms from
definition of a policy
– User = arbitrary granularity
• We will focus on max-min fairness – just an example
25 26
7
Bit-by-bit RR Illustration Fair Queuing
• Mapping bit-by-bit schedule onto packet
• Not feasible to
transmission schedule
interleave bits on
real networks • Transmit packet with the lowest Fi at any
– FQ simulates bit-by- given time
bit RR – How do you compute Fi?
29 30
0.4
0.35
F=10
Throughput (Mbps)
F=8 0.3
0.15
F=2 0
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
Flow Number
31 32
8
Fair Queuing Tradeoffs WFQ Illustration
• Complex computation
Flow 1
– Classification into flows may be hard W1
– Must keep queues sorted by finish times W2
Flow 2
– dR/dt changes whenever the flow count changes
I/P O/P
• Complex state – must keep queue per flow
• Hard in routers with many flows (e.g., backbone routers) W3
• Flow aggregation is a possibility (e.g. do fairness per domain)
• FQ can control congestion by monitoring flows
• Weighted fair queuing can give flows a different fraction
of the bandwidth - controlled by a weight Wi Flow n Wn
– Bandwidth of flow i is Wi / ∑ Wj
Variation: Weighted Fair Queuing (WFQ)
33
34
Traffic Enforcement:
Overview
Token Bucket Filter
Tokens enter bucket
at rate r
• What is QoS?
Bucket depth b:
• Queuing discipline and scheduling capacity of bucket
Operation:
• Traffic Enforcement – If bucket fills, tokens are discarded
– Sending a packet of size P uses P
tokens
• Integrated services – If bucket has P tokens, packet sent
at max rate, else must wait for
35 tokens to accumulate 36
9
Token Bucket Operation Token Bucket Characteristics
• Can characterize flow using a token bucket:
Tokens Tokens Tokens
smallest parameters for which no packets will
be delayed
• On the long run, rate is limited to r
Overflow • On the short run, a burst of size b can be sent
• Amount of traffic entering at interval T is
bounded by:
Packet Packet
– Traffic = b + r*T
Enough tokens Not enough tokens
packet goes through, wait for tokens to • Information useful to admission algorithm
tokens removed accumulate
38
37
3Kb
– R – maximum link capacity or peak rate (optional parameter) 2.2Kb
• A bit is transmitted only when there is an available token
10
Token Bucket Specs - Example Overview
• What is QoS?
BW Flow B
2
Flow A: r = 1 MBps, B=1 byte
• Queuing discipline and scheduling
1 Flow A Flow B: r = 1 MBps, B=1MB
• Integrated services
42
41
11
Lessons
45
12