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 03 · Networking · Faster, private, everywhere · about 15 min to read

Play it as a journeyTutor comes with a plan

A call without a server: WebRTC, STUN, TURN and ICE

Inside Your Building
Inside Your Building · Open board

: the private addresses inside one building and the single gate where they meet the internet. This lesson is about two people whose buildings each have such a gate, and how they still reach each other.

Before you start. From Inside your building (your router's life) you have private addresses such as 192.168.1.5, which work only inside one network, and NAT, the box at the edge that swaps a private address for the building’s one public address. From TCP vs UDP, and the 3-way handshake you have UDP, which sends single messages and does not promise they arrive. From How a parcel finds any house on earth you have the packet, with a source and a destination address. From How the web outgrew the phone call you have the idea that something built on UDP must do its own checking, which is what this lesson’s call does. Nothing else is assumed.

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

  • The video call that cost a fortune in bandwidth
  • Why the phones cannot simply call each other: NAT
  • STUN: asking a server outside what address it sees
  • A candidate: one address someone might reach you at
  • Sending at the same moment opens both gates
  • TURN: a relay for the cases where this fails
  • ICE: trying every pair and keeping the best
  • A real STUN request, byte by byte
  • Priorities: how ICE sorts the pairs
  • A model of when the direct path works
  • Edge cases and trade-offs

Terms it explains: peer to peer, WebRTC, STUN, candidate, symmetric, TURN, ICE.

Review Networking