Cs 164 Lec 13
Cs 164 Lec 13
In this set....
Connection Termination
Note that after the
server receives the
Active Close
FIN_WAIT_1, it
FIN_WAIT1
may still have
FIN
, Se
q N
um
messages -- thus,
= M
connection not yet
+1
ACK= M
closed.
FIN_WAIT2
K
C
A
/
DATA
CLOSE_WAIT
LAST_ACK
um = N
N
q
e
S
FIN,
ACK
N+1
CLOSED
CLOSED
Active open/SYN
Passive open
Close
Close
LISTEN
SYN_RCVD
SYN/SYN + ACK
Send/SYN
SYN/SYN + ACK
ACK
SYN + ACK/ACK
Close/FIN
ACK
ESTABLISHED
Close/FIN
FIN_WAIT_1
SYN_SENT
FIN/ACK
CLOSE_WAIT
ACK +FIN/ACK
FIN/ACK
FIN_WAIT_2
Close/FIN
CLOSING
ACK Timeout after two
segment lifetimes
FIN/ACK
TIME_WAIT
LAST_ACK
ACK
CLOSED
SYN (Send)
CLOSED
TIME_WAIT
SYN_SENT
Rcv.
SYN+ACK,
Send ACK
ESTABLISHED
FIN_WAIT2
Rcv. ACK, Send
Nothing
FIN_WAIT1
Send FIN
Passive OPEN,
Create Listen
socket
CLOSED
LAST ACK
LISTEN
Send FIN
Rcv. SYN,
Send SYN+ACK
SYN_RCVD
CLOSE_WAIT
ESTABLISHED
RCV ACK
Flow Control
Flow control ensures that the
sender does not send at a rate that
causes the receiver buffer to
overflow.
Note that flow control is end-toend.
Sending application
LastByteWritten
LastByteAcked
LastByteSent
(a)
TCP
Receiving application
TCP
LastByteRead
NextByteExpected
LastByteRcvd
Persistency
What does one do when Advertised
Window = 0 ?
The sender will persist by sending 1
segment.
Note that this segment may not be
accepted by the receiver initially.
But at some point, it would trigger a
response that may contain a new
Advertised window.
RTT Estimation
Simple mechanism could be:
A problem
Sender
Receiver
Sender
Original transmission
Receiver
Original transmission
Retransmission
ACK
Retransmission
ACK
(a)
(b)
Issues ..
We cannot eliminate the possibility of small
segments being sent.
However, we can introduce methods to
coalesce small chunks.
Nagles Algorithm
If sender waits too long --> bad for interactive
connections.
If it does not wait long enough -- silly window syndrome.
How to solve ?
Timer -- clock based
If both available data and Window MSS, send full
segment.
Else, if there is unACKed data in flight, buffer new data
until ACK returns.
Else, send new data now.
TCP Throughput
If a connection sends W segments of
MSS size (in bytes) in RTT seconds,
then, the throughput is defined as :
W *MSS / RTT bytes/second.
Throughput (cont)
If a TCP session goes through n links and if
link j has a rate Rj and is shared by Kj
connections, ideally the throughput = Rj/Kj.
Thus, a connections end-to-end rate is r =
min (R1/K1, R2/K2, .. Rj/Kj... Rn/Kn).
In reality not so simple, some connections
may be unable to use their share -- so the
share may be higher.
Where are we ?
We have covered Chapter 5 -Sections 5.1 and 5.2.
Whatever I left out from Section
5.2 is for self-study.