fairness, queue management, and qosprs/15-441-f17/lectures/999-qos.pdf · 2017-12-14 · fairness,...

96
Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry Slides borrowed from folks at CMU, Berkeley, and elsewhere.

Upload: others

Post on 06-Apr-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness, Queue Management, and QoS

15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Slides borrowed from folks at CMU, Berkeley, and elsewhere.

Page 2: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

YINZ I AM GETTING T-SHIRTS

If you TA for me next year I will give you a t-shirtor jacket

Page 3: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

sli.do time… (yell at me if I don’t notice?)

Page 4: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

News and such

• Final is next week.

• Final exam review on FRIDAY in Recitation Slot

• Along with a review handout like I made for the midterm

• Homework due soon also…

Page 5: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Recall: the Internet provides best-effort delivery with no guarantees.

Why might this not be desirable?

Page 6: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Why isn’t best-effort always what we want?• Some applications require “higher” quality of service:

• Bandwidth: fast data transfers, video • Delay, jitter: telephony • Packet loss, bit error rate: update services

• Human desire for fairness: • Misbehaving connections can consume resources and hurt other connections! • Even in the absence of guarantees about latency, loss, or throughput, lack of

guarantee about fairness bothers many people.

Page 7: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Quality of Service versus Fairness

• Traditional definition of fairness: treat all flows equally. • E.g., share bandwidth on bottleneck link equally

• QoS: treat flows differently. • For example, some users get a bandwidth guarantee, while others have

to use best effort service

• The two are not in conflict • All else being equal, users are treated equally • Unequal treatment is based on policies, price:

• Administrative policies: rank or position • Economics: extra payment for preferential treatment

Page 8: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

What is a flow?• Defines the granularity of QoS and fairness

• TCP flow • Traffic to or from a device, user, or network • Bigger aggregates for traffic engineering purposes

• Routers use a classifier to determine what flow a packet belongs to • Classifier uses a set of fields in the packet header to generate a flow ID • Example: (src IP, dest IP, src port, dest port, protocol) • Or: (src prefix, dest prfix), i.e., some fields are wildcards

Page 9: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Why should we consider QoS?• Continuous media applications

• Lower and upper limit on acceptable performance. • BW below which video and audio are not intelligible • Internet telephones, teleconferencing with high delay (200 - 300ms)

impair human interaction • Sometimes called “tolerant real-time” since they can adapt to the

performance of the network

• Hard real-time applications • Require hard limits on performance • E.g. control applications… consider remote, robotic surgery…(!)

Page 10: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

QoS Analogy: Surface Mail• The defaults if “first class mail”.

• Usually gets there within a few days • Sufficient for most letters

• Many “guaranteed” mail delivery services: next day, 2-day delivery, next day am, ….. • Provide faster and more predictable service at a higher cost • Providers differentiate their services: target specific markets with

specific requirements and budgets

• Why don’t we do the same thing in networks?

Page 11: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness Goals• Allocate resources fairly

• Isolate ill-behaved users • Router does not send explicit feedback to source • Still needs e2e congestion control

• Still achieve statistical multiplexing • One flow can fill entire pipe if no contenders • Work conserving à scheduler never idles link if it has a packet

Page 12: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Problems in Achieving fairness

Page 13: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Problems in Achieving fairness • In the Internet, fairness is only achieved if all flows play by the rules

Page 14: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Problems in Achieving fairness • In the Internet, fairness is only achieved if all flows play by the rules

• In practice: most sources must use TCP or be “TCP friendly” • most sources are cooperative • most sources implement homogeneous/compatible control law

• compatible means less aggressive than TCP

Page 15: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Problems in Achieving fairness • In the Internet, fairness is only achieved if all flows play by the rules

• In practice: most sources must use TCP or be “TCP friendly” • most sources are cooperative • most sources implement homogeneous/compatible control law

• compatible means less aggressive than TCP

• What if sources do not play by the rule? • E.g., TCP versus UDP without congestion control

Page 16: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

RANYSHA ALREADY TOLD YOU THAT

Page 17: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

How might you change the Internet to implement QoS?

Page 18: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

How might you change the Internet to implement Fairness?

Page 19: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Techniques to implement QoS and Fairness• Admission control limits number of flows

• You cannot provide guarantees if there are too many flows sharing the same set of resources (bandwidth)

• For example, telephone networks - busy tone • This implies that your request for service can be rejected

