What Happens when You Type “www.google.com”
In this article, I will cover what happens when you type “www.google.com” into your browser. I am by no means an expert, but an avid learner. At the end of this article, I will post all the resources I referenced. This article does not contain information pertaining to load balancers, cache, cookies or authentication. This article is supposed to act as a straightforward introduction into what happens when you type, “www.google.com”
- You open up your browser and you type, “www.google.com” and press enter. What happens after that?
2. Before you hit enter, your browser pre-fills it’s search bar with an application layer protocol (usually this is either HTTP or HTTPS). HTTP stands for Hyper Text Transfer Protocol. HTTP is a protocol your browser or the client uses to send requests to the server. We’ll get to these steps later in the article.
After you hit enter, the browser uses DNS (Domain Name System) to translate the domain (google.com) into an IP address that is located on a server. There are typically 32 bits in an IP address (w.x.y.z), 8 bits per placement.
3. Once an IP address is translated, the browser uses a TCP (Transmission control protocol) connection on the application layer (HTTP or HTTPS) to send the request to port 80. Port 80 is a public port that acts as a highway to transfer web traffic.
4. Once the TCP connection is made, the request is sent off to the google server through your ISP (internet service provider) or your router at home.
5. Once the request has been parsed and interpreted by Google’s server, the server sends the data (html files, css files, etc) back to the clients IP address through the TCP connection.
6. The browser then renders the files asynchronously until all files are loaded correctly.
7. The TCP connection closes if the HTTP headers includes:
Connection: close
This header states to the server to close the connection after the response is sent.
8. Once the browser renders the files, all that is left is, for example, Javascript animations and user events.
And that’s it! If you are looking for a more in-depth version of what happens, I recommend checking out these resources:
Happy hacking!
-Crystal