Parse the URL
The browser splits what you typed into parts. The scheme says which protocol to use, the host says which machine, and the path says which thing on that machine.
You typed a few letters and a page showed up in under a second. In between, your computer talked to half a dozen machines across the planet. Here's the whole trip, one step at a time.
The browser splits what you typed into parts. The scheme says which protocol to use, the host says which machine, and the path says which thing on that machine.
Computers don't route by names, they route by IP addresses. So the browser asks: what's the address for aryans.codes? It checks its own cache, then the OS cache, then asks a recursive resolver (usually your ISP, or 1.1.1.1 / 8.8.8.8).
If the resolver doesn't know, it walks the tree: root servers point to the .codes servers, which point to the domain's own nameservers, which finally give the answer.
. (root)
└─ codes. "ask these TLD servers"
└─ aryans.codes. "ask these nameservers"
└─ A record → 185.199.108.153
assets.aryans.codes are just more records in the same zone. Often they're a CNAME, which is a pointer to another name.With an IP in hand, the browser opens a TCP connection on port 443. This is the famous three-way handshake. It makes sure both sides are listening and agree on sequence numbers, so lost packets can be resent and arrive in order.
you ──SYN──────▶ server you ◀──SYN-ACK── server you ──ACK──────▶ server connected
That padlock means everything from here on is encrypted. In TLS 1.3 the browser sends supported ciphers and a key share. The server answers with its own key share and a certificate proving it really owns the domain, signed by an authority your browser already trusts.
Both sides combine the key shares into the same secret without ever sending it. Anyone sniffing the wifi just sees noise.
ClientHello + key share ─▶
◀─ ServerHello + key share + certificate
both derive the same session key 🔒
Finally, the real request. It's surprisingly plain text (well, binary-framed in HTTP/2, but same idea).
HTTP/2 200 content-type: text/html; charset=utf-8 cache-control: max-age=600 content-length: 9241 <!doctype html><html>...
The browser reads the HTML top to bottom and builds a tree of elements called the DOM. When it hits a stylesheet, script, image, or font, it fires off more requests, often to an assets subdomain or a CDN, which repeats steps 2-5 for that host.
html
├─ head
│ ├─ title
│ └─ link rel=stylesheet → fetch!
└─ body
├─ h1
└─ img src=assets.aryans.codes/… → fetch!
DOM + CSS rules become a render tree. The browser calculates where every box goes (layout), fills in pixels (paint), and stacks layers together on the GPU (composite). At 60 frames per second it has about 16 ms to do this whenever something changes.
transform and opacity is smooth, while animating width can stutter. The first two skip layout and paint.