How HTTP Requests Travel Through Every Network Layer from URL to Server
This article explains the complete network communication process for HTTP, covering the OSI and TCP/IP models, DNS lookup, protocol stack handling, TCP handshakes, IP routing, MAC addressing, switches, routers, Ethernet transmission, and server-side packet de‑encapsulation.
1. Network Model Overview
OSI (Open System Interconnection) was defined first as a model, then protocols and standards followed; whereas TCP/IP came after protocols and applications, referencing the OSI model.
OSI is a theoretical model, while TCP/IP is widely used and has become the de facto networking standard.
2. HTTP Network Communication Process
Example: Simple Network Topology Model
Detailed Explanation: Communication Process from URL Input to Page Display
Client (Sender Packet Assembly)
1) HTTP
Browser parses the URL (protocol, domain, resource path).
Generates an HTTP request message.
2) DNS (Real Address Query)
Query DNS server for the IP address corresponding to the domain name.
Higher‑level domain components appear on the right side of the domain name.
3) Protocol Stack (Guidance Helper)
After obtaining the IP, the OS kernel’s protocol stack handles the subsequent HTTP transmission.
4) TCP (Reliable Transmission)
Header contains source and destination port numbers, sequence number, acknowledgment number, etc.
TCP performs a three‑way handshake before transmitting data to ensure both sides can send and receive.
TCP packet = TCP header + HTTP message.
5) IP (Remote Positioning)
Encapsulates data into a network packet for transmission.
IP packet = IP header + TCP header + HTTP message.
6) MAC (Two‑Point Transmission)
Adds a MAC header (source and destination MAC addresses) – the Ethernet header.
MAC address uniquely identifies a device; ARP is used to find the next router’s MAC address.
Resulting packet: MAC header + IP header + TCP header + HTTP message.
7) Network Card (Outbound)
Converts digital information (IP packet) into electrical signals for transmission over the cable.
Controlled by the network‑card driver.
The card checks the destination MAC address; if it does not match, the packet is discarded.
8) Switch (Forwarding)
Forwards the network packet unchanged to its destination.
Operates at the MAC layer (Layer 2 data link).
Receives electrical signals, converts them to digital information.
Layer‑2 switch has its own MAC address; ports do not have MAC addresses (Layer‑3 switches do).
Uses a MAC address table to map device MAC addresses to switch ports.
9) Router (Outbound)
Similar to a switch, it looks up a forwarding table to determine the next hop.
The MAC header’s destination MAC address is the router’s port MAC address.
Router removes the MAC header, then forwards the packet based on the IP header.
Before sending, the router looks up the routing table and uses ARP to resolve the next hop’s MAC address.
Finally, the packet is converted back to electrical signals and sent out.
Ethernet (Transmission)
During network packet transmission across subnets, the source and destination IP addresses remain constant, while the MAC address changes to enable Ethernet‑level delivery.
Server Side (Receiver Unpacking)
1) Router (Ingress)
2) Switch (Internal)
3) Server (Endpoint)
The server strips each header layer until the TCP port number matches the intended HTTP process.
The HTTP process wraps the resource in an HTTP response message, then adds TCP, IP, and MAC headers before sending it out through the network card.
The client receives the HTTP response, passes it to the browser for rendering.
When the client finishes, it initiates a TCP four‑way handshake to close the connection.
Example: Server and Client Interaction
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.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
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.