• Traffic enforcement limits how much traffic flows can inject based on predefined limits. • Make sure user respects the traffic contract • Data outside of contract can be dropped (before entering the network!) or

can be sent at a lower priority • Router scheduling that users get their share of the bandwidth.

• Again based on pre-negotiated bounds

Page 20: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Implementing QoS: Reserving Resources End-to-End

• Source sends a reservation message• E.g., “this flow needs 5 Mbps”

Page 21: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Implementing QoS: Reserving Resources End-to-End

• Source sends a reservation message• E.g., “this flow needs 5 Mbps”

• Each router along the path

Page 22: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Implementing QoS: Reserving Resources End-to-End

• Source sends a reservation message• E.g., “this flow needs 5 Mbps”

• Each router along the path• Keeps track of the reserved resources

• E.g., “the link has 6 Mbps left”

Page 23: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Implementing QoS: Reserving Resources End-to-End

• Source sends a reservation message• E.g., “this flow needs 5 Mbps”

• Each router along the path• Keeps track of the reserved resources

• E.g., “the link has 6 Mbps left”• Checks if enough resources remain

• E.g., “6 Mbps > 5 Mbps, so circuit can be accepted”

Page 24: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Implementing QoS: Reserving Resources End-to-End

• Source sends a reservation message• E.g., “this flow needs 5 Mbps”

• Each router along the path• Keeps track of the reserved resources

• E.g., “the link has 6 Mbps left”• Checks if enough resources remain

• E.g., “6 Mbps > 5 Mbps, so circuit can be accepted”• Creates state for flow and reserves resources

• E.g., “now only 1 Mbps is available”

Page 25: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Requires: traffic enforcement — control how much data sender can

put into the network!

Page 26: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Token Bucket Filter

Operation: • If bucket fills, tokens are discarded • Sending a packet of size P uses P tokens • If bucket has P tokens, packet sent at max rate, else must wait for tokens to

accumulate

Tokens enter bucket at rate r

Bucket depth b: capacity of bucket

Page 27: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Token Bucket OperationTokens

Packet

Overflow

Tokens Tokens

Packet

Enough tokens à packet goes through, tokens removed

Not enough tokens à wait for tokens to accumulate

Page 28: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Token Bucket Characteristics• Can characterize flow using a token bucket: smallest parameters for

which no packets will be delayed

• On the long run, rate is limited to r

• On the short run, a burst of size b can be sent

• Maximum amount of traffic that can enter the network in time interval T is bounded by: • Simple case: Traffic = b + r*T

• Information useful to admission algorithm

Page 29: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Token Buckets

Page 30: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Token Buckets• Parameters

• r – average rate, i.e., rate at which tokens fill the bucket • b – bucket depth (limits size of burst)

Page 31: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Token Buckets• Parameters

• r – average rate, i.e., rate at which tokens fill the bucket • b – bucket depth (limits size of burst)

• A bit can be transmitted only when a token is available

Page 32: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Token Buckets• Parameters

• r – average rate, i.e., rate at which tokens fill the bucket • b – bucket depth (limits size of burst)

• A bit can be transmitted only when a token is availabler bps

b bits

≤ R bps

regulator

Page 33: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Example• r = 100 Kbps; b = 3 Kb; R = 500 Kbps

Page 34: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Example• r = 100 Kbps; b = 3 Kb; R = 500 Kbps

3Kb

T = 0 : 1Kb packet arrives

(a)

Page 35: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Example• r = 100 Kbps; b = 3 Kb; R = 500 Kbps

3Kb

T = 0 : 1Kb packet arrives

(a)

2.2Kb

T = 2ms : packet transmitted b = 3Kb – 1Kb + 2ms*100Kbps = 2.2Kb

(b)

Page 36: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Example• r = 100 Kbps; b = 3 Kb; R = 500 Kbps

3Kb

T = 0 : 1Kb packet arrives

(a)

2.2Kb

T = 2ms : packet transmitted b = 3Kb – 1Kb + 2ms*100Kbps = 2.2Kb

(b)

2.4Kb

T = 4ms : 3Kb packet arrives

(c)

Page 37: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Example• r = 100 Kbps; b = 3 Kb; R = 500 Kbps

3Kb

T = 0 : 1Kb packet arrives

(a)

2.2Kb

T = 2ms : packet transmitted b = 3Kb – 1Kb + 2ms*100Kbps = 2.2Kb

(b)

2.4Kb

T = 4ms : 3Kb packet arrives

(c)

3Kb

