Log inStart free
LESSON 33.21 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

TCP: handshake, flow and congestion control

Watch one chat request cross a TCP connection, segment by segment.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 33.21 · GATEWAY LINKHANDSHAKE 50 MS
01
Stage 1 of 6 · Handshake
SYN, SYN-ACK, ACK: the three-way handshake opens the TCP connection. Data waits 1 round trip, 50 ms.
Explain it simply

Before any data moves, the client and the gateway trade three short messages. Each side picks a starting sequence number, a counter for its bytes. That costs one round trip before the first byte of the request. This client is near the gateway: a round trip is 50 milliseconds, not 80 as in lessons 33.02 and 33.23.

Three arrows cross between the client lane and the gateway lane: SYN, SYN-ACK and ACK. The first data leaves at 50 ms.

segmentsACKscwnd, rwnd (dashed), ssthresh (dotted)lossRTO wait, dropped datagram
clientgatewayTCP0 ms100 ms200 ms300 ms400 ms500 ms600 ms700 msthree-way handshakeSYNseq 0SYN-ACKseq 0 · ack 1ACKack 1data starts after 1 RTT = 50 msclientgatewayTCP0 ms100 ms200 ms300 ms400 ms500 ms600 ms700 msthree-way handshakeSYNseq 0SYN-ACKseq 0 · ack 1ACKack 1data starts after 1 RTT = 50 ms
Toy: R25's 2,432-byte request, 100-byte segments, 50 ms round trip
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
tdata=1 RTTt_{\text{data}} = 1\ \sy{rtt}{param}{\text{RTT}}
tdata=1×50 ms=50 mst_{\text{data}} = 1 \times 50\,\text{ms} = 50\,\text{ms}

Data can start after one round trip.

Common mix-ups

MYTHUDP is faster, so it is better for every request.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01If segment 25, the last one, is lost, does TCP recover by fast retransmit or by timeout?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.