I read about TCP/IP Illustrated, Volume 1: The Protocols (2nd Edition) 13.2 TCP Connection Establishment and Termination, and the following picture shows the TCP connection and termination process, what confuse me is the sequence number of ACK sent by client in termination process, just like the picture shows:
when server send FIN+ACK, Seq=L, ACK=K+1,(options) to client, this means that server need a segment whose sequence number is K+1, so I think the client should send ACK, Seq=K+1, ACK=L+1, (options) to server, right?
Asked
Active
Viewed 4,793 times
3

cong
- 145
- 1
- 6
-
I'm not asking why we need three segments to establish a connection and four to terminate one but the sequence number in the termination process, I don't think it duplicated with Why do we need a 3-way handshake? Why not just 2-way? – cong Jan 18 '18 at 07:16
1 Answers
3
It is clearly spelled out in RFC 793 Transmission Control Protocol, Section 3.5 Closing a Connection:
TCP A TCP B
ESTABLISHED ESTABLISHED
(Close)
FIN-WAIT-1 --> <SEQ=100><ACK=300><CTL=FIN,ACK> --> CLOSE-WAIT
FIN-WAIT-2 <-- <SEQ=300><ACK=101><CTL=ACK> <-- CLOSE-WAIT
(Close)
TIME-WAIT <-- <SEQ=300><ACK=101><CTL=FIN,ACK> <-- LAST-ACK
TIME-WAIT --> <SEQ=101><ACK=301><CTL=ACK> --> CLOSED
(2 MSL)
CLOSED
Normal Close Sequence
Figure 13.
The RFC is the definition of TCP, and textbooks may have errors (it happens all the time). It is a good idea to also study the RFCs of any protocols which you are learning.

Ron Maupin
- 99,565
- 26
- 120
- 195