cse 6590 fall 2010 department of computer science & engineering york university 15 december 2015...
Post on 20-Jan-2016
214 Views
Preview:
TRANSCRIPT
CSE 6590Fall 2010
Department of Computer Science & Engineering
York University
April 21, 20231
Transport Protocols and TCP: Review
1
Connection Establishment and Termination
22
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
Connection State Diagram
44
Assume a reliable network (no loss seen at the transport layer).
Connection Establishment Diagram
55
What if either SYN is lost? (discussed later)
Assume a reliable network (no loss seen at the transport layer).
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
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
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.
Two Way Handshake:Obsolete SYN Segment
99
TCP Three Way Handshake:State Diagram
1010
TCP Three WayHandshake:Examples
1111
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
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
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
TCP Congestion Control
1515
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
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)
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
Use of Exponential Averaging
19
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
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
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
Window Management
23
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
Window Management Examples
2525
Reading
26
Data and Computer Communications by William Stallings, Chapter 20.
26
top related