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 04 · Networking · The whole trip · about 14 min to read

Watch: Routing: how a packet finds any house on earth
▶ VideoPlay it as a journeyTutor comes with a plan

From the wire to your accept(): sockets and the receive path

The Parcel's Journey
The Parcel's Journey · Open board

: one parcel travelling from a laptop to a server. This lesson follows the last stretch of that trip, from the server’s network card to the line of code that reads the parcel.

Before you start. A socket is the door a program holds for one network conversation, a file descriptor that read and write accept (Everything is a file descriptor). The five calls that create and open such a door, socket, bind, listen, accept and recv, are in The five calls that open a door. The two queues that hold callers before accept are in The hold line (the listen queue, and the SYN flood). The window, the amount a sender may send before it waits for a “got it”, is in The page that never arrived (TCP reliable delivery).

Lesson 35 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

  • January 1996: a machine that is busy and does nothing
  • Seven steps from the wire to your program
  • Many packets, one interrupt
  • The receive buffer: where bytes wait for recv()
  • The receive window: the shelf talks back
  • ss: two columns, two meanings
  • netem: a bad network, made on purpose
  • The interrupt, then polling: NAPI
  • Where a packet can be lost on the way in
  • The size the buffer needs
  • The experiment, as run
  • Limits of what was measured

Terms it explains: interrupt, ring buffer, receive buffer, receive window, Recv-Q, Send-Q, NAPI, softirq.

Related paper

Review Networking