TCP Congestion Avoidance Joshua Gancher November 10, 2016 Joshua - - PowerPoint PPT Presentation

tcp congestion avoidance
SMART_READER_LITE
LIVE PREVIEW

TCP Congestion Avoidance Joshua Gancher November 10, 2016 Joshua - - PowerPoint PPT Presentation

TCP Basics The Problem: Congestion Collapse The Solution More Problems TCP Congestion Avoidance Joshua Gancher November 10, 2016 Joshua Gancher TCP Congestion Avoidance TCP Basics The Problem: Congestion Collapse The Solution More


slide-1
SLIDE 1

TCP Basics The Problem: Congestion Collapse The Solution More Problems

TCP Congestion Avoidance

Joshua Gancher November 10, 2016

Joshua Gancher TCP Congestion Avoidance

slide-2
SLIDE 2

TCP Basics The Problem: Congestion Collapse The Solution More Problems

A little history

◮ Late 1950’s: SAGE radar station

Joshua Gancher TCP Congestion Avoidance

slide-3
SLIDE 3

TCP Basics The Problem: Congestion Collapse The Solution More Problems

A little history

◮ Late 1950’s: SAGE radar station ◮ 1961: Leonard Kleinrock – queueing theory =

⇒ packet switching

Joshua Gancher TCP Congestion Avoidance

slide-4
SLIDE 4

TCP Basics The Problem: Congestion Collapse The Solution More Problems

A little history

◮ Late 1950’s: SAGE radar station ◮ 1961: Leonard Kleinrock – queueing theory =

⇒ packet switching

◮ 1964: Dartmouth Time Sharing System

Joshua Gancher TCP Congestion Avoidance

slide-5
SLIDE 5

TCP Basics The Problem: Congestion Collapse The Solution More Problems

A little history

◮ Late 1950’s: SAGE radar station ◮ 1961: Leonard Kleinrock – queueing theory =

⇒ packet switching

◮ 1964: Dartmouth Time Sharing System ◮ 1969: Beginning of ARPANET – UCLA, SRI, UCSB, Utah

◮ Initially over NCP

”We typed the L and we asked on the phone, ”Do you see the L?” ”Yes, we see the L,” came the response. ”We typed the O, and we asked, ”Do you see the O.” ”Yes, we see the O.” ”Then we typed the G, and the system crashed... Yet a revolution had begun...” Kleinrock, at UCLA

Joshua Gancher TCP Congestion Avoidance

slide-6
SLIDE 6

TCP Basics The Problem: Congestion Collapse The Solution More Problems

TCP in One Slide

Sender Receiver

1:100 ACK 100 101:200 101:200 ACK 150 151:250

(wsize = 100; rate = wsize/RTT)

◮ 1974: RFC 675

◮ (coined the term

Internet)

Joshua Gancher TCP Congestion Avoidance

slide-7
SLIDE 7

TCP Basics The Problem: Congestion Collapse The Solution More Problems

TCP in One Slide

Sender Receiver

1:100 ACK 100 101:200 101:200 ACK 150 151:250

(wsize = 100; rate = wsize/RTT)

◮ 1974: RFC 675

◮ (coined the term

Internet)

◮ All data carries a sequence

number

Joshua Gancher TCP Congestion Avoidance

slide-8
SLIDE 8

TCP Basics The Problem: Congestion Collapse The Solution More Problems

TCP in One Slide

Sender Receiver

1:100 ACK 100 101:200 101:200 ACK 150 151:250

(wsize = 100; rate = wsize/RTT)

◮ 1974: RFC 675

◮ (coined the term

Internet)

◮ All data carries a sequence

number

◮ Receiver sends back

cumulative acknowledgement (ACKs)

Joshua Gancher TCP Congestion Avoidance

slide-9
SLIDE 9

TCP Basics The Problem: Congestion Collapse The Solution More Problems

TCP in One Slide

Sender Receiver

1:100 ACK 100 101:200 101:200 ACK 150 151:250

(wsize = 100; rate = wsize/RTT)

◮ 1974: RFC 675

◮ (coined the term

Internet)

◮ All data carries a sequence

number

◮ Receiver sends back

cumulative acknowledgement (ACKs)

◮ If no ACK, retransmit

from last ACK

Joshua Gancher TCP Congestion Avoidance

slide-10
SLIDE 10

TCP Basics The Problem: Congestion Collapse The Solution More Problems

TCP in One Slide

Sender Receiver

1:100 ACK 100 101:200 101:200 ACK 150 151:250

(wsize = 100; rate = wsize/RTT)

◮ 1974: RFC 675

◮ (coined the term

Internet)

