top of page
  • listoweladolwin

What happens when you type "google.com" in your browser and press enter?

Have you ever wondered what happens behind doors when you type "google.com" in your browser? Where your browser gets those beautiful images from? The styles? And oh, the animations? No, they're not stored on your browser.


In this article, I will satisfy your curiosity, you will get to know whatever goes behind the scenes to fetch you the results.

Okay, some basics before we get started;

  1. IP Address; Just like humans use names to identify one another, computers use numbers (pro tip; computers understand only numbers, 0s and 1s to be specific). An IP Address is therefore a series of numbers that identifies a computer on the internet. Yes, every single computer on the internet is identified by a unique IP address. An IP address may look something like 192.0. 2.44

  2. Website; Oh yes, it is familiar, but having a deeper understanding of it will really help in understanding today's concept. A website is a collection of files (images, texts, animations, and even videos) that tell your browser what to display and how to display it.

  3. Server; A server is an online storage house that keeps the content of websites and provides them when requested. Putting your website on these servers is called Hosting

  4. Domain Name System(DNS); Remember IP address? DNS is a set of protocols that translates human readable domain names (for example, www.amazon.com) to machine readable IP addresses (for example, 192.0. 2.44) and vice versa.

Alright enough of the definitions, let's get to business.

"Google.com" is a URL(Uniform resource locator). A url locates a resource on the internet.

The URL is the domain name that translates to the IP address of the server that stores the content we need.

So first, since the computer understands only numbers, the url needs be translated to numbers. This is when a DNS comes in. The browser first checks its cache to see if it has visited that website before and still has its IP address. If not found in the browser's cache, your operating system's cache is also checked. If the address still can't be found, the operating system requests for the address from your Internet Service Provider. Remember when in school when you need to take a pen from a friend in class, but the friend is a fan of the front seats and you, a back bencher? You call the person next to you to call the person next to them until it gets to your friend and then the same process gets you the pen.

Same process is used by the computer to look up IP addresses.

If your Internet Service Provider does not have the requested IP address in its cache, it makes a request to the root domain(.COM in our case). The root domain, though might not have the IP address, can give directions to where the address can be found.

This process continues until the IP address is found.

Note, all these happen in milliseconds. I know right, it is flabbergasting (oops, sorry about that)


Now your computer has the IP address of the server that keeps the resource we need. What next?

A connection needs be established in order to share the resources. Two types of connections are possible; TCP(Transmission Control Protocol) or UDP(User Datagram Protocol). With TCP, there is a guarantee that whatever files are sent reach the destination.

But for UDP, some files may get lost on their way to the destination computer. But, UDP has its advantage too; speed. UDP is used mostly in live videos because speed is more important in cases like that. But since you would not want to request a page and get only part of it, TCP is used in websites.


When a successful and secure connection is established, it is then the browser can make request to the server.

HTTP(Hypertext Transfer Protocol) is a communication standard that dictates how the browser communicates with the server.

The communication starts with your browser sending a request to the server. In the request, comprises the resource the browser is requesting and other methods to help locate the resource.

The server receives the request, and if the resource is available, a response is sent back to your browser. In cases where no such resource as the one you are requesting is found, an error 404(File Not Found) is encountered.


When the process goes smoothly and the browser receives the response, it checks the received files(HTML, CSS, JavaScript and possibly images and others) to see how it should display the content to you. It is through this you see the images perfectly displayed and the texts, rightly aligned.


Congratulations, you now know how your browser fetches all the data you see when you type a URL.


Recap on what we learnt

We discussed a few terminologies and dived deeper into these steps;

  • You type the url in your browser and hit enter

  • The browser looks up the server's IP address

  • A connection is establish between your browser and the server

  • Your server sends an HTTP request

  • The server sends back an HTTP response

  • Your browser renders the content to you



29 views0 comments

Commenti


bottom of page