hop 1 of 32 · 5 min
What happens when you press Enter
A student in Coimbatore types leetfoundation.com and presses Enter. The page appears in about half a second. Here is everything that happened in it.
The name is not an address. The browser has a word; the network needs a number. It asks a DNS resolver, which asks a root server, then a .com server, then the domain's own server, and gets back something like 139.59.24.7.
A connection is opened. Three messages travel each way before a single byte of the page moves: SYN, SYN-ACK, ACK. On a Mumbai server that is about 40 milliseconds gone.
The request is written. GET / HTTP/1.1 with a handful of headers. Perhaps 400 bytes.
It is cut into pieces. TCP breaks it into segments. IP wraps each with a source and destination address. The link layer wraps each of those in a frame addressed to the next device on the wire, which is the home router and nothing further.
It is passed along. Fifteen or twenty routers, each looking only at the destination IP and deciding which way is closer. None of them knows the whole route. None of them needs to.
It arrives, and is put back together. The server's TCP reassembles the pieces in order, notices anything missing, and asks for it again.
The reply comes back, the same way, in reverse.
Why this is worth understanding
Every failure you will meet is one step of this list. A page that will not load at all is usually DNS. A page that is slow to start is usually the round trips. A video call that stutters is the transport layer making a choice you will meet on page nine.