Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 02 · Networking · How a packet finds a house · about 18 min to read

Play it as a journeyTutor comes with a plan

The forty millisecond mystery: Nagle, delayed ACK and RST

TCP Handshake
TCP Handshake · Open board

The TCP handshake zoomed into real bytes. Every message in this lesson is one of those packets. The handshake opens the connection. This lesson is about two small rules that can stall it once it is open, and about the packet that ends it without a goodbye.

Lesson 17 of 44 in Networking

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 21 November 2015: forty milliseconds that nobody could find
  • Two small writes, one slow reply: a stall you can measure
  • Nagle’s algorithm: send one small piece, then wait for its ACK
  • Delayed ACK: the receiver waits before it replies
  • TCP_NODELAY: turn Nagle’s algorithm off for one socket
  • RST: a connection torn down with no goodbye
  • Half-open and keepalive: when a connection dies and nobody tells you
  • The stall, three ways
  • The exact rules
  • RST in detail
  • Half-open and keepalive in detail

Terms it explains: Nagle's algorithm, delayed ACK, TCP_NODELAY, RST, keepalive.

Lab

The pipe is 100 Mbps and the file is 1 MB. Why does the round-trip time decide how long it takes?

Drag How far away the server is out to the satellite, then press Play next flight and watch The clock.

Open The TCP handshake

Related paper

Review Networking