◮ All data carries a sequence

number

◮ Receiver sends back

cumulative acknowledgement (ACKs)

◮ If no ACK, retransmit

from last ACK

◮ Receiver advertises window

size in header

Joshua Gancher TCP Congestion Avoidance

slide-11
SLIDE 11

TCP Basics The Problem: Congestion Collapse The Solution More Problems

TCP Sending Behavior

Repeat:

  • 1. Send packet
  • 2. Wait for ack
  • 3. If no ack within timeout, retransmit until acknowledged

Joshua Gancher TCP Congestion Avoidance

slide-12
SLIDE 12

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Bottleneck Buffers

A B C D E F G H

Joshua Gancher TCP Congestion Avoidance

slide-13
SLIDE 13

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Bottleneck Buffers

A B C D E F G H

◮ F,G,H advertise large window

Joshua Gancher TCP Congestion Avoidance

slide-14
SLIDE 14

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Bottleneck Buffers

A B C D E F G H

◮ F,G,H advertise large window ◮ A,B,C send large window

Joshua Gancher TCP Congestion Avoidance

slide-15
SLIDE 15

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Bottleneck Buffers

A B C D E F G H

◮ F,G,H advertise large window ◮ A,B,C send large window ◮ E’s buffer reaches capacity

Joshua Gancher TCP Congestion Avoidance

slide-16
SLIDE 16

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Bottleneck Buffers

A B C D E F G H

◮ F,G,H advertise large window ◮ A,B,C send large window ◮ E’s buffer reaches capacity

= ⇒ A,B,C all must retransmit lost packets, after timeout

Joshua Gancher TCP Congestion Avoidance

slide-17
SLIDE 17

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Bottleneck Buffers

A B C D E F G H

◮ F,G,H advertise large window ◮ A,B,C send large window ◮ E’s buffer reaches capacity

= ⇒ A,B,C all must retransmit lost packets, after timeout What if timeout range is smaller than transmit time?

Joshua Gancher TCP Congestion Avoidance

slide-18
SLIDE 18

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Congestion Collapse

1986: NSFNET dropped from 32 Kb/s to 40 b/s [Hosts] will begin to introduce more and more copies

  • f the same datagrams into the net. The network is now

in serious trouble... Hosts are sending each packet several times, and eventually some copy of each packet arrives at its destination. This is congestion collapse. – RFC 896

Joshua Gancher TCP Congestion Avoidance

slide-19
SLIDE 19

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Optimistic Case / Worst Case

◮ Low demand on

network

◮ No major bottleneck ◮ Little packet loss

Joshua Gancher TCP Congestion Avoidance

slide-20
SLIDE 20

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Optimistic Case / Worst Case

◮ Low demand on

network

◮ No major bottleneck ◮ Little packet loss ◮ Low load stable state ◮ Low round trip time

Joshua Gancher TCP Congestion Avoidance

slide-21
SLIDE 21

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Optimistic Case / Worst Case

◮ Low demand on

network

◮ No major bottleneck ◮ Little packet loss ◮ Low load stable state ◮ Low round trip time ◮ High demand on

network

◮ Bottleneck ◮ High packet loss

Joshua Gancher TCP Congestion Avoidance

slide-22
SLIDE 22

TCP Basics The Problem: Congestion Collapse The Solution More Problems

Optimistic Case / Worst Case

◮ Low demand on

network

◮ No major bottleneck ◮ Little packet loss ◮ Low load stable state ◮ Low round trip time ◮ High demand on

network

◮ Bottleneck ◮ High packet loss ◮ High load stable state ◮ High round trip time

Joshua Gancher TCP Congestion Avoidance

slide-23
SLIDE 23

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

◮ From Berkeley; now at UCLA ◮ Major contributions to TCP/IP ◮ Member of the Internet Hall of Fame

Joshua Gancher TCP Congestion Avoidance

slide-24
SLIDE 24

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Conservation of Packets

Conservation Under stable conditions, new packets enter the stream only when

  • ld packets leave.

Joshua Gancher TCP Congestion Avoidance

slide-25
SLIDE 25

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Conservation of Packets

Conservation Under stable conditions, new packets enter the stream only when

  • ld packets leave.

Can be violated by:

◮ The connection doesn’t stabilize ◮ A new packet enters before an old packet is received ◮ In-transit packet loss

Joshua Gancher TCP Congestion Avoidance

slide-26
SLIDE 26

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Stability

Problem 1: Stability

Joshua Gancher TCP Congestion Avoidance

slide-27
SLIDE 27

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Self-Clocking TCP

Joshua Gancher TCP Congestion Avoidance

slide-28
SLIDE 28

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Slow Start

