How Does an HTTP Request Travel Across the Internet? A Step‑by‑Step Journey
This article explains in detail how an HTTP request moves from a user’s device through Wi‑Fi, routers, modems, ISP NAT devices, and finally reaches the application server, illustrating each OSI layer and the transformations that occur along the way.
Introduction
Typical home network topologies connect end devices to a router via Wi‑Fi (or 4G/5G to a base station), the router to a modem (optical network terminal), and then the ISP takes over to forward the request to the application server.
OSI Network Model
The simplified five‑layer OSI model is essential for understanding how an HTTP request is carried across the network.
Transport layer: TCP header contains source and destination ports.
Network layer: IP header contains source and destination IP addresses.
Data‑link layer: MAC header contains source and destination MAC addresses.
HTTP Request’s Network Journey
1. User Device → Router
HTTP requests rely on a TCP connection. The user first resolves the domain name to an IP address using DNS. The DNS lookup proceeds as follows:
Browser DNS cache (if the page was visited recently).
Operating‑system DNS cache.
Local /etc/hosts file for static mappings.
DNS query to the configured name server (from /etc/resolv.conf), which may be the ISP’s server or a public DNS such as Google 8.8.8.8 or Cloudflare 1.1.1.1.
Recursive resolution: root server → top‑level domain server → authoritative server.
After DNS resolution, the data is encapsulated layer by layer:
Transport layer: TCP header with a random source port and destination port 80 (HTTP).
Network layer: IP header with the user’s private IP as source and the server’s public IP as destination.
The user’s device uses ARP to discover the router’s MAC address, then builds a MAC frame containing the device’s MAC as source and the router’s MAC as destination.
Physical layer: the frame is transmitted over Wi‑Fi (radio waves) to the router.
2. Router → Modem (Optical Network Terminal)
At the physical layer the router decodes the Wi‑Fi signal into a data‑link frame, rewrites the source MAC to its own and the destination MAC to the modem’s, and forwards the packet.
The router does not perform NAT here because it lacks a public IP; the source IP remains the user’s private address.
3. Modem → ISP NAT Device
The modem forwards the packet to the ISP’s network. Because IPv4 public addresses are scarce, the ISP typically shares a single public IP among many customers.
The ISP’s NAT device translates the private source IP to the shared public IP, after which the packet enters the public Internet.
4. ISP NAT Device → Server
The server receives the packet, then parses it from the physical layer up through data‑link, network, transport, and finally reconstructs the original HTTP request at the application layer.
Conclusion
The article walks through the complete path of an HTTP request from the user’s terminal to the application server, showing how each OSI layer adds its own header and how the request is transformed and routed at each hop.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
System Architect Go
Programming, architecture, application development, message queues, middleware, databases, containerization, big data, image processing, machine learning, AI, personal growth.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
