26
CSE 6590 Fall 2010 Department of Computer Science & Engineering York University May 15, 2022 1 Transport Protocols and TCP: Review 1

CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Embed Size (px)

Citation preview

Page 1: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

CSE 6590Fall 2010

Department of Computer Science & Engineering

York University

April 21, 20231

Transport Protocols and TCP: Review

1

Page 2: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Connection Establishment and Termination

22

Page 3: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Connection Establishment and Termination

3

required by connection-oriented transport protocols like TCP

need connection establishment and termination procedures to allow: each end to know the other existsnegotiation of optional parameterstriggers allocation of transport entity resources

3

Page 4: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Connection State Diagram

44

Assume a reliable network (no loss seen at the transport layer).

Page 5: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Connection Establishment Diagram

55

What if either SYN is lost? (discussed later)

Assume a reliable network (no loss seen at the transport layer).

Page 6: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Connection Termination

6

either or both sides by mutual agreementgraceful or abrupt terminationif graceful, initiator must:

send FIN to other end, requesting terminationplace connection in FIN WAIT statewhen FIN received, inform user and close

connectionother end must:

when receives FIN must inform TS user and place connection in CLOSE WAIT state

when TS user issues CLOSE primitive, send FIN & close connection

6

Page 7: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Connection Establishment

7

two way handshakeA send SYN, B replies with SYNlost SYN handled by re-transmissionignore duplicate SYNs once connected

lost or delayed data segments can cause connection problemseg. segment from old connection

7

Page 8: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Two Way Handshake:Obsolete Data Segment

88

Solution: starting SN is far away from the last SN of the previous connection.

Use request of the form SYNi where i +1 is the SN of the first data segment to be sent.

Page 9: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Two Way Handshake:Obsolete SYN Segment

99

Page 10: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

TCP Three Way Handshake:State Diagram

1010

Page 11: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

TCP Three WayHandshake:Examples

1111

Page 12: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

TCP Connection Establishment: Summary

12

three way handshakeSYN, SYN-ACK, ACK

connection determined by source and destination sockets (host, port)

can only have a single connection between any unique pairs of ports

but one port can connect to multiple ports

Page 13: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Connection Termination (2)

13

also need 3-way handshakemisordered segments could cause:

entity in CLOSE WAIT state sends last data segment, followed by FIN

FIN arrives before last data segmentreceiver accepts FIN, closes connection, loses

dataneed to associate sequence number with

FINreceiver waits for all segments before FIN

sequence number

13

Page 14: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Connection Termination: Graceful Close

14

also have problems with loss of segments and obsolete segments

need graceful close which will:send FIN i and receive AN i+1receive FIN j and send AN j+1wait twice maximum expected segment

lifetime

14

Page 15: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

TCP Congestion Control

1515

Page 16: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

TCP Congestion Control

16

flow control also used for congestion controlrecognize increased transit times & dropped

packetsreact by reducing flow of data

RFC’s 1122 and 2581 detail extensionsTahoe, Reno and New Reno implementations

two categories of extensions:retransmission timer management window management

16

Page 17: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Retransmission Timer Management

17

static timer likely too long or too shortestimate round trip delay by observing

pattern of delay for recent segmentsset time to value a bit greater than

estimated RTTsimple average over a number of

segmentsexponential average using time series

(RFC793)

Page 18: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Computing RTT

18

Simple average

Exponential average

18

1

1

)(1

1)1(

K

i

iRTTK

Kr

)1(1

1)(

1)1(

KRTT

KKr

K

KKr

10

)1()1()()1(

a

KRTTaKraKr

Page 19: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Use of Exponential Averaging

19

Page 20: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Exponential RTO Backoff

20

timeout probably due to congestiondropped packet or long round trip time

hence maintaining same RTO is not good ideabetter to increase RTO each time a segment is

re-transmittedRTO = q*RTOcommonly q = 2 (binary exponential backoff)as in Ethernet CSMA/CD

Page 21: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Window Management

21

slow startlarger windows cause problem on connection

createdat start limit TCP to 1 segmentincrease when data ACK, exponential growth

dynamic windows sizing on congestionwhen a timeout occurs perhaps due to congestionset slow start threshold to half current congestion

windowset window to 1 and slow start until thresholdbeyond threshold, increase window by 1 for each

RTT

Page 22: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Summary

22

Assigns a congestion window Cw:Initial value of Cw = 1 (packet)If trx successful, congestion window doubled.

Continues until Cmax is reachedAfter Cw ≥ Cmax, Cw = Cw + 1If timeout before ACK, TCP assumes congestion

TCP response to congestion is drastic:A random backoff timer disables all transmissions for

duration of timerCw is set to 1Cmax is set to Cmax / 2

Congestion window can become quite small for successive packet losses.

22

Page 23: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Window Management

23

Page 24: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Fast Retransmit, Fast Recovery

24

retransmit timer rather longer than RTTif segment lost TCP slow to retransmitfast retransmit

if receive a segment out of order, issue an ACK for the last in-order segment correctly received. Repeat this until the missing segment arrives.

if receive 4 ACKs for same segment then immediately retransmit (without waiting for timer) since it is likely to have been lost

fast recoverylost segment means some congestionhalve window then increase linearlyavoids slow-start

Page 25: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Window Management Examples

2525

Page 26: CSE 6590 Fall 2010 Department of Computer Science & Engineering York University 15 December 2015 1 Transport Protocols and TCP: Review 1

Reading

26

Data and Computer Communications by William Stallings, Chapter 20.

26