Networking fundamentals

From a fetch() call to bytes on the wire, and beyond.

34 chapters in 5 parts, after the Kadé reference. Terms are collected in the glossary.

Start with 0. The Kadé scenario

Start here

  1. 0.The Kadé scenarioThe company and addresses every chapter reuses.3 min

Addressing and local delivery

  1. 1.How a request leaves your laptopOne fetch() call, followed from the browser to the wire.10 min
  2. 2.IP addresses (IPv4)What an IP address is, and the ranges with special jobs.6 min
  3. 3.Networks, hosts and CIDRWhat a network is, and how CIDR writes a whole range.7 min
  4. 4.Subnet masksHow a machine decides: same network, or the gateway?5 min
  5. 5.The default gatewayThe way off your network, and how your laptop learns it.5 min
  6. 6.Putting it togetherThree messages across two networks, every decision in order.4 min
  7. 7.MAC addressesThe second address on every frame, and what it is for.6 min
  8. 8.MAC vs IP: why we need bothTwo addresses per interface, and why neither can do both jobs.3 min
  9. 9.ARP: from IP to MACHow a device finds the MAC address behind an IP.5 min
  10. 10.NAT: sharing one public IPHow many private devices share one public address.13 min

Layers, routing and transport

  1. 11.TCP/IP & OSI modelsThe layers that give every earlier piece its place.6 min
  2. 12.How routing works (in depth)One packet, router by router, from the office to kade-api.12 min
  3. 13.ICMP: ping & tracerouteHow networks report problems, and the tools built on it.8 min
  4. 14.UDP: the fast protocolGetting data to the right program, with no guarantees.7 min
  5. 15.Anatomy of a UDP datagramA real DNS query, read field by field in 8 bytes.6 min
  6. 16.TCP: the reliable backboneWhat TCP promises, and how a connection opens and closes.7 min
  7. 17.TCP sequence & ACK numbersThe two numbers behind TCP's reliability, and how to read them.5 min
  8. 18.TCP segment, MTU, MSS & fragmentationThe TCP header, and how big each piece can be.9 min
  9. 19.TCP flow controlHow a full receiver tells the sender to slow down.5 min
  10. 20.TCP congestion controlHow TCP guesses what the network between can carry.7 min
  11. 21.Sockets, Nagle & keepalives: TCP from your codeTCP from your app's side: queues, hidden delays, idle timeouts.8 min

Application protocols

  1. 22.DNS: how resolution worksWho is asked for a name, in what order, and where it fails.10 min
  2. 23.DNS records & email securityA domain built record by record, then fake email stopped.10 min
  3. 24.HTTP & its versionsRequests, responses and headers, and what HTTP/2 and 3 change.9 min
  4. 25.TLS & HTTPSHow a connection is kept private and proven genuine.12 min
  5. 26.WebSocketsPushing live updates to an app, and running that in production.8 min
  6. 27.DHCP in depthThe real packets behind getting an address, and the attacks.9 min
  7. 28.Same-origin policy & CORSWhy browsers block cross-origin reads, and how CORS allows them.8 min
  8. 29.SSH & tunnelsRemote shells, keys, and tunnels to hosts you cannot reach.8 min

Network building blocks

  1. 30.IPv6The permanent fix for running out of addresses.9 min
  2. 31.Ports & socketsHow each packet reaches the right program on a machine.7 min
  3. 32.Hubs, switches & routersWhat each box does with a frame, and where broadcasts stop.7 min

Putting it together

  1. 33.Proxies, reverse proxies & load balancersThe boxes in the middle, and a load balancer for Kadé.16 min
  2. 34.Capstone: opening api.kade.lkOne request to api.kade.lk, every packet and every hop.8 min