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?
- A. FIN: seq 6201, ack 9700; server acknowledges 6202
- B. FIN: seq 6200, ack 9700; server acknowledges 6201
- C. FIN: seq 6201, ack 9701; server acknowledges 6201
- 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
- Two stations 3000 km apart are joined by a 4 Mbps link on which signals travel at 2 x 10^8 m/s. Frames are 2000 bytes long, ACKs are…
- A stop-and-wait link runs at 1 Mbps with a one-way propagation delay of 10 ms. Data frames are 5000 bits, ACKs are 500 bits, and each data…
- A sender must deliver frames 1 to 12. Every 6th frame transmission (counting retransmissions too) is lost; ACKs are never lost. With…
- A stop-and-wait sender has 6 frames to deliver over a 100 kbps link with one-way propagation delay 20 ms. Frames are 1000 bits and ACKs…
- A 20 Mbps link has a one-way propagation delay of 8 ms and carries 1250-byte frames; ACKs are negligibly short. The sender window is…
- An IPv4 datagram of total length 4020 bytes (20-byte header, no options) is forwarded over a link with MTU 1500 bytes and then over a link…