CS FundamentalsVery hardProduct company interview · GATE level

A client opens a TCP connection with initial sequence number 5000; the server chooses 9000. After the three-way handshake the client sends three data segments of 400, 300 and 500 bytes, the server replies with one segment of 700 bytes, and all data is acknowledged. The client then sends a FIN carrying no data. What are the sequence number and acknowledgment number in that FIN segment, and what acknowledgment number does the server use to acknowledge the FIN?

  1. A. FIN: seq 6201, ack 9700; server acknowledges 6202
  2. B. FIN: seq 6200, ack 9700; server acknowledges 6201
  3. C. FIN: seq 6201, ack 9701; server acknowledges 6201
  4. D. FIN: seq 6201, ack 9701; server acknowledges 6202

Correct answer: D. FIN: seq 6201, ack 9701; server acknowledges 6202

A SYN consumes one sequence number, so the client's first data byte is 5001 and the server's is 9001. After 400 + 300 + 500 = 1200 bytes the client's next sequence number is 6201, which the FIN uses. The server sent bytes 9001-9700, so the client acknowledges 9701. A FIN also consumes one sequence number, so the server acknowledges 6202. The answers with 6200 or 9700 forget that the SYN used a number; acknowledging 6201 forgets that the FIN does too.

More Computer Networks questions

Exams that ask this topic