Chapter 3 Outline: 3.5 Connection-Oriented Transport: TCP
Chapter 3 Outline: 3.5 Connection-Oriented Transport: TCP
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
overwhelm receiver
door door
TCP TCP
send buffer receive buffer
segment
350
300
250
RTT (milliseconds)
200
150
100
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
DevRTT = (1-)*DevRTT +
*|SampleRTT-EstimatedRTT|
(typically, = 0.25)
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
Seq=92 timeout
timeout
X
loss
Sendbase
= 100
Seq=92 timeout
SendBase
= 120
SendBase
= 100 SendBase
= 120 premature timeout
time time
lost ACK scenario
Transport Layer 3-13
TCP retransmission scenarios (more)
Host A Host B
timeout
X
loss
SendBase
= 120
time
Cumulative ACK scenario
X
timeout
time
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
speed-matching
service: matching the
send rate to the
receiving app’s drain
rate
app process may be
slow at reading from
buffer
Transport Layer 3-20
TCP Flow control: how it works
Rcvr advertises spare
room by including value
of RcvWindow in
segments
Sender limits unACKed
(Suppose TCP receiver data to RcvWindow
discards out-of-order guarantees receive
segments) buffer doesn’t overflow
spare room in buffer
= RcvWindow
= RcvBuffer-[LastByteRcvd -
LastByteRead]
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
seq. #s no data
close
client closes socket:
clientSocket.close();
timed wait
Step 2: server receives
FIN, replies with ACK.
Closes connection, sends
FIN. closed
timed wait
Note: with small
closed
modification, can handle
simultaneous FINs.
closed
TCP server
lifecycle
TCP client
lifecycle