How Does a URL Turn Into a Web Page? Deep Dive into HTTP, TCP/IP, and Network Layers
From entering a URL to rendering a page, this article walks through the complete HTTP request lifecycle, detailing DNS resolution, TCP/IP transport, protocol layering, encapsulation, and the structure of HTTP messages, providing a clear, step‑by‑step explanation of how data travels across the network.
From a Classic Interview Question
From entering a URL to page rendering, the process includes four main steps: domain name resolution, HTTP request transmission, server response construction, and browser rendering.
Layered Model
An HTTP request passes through four layers, each with its own protocols.
Protocols are agreements that each layer follows to process data.
Application layer: HTTP, FTP, SMTP, SNMP
Transport layer: TCP, UDP
Network layer: ICMP, IGMP
Link layer: ARP, RARP
Encapsulation and Decapsulation
Data is wrapped with protocol headers at each layer when sending (encapsulation) and headers are stripped at each layer when receiving (decapsulation).
Encapsulation
When the source sends an HTTP message, it is transmitted as a data stream over an established TCP connection; TCP splits the stream into segments, adds its header, which are then placed into IP packets, and finally into Ethernet frames.
Decapsulation
The terminal receives an Ethernet frame, removes each layer's header from bottom to top, and finally delivers the HTTP message to the application.
HTTP
HTTP is an application‑layer protocol that packages user actions and server responses into HTTP messages.
Message Structure
HTTP request format:
<method> <request‑url> <version> // start line
<headers> // header fields
<body> // optional entityHTTP response format:
<version> <status> <reason‑phrase> // start line
<headers>
<body>Transport Layer – TCP
HTTP runs over TCP, which provides reliable data transfer using sequence numbers, acknowledgments, flags (SYN, ACK, FIN, etc.), checksums, and flow control.
Network Layer – IP
IP routes packets based on destination IP, handling fragmentation, TTL, and includes fields such as version, header length, total length, identification, flags, fragment offset, and checksum.
Routing
IP uses a routing table to forward packets; if no specific route matches, the default route is used.
ARP
Address Resolution Protocol maps IP addresses to MAC addresses, using broadcast requests and unicast replies.
Ethernet Frame
An Ethernet frame contains a preamble, start‑of‑frame delimiter, destination MAC, source MAC, type field, payload (e.g., IP packet), and frame‑check sequence.
Original author: nero Source: https://www.neroht.com/article-detail/18
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.
