What happens when you type google.com in your browser and hit enter?
Ever wondered what happens behind the scenes when you type ‘google.com’ and hit enter? While it may seem simple, the reality is far from it. This writing will take you through the various details involved, shedding light on the complexities of the digital world.
To begin with, let’s start by explaining what https://www.google.com’ is. It is a URL which is an acronym for Uniform Resource Locator. So basically, any resource available on the internet can be searched for and identified by a URL. A URL is made up of several components. This one for instance is made up of the protocol(‘https’), a subdomain(‘www.’), domain-name(‘google’) which is a second-level domain and a top-level domain(‘.com’). The top-level domain and the second-level domain come together to form the root domain(‘google.com’). A URL normally consists of a port number. If a port number is not explicitly given in the URL the web browser uses default port numbers. In this case, port number 443 will be used because of the HTTPS protocol.
I made mention of the fact that a URL is used to locate resources on the internet. The resources could be pages, links, and other content. This URL acts as an address for these resources. Mind you these resources are found on servers. It is the interconnection of these servers with each other and end devices as well as intermediary devices that create the Internet. A server is a system, it could be a hardware or a virtualized program on top of a hardware serving requests to end devices. The fact that I said URLs are addresses does not mean that every server is tagged with an address and that computers communicate with each other using this address(URL).
Computers do not understand human language so let’s say for instance I want to request a page from google.com, the computer wouldn’t understand what I mean. This is why every end device built using the OSI(Open Systems Interconnection) model and following the layer two and layer three protocols has a physical address, sometimes called the MAC address and an IP address. The two addresses are bits(numbers) which are easily understood by computers. A MAC address is a 12-digit hexadecimal number that is uniquely assigned to the network interface card(NIC) of a machine during manufacturing. Our focus won’t be on MAC addresses since its use is common in IEEE 802 technologies located in the data-link layer of the TCP/IP model. IP address on the other hand is a 32/128 bit address that is assigned to a device connected to a computer network. The IP address protocol is found in the internet layer which is of much focus for us at the moment.
Every device connected to the internet is identified by its Public IP address. This way computers understand numbers and can communicate with each other over the network. However, an issue arose: humans would have to memorize the IP address of every server that holds the information they need. This is a herculean task as humans aren’t that conversant with numbers. A solution was proposed to represent these IP addresses as words and have them mapped to each other. This solution is the DNS(Domain Name System).
领英推荐
Here is how it works. When a URL like https://www.google.com is entered into your browser, because every PC has a DNS cache locally stored somewhere, the browser first checks the cache to see if it has a record that maps the URL you entered to an IP address of some server elsewhere. If there isn’t any record a request is sent to a DNS resolver(server). It also checks its cache to see if it can find the URL. All resolvers are usually your ISPs(Internet Service Providers) so even if the request can’t be found they sure know where to locate the root server. The root server knows where to locate the ‘.com’ TLD(top-level domain) server. Root servers are authoritative name servers that serve the DNS root zone. They sit on top of the DNS hierarchy. There are 13 of them. Now, the TLD server may not know the IP address of the exact URL you are searching for but it knows authoritative name servers related to it.
A typical question one will ask is how did the TLD server get to know the authoritative name servers related to the domain I am searching for. This is what happens; whenever a domain is purchased the domain registrar communicates to the TLD registry the authoritative name servers. There are usually more than one name server attached to a domain. Now it is from this server where our domain name is resolved into an IP address which we(the browser) can now use to make our request to the server. Our request is being sent using the https protocol. This protocol runs on port 443 and that is the port where the server will be doing its listening. Normally a request to a server uses http but that is insecure as data being sent is not encrypted. For an https, data being sent and received is encrypted. Encryption is done using SSL(secure socket layer) which is normally configured on load balancers that tend to receive the requests before the actual servers. Since the server also knows my public IP as part of the https request headers, it knows where to send the response to.
To wrap it up, typing ‘google.com’ and pressing enter initiates a sequence of actions, with a focus on IP addresses. While MAC addresses have their place in certain network technologies, our main emphasis has been on the importance of IP addresses and domain name resolution. This understanding allows us to grasp the inner workings of the internet. So, the next time you’re online, consider the underlying complexities involved. Let’s appreciate the finer details that drive our digital experiences and connections.
Software Engineer || Core member of TellMonifa || Computer Science ||
4 个月Very informative, I like this article