AI InterviewSearch…Search problems, topics, or pages…Ctrl KGet started
Easynetworkstcp

~45s

The three-way handshake

What is the correct order of segments in the TCP three-way handshake?

Show the answer and the worked solution

Correct answer: C.

SYN, SYN-ACK, ACK

Worked solution

  1. The client opens by sending a SYN carrying its initial sequence number.
  2. The server replies with a single segment that both acknowledges the client's SYN and carries its own SYN — the SYN-ACK.
  3. The client acknowledges the server's SYN with an ACK, and the connection is open: SYN, SYN-ACK, ACK.

Answer: SYN, SYN-ACK, ACK.

The idea

Each side must announce a sequence number and have it acknowledged, which would take four segments; combining the server's SYN with its ACK is what reduces it to three.

Shortcut. Nothing can be acknowledged before it is sent, so SYN must come first and a bare ACK last, and only SYN, SYN-ACK, ACK fits.

Common trap. "SYN, ACK, SYN-ACK" starts correctly, but the server does not acknowledge first and send its own SYN separately; one SYN-ACK does both.

OS, DBMS & Networks

32 of 40

Level

Easy

Target time

~45s

The three-way handshake — Aptitude Question

The three-way handshake: What is the correct order of segments in the TCP three-way handshake? Answer and worked solution on CodeKairo.

Question

What is the correct order of segments in the TCP three-way handshake?

Options

  1. ACK, SYN, SYN-ACK
  2. SYN, ACK, SYN-ACK
  3. SYN, SYN-ACK, ACK
  4. SYN-ACK, SYN, ACK
Show the answer and the worked solution

Correct answer: C. SYN, SYN-ACK, ACK

Worked solution

  1. The client opens by sending a SYN carrying its initial sequence number.
  2. The server replies with a single segment that both acknowledges the client's SYN and carries its own SYN — the SYN-ACK.
  3. The client acknowledges the server's SYN with an ACK, and the connection is open: SYN, SYN-ACK, ACK.

Answer: SYN, SYN-ACK, ACK.

The idea

Each side must announce a sequence number and have it acknowledged, which would take four segments; combining the server's SYN with its ACK is what reduces it to three.

Shortcut. Nothing can be acknowledged before it is sent, so SYN must come first and a bare ACK last, and only SYN, SYN-ACK, ACK fits.

Common trap. "SYN, ACK, SYN-ACK" starts correctly, but the server does not acknowledge first and send its own SYN separately; one SYN-ACK does both.

All OS, DBMS & Networks questions · placement mock tests