Congestion Windows Initialize: cwnd := 1 On ack: cwnd++ On packet loss: set cwnd := 1 On send: send min(cwnd, receiver’s window size)

Joshua Gancher TCP Congestion Avoidance

slide-29
SLIDE 29

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Slow Start

Congestion Windows Initialize: cwnd := 1 On ack: cwnd++ On packet loss: set cwnd := 1 On send: send min(cwnd, receiver’s window size)

◮ Exponential acceleration to receiver’s window size

(R log W time to reach window size of W )

◮ Reset back to 1 on failure (will be amended)

Joshua Gancher TCP Congestion Avoidance

slide-30
SLIDE 30

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Execution with Slow Start

Joshua Gancher TCP Congestion Avoidance

slide-31
SLIDE 31

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Conservation of Packets

Conservation Under stable conditions, new packets enter the stream only when

  • ld packets leave.

Can be violated by:

◮ The connection doesn’t stabilize ◮ A new packet enters before an old packet is received ◮ In-transit packet loss

Joshua Gancher TCP Congestion Avoidance

slide-32
SLIDE 32

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Problem 2: Packet duplication

Joshua Gancher TCP Congestion Avoidance

slide-33
SLIDE 33

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Problem 2: Packet duplication

◮ Need a good estimator of round-trip time (RTT)

Joshua Gancher TCP Congestion Avoidance

slide-34
SLIDE 34

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Problem 2: Packet duplication

◮ Need a good estimator of round-trip time (RTT)

Jacobson’s insight: account for the variation of RTT

◮ Each ACK: RTT := α · RTT + (1 − α) · M

◮ Where α ≈ 0.9 Joshua Gancher TCP Congestion Avoidance

slide-35
SLIDE 35

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Problem 2: Packet duplication

◮ Need a good estimator of round-trip time (RTT)

Jacobson’s insight: account for the variation of RTT

◮ Each ACK: RTT := α · RTT + (1 − α) · M

◮ Where α ≈ 0.9

◮ Set timeout to β · RTT

◮ Where β ≈ 2 Joshua Gancher TCP Congestion Avoidance

slide-36
SLIDE 36

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Round-Trip Time Estimation

Joshua Gancher TCP Congestion Avoidance

slide-37
SLIDE 37

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Conservation of Packets

Conservation Under stable conditions, new packets enter the stream only when

  • ld packets leave.

Can be violated by:

◮ The connection doesn’t stabilize ◮ A new packet enters before an old packet is received ◮ In-transit packet loss

Joshua Gancher TCP Congestion Avoidance

slide-38
SLIDE 38

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Congestion Avoidance

Problem 3: packet loss in-transit

Joshua Gancher TCP Congestion Avoidance

slide-39
SLIDE 39

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Congestion Avoidance

Problem 3: packet loss in-transit

◮ 99% of packet loss due to buffer overflow

Joshua Gancher TCP Congestion Avoidance

slide-40
SLIDE 40

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Congestion Avoidance

Problem 3: packet loss in-transit

◮ 99% of packet loss due to buffer overflow ◮ Need local state to keep track of network allowance

Joshua Gancher TCP Congestion Avoidance

slide-41
SLIDE 41

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Congestion Avoidance

Problem 3: packet loss in-transit

◮ 99% of packet loss due to buffer overflow ◮ Need local state to keep track of network allowance

◮ Congestion window: slow start ◮ Congestion threshold: exploratory window opening Joshua Gancher TCP Congestion Avoidance

slide-42
SLIDE 42

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Congestion Avoidance

Problem 3: packet loss in-transit

◮ 99% of packet loss due to buffer overflow ◮ Need local state to keep track of network allowance

◮ Congestion window: slow start ◮ Congestion threshold: exploratory window opening

Queueing theory:

◮ Low load: average buffer length ≈ constant ◮ Congestive load: average buffer length ≈ exponential growth

Joshua Gancher TCP Congestion Avoidance

slide-43
SLIDE 43

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Congestion Avoidance

Problem 3: packet loss in-transit

◮ 99% of packet loss due to buffer overflow ◮ Need local state to keep track of network allowance

◮ Congestion window: slow start ◮ Congestion threshold: exploratory window opening

Queueing theory:

◮ Low load: average buffer length ≈ constant ◮ Congestive load: average buffer length ≈ exponential growth

Jacobson’s insight:

◮ Use timeouts to determine congestion ◮ No congestion: log growth ◮ Congestion: exponential decay

Joshua Gancher TCP Congestion Avoidance

slide-44
SLIDE 44

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