T = 10ms : packet needs to wait until enough tokens are in the bucket

(d)

Page 38: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Traffic Enforcement: Example• r = 100 Kbps; b = 3 Kb; R = 500 Kbps

3Kb

T = 0 : 1Kb packet arrives

(a)

2.2Kb

T = 2ms : packet transmitted b = 3Kb – 1Kb + 2ms*100Kbps = 2.2Kb

(b)

2.4Kb

T = 4ms : 3Kb packet arrives

(c)

3Kb

T = 10ms : packet needs to wait until enough tokens are in the bucket

(d)

0.6Kb

T = 16ms : packet transmitted

(e)

Page 39: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Controlling Fairness and QoS with Queuing Disciplines

• Each router must implement some queuing discipline

• Queuing allocates both bandwidth and buffer space: • Bandwidth: which packet to serve (transmit) next • Buffer space: which packet to drop next (when required)

• Queuing also affects latency

Page 40: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Network Queuing Disciplines• First-in-first-out (FIFO) + drop-tail

• Simplest choice - used widely in the Internet • FIFO means all packets treated equally • Drop-tail: new packets gets dropped when queue is • Important distinction:

• FIFO: scheduling discipline • Drop-tail: drop policy

• Alternative is to do Active Queue Management • To improve congestion response • Support fairness in presence of non-TCP flows • To give flows different types of service – QoS

Page 41: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Implementing Max-min Fairness• Generalized processor sharing

• Fluid fairness • Bitwise round robin among all queues

• Why not simple round robin? • Variable packet length à can get more service by sending bigger

packets • Unfair instantaneous service rate

• What if packets arrive just before/after packet departs?

• We will use bit-bit round robin as an example • Many other algorithms exist

Page 42: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness: General Approach

Page 43: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness: General Approach• Routers classify packets into “flows”

• (For now) flows are packets between same source/destination

Page 44: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness: General Approach• Routers classify packets into “flows”

• (For now) flows are packets between same source/destination

• Each flow has its own FIFO queue in router

• Router services flows in a fair fashion • When line becomes free, take packet from next flow in a fair order

Page 45: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness: General Approach• Routers classify packets into “flows”

• (For now) flows are packets between same source/destination

• Each flow has its own FIFO queue in router

• Router services flows in a fair fashion • When line becomes free, take packet from next flow in a fair order

• What does “fair” mean exactly?

Page 46: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-min Fairness• Give users with “small” demand what they want, evenly divide

unused resources to “big” users

• Formally: • Resources allocated in terms of increasing demand • No source gets resource share larger than its demand • Sources with unsatisfied demands get equal share of resource

Page 47: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-min Fairness• Give users with “small” demand what they want, evenly divide

unused resources to “big” users

• Formally: • Resources allocated in terms of increasing demand • No source gets resource share larger than its demand • Sources with unsatisfied demands get equal share of resource

Page 48: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-min Fairness• Give users with “small” demand what they want, evenly divide

unused resources to “big” users

• Formally: • Resources allocated in terms of increasing demand • No source gets resource share larger than its demand • Sources with unsatisfied demands get equal share of resource

Page 49: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-min Fairness• Give users with “small” demand what they want, evenly divide

unused resources to “big” users

• Formally: • Resources allocated in terms of increasing demand • No source gets resource share larger than its demand • Sources with unsatisfied demands get equal share of resource

Page 50: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-min Fairness• Give users with “small” demand what they want, evenly divide

unused resources to “big” users

• Formally: • Resources allocated in terms of increasing demand • No source gets resource share larger than its demand • Sources with unsatisfied demands get equal share of resource

Page 51: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-min Fairness• Give users with “small” demand what they want, evenly divide

unused resources to “big” users

• Formally: • Resources allocated in terms of increasing demand • No source gets resource share larger than its demand • Sources with unsatisfied demands get equal share of resource

Page 52: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-Min Fairness

Page 53: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-Min Fairness• Given set of bandwidth demands ri and total bandwidth C, max-min

bandwidth allocations are:

r1

r2

r3

??

?C bits/s

Page 54: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-Min Fairness• Given set of bandwidth demands ri and total bandwidth C, max-min

bandwidth allocations are:ai = min(f, ri)

r1

r2

r3

??

?C bits/s

Page 55: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-Min Fairness• Given set of bandwidth demands ri and total bandwidth C, max-min

bandwidth allocations are:ai = min(f, ri) where f is the unique value such that Sum(ai) = C

r1

r2

