Browsing the Internet has become a routine thing in
our daily life, there are many social networking sites that we visit on a daily
basis, as well as when you want to search for something or buy some goods, the
Internet comes to your mind full speed, where you can visit your target website
with one click, and get the service you want or the information you inquire
about. It sounds so easy, but between that click and loading the target page is
a long journey covering thousands of miles in a few seconds which is the same
amount of time it takes to load a website on your device! So, in this topic,
let us explore what happens behind the scenes of that long journey that only
takes a few seconds.
The relationship between websites, servers, and IP addresses
The search process includes several elements: your
browser, your computer's operating system, your Internet service provider, the
server on which you host the site, and the services running on that server.
Websites are collections of files, often HTML, CSS, JavaScript, and images,
that come together to tell your browser how to view a site. Because these files
and the data they contain must be available at any time to anyone who requests
them, it would have been better if a powerful external computer connected to
the Internet, called a server, stored these files.
When you point your browser to a specific website
address, the browser starts detecting the server hosting the website, and it
does this by checking the website's domain to find its address, and DNS helps
find the server. Well, now let's go through each step of the journey in detail
from typing a site URL or clicking on an associated address, to getting to what
you want on your device screen.
First, let's start with choosing the target website
The long journey begins with the simplest step, which
is to choose the website to visit, and this is done either by clicking on the
site from the bookmark bar at the top of the browser or typing the site URL
yourself in the browser address bar or even through the results of the engine
search. Regardless, when we say a website, we are referring to our site
“kingdom of hardware” or any of the other Internet sites such as Facebook,
Twitter, YouTube, and others.
The Internet works mainly according to the client-server
model, that is, websites are actually stored on devices called servers. These
servers can be stored anywhere in the world. Whenever you want to visit a
website, your device creates a request that is sent to the server. Now, once
this request is made, the request we make to the web server is digitally
fulfilled in the form of a packet of data. This network packet contains the IP
address of the device you are using, and the IP address of the server you are
requesting data from and will store the actual request inside.
More clearly; The web address is divided into several
parts, each with its own meaning and function. Let's choose one that helps us
explain it more clearly.
https://kingdomofhardware.blogspot.com/2022/10/what-is-optimal-distance-that-separates.html
The address begins with the HTTPS:// schema, which is
a secure hypertext transfer protocol that tells the browser to make a
connection to the server using the TLS security protocol, a cryptographic
protocol to secure communications over the Internet, and it encrypts data
exchanged between the browser and the server, such as passwords or credit card
information. There are other protocols that browsers know how to handle like
//:ftp, //:mailto, or //: file.
After the protocol comes to the domain name
kingdomofhardware.blogspot.com, this address indicates the IP address of a
particular server. After the domain name comes to the name of the path (page
link) on the server that you want to display
what-is-optimal-distance-that-separates.html. In this case, we see that it is
followed by .html, which indicates that this is a flat file on the server with
HTML content, and can use other formats such as CSS or JavaScript.
What is the role of CRC technology?
During the transmission of a data packet over the
Internet, some of its data may be lost or some data may be corrupted. In order
for the recipient to certify that the data is genuine and error-free, a
“reliability check” is used. CRC is one of the most widely applied screening
methods.
It is known that the data is stored and preserved
digitally in the form of the numbers 0 and 1, and the verification of
reliability through the periodic redundancy check exploits this technique and
counts the number of (1) numbers stored in the data and stores their number. On
Receipt If the number of digits (1) stored matches the number received by the
receiver, then the packet is original.
Find the corresponding IP address for the domain
After checking that the package is ready to work, the
browser needs to know which server to connect to on the Internet. To do this,
he needs to look up the IP address of the server hosting the website using the
domain you wrote, and he does it using a system called DNS which is more like a
name book or word dictionary for the Internet.
DNS translates URLs familiar to us humans
(kingdomofhardware.blogspot.com) into IP addresses that a computer understands
(usually four sets of numbers separated by periods). For example, when you
visit Facebook (facebook.com), the browser translates the site's domain into
the corresponding IP address of 31.13.67.35 thanks to the DNS system.
Depending on whether you visited this website
recently, your browser can find this DNS information from several sources,
including your computer or your Internet service provider. Your browser checks
its own cache, the operating system cache, the local network cache on your
router, and the DNS server cache on your corporate network or your Internet
service provider (ISP).
If the browser cannot find an IP address in any of
these cache layers, the DNS server on your company's network or at your ISP is
doing a recursive DNS lookup. A frequent DNS lookup requests multiple DNS
servers around the Internet, which in turn requests more DNS servers for a DNS
record to be found. Once the browser has obtained the DNS record of the IP
address, it is time to find the server on the Internet and establish a
connection
The browser initiates a TCP connection to the server
Data packets travel over a phone or cable wire through
different networks and then end up in the main Internet hub of a country or
region where the server's IP address is decrypted using a transmission control
protocol, known as TCP, to find the server with an IP address to connect to.
But this is an ineffective method.
Instead, many sites use a Content Delivery Network, or
CDN, to cache static and dynamic content near the browser. A CDN is a globally
distributed network of caching servers that improve website performance by
bringing content closer to users. Once the browser finds the server on the
Internet, it establishes a TCP connection to the server.
Suppose the website you want to visit has servers
abroad, here the main Internet center in your country will send the package to
the Internet center in the country where the server is located. This Internet
hub will eventually send the request to the server via its local networks.
There is a huge network of wires connecting Internet
hubs all over the world. These wires cross land, seas, and even entire oceans,
and all of these wires are fiber-optic cables that can transmit data at the
speed of light.
Responding and processing a site visit request
Once the server receives your request, it is ready to
send the requested website. A website may consist of text, images, or videos
that are too large to be sent as a single packet of data, so the server divides
the website into multiple packets of data and sends them together. These
multiple packages make the same journey as the site visit request, but not all
packages have to travel the same path. To speed up the process and avoid
getting bogged down in network traffic, each packet takes its own path, i.e.
packets choose paths so that they reach your device at approximately the same
time.
After all the packages reach your device, it remains
to rebuild the website, which is done by a method called serialization. When
the server splits a website into multiple packages, it gives a serial number to
each package stored inside it. Now, your device uses the same sequence to
recreate your desired website. Once you've downloaded a webpage, your browser's
journey isn't over, so if you click a new link, the steps will start over.
What you just read is what happens behind the scenes
when you request a visit to a particular website, and of course, to your
surprise, that journey of thousands of miles takes only a few seconds to see
the result right in front of your eyes on your device!