New Congestion Window Algorithm On timeout: ssthresh := cur window size / 2 cwnd := 1 On ack: if cwnd < ssthresh, cwnd++ // slow start else, cwnd += 1/cwnd // exploratory growth

Joshua Gancher TCP Congestion Avoidance

slide-45
SLIDE 45

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Congestion Avoidance

Joshua Gancher TCP Congestion Avoidance

slide-46
SLIDE 46

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Biggest lesson learned:

Joshua Gancher TCP Congestion Avoidance

slide-47
SLIDE 47

TCP Basics The Problem: Congestion Collapse The Solution More Problems Slow Start Round-Trip Timing Window Resizing

Biggest lesson learned:

◮ Analytic methods =

⇒ tiny codebase which does a whole lot

Joshua Gancher TCP Congestion Avoidance

slide-48
SLIDE 48

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions Joshua Gancher TCP Congestion Avoidance

slide-49
SLIDE 49

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

TCP Congestion Control with a Misbehaving Receiver

◮ Van Jacobson paper assumes coordination

Joshua Gancher TCP Congestion Avoidance

slide-50
SLIDE 50

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

TCP Congestion Control with a Misbehaving Receiver

◮ Van Jacobson paper assumes coordination ◮ Attacks: Malicious receivers can encourage unfriendliness

Joshua Gancher TCP Congestion Avoidance

slide-51
SLIDE 51

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

TCP Congestion Control with a Misbehaving Receiver

◮ Van Jacobson paper assumes coordination ◮ Attacks: Malicious receivers can encourage unfriendliness ◮ Modifications to disable such attacks

Joshua Gancher TCP Congestion Avoidance

slide-52
SLIDE 52

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 1: ACK Division

ACK Granularity During slow start, acks assumed to be in units of segments

Joshua Gancher TCP Congestion Avoidance

slide-53
SLIDE 53

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 1: ACK Division

ACK Granularity During slow start, acks assumed to be in units of segments Attack:

◮ Send many acks for each segment received

Joshua Gancher TCP Congestion Avoidance

slide-54
SLIDE 54

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 1: ACK Division

ACK Granularity During slow start, acks assumed to be in units of segments Attack:

◮ Send many acks for each segment received ◮ Causes congestion window to increase many times

Joshua Gancher TCP Congestion Avoidance

slide-55
SLIDE 55

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 1: ACK Division

Joshua Gancher TCP Congestion Avoidance

slide-56
SLIDE 56

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 1: ACK Division

Joshua Gancher TCP Congestion Avoidance

slide-57
SLIDE 57

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 1: ACK Division

Solution:

◮ Require unambiguous ACK granularity

Joshua Gancher TCP Congestion Avoidance

slide-58
SLIDE 58

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 1: ACK Division

Solution:

◮ Require unambiguous ACK granularity ◮ Either byte-level or segment-level

Joshua Gancher TCP Congestion Avoidance

slide-59
SLIDE 59

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 2: Duplicate ACKs

Duplicate ACKs Duplicate ACKs interpreted as duplicate packets leaving the network; each ACK increases cwnd Attack:

◮ Flood connection with duplicate ACKs

Joshua Gancher TCP Congestion Avoidance

slide-60
SLIDE 60

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 2: Duplicate ACKs

Joshua Gancher TCP Congestion Avoidance

slide-61
SLIDE 61

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 2: Duplicate ACKs

Joshua Gancher TCP Congestion Avoidance

slide-62
SLIDE 62

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 2: Duplicate ACKs

Solution:

◮ Attach nonces to retransmitted data

Joshua Gancher TCP Congestion Avoidance

slide-63
SLIDE 63

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 3: Optimistic ACKing

Optimistic ACKs ACKs can be sent before data is received, obtaining artificially low RTT Attack:

◮ Send ACKs before data is received ◮ Time so that ACK received just after data is sent

Joshua Gancher TCP Congestion Avoidance

slide-64
SLIDE 64

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 3: Optimistic ACKing

Joshua Gancher TCP Congestion Avoidance

slide-65
SLIDE 65

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 3: Optimistic ACKing

Joshua Gancher TCP Congestion Avoidance

slide-66
SLIDE 66

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Attack 3: Optimistic ACKing

Solution:

◮ Use cumulative nonces to enforce causality

Joshua Gancher TCP Congestion Avoidance

slide-67
SLIDE 67

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions Joshua Gancher TCP Congestion Avoidance

slide-68
SLIDE 68

TCP Basics The Problem: Congestion Collapse The Solution More Problems Attacks and Solutions

Lesson learned:

◮ Must assume malicious behavior in wide area networks!! ◮ More important now than ever

Joshua Gancher TCP Congestion Avoidance