Consider the three-way handshake mechanism followed during TCP connection establishment between hosts P and Q. Let X and Y be two random 32-bit starting sequence numbers chosen by P and Q respectively. Suppose P sends a TCP connection request message to Q with a TCP segment having SYN bit = 1, SEQ number = X, ACK bit = 0. Suppose Q accepts the connection request. Which one of the following choices represents the information present in the TCP segment header that is sent by Q to P? A. SYN bit = 1, SEQ number = X + 1, ACK bit = 0, ACK number = Y, FIN bit = 0 B. SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK number = X + 1, FIN bit = 0 C. SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK number = X, FIN bit = 1 D. SYN bit = 1, SEQ number = X + 1, ACK bit = 1, ACK number = Y, FIN bit = 0
GATE 2021 · Computer Networks · TCP · medium
Answer: B. SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK number = X + 1, FIN bit = 0
- Determine Q's SYN-ACK fields: P sent SYN=1, SEQ=X, ACK=0. Q accepts, so Q must: (1) Set SYN=1 to synchronize Q's sequence. (2) Set SEQ=Y, Q's own ISN. (3) Set ACK=1 to acknowledge P's SYN. (4) Set ACK number = X+1 (acknowledges receipt of P's SYN byte at position X). (5) Set FIN=0 (not terminating).
- Match against options: Option B: SYN=1, SEQ=Y, ACK=1, ACK number=X+1, FIN=0. This matches exactly. Option A is wrong (ACK=0, no ACK number). Option C is wrong (FIN=1 during handshake). Option D is wrong (SEQ=X+1 instead of Y).