Ever wondered whatβs happening behind the scenes when you type something like example.com/phone into your browser and hit Enter? Letβs break it down:
πΉ Step 1: Entering the URL
Bob types a URL into the browser. A URL typically has four parts:
-
Scheme:
http://β tells the browser to use HTTP protocol -
Domain:
example.comβ identifies the server -
Path:
/product/electricβ specifies the resource location -
Resource:
phoneβ the exact item Bob wants to view
πΉ Step 2: DNS Lookup
The browser needs the IP address of the domain. It searches through:
- Browser cache
- OS cache
- Local network cache
- ISP cache
If the IP address isn't found, a recursive DNS lookup is triggered (weβll dive deeper into this in another post).
πΉ Step 3: Establishing a TCP Connection
With the IP address in hand, the browser sets up a TCP connection to the server.
πΉ Step 4: Sending the HTTP Request
The browser sends a structured HTTP request asking for the /phone resource under the domain example.com.
πΉ Step 5: Receiving the HTTP Response
The server processes the request and sends back an HTTP response.
If successful (status code 200 OK), it includes the requested HTML content like:
Hello world
πΉ Step 6: Browser Renders the Page
Finally, the browser takes the HTML and renders the page so Bob can see and interact with it.
π Key takeaway:
Typing a URL triggers a chain of networking and server events β from DNS lookups to TCP handshakes to rendering web pages β all in a blink of an eye!
Top comments (0)