The OSI Model vs TCP/IP
The OSI model (7 layers) is a conceptual framework. The TCP/IP model (4 layers) is what the internet actually uses. Each layer encapsulates data from the layer above.
A visual guide to the invisible infrastructure that connects the modern world - from electrons on a wire to the global routing fabric across continents.
Every interaction on the internet relies on a stack of protocols built over decades. The diagrams below show how data is structured, layered, and routed across networks.
The OSI model (7 layers) is a conceptual framework. The TCP/IP model (4 layers) is what the internet actually uses. Each layer encapsulates data from the layer above.
Data is broken into packets (layer 3) and wrapped in frames (layer 2). Each layer adds its own header - this is encapsulation. The animated visualization below shows packets traversing OSI layers through a router.
Switches (layer 2) forward by MAC address. Routers (layer 3) forward by IP using Dijkstra's shortest-path algorithm (OSPF, IS-IS) or path-vector (BGP). Select source and destination below to trace a packet through the network.
TCP provides reliable, connection-oriented delivery using sequence numbers, acknowledgements, and a three-way handshake (SYN, SYN-ACK, ACK). Sliding window flow control and AIMD congestion control manage throughput.
Well-known: HTTP(80), HTTPS(443), SSH(22), DNS(53)
Registered: assigned by IANA for specific services
Ephemeral: dynamically assigned to client connections
A socket is identified by the tuple (protocol, local IP, local port, remote IP, remote port). The OS demultiplexes incoming traffic using the destination port number.
DNS translates names to IPs. IP addressing provides unique identifiers. BGP routes traffic between the 70,000+ autonomous systems that make up the internet.
The web (invented at CERN, 1989) is built on URLs, HTTP, and HTML. A URL decomposes as: scheme://host[:port][/path][?query][#fragment].
The DNS is a hierarchical database. Queries flow from stub resolver through recursive resolvers, root servers, TLD servers, and authoritative nameservers. The interactive simulator below traces each step.
Enter a domain and click Resolve to trace the DNS lookup path
Resolution complete: example.com → 93.184.216.34
Cached by recursive resolver for 300s TTL
32-bit address. ~4.3B unique addresses. Exhausted - NAT mitigates. RFC 1918 private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
128-bit address. 340 undecillion addresses. No NAT needed. Native dual-stack deployment growing. Format: 2001:db8::/32.
BGP is the glue that holds the internet together. Over 70,000 ASes exchange reachability info via path-vector routing. The AS_PATH attribute prevents loops and enables traffic engineering.
Loading a website triggers a sequence of DNS lookups, TCP handshakes, TLS negotiations, and HTTP exchanges. Each stage is shown below.
HTTP is a request-response protocol. Each request has a method (GET, POST, PUT, etc.), URI, version, headers, and optional body. Below is an interactive builder to construct raw HTTP requests.
GET /v1/users HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer <token>
User-Agent: Mozilla/5.0 (compatible; NetworksGuide/1.0)
TLS provides confidentiality (encryption), integrity (no tampering), and authentication (server identity via certificates). TLS 1.3 reduced the handshake from 2-RTT to 1-RTT using ECDHE key exchange. Step through each phase below.
Client sends supported TLS version (1.3), cipher suites (TLS_AES_256_GCM_SHA384), key share (X25519 public key), and random nonce.
AES-256-GCM: bulk encryption
ChaCha20-Poly1305: mobile-optimized
Key: same for encrypt/decrypt
RSA-2048 / ECDSA P-256
Ed25519: modern & fast
Key: public + private pair
SHA-256: 256-bit digest
SHA-3: Keccak standard
BLAKE2b: high performance
TLS 1.3 combines all three: ECDHE (asymmetric) for key exchange, HKDF (hash) for key derivation, AES-256-GCM (symmetric) for bulk encryption.
The complete sequence from URL entry to pixels on screen, with estimated round-trip costs.
Total new-connection latency: 3-4 RTTs + processing. HTTP/2 reuse eliminates subsequent connection overhead. HTTP/3 (QUIC) further reduces to 0-RTT for returning visitors.
Content is cached at thousands of edge locations worldwide. Traffic is shaped by peering agreements. Applications run at the network edge for minimal latency.
CDNs use geographically distributed edge servers and anycast routing to serve content from the nearest POP. Cache hits skip the origin entirely, delivering sub-20ms response times globally.
Average cache hit ratio for static assets
Latency reduction (RTT) for global users
DDoS mitigation at the edge
Edge computing runs application logic directly at CDN POPs. Instead of all requests traveling to a central data center, code executes close to the user. Platforms: Cloudflare Workers, Fastly Compute@Edge, AWS Lambda@Edge. Use cases: real-time personalization, A/B testing, image optimization, bot detection, SSR at the edge.
As much logic as possible runs at the CDN edge; the origin is treated as a fallback database. This pattern enables sub-50ms time-to-first-byte globally.
The internet is a web of interconnection agreements. Transit (paying an upstream for full internet access), Peering (direct exchange, usually at an IXP), and Tier 1 networks (no transit providers) form the hierarchy. The world's largest IXPs: DE-CIX Frankfurt (10Tbps+), AMS-IX Amsterdam, LINX London.
Network pays upstream ISP for full internet reachability. Tier 1 networks (AT&T, Lumen, NTT) have no transit - they reach everyone via peering.
Two networks exchange traffic directly at an IXP. Settlement-free if balanced; paid peering if traffic ratio is skewed.
Submarine cable systems
1.4M km fiber
ASNs in global table
IPv4 + IPv6 prefixes
Peak IXP throughput
DE-CIX Frankfurt
Global edge POP count
Cloudflare alone
Traffic from CDN edge
Up from 20% in 2015
Traffic encrypted
HTTPS: 3% in 2014
Internet users
~66% of population
Max Earth RTT
Fiber: 2/3 light speed
HTTP/2 introduced multiplexed streams and HPACK compression. HTTP/3 replaces TCP with QUIC (over UDP), eliminating head-of-line blocking and providing 0-RTT reconnect. Modern security follows Zero Trust Architecture: never trust, always verify, with mTLS and service meshes.
How Networks Work - A visual technical reference on internet infrastructure.