Part 1: How the Internet Works: From Physical Fiber Optics to Global Packet Transmission
Series Overview & Learning Objectives
Welcome to Mastering Computer Networking, a 9-part engineering masterclass on network architecture, internet protocols, distributed routing, and high-availability infrastructure. Every time you enter a URL or transmit an API payload, your request traverses an extraordinary global mesh of copper, fiber-optic transoceanic cables, high-speed switching silicon, and autonomous routing topologies. In this inaugural installment, we dismantle the abstraction of the internet, dissect the packet encapsulation lifecycle across the TCP/IP model, and follow a datagram from your local network card across Tier-1 optical backbones to an origin server.
1. The Global Physical Infrastructure: Beyond the Cloud
While software developers frequently treat the "cloud" as an ethereal computing substrate, the internet is fundamentally a physical, physical-first network. Over 99% of international data traffic flows not through satellites, but through subsea fiber-optic cables resting on ocean floors, spanning millions of kilometers and carrying hundreds of terabits per second via Dense Wavelength Division Multiplexing (DWDM).
Local Edge (Last Mile)
The physical connection from your home, mobile base station, or office to your Internet Service Provider via Fiber-to-the-Home (FTTH), DOCSIS coaxial cable, or 5G NR microwave towers.
Internet Exchange Points (IXPs)
Physical colocation facilities where ISPs, Content Delivery Networks (CDNs), and large tech enterprises directly interconnect their Autonomous Systems to exchange routing traffic without paying transit fees.
Tier-1 Transit Backbones
A select tier of global telecommunication titans (such as Lumen, Telia Carrier, NTT, and AT&T) whose networks have reach to every other network on the internet purely through settlement-free peering.
2. Packet Encapsulation: The Five-Layer Journey
When your client initiates an HTTP/3 or HTTP/2 request to https://draftsbook.com, your payload cannot simply jump onto a physical wire. It must descend through the TCP/IP protocol stack, where each abstraction layer wraps the data with crucial control headers. This recursive wrapping is known as Encapsulation:
| Layer | Protocol Data Unit (PDU) | Headers Added | Primary Addressing / Role |
|---|---|---|---|
| Application (L7) | Data / Stream | HTTP, TLS, DNS, SSH | Application payloads, MIME types, cookies, session states |
| Transport (L4) | Segment (TCP) / Datagram (UDP) | TCP Header (20-60B), UDP (8B) | Source & Destination Ports (e.g. 443), Sequence & Ack numbers |
| Network / Internet (L3) | Packet / Datagram | IPv4 Header (20B), IPv6 (40B) | Source & Destination IP Addresses, TTL / Hop Limit, QoS |
| Data Link (L2) | Frame | Ethernet Header (14B) + FCS (4B) | Source & Next-Hop MAC Addresses, VLAN tag, Frame Check (CRC32) |
| Physical (L1) | Bits / Symbols | Preamble, SFD, Line Coding | Voltage levels, light pulses (photons), RF frequencies (Wi-Fi) |
ARCHITECTURAL INVARIANT: Decapsulation at Destination
When the destination machine receives the physical electrical or optical signals, its Network Interface Card (NIC) decodes the bits, validates the Frame Check Sequence (CRC32), removes the Layer 2 Ethernet header, inspects the Layer 3 IP header, and passes the TCP segment up to the operating system kernel. The kernel validates checksums, reassembles bytes according to sequence numbers, and delivers the decrypted stream to the application socket.
3. Step-by-Step: The Five Stages of an Internet Request
Let us trace the complete lifecycle of a single network packet as it travels from your workstation to an origin server on the other side of the planet:
Client Kernel & Network Address Translation (NAT)
Your workstation creates a private socket (e.g., 192.168.1.15:52431). The packet leaves your NIC and reaches your local gateway router. Because private IPv4 addresses (RFC 1918) cannot be routed across the public internet, the gateway performs Source NAT (SNAT), rewriting your packet's source address to the router's single public IP (e.g. 203.0.113.42:39210) and tracking the mapping in its stateful translation table.
ISP Edge Ingestion & Forwarding Information Base (FIB)
The packet arrives at the ISP's Broadband Remote Access Server (BRAS) or Optical Line Terminal (OLT). The ISP router queries its Forwarding Information Base (FIB)—a hardware-accelerated Ternary Content-Addressable Memory (TCAM) table—to match the destination IP against its longest prefix match and determine the outbound interface.
Border Gateway Protocol (BGP) Inter-Domain Routing
If the destination IP resides outside the ISP's Autonomous System (AS), edge border routers advertise and select paths using BGP-4. The packet hops across Autonomous Systems, traversing optical transit cross-connects at regional Internet Exchange Points (IXPs) without intermediate payload inspection.
Subsea Fiber Transmission at the Speed of Light
Over long geographical distances, the packet is modulated into infrared laser wavelengths inside silica glass. In optical fiber, light propagates at approximately 200,000 km/s (roughly two-thirds the speed of light in vacuum), meaning a transatlantic packet incurs an irreducible ~30ms of pure propagation delay. Optical repeaters spaced every 60-100 km amplify attenuated light signals using Erbium-Doped Fiber Amplifiers (EDFA).
Destination Datacenter Ingestion & Reverse Proxy
Upon arriving at the destination hyperscaler or datacenter fabric, Top-of-Rack (ToR) switches route the packet to an edge load balancer or reverse proxy (such as Envoy, Nginx, or HAProxy). The proxy handles TLS termination, extracts the HTTP headers, and proxies the payload over private micro-segmentation to the target container or application server.
4. Summary & Key Architectural Takeaways
- ✓ No Central Authority: The internet is a decentralized network of autonomous systems bound by mutual peering and standard protocol specifications (RFCs).
- ✓ Layer Independence: Application layer protocols (HTTP, SSH) do not need to understand physical transport media; IP provides a universal abstraction layer.
- ✓ Latency is Physical: While bandwidth can scale with more fiber pairs, round-trip latency is bounded by the speed of light in fiber optics and router queueing.
Related reading
How to Give Google Antigravity Direct SSH Access to Remote Servers (Proxmox & Linux)
Connect Google Antigravity directly to Proxmox and Linux servers using the Model Context Protocol (MCP), dedicated Ed25519 keys, and automated updates.
By Md. Harun-Or-Roshid
Part 10: Cloud to Fog & Edge: Architecting the Distributed Continuum
Explore the distributed computing continuum: compare centralized cloud, fog computing gateways, and real-time edge nodes for latency-critical IoT systems.
By Md. Harun-Or-Roshid
Part 10: Distributed Databases: Partitioning, Sharding, 2PC & CAP Theorem
Master distributed database architecture: horizontal sharding, consistent hashing, two-phase commit (2PC), CAP theorem trade-offs, and NewSQL engines.
By Md. Harun-Or-Roshid
Part 9: Load Balancing: Layer 4 vs Layer 7, Algorithms, Reverse Proxies & High Availability
Master high-availability load balancing, comparing Layer 4 transport vs Layer 7 application routing, consistent hashing rings, and health checks.
By Md. Harun-Or-Roshid