GATE CS 2024 Set 1 — Question 29

MSQ+1 / -0EasyTCP HandshakeTransport LayerComputer Networks

Computer Networks → Transport Layer → TCP Handshake

Last updated

Question

TCP client PP successfully establishes a connection to TCP server QQ. Let NPN_P denote the sequence number in the SYN sent from PP to QQ. Let NQN_Q denote the acknowledgement number in the SYN ACK from QQ to PP. Which of the following statements is/are CORRECT?
A.
The sequence number NPN_P is chosen randomly by PP
B.
The sequence number NPN_P is always 0 for a new connection
C.
The acknowledgement number NQN_Q is equal to NPN_P
D.
The acknowledgement number NQN_Q is equal to NP+1N_P + 1

Correct answer

(A) The sequence number N_P is chosen randomly by P; (D) The acknowledgement number N_Q is equal to N_P + 1

Solution

In the TCP three-way handshake process:
1.Step 1 (SYN): The client PP sends a SYN segment to the server QQ to initiate a connection. This segment contains an Initial Sequence Number (ISN), denoted as NPN_P. According to TCP standards (RFC 793, RFC 6528), the ISN is chosen using a pseudo-random generator to ensure uniqueness and security against sequence number prediction attacks. Therefore, statement (A) is correct.
2.Step 2 (SYN ACK): The server QQ responds with a SYN ACK segment. This segment includes its own ISN and an acknowledgement number. The acknowledgement number confirms the receipt of the client's SYN. Since the SYN flag logically consumes one sequence number, the acknowledgement number is set to the client's sequence number plus one (NP+1N_P + 1). The question defines NQN_Q as this acknowledgement number. Thus, NQ=NP+1N_Q = N_P + 1, making statement (D) correct.
Statement (B) is incorrect because the ISN is randomized, not fixed at 0. Statement (C) is incorrect because the acknowledgement number must be NP+1N_P + 1 to account for the SYN flag.

More questions on Transport Layer

Practice GATE CS PYQs with adaptive difficulty

Timed practice, skill tracking, and AI explanations — free to start.

Start practicing free