Question:medium

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$, and 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$?

Show Hint

In TCP, a SYN consumes one sequence number; hence acknowledgements always increment the received SEQ by 1.
Updated On: Feb 2, 2026
  • SYN bit = 1, SEQ number = $X+1$, ACK bit = 0, ACK number = $Y$, FIN bit = 0
  • SYN bit = 0, SEQ number = $X+1$, ACK bit = 0, ACK number = $Y$, FIN bit = 1
  • SYN bit = 1, SEQ number = $Y$, ACK bit = 1, ACK number = $X+1$, FIN bit = 0
  • SYN bit = 1, SEQ number = $Y$, ACK bit = 1, ACK number = $X$, FIN bit = 0
Show Solution

The Correct Option is C

Solution and Explanation

The three-way handshake is a critical mechanism used in TCP (Transmission Control Protocol) to establish a reliable connection between two hosts. The process involves three steps:

  1. Client Sends SYN: Host P sends a TCP segment to Host Q with the SYN bit set to 1, a random sequence number (X), and the ACK bit set to 0 to initiate the connection.
  2. Server Responds with SYN-ACK: Upon receiving the SYN, Host Q responds with a TCP segment that has both SYN and ACK bits set to 1. Host Q chooses its own sequence number (Y) and sets the ACK number to X + 1 to acknowledge the receipt of Host P's SYN.
  3. Client Sends ACK: Finally, Host P sends an ACK to Host Q, acknowledging the receipt of its SYN by setting the ACK number to Y + 1.

In the given problem, Host P sends a TCP segment with the following characteristics: SYN bit = 1, SEQ number = X, and ACK bit = 0. Host Q must reply if it accepts the connection with:

  • SYN bit = 1: This signifies that Host Q is also sending a SYN request.
  • SEQ number = Y: Host Q chooses its own initial sequence number.
  • ACK bit = 1: This acknowledges Host P's SYN request.
  • ACK number = X + 1: This acknowledges the sequence number chosen by Host P.
  • FIN bit = 0: The FIN bit is used to terminate a connection, not establish one. Hence it is set to 0.

Based on the above explanation, the correct option is:

SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK number = X + 1, FIN bit = 0
Was this answer helpful?
0