3

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: enter image description here 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?

1

1 Answer 1

2

It is clearly spelled out in RFC 793 Transmission Control Protocol, Section 3.5 Closing a Connection:

      TCP A                                                TCP B

  1.  ESTABLISHED                                          ESTABLISHED

  2.  (Close)
      FIN-WAIT-1  --> <SEQ=100><ACK=300><CTL=FIN,ACK>  --> CLOSE-WAIT

  3.  FIN-WAIT-2  <-- <SEQ=300><ACK=101><CTL=ACK>      <-- CLOSE-WAIT

  4.                                                       (Close)
      TIME-WAIT   <-- <SEQ=300><ACK=101><CTL=FIN,ACK>  <-- LAST-ACK

  5.  TIME-WAIT   --> <SEQ=101><ACK=301><CTL=ACK>      --> CLOSED

  6.  (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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.