I was trying to understand TCP connection establishment and termination steps from Forouzan's book.
In third step of three way handshake of connection establishment, it says following
The client sends the third segment. This is just an ACK segment. It acknowledges the receipt of the second segment with the ACK flag and acknowledgment number field. Note that the ACK segment does not consume any sequence numbers if it does not carry data, but some implementations allow this third segment in the connection phase to carry the first chunk of data from the client. In this case, the segment consumes as many sequence numbers as the number of data bytes.
Q1. I dont get bold faced sentence. It says third segment does not consume sequence number if it is only ACK and does not carry any data. But, in the diagram, both first and second segment is shown to have different sequence numbers 8000 and 8001. I felt both should be 8000.
In third step of three way handshake of connection termination, it says:
The client TCP sends the last segment, an ACK segment, to confirm the receipt of the FIN segment from the TCP server. This segment contains the acknowledgment number, which is one plus the sequence number received in the FIN segment from the server. This segment cannot carry data and consumes no sequence numbers.
Q2. Again I dont get bold faced sentence. It says if ACK segment does not carry data, it wont consume sequence number. But in diagram sequence numbers of first and third segments are different: x and x+1. I felt both should be x.
Am I making some mistake here to understand diagrams?
At some point later in the book, while explaining how re transmission timer is calculated, it shows connection establishment phase as follows:
Note that first and third segment have same sequence number, 1400. Then why first and second diagram have different sequence number in first and third segment? Should they have same sequence number or I am miss interpreting "consumes no sequence number"?