



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




copyright 2005 Douglas S. Reeves 2
copyright 2005 Douglas S. Reeves 3
copyright 2005 Douglas S. Reeves 5
copyright 2005 Douglas S. Reeves 6
copyright 2005 Douglas S. Reeves 7
Complete State Diagram
Application: active open
Send: SYN
Recv
Send: ACK
Application: close
Send: FIN
Recv: ACK
Send: (nothing)
Recv: FIN
Send: ACK
2MSL timeout occurs
Send: (nothing)
Data being transferred
Appl: passive
open
Send: (nothing)
Recv
Send:SYN,ACK
Recv
Send: (nothing)
Recv: FIN
Send: ACK
Application: close
Send: FIN
Recv: ACK
Send: (nothing)
Data being transferred
Recv
Send: (nothing)
Appl: close or
timeout
Recv: SYN
Send: SYN,ACK
Appl: close
Send: FIN
Recv: FIN
Send: ACK
Recv: ACK
Send: (nothing)
Recv
Send: ACK
copyright 2005 Douglas S. Reeves 8
Normal Client Sequence
Application: active open
Send: SYN
Application: close
Send: FIN
Recv: ACK
Send: (nothing)
Recv: FIN
Send: ACK
2MSL timeout occurs
Send: (nothing)
Recv
Send: ACK
Data being transferred
copyright 2005 Douglas S. Reeves 9
Normal Server Sequence
Appl: passive open
Send: (nothing)
Recv
Send:SYN,ACK
Recv: FIN
Send: ACK
Application: close
Send: FIN
Recv: ACK
Send: (nothing)
Recv
Send: (nothing)
Data being transferred
copyright 2005 Douglas S. Reeves 10
All Together, Now
CLOSED
SYN_SEN
T
Application: active
open
Send: SYN
Application:
close
Send: FIN
FIN_WAIT_
FIN_WAIT_
Recv: ACK
Send:
(nothing)
TIME_WAIT
Recv: FIN
Send: ACK
2MSL timeout occurs
Send: (nothing)
Timeout
problems
ESTABLISHED
Recv
:
SYN,ACK
Send: ACK
Data being
transferred
CLOSED
LISTENING
Appl: passive
open
Send: (nothing)
SYN_RCVD
Recv
: SYN
Send:SYN,AC
K
CLOSE_WAIT
Recv:
FIN
Send:
ACK
LAST_ACK
Application:
close
Send: FIN
ESTABLISHED
Recv
Send:: ACK
(nothing)
Data being
transferred
copyright 2005 Douglas S. Reeves 11
Server States When Client Resets
Connection Before Establishment Complete
Appl: passive
open
Send: (nothing)
Recv
Send:SYN,ACK
Recv
Send: (nothing)
copyright 2005 Douglas S. Reeves 12
Simultaneous Active Opens
(pass each other in the network)
x , SYN
SEQ=y, SYN
SYN,ACK=y+
SYN,ACK=x+
INTERACTIVE DATA TRANSFER
copyright 2005 Douglas S. Reeves 20
Character-by-Character Transfer (Telnet)
t
t
t
t
ack
ack 2056
t
t
t
t
t
t
ack
ack 2057
t
t
.
.
.
copyright 2005 Douglas S. Reeves 21
Performance?
copyright 2005 Douglas S. Reeves 22
Improvement #1: Delayed ACKs
send
dependent
copyright 2005 Douglas S. Reeves 23
Delayed ACK Example
t
t
t
t
ack
ack 2056
t
t
t
t
1), ack
1), ack 2057
t
t
copyright 2005 Douglas S. Reeves 24
Improvement #2: “Nagle’s Algorithm”
(RFC 896)
segment
first byte and buffer the rest until…
copyright 2005 Douglas S. Reeves 25
Nagle’s Algorithm (cont’d)
copyright 2005 Douglas S. Reeves 26
Example
t
t
t
t
ack
ack 2056
t
t
.
.
.
FLOW CONTROL AND
OPTIMAL WINDOW SIZES
copyright 2005 Douglas S. Reeves 28
Flow Control in TCP
overrun the receiver’s buffer
processed by application
advertisement ( Window Size)
before it must wait for an acknowledgment
copyright 2005 Douglas S. Reeves 29
Sliding Window, Again
copyright 2005 Douglas S. Reeves 30
Sliding Window, Again (cont’d)
copyright 2005 Douglas S. Reeves 37
Other Examples
5 KB
(40 Kb)
5 ms
(.005 s)
1000 KB
(8000 Kb)
6.25 MB
(50 Mb)
500 ms
(.5 s)
12.5 MB/s
(100 Mb/s)
Receiver BW RTT Window Size
copyright 2005 Douglas S. Reeves 38
Summary
The state diagram captures all the behavior of
connection state
The 2MSL timer and long sequence numbers
help avoid confusion between independent
connections
Delayed ACKs and Nagle’s algorithm improve the
efficiency of low-data-rate, high-RTT transfers
copyright 2005 Douglas S. Reeves 39
Summary (cont’d)
window advertisements
the sliding window size can change over time
delay-receiver bandwidth product
copyright 2005 Douglas S. Reeves 40
Next Lecture