What happens when... typing google.com into the internet ?
Here is the OS + network + application communication when make a request by typing “google.com”
1. You press keys
-
When you type “g”, “o”, “o”… your keyboard sends electrical or touch signals to the computer.
-
The OS detects each keypress, and the browser shows it in the address bar while suggesting completions like google.com.
-
When you hit Enter, another signal is sent — the OS delivers a key event to the browser.
2. The browser parses the input
-
The browser checks if what you typed is a valid URL or just a search term.
-
Seeing google.com, it treats it as a domain name.
-
If https:// isn’t typed, it checks if the site is on the HSTS list (always use HTTPS). For Google, it is — so the browser prepares an HTTPS request.
3. DNS lookup
-
The browser looks in its cache to see if it already knows the IP address of google.com.
-
If not, it asks the OS, which may check:
-
The hosts file
-
The local DNS cache
-
Your configured DNS server (often your router or ISP)
-
-
If necessary, DNS servers on the internet are queried until the IP is found
4. ARP (finding the next hop)
-
Before sending the DNS query or HTTP request, your computer must know the MAC address of the next device (router/gateway).
-
If it doesn’t, it sends an ARP request on the network asking, “Who has this IP?” and receives a reply with the MAC address.
5. TCP connection setup
-
The browser opens a socket to the server’s IP on port 443 (HTTPS).
-
A TCP three-way handshake happens:
-
Client → Server: SYN
-
Server → Client: SYN + ACK
-
Client → Server: ACK
-
-
This establishes a reliable connection.
6. TLS handshake
- To create an encrypted connection:
-
Browser sends a ClientHello with supported ciphers.
-
Server replies with a ServerHello and its certificate (with its public key).
-
Browser verifies the certificate, then sends a random secret encrypted with the server’s public key.
-
Both sides use this secret to create a shared session key.
- All communication is now encrypted.
7. HTTP request
7.1. Request
GET / HTTP/1.1
Host: google.com
7.2. Response
200 OK
[headers]
[HTML content]
7.3. Browser rendering
-
HTML parser builds the DOM tree.
-
CSS files are fetched and parsed into a Style Tree.
-
JavaScript is executed (which can modify the DOM).
-
The browser constructs a Render Tree → calculates layout → paints pixels to the screen.
-
The GPU helps compose and display the final image.
7.4. After load
-
JavaScript continues running (for example, showing animations or handling user input).
-
Additional network requests (images, CSS, JS files) are made as needed.
-
The page becomes interactive, and you can start typing your search.
8. Dive deep
8.1. What is different from MAC, IPv4, IPv6
8.1.1. IP = Global routing
-
Routers use IP addresses to move data between networks.
-
Example: from your home network → your ISP → Google’s data center.
8.1.2. MAC = Local delivery
-
On each local network (like your home Wi-Fi), devices don’t understand IP directly.
-
They use MAC addresses to actually deliver packets from one network card to another.
8.1.3. ARP Protocol (IP -> Mac)
- The OS uses ARP (Address Resolution Protocol) to map IP → MAC before sending data.
8.1.4. IPv4, IPv6, A and AAAA records
When you access https://google.com:
- Your computer asks DNS for the IP:
-
A record → IPv4 address
-
AAAA record → IPv6 address
-
If your network supports IPv6, your OS/browser prefers IPv6 (modern default).
-
If not, it falls back to IPv4.
➡️ Result: both IPv4 and IPv6 users reach the same website, just over different network paths.
Notes: If you want to use IPv6, you need to config the router to allow IPv6.
8.2. IP and MAC Address
-
IP: find the location and address.
-
MAC: where you transfer data, by binary to a router.