The Transport Layer: TCP & Congestion Control Smith College, - - PDF document

the transport layer tcp congestion control
SMART_READER_LITE
LIVE PREVIEW

The Transport Layer: TCP & Congestion Control Smith College, - - PDF document

The Transport Layer: TCP & Congestion Control Smith College, CSC 249 Feb 20, 2018 1 Overview: TCP Basics q Recap: using SEQ and ACK numbers v SEQ random initial number for numbering the bytes in the application message v ACKnowledge


slide-1
SLIDE 1

1

1

The Transport Layer: TCP & Congestion Control

Smith College, CSC 249 Feb 20, 2018

2

Overview: TCP Basics

q Recap: using SEQ and ACK numbers

v SEQ random initial number for numbering the

bytes in the application message

v “ACKnowledge” next byte expected v Read chapter to review

q TCP congestion control

v Read through multiple times!

q TCP flow control

slide-2
SLIDE 2

2

3-3

TCP: SEQ and ACK numbers

Host A

ACK=100

time

Host B

Seq=100, 20 bytes data Seq=92, 8 bytes data ACK=120 source port # dest port # application data (variable length) sequence number acknowledgement number

receive window

F S R P A U

head len

source port # dest port # application data (variable length) sequence number acknowledgement number

receive window

F S R P A U

head len

3-4

TCP: Cumulative ACK

Host A

Seq=92, 8 bytes data ACK=100

loss

timer

Cumulative ACK scenario

Host B X

Seq=100, 20 bytes data

time

A C K = 1 2

slide-3
SLIDE 3

3

5

TCP possible sender events:

(1) Data received from application:

  • 1. Create a segment and assign a SEQ number

v SEQ # is byte-stream number of first data byte in segment

  • 2. Start timer if it is not already running

v Timer is for the oldest un-acked segment v Expiration interval: TimeOutInterval

(2) Timeout (ACK not received):

  • 1. Retransmit segment that caused the timeout
  • 2. Restart the timer

(3) ACK received for previously unacked segments

  • 1. Update what is known to be acked
  • 2. Start timer if there are outstanding segments

6

TCP: retransmission scenarios

Host A

Seq=100, 20 bytes data ACK=100

time premature timeout

Host B

Seq=92, 8 bytes data ACK=120 Seq=92, 8 bytes data Seq=92 timeout ACK=120

Host A

Seq=92, 8 bytes data ACK=100

loss

timeout

lost ACK scenario

Host B

X

Seq=92, 8 bytes data A C K = 1

time

Seq=92 timeout

SendBase = 100

1) What is/was ‘A’s next step? 2) What does ‘B’ then do?

slide-4
SLIDE 4

4

7

Host A timeout Host B

time

X

resend seq X2

seq # x1 seq # x2 seq # x3 seq # x4 seq # x5 ACK x1 ACK x1 ACK x1 ACK x1

triple duplicate ACKs

What does ‘A’ do next, and when does it do it? Fast retransmit, before the timer times out

8

New Today: Principles of Congestion Control

q Packet loss is caused by overflowing

router buffers

q Retransmission treats the symptom q Congestion control treats the cause q What are costs of congestion?

v v v v

slide-5
SLIDE 5

5

10

TCP Congestion Control

q Three questions

  • 1. How does a sender sense congestion?
  • 2. How does a sender limit its sending

rate?

  • 3. What algorithm is used to change the

send-rate?

12

TCP Congestion Control: details

How does sender perceive congestion?

q A loss event is ?

v A timeout or v 3 duplicate ACKs

How does sender limit its send rate?

q TCP sender reduces the send rate via

changing a variable value, the “CongWin,” after a loss event

LastByteSent-LastByteAcked ≤ CongWin

slide-6
SLIDE 6

6

13

TCP Congestion Control Window

q CongWin is dynamic, function of perceived network

congestion

q Sender limits transmission:

LastByteSent-LastByteAcked ≤ CongWin

q Changing CongWin changes the SendRate

14

TCP Congestion Control Algorithm

slide-7
SLIDE 7

7

15

TCP Congestion Control Algorithm

Three major mechanisms:

1) Slow start 2) Congestion Avoidancce

  • AIMD = additive increase,

multiplicative decrease

3) Fast Recovery:

  • Reaction to timeout events versus

3 duplicate ACKs

Are used to adjust... ?

v Adjust CongWin

16

TCP Slow Start

1) When connection begins, CongWin = 1 MSS

v Available bandwidth probably much greater v Desirable to quickly ramp up to respectable rate

2) Increase rate exponentially fast until first

loss event

v Grow window 1MSS for each ACK received

q Summary: initial rate is slow but ramps up

exponentially fast

slide-8
SLIDE 8

8

17

TCP: detecting, reacting to loss

§ Loss indicated by timeout

  • cwnd set to 1 MSS;
  • Window (cwnd ) grows exponentially (slow

start) to the threshold, then grows linearly

§ Loss indicated by 3 duplicate ACKs

  • Duplicate ACKs indicate network capable of

delivering some segments

  • cwnd is cut in half window then grows

linearly

18

TCP Slow Start with Exp. Increase

q When connection

begins, increase rate exponentially until first loss event:

v Double CongWin every

RTT

v Increment CongWin for

every ACK received

Host A

  • ne segment

RTT

Host B

time

two segments four segments

slide-9
SLIDE 9

9

19

Implementation:

§ variable ssthresh § on loss event, ssthresh is set to 1/2 of cwnd just before

loss event

TCP: Congestion algorithm switching from slow start to CA

20

Reaction to Loss Events

q Exponential increase switches to linear increase

when CongWin gets to the ‘threshold’ value (size)

slide-10
SLIDE 10

10

21

Identify everything on this graph

27

Summary: TCP Congestion Control

Increase Sending Rate Phase Options:

  • 1. When CongWin is below Threshold, sender in

slow-start phase, window grows exponentially.

  • 2. When CongWin is above Threshold, sender is in

congestion-avoidance phase, window grows linearly. Decrease Sending Rate Phase Options:

  • 1. When a triple duplicate ACK occurs, Threshold

set to CongWin/2 and CongWin set to Threshold.

  • 2. When timeout occurs, Threshold set to

CongWin/2 and CongWin is set to 1 MSS.