Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at...

44
Transport Layer (Congestion Control)

Transcript of Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at...

Page 1: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Transport Layer (Congestion Control)

Page 2: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Where we are in the Course

• Still at the Transport Layer• Some of the functionality discussed spills into Network layer

CSE 461 University of Washington 2

Physical

Link

Network

Transport

Application

Page 3: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

TCP to date:

•We can set up a connection (connection establishment)

•Tear down a connection (connection release)

•Keep the sending and receiving buffers from overflowing (flow control)

What’s missing?

Page 4: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Network Congestion

•A “traffic jam” in the network• Later we will learn how to control it

CSE 461 University of Washington 4

What’s the hold up?

Network

Page 5: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Nature of Congestion

•Routers/switches have internal buffering

CSE 461 University of Washington 5

. . .

. . .

. . . . . .

Input Buffer Output BufferFabric

Input Output

Page 6: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Nature of Congestion

•Simplified view of per port output queues• Typically FIFO (First In First Out), discard when full

CSE 461 University of Washington 6

Router

=

(FIFO) QueueQueuedPackets

Router

Page 7: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Nature of Congestion

• Queues help by absorbing bursts when input > output rate

• But if input > output rate for long enough, queue will overflow• This is congestion

• Congestion is a function of the traffic patterns and topology• can occur even if every link has the same capacity

CSE 461 University of Washington 7

Page 8: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Effects of Congestion - Measures

•What happens to performance as we increase load?

Page 9: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Effects of Congestion

•What happens to performance as we increase load?

Page 10: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Effects of Congestion

•As offered load rises, congestion occurs as queues begin to fill:• Delay and loss rise sharply with more load• Throughput falls below load (due to loss)

• Goodput may fall below throughput (due to retransmissions)

•None of the above is good!• Want network to operate just before congestion

CSE 461 University of Washington 10

Page 11: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Bandwidth Allocation: Goals

• Important task for network is to allocate its capacity to senders• Good allocation is both efficient and fair

•Efficient means goodput is very near the hardware transmission rate(s)

•Fair means something about senders getting a reasonable share the network

CSE 461 University of Washington 11

Page 12: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Bandwidth Allocation

•Why is it hard? (Just split equally!)• Number of senders and their offered loads change

• Senders may lack capacity in different parts of network• Network is distributed; no single party has an overall

picture of its state

CSE 461 University of Washington 12

Page 13: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Bandwidth Allocation

•Solution framework:• Senders adapt concurrently based on their own view of

the network

• Design this adaption so the network usage as a whole is efficient and fair

• Adaption is continuous since offered loads continue to change over time

CSE 461 University of Washington 13

Page 14: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Fair Allocations

Page 15: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Fair Allocation

• What’s a “fair” bandwidth allocation?• One answer: the max-min fair allocation

CSE 461 University of Washington 15

Page 16: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Recall

•We want a good bandwidth allocation to be both fair and efficient• Now we define what fair means

•Caveat: in practice, efficiency is more important than fairness

CSE 461 University of Washington 16

Page 17: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Efficiency vs. Fairness

•Cannot always have both!• Example network with traffic:

• AB, BC and AC

• How much traffic can we carry?

CSE 461 University of Washington 17

A B C1 1

Page 18: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Efficiency vs. Fairness

• If we care about fairness:• Give equal bandwidth to each flow

• AB: ½ unit, BC: ½, and AC, ½ • Total traffic carried is 1 ½ units

CSE 461 University of Washington 18

A B C1 1

Page 19: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Efficiency vs. Fairness

• If we care about efficiency:• Maximize total traffic in network• AB: 1 unit, BC: 1, and AC, 0

• Total traffic rises to 2 units!

CSE 461 University of Washington 19

A B C1 1

Page 20: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

The Unclear Notion of Fairness

• Want to be fair over what?• Sending hosts?

• Receiving hosts?

• Flows (TCP connections)?

• Applications?• Users?

• Only one of these is “easy to implement”: flows

CSE 461 University of Washington 20

A B C1 1

Page 21: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

The Unclear Notion of Fairness

•We look for fairness among flows because we have a way to manipulate individual flows• TCP implementations

• Everything else is awkward – no one easily has the information required

• So, we’re looking for “equal per flow”

CSE 461 University of Washington 21

Page 22: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

“Equal per Flow” and Bottlenecks

•Bottleneck for a flow of traffic is the link that limits its bandwidth• Where congestion occurs for the flow• For AC, link A–B is the bottleneck

• A can’t use more than 10% of B-C, no matter its offered load

CSE 461 University of Washington 22

A B C1 10

Bottleneck

Page 23: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

“Equal per Flow” and Bottlenecks

•Flows may have different bottlenecks• For AC, link A–B is the bottleneck• For BC, link B–C is the bottleneck• Can no longer divide links equally …

CSE 461 University of Washington 23

A B C1 10

Page 24: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Max-Min Fairness

• Intuitively, flows bottlenecked on a link get an equal share of that link

•Max-min fair allocation is one that:• Increasing the rate of one flow will decrease the rate of a

smaller flow

• This “maximizes the minimum” flow

CSE 461 University of Washington 24

