Question

Consider the three-way handshake mechanism followed during TCP connection establishment between hosts PP and QQ. Let XX and YY be two random 32-bit starting sequence numbers chosen by PP and QQ respectively. Suppose PP sends a TCP connection request message to QQ with a TCP segment having SYN bit = 1, SEQ number = XX, and ACK bit = 0. Suppose QQ accepts the connection request. Which one of the following choices represents the information present in the TCP segment header that is sent by QQ to PP?

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2021 answer key

Solution

Follow the sequence numbers and control flags used in the second message (SYN-ACK) of the TCP three-way handshake.

In TCP connection establishment:

  1. Host PP sends a SYN segment: SYN=1,ACK=0,SEQ=X\text{SYN} = 1, \text{ACK} = 0, \text{SEQ} = X.
  2. Host QQ responds with a SYN + ACK segment: it acknowledges PP's SYN by setting ACK=1\text{ACK} = 1 and ACK number=X+1\text{ACK number} = X + 1 (since the SYN consumes one sequence number). At the same time, QQ initiates its own sequence stream by setting SYN=1\text{SYN} = 1 with its initial sequence number SEQ=Y\text{SEQ} = Y. The connection is not terminating, so FIN=0\text{FIN} = 0.

Thus, the segment sent by QQ has SYN bit=1\text{SYN bit} = 1, SEQ number=Y\text{SEQ number} = Y, ACK bit=1\text{ACK bit} = 1, ACK number=X+1\text{ACK number} = X + 1, and FIN bit=0\text{FIN bit} = 0. This matches option C.

Final answer

C

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2021 Computer Science and Information Technology - Session 2 (CS2)
Question
17 of 65, printed as CS Q.7
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.