The GATE Grind

GATE 2021 CS (CS2) – Question 17

Computer Networks · TCP: Flow Control, Congestion Control, Socket API · 1 mark · Multiple choice

P and Q choose initial TCP sequence numbers X and Y. P sends SYN=1,SEQ=X,ACK=0 to request a connection. Which header does Q return on accepting?

  1. SYN=1,SEQ=X+1,ACK=0,ACKNO=Y,FIN=0
  2. SYN=0,SEQ=X+1,ACK=0,ACKNO=Y,FIN=1
  3. SYN=1,SEQ=Y,ACK=1,ACKNO=X+1,FIN=0
  4. SYN=1,SEQ=Y,ACK=1,ACKNO=X,FIN=0

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) SYN=1,SEQ=Y,ACK=1,ACKNO=X+1,FIN=0

Explanation

Q sends a SYN-ACK: SYN and ACK flags are set, its own sequence starts at Y, and it acknowledges P’s SYN with X+1 because SYN consumes one sequence number. FIN remains zero because no connection close is requested. Hence C.

More TCP: Flow Control, Congestion Control, Socket API questions

All TCP: Flow Control, Congestion Control, Socket API questions →