https://Protocolwww.Subdomaingoogle.comDomain/searchPath?q=helloQueryUser Enters URL
The journey begins when you type a website address (URL) into your browser's address bar and press Enter. The browser now needs to figure out how to reach that website.
What is a URL?
https://is the protocolwww.is a subdomaingoogle.comis the domain/searchis the path?q=hellois the query
Check Cache
Before making any network requests, the browser checks if it already knows the IP address for this domain. It searches through multiple cache layers.
Cache Hierarchy
- Browser Cache: Recently visited sites stored in browser memory
- OS Cache: Operating system's DNS resolver cache
- Router Cache: Your home router's cached DNS entries
- ISP Cache: Your Internet Service Provider's DNS cache
DNS Resolution
DNS (Domain Name System) translates human-readable domain names into IP addresses that computers use to identify each other on the network.
DNS Hierarchy
- Root Server: Knows where to find TLD servers (.com, .org, etc.)
- TLD Server: Knows which authoritative servers handle specific domains
- Authoritative NS: Has the actual IP address for the domain
TCP 3-Way Handshake
Before any data can be exchanged, a reliable connection must be established using the TCP (Transmission Control Protocol) three-way handshake.
The Three-Way Handshake
- SYN: Client sends a synchronization request
- SYN-ACK: Server acknowledges and sends its own sync
- ACK: Client acknowledges, connection is now established
TLS Handshake
For HTTPS connections, a TLS (Transport Layer Security) handshake establishes an encrypted communication channel to protect your data.
TLS Handshake Steps
- Client Hello: Browser sends supported encryption methods
- Server Hello: Server sends its certificate and chosen encryption
- Key Exchange: Both parties establish shared encryption keys
- Secure Channel: All further communication is encrypted
HTTP Request
Your browser sends an HTTP GET request to the server, asking for the webpage content. The request includes headers with information about your browser and what content you can accept.
HTTP Request Components
- Method: GET (retrieve), POST (submit), etc.
- Path: The specific resource being requested
- Headers: Metadata about the request
- Body: Optional data (mainly for POST requests)
Server Response
The server processes your request and sends back a response containing the HTML document, along with CSS stylesheets and JavaScript files needed to render the page.
Response Contents
- Status Code: 200 OK, 404 Not Found, etc.
- HTML: The structure and content of the page
- CSS: Styling rules for visual presentation
- JavaScript: Code for interactivity and dynamic behavior
Browser Rendering
The browser processes all received files to construct and display the final webpage. This involves parsing, building tree structures, and painting pixels on screen.
Rendering Pipeline
- DOM Tree: HTML is parsed into a Document Object Model
- CSSOM Tree: CSS is parsed into a style object model
- JavaScript: a script can change the DOM and CSSOM
- Render Tree: DOM + CSSOM combined for visible elements
- Layout: Calculate exact position and size of elements
- Paint: Fill in pixels on the screen
←→ steps · Space auto play