r3

??

?C bits/s

Page 56: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Example

Page 57: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Example• C = 10; r1 = 8, r2 = 6, r3 = 2; N = 3

Page 58: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Example• C = 10; r1 = 8, r2 = 6, r3 = 2; N = 3• C/3 = 3.33 →

• Can service all of r3 • Remove r3 from the accounting: C = C – r3 = 8; N = 2

Page 59: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Example• C = 10; r1 = 8, r2 = 6, r3 = 2; N = 3• C/3 = 3.33 →

• Can service all of r3 • Remove r3 from the accounting: C = C – r3 = 8; N = 2

• C/2 = 4 → • Can’t service all of r1 or r2 • So hold them to the remaining fair share: f = 4

Page 60: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Example• C = 10; r1 = 8, r2 = 6, r3 = 2; N = 3• C/3 = 3.33 →

• Can service all of r3 • Remove r3 from the accounting: C = C – r3 = 8; N = 2

• C/2 = 4 → • Can’t service all of r1 or r2 • So hold them to the remaining fair share: f = 4

862

44

2

f = 4: min(8, 4) = 4 min(6, 4) = 4 min(2, 4) = 2

10

Page 61: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-Min Fairness• Given set of bandwidth demands ri and total bandwidth C, max-min

bandwidth allocations are:ai = min(f, ri) • where f is the unique value such that Sum(ai) = C

• Property:• If you don’t get full demand, no one gets more than you

Page 62: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Max-Min Fairness• Given set of bandwidth demands ri and total bandwidth C, max-min

bandwidth allocations are:ai = min(f, ri) • where f is the unique value such that Sum(ai) = C

• Property:• If you don’t get full demand, no one gets more than you

• This is what round-robin service gives if all packets are the same size

Page 63: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

How do we deal with packets of different sizes?

Page 64: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

How do we deal with packets of different sizes?• Mental model: Bit-by-bit round robin (“fluid flow”)

Page 65: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

How do we deal with packets of different sizes?• Mental model: Bit-by-bit round robin (“fluid flow”)

• Can you do this in practice?

Page 66: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

How do we deal with packets of different sizes?• Mental model: Bit-by-bit round robin (“fluid flow”)

• Can you do this in practice?

• No, packets cannot be preempted

Page 67: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

How do we deal with packets of different sizes?• Mental model: Bit-by-bit round robin (“fluid flow”)

• Can you do this in practice?

• No, packets cannot be preempted

• But we can approximate it • This is what “fair queuing” routers do

Page 68: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fair Queuing (FQ)

Page 69: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fair Queuing (FQ)

• For each packet, compute the time at which the last bit of a packet would have left the router if flows are served bit-by-bit

Page 70: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fair Queuing (FQ)

• For each packet, compute the time at which the last bit of a packet would have left the router if flows are served bit-by-bit

• Then serve packets in the increasing order of their deadlines

Page 71: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Example

1 2 3 4 5

1 2 3 4 5 6Flow 1 (arrival traffic)

Flow 2 (arrival traffic)

time

time

Page 72: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Example

1 2 3 4 5

1 2 3 4

1 23

1 24

3 45

5 6

5 6Flow 1 (arrival traffic)

Flow 2 (arrival traffic)

Service in fluid flow

system

time

time

time

Page 73: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Example

1 2 3 4 5

1 2 3 4

1 23

1 24

3 45

5 6

1 2 1 3 2 3 4 4

5 6

55 6

Flow 1 (arrival traffic)

Flow 2 (arrival traffic)

Service in fluid flow

system

FQPacket system

time

time

time

time

Page 74: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fair Queuing (FQ)

Page 75: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fair Queuing (FQ)• Think of it as an implementation of round-robin generalized to the case

where not all packets are equal sized

• Weighted fair queuing (WFQ): assign different flows different shares

Page 76: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fair Queuing (FQ)• Think of it as an implementation of round-robin generalized to the case

where not all packets are equal sized

• Weighted fair queuing (WFQ): assign different flows different shares

• Today, some form of WFQ implemented in almost all routers • Not the case in the 1980-90s, when CC was being developed • Mostly used to isolate traffic at larger granularities (e.g., per-prefix)

Page 77: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ vs. FIFO

Page 78: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ vs. FIFO• FQ advantages:

• Isolation: cheating flows don’t benefit • Bandwidth share does not depend on RTT • Flows can pick any rate adjustment scheme they want

Page 79: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ vs. FIFO• FQ advantages:

