Question:

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: Dec 29, 2025
  • 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
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Recall TCP three-way handshake.
The handshake consists of:
1) $P \rightarrow Q$: SYN with SEQ = $X$
2) $Q \rightarrow P$: SYN-ACK with SEQ = $Y$ and ACK = $X+1$
3) $P \rightarrow Q$: ACK with SEQ = $X+1$ and ACK = $Y+1$

Step 2: Identify the response sent by $Q$.
When $Q$ accepts the connection request, it sends a SYN-ACK segment. This segment must have SYN = 1, ACK = 1, SEQ = $Y$, and ACK number = $X+1$.

Step 3: Match with the options.
Option (C) exactly matches these fields and correctly represents the TCP header sent by $Q$ to $P$.

Step 4: Conclusion.
Therefore, the correct option is (C).

Was this answer helpful?
0
0

Questions Asked in GATE CS exam

View More Questions