Page 25: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Max-Min Fairness (2)

•To find it given a network, imagine “pouring water into the network”

1. Start with all flows at rate 02. Increase the flows until there is a new bottleneck in

the network

3. Hold fixed the rate of the flows that are bottlenecked4. Go to step 2 for any remaining flows

CSE 461 University of Washington 25

Page 26: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Max-Min Example

•Example: network with 4 flows, links equal bandwidth• What is the max-min fair allocation?

CSE 461 University of Washington 26

Page 27: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Max-Min Example

•When rate=1/3, flows B, C, and D bottleneck R4—R5 • Fix B, C, and D, continue to increase A

CSE 461 University of Washington 27

BottleneckBottleneck

Page 28: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Max-Min Example

•When rate=2/3, flow A bottlenecks R2—R3. Done.

CSE 461 University of Washington 28

Bottleneck

Bottleneck

Page 29: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Max-Min Example

•End with A=2/3, B, C, D=1/3, and R2—R3, R4—R5 full • Other links have extra capacity that can’t be used

• , linksxample: network with 4 flows, links equal bandwidth• What is the max-min fair allocation?

CSE 461 University of Washington 29

Page 30: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Adapting over Time

•Allocation changes as flows start and stop

CSE 461 University of Washington 30

Time

Page 31: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Adapting over Time (2)

CSE 461 University of Washington 31

Flow 1 slows when Flow 2 starts

Flow 1 speeds up when Flow 2 stops

Time

Flow 3 limit is elsewhere

Page 32: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Bandwidth Allocation

Page 33: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Recall

•Want to allocate capacity to senders• Somehow get feedback about congestion at routers

• Transport layer adjusts offered load• A good allocation is efficient and fair

•How should we perform the allocation?• Several different possibilities …

CSE 461 University of Washington 33

Page 34: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Bandwidth Allocation Models

•Open loop versus closed loop• Open: reserve bandwidth before use• Closed: use feedback to adjust rates

•Host versus Network support• Who is sets/enforces allocations? (Hosts? Routers?)

•Window versus Rate based• How is allocation expressed?

CSE 461 University of Washington 34

Page 35: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Bandwidth Allocation Models

• Infer information about congestion by observing characteristics of send-ACK loop• E.g., did segment seem to get to receiver? how long did it take?

•TCP implementation adjusts sender’s behavior via window in response• How senders adapt is a control law

CSE 461 University of Washington 35

TCP is a closed loop, host-driven, and window-based

Page 36: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

Additive Increase Multiplicative Decrease (AIMD)

•AIMD is a control law hosts can use to reach a fair allocation (under idealized conditions, at least)

•AIMD:• Hosts additively increase rate while network not congested• Hosts multiplicatively decrease rate when congested• Used by TCP

• Let’s explore the AIMD game …

CSE 461 University of Washington 36

Page 37: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

AIMD Game

•Hosts 1 and 2 share a bottleneck• But do not talk to each other directly

• Imagine that the router provides binary feedback• Tells hosts if network is congested

CSE 461 University of Washington 37

Rest ofNetwork

Bottleneck

Router

Host 1

Host 2

1

11

Page 38: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

AIMD Game

CSE 461 University of Washington 38

Host 1Throughput

Host 2Throughput

0 1

1

Fair

Efficient

OptimalAllocation

Congested

Page 39: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

AIMD Game (3)

•AI and MD move the allocation

CSE 461 University of Washington 39

Host 1

Host 20 1

1

Fair, y=x

Efficient, x+y=1

OptimalAllocation

Congested

MultiplicativeDecrease

AdditiveIncrease

Page 40: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

AIMD Game (4)

•Play the game!

CSE 461 University of Washington 40

Host 1

Host 20 1

1

A starting point

Page 41: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

AIMD Game (5)

•Always converge to good allocation!

CSE 461 University of Washington 41

Host 1

Host 20 1

1

Fair

Efficient

Congested

A starting point

Page 42: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

AIMD Sawtooth

•AIMD produces a “sawtooth” pattern over time for the rate of each host• This is the TCP sawtooth (later)

CSE 461 University of Washington 42

MultiplicativeDecrease

AdditiveIncrease

Time

Host 1 or 2’s Rate

Page 43: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

AIMD Properties

•Converges to an allocation that is efficient and fair when hosts run it• Why?• Holds for more general topologies

•Other increase/decrease control laws do not! (Try MIAD, MIMD, MIAD)•Requires only simple (binary) feedback from the

network

CSE 461 University of Washington 43

Page 44: Transport Layer (Congestion Control)...(Congestion Control) Where we are in the Course •Still at the Transport Layer •Some of the functionality discussed spills into Network layer

“Feedback” Signals

•Several possible signals, with different pros/cons• We’ll look at classic TCP that uses packet loss as a signal

CSE 461 University of Washington 44

Signal Example Protocol Pros / Cons

Packet loss TCP NewReno

Cubic TCP (Linux)

Hard to get wrong

Hear about congestion late

Packet delay Compound TCP

(Windows)

Hear about congestion early

Need to infer congestion

Router

indication

TCPs with Explicit

Congestion Notification

Hear about congestion early

Require router support