All quizzesHard
Network Protocols
Preview — 3 of 10 questions
What is the correct sequence of the TCP three-way handshake when a client opens a connection to a server?
javascript
Client Server
│──── SYN ────────────────▶│ "I want to connect"
│◀─── SYN-ACK ────────────│ "OK, I'm ready"
│──── ACK ────────────────▶│ "Acknowledged, let's talk"
│ │
│══ Data transfer begins ══│AACK → SYN → SYN-ACK
BCONNECT → ACCEPT → CONFIRM
CSYN → ACK → SYN-ACK
DSYN → SYN-ACK → ACK
A multiplayer game needs to send player position updates 60 times per second. If a position update arrives late, it is useless — the player has already moved. Which protocol is correct?
javascript
TCP behavior for dropped packet:
Frame 1: pos(x=10, y=20) ✓
Frame 2: pos(x=12, y=22) ✗ (dropped)
TCP detects loss → STOPS sending Frame 3 → retransmits Frame 2
Frame 2 arrives 50ms later → Frame 3 delivered → but Frame 2 is now outdated!
Result: stuttering, head-of-line blocking
UDP behavior for dropped packet:
Frame 1: pos(x=10, y=20) ✓
Frame 2: pos(x=12, y=22) ✗ (dropped, ignored)
Frame 3: pos(x=15, y=25) ✓ (delivered immediately)
Result: one missed frame, smooth movement continuesATCP — because guaranteed delivery ensures no position updates are lost.
BHTTP/2 — because it multiplexes streams and handles retransmission automatically.
CUDP — because low latency matters more than guaranteed delivery; a dropped position packet is better than a delayed one.
DWebSocket — because WebSocket uses a dedicated protocol for real-time data.
What problem does HTTP/2 multiplexing solve that HTTP/1.1 cannot?
javascript
HTTP/1.1 (pipelining):
Connection 1: Req A ──▶ [wait for A] ──▶ Res A ──▶ Req B ──▶ Res B
Connection 2: Req C ──▶ [wait for C] ──▶ Res C
Browser opens 6 parallel connections to work around this
HTTP/2 (multiplexing on one connection):
Stream 1: Req A ─────────────────▶ Res A
Stream 2: Req B ────────────▶ Res B
Stream 3: Req C ──────────────────────▶ Res C
(all interleaved on single TCP connection)AHTTP/2 allows sending requests without TLS, making it faster than HTTPS.
BHTTP/2 allows servers to initiate connections to clients without a prior request.
CHTTP/2 compresses TCP headers at the network level to reduce bandwidth.
DHTTP/2 sends multiple requests and responses over a single TCP connection concurrently, eliminating head-of-line blocking at the application layer.
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.