The Internet

Every git push you have made this year crossed the planet in packets, addressed to a name resolved by DNS, routed by machines that know nothing about each other. This is the reference for how that works — and the TCP/UDP trade the exam asks about every single year.

Packets, not streams

Nothing crosses the internet whole. Data is chopped into packets — typically up to about 1,500 bytes each — and every packet carries a header: source address, destination address, sequence number, checksum. Packets from the same file may take different physical routes; the receiver reassembles by sequence number, and a lost packet is resent individually, not the whole file.

laptop → campus router → ISP → (several unknown hops) → github.com
  packet 1 ──────────────────────→ arrives
  packet 2 ──→ lost → resent, new route → arrives
  packet 3 ───────────────────────────────→ arrives
  receiver reassembles 1, 2, 3 by sequence number

The design's superpower is that no single route is sacred — "the internet routes around damage" because every router makes only local decisions about the next hop. There is no map, no master, and no single point of failure. That decentralization is also the exam's favorite property of the internet's design.

TCP vs UDP — the reliability trade

TCPUDP
PromiseAll packets arrive, in order, or the transfer failsBest effort; loss and disorder tolerated
MechanismHandshake, acknowledgments, retransmission, sequencingFire and forget
CostLatency — waiting for receiptsNo receipts, no order, no retry
Your lifegit push, web pages, downloads, emailGame packets, voice, video calls

The one-sentence exam answer: games prefer UDP because a late packet is worthless (the state has moved on) while downloads prefer TCP because losing one byte of the file corrupts it. Your own games run locally for now, but the card jam's hypothetical leaderboard (9.8) is exactly the moment these choices become real.

DNS — names to numbers

Machines route by IP address (like 140.82.112.3); humans type github.com. DNS is the lookup system that converts — and its hierarchy is worth being able to sketch:

  1. Your machine checks its own cache — hit? done in microseconds
  2. It asks the configured resolver (campus, home router, or public DNS) — which also caches
  3. The resolver walks the hierarchy if needed: root servers (know the TLDs) → .com servers (know who runs the domain) → github.com's servers (know the actual records)
  4. Every level caches its answer for a time-to-live, which is why the SECOND lookup is always faster than the first

Caching exists at every level because lookup latency is real — and cache invalidation is why "turn it off and on again" is actual engineering: you are flushing the machine's memory of a lie.

Routing and latency

traceroute github.com shows every hop and its round-trip time. Big jumps usually mark ISP boundaries or ocean crossings. Two facts to carry: latency is physics (nothing beats the speed of light across an ocean), and bandwidth is not latency — a fat pipe still takes the same 80 ms to start answering. A laggy game and a slow download are different diseases.

What the internet is, one paragraph (memorize the shape)

The internet is a network of networks, connected by routers, using shared standards (the TCP/IP family) so that any machine can talk to any other without central coordination. The web is NOT the internet — the web (HTTP pages) is one service that rides on it, like email, game traffic, and git itself. Encryption (the next page) is also a rider: TLS wraps the packets, it does not change the routing.

The exam-question shapes

Where you meet networks this year

← Binary & Hex All docs Encryption →