This chapter explains how data moves across the Internet: layers, packets, routing, NAT, and how a CDN like Cloudflare accelerates and protects traffic.
Chip Architect Note: Packet processing hot paths reward predictable, cache-friendly code. Edge systems favor small, branch-stable parsers and minimized copy operations.
OSI vs TCP/IP models
OSI (7 layers) is a conceptual model; TCP/IP (4–5 layers) is closer to the Internet’s reality. Understand both to map protocols to layers.
Packets, frames, and MTU
- Frame: Link-layer unit (e.g., Ethernet frame).
- Packet: Network-layer unit (e.g., IP packet).
- Segment: Transport-layer unit (e.g., TCP segment).
- MTU: Maximum Transmission Unit. Large payloads may fragment or use Path MTU Discovery.
Routing and BGP
Routers forward packets based on IP prefixes. BGP (Border Gateway Protocol) exchanges reachability between autonomous systems. Cloudflare peers globally to shorten paths and avoid congestion.
CDN acceleration and edge
- Caching static assets near users reduces latency and origin load.
- Edge compute (Workers) runs logic close to users for faster TTFB.
- Anycast routing lets one IP be reachable via the nearest PoP.