GATE CS 2024 Set 1 | Question 29

MSQ · 1 mark

TCP client P successfully establishes a connection to TCP server Q. Let \(N_{P}\) denote the sequence number in the SYN sent from P to Q. Let \(N_{Q}\) denote the acknowledgement number in the SYN ACK from Q to P. Which of the following statements is/are CORRECT?

  1. Option A: The sequence number \(N_{P}\) is chosen randomly by P (correct)
  2. Option B: The sequence number \(N_{P}\) is always 0 for a new connection
  3. Option C: The acknowledgement number \(N_{Q}\) is equal to \(N_{P}\)
  4. Option D: The acknowledgement number \(N_{Q}\) is equal to \(N_{P} + 1\) (correct)

Answer

(A), (D)

Explanation

  • A: true. In the three-way handshake each side picks its initial sequence number (pseudo-)randomly. This stops stray segments of an old connection between the same ports from being accepted, and makes it hard for an attacker to guess the numbers and forge segments.
  • B: false. Starting every connection at 0 is exactly what the random choice avoids; packet analysers that show 0 are displaying relative numbers.
  • C and D: a SYN uses up one sequence number even though it carries no data. The acknowledgement number in the SYN ACK is the next sequence number Q expects from P, so \(N_{Q} = N_{P} + 1\). C is false and D is true.

Answer: A, D