• Isolation: cheating flows don’t benefit • Bandwidth share does not depend on RTT • Flows can pick any rate adjustment scheme they want

Page 80: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ vs. FIFO• FQ advantages:

• Isolation: cheating flows don’t benefit • Bandwidth share does not depend on RTT • Flows can pick any rate adjustment scheme they want

• Disadvantages: • More complex than FIFO: per flow queue/state, additional per-packet

book-keeping

Page 81: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ in the big picture• FQ does not eliminate congestion à it just manages the

congestion

Page 82: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ in the big picture• FQ does not eliminate congestion à it just manages the

congestion

1Gbps100Mbps

1Gbps

5Gbps

1Gbps

Page 83: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ in the big picture• FQ does not eliminate congestion à it just manages the

congestion

1Gbps100Mbps

1Gbps

5Gbps

1Gbps

Blue and Green get 0.5Gbps; any excess

will be dropped

Page 84: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ in the big picture• FQ does not eliminate congestion à it just manages the

congestion

1Gbps100Mbps

1Gbps

5Gbps

1Gbps

Blue and Green get 0.5Gbps; any excess

will be dropped

Will drop an additional400Mbps from the green flow

Page 85: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ in the big picture• FQ does not eliminate congestion à it just manages the

congestion

1Gbps100Mbps

1Gbps

5Gbps

1Gbps

Blue and Green get 0.5Gbps; any excess

will be dropped

Will drop an additional400Mbps from the green flow

If the green flow doesn’t drop its sending rate to 100Mbps, we’re wasting 400Mbps that could be usefully given to the blue flow

Page 86: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ in the big picture• FQ does not eliminate congestion à it just manages the congestion

• robust to cheating, variations in RTT, details of delay, reordering, retransmission, etc.

Page 87: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ in the big picture• FQ does not eliminate congestion à it just manages the congestion

• robust to cheating, variations in RTT, details of delay, reordering, retransmission, etc.

• But congestion (and packet drops) still occurs

Page 88: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ in the big picture• FQ does not eliminate congestion à it just manages the congestion

• robust to cheating, variations in RTT, details of delay, reordering, retransmission, etc.

• But congestion (and packet drops) still occurs

• And we still want end-hosts to discover/adapt to their fair share!

Page 89: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

FQ in the big picture• FQ does not eliminate congestion à it just manages the congestion

• robust to cheating, variations in RTT, details of delay, reordering, retransmission, etc.

• But congestion (and packet drops) still occurs

• And we still want end-hosts to discover/adapt to their fair share!

• What would the end-to-end argument say w.r.t. congestion control?

Page 90: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness is a controversial goal

Page 91: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness is a controversial goal• What if you have 8 flows, and I have 4?

• Why should you get twice the bandwidth

Page 92: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness is a controversial goal• What if you have 8 flows, and I have 4?

• Why should you get twice the bandwidth

• What if your flow goes over 4 congested hops, and mine only goes over 1? • Why shouldn’t you be penalized for using more scarce bandwidth?

Page 93: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Fairness is a controversial goal• What if you have 8 flows, and I have 4?

• Why should you get twice the bandwidth

• What if your flow goes over 4 congested hops, and mine only goes over 1? • Why shouldn’t you be penalized for using more scarce bandwidth?

• And what is a flow anyway? • TCP connection • Source-Destination pair? • Source?

Page 94: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Summary• Internet guarantees best effort delivery

• Sometimes we want to provide bandwidth, latency guarantees

• Sometimes we want to at least ensure traffic is served fairly

• Can do this by admission control, traffic enforcement, queue management/router

• …but still not used widely on Internet, just in local networks.

Page 95: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Seriously, come TA for us next year!• Some ideas for things we’ll do next year:

• Move everything to GitHub: projects code, web site…

• Faster updates and no accidental rollbacks :P

• Updated and new projects

• Some of my ideas: invent your own TCP, implement an IDS…

• More candy. And JACKETS. I will buy you JACKETS and you will look too cool at the networking parties.

• Email me and Prof. Steenkiste if interested.

Page 96: Fairness, Queue Management, and QoSprs/15-441-F17/lectures/999-qos.pdf · 2017-12-14 · Fairness, Queue Management, and QoS 15-441 Fall 2017 Profs Peter Steenkiste & Justine Sherry

Friday

• Recitation here.

• With me.

• I will cover whatever you ask me to on Piazza.

• There will also be a handout like there was for the Midterm.