How does the internet work?


Domain Name
A domain, or domain name, is a unique name that identifies a website or email address on the internet. It's a human-readable address that's easier to remember than the numeric IP address associated with it.
URL
URL:A typical website has at least 3 parts in its URL like www.google.com but some complex URLs might also have 8 to 9 parts namely scheme, subdomain, domain name, top-level domain, port number, path, query, parameters, and fragment.
1. Scheme : https://
The protocol or scheme part of the URL and indicates the set of rules that will decide the transmission and exchange of data. HTTPS which stands for Hyper Text Transfer Protocol Secure tells the browser to display the page in Hyper Text (HTML) format as well as encrypt any information that the user enters in the page.
2. Subdomain :https://www.
The subdomain is used to separate different sections of the website as it specifies the type of resource to be delivered to the client. Here the subdomain used ‘www’ is a general symbol for any resource on the web. Subdomains like ‘blog’ direct to a blog page, ‘audio’ indicates the resource type as audio.
3. Domain Name :https://www.example.
Domain name specifies the organization or entity that the URL belongs to. Like in www.facebook.com the domain name ‘facebook’ indicates the organization that owns the site.
4. Path :https://www.example.co.uk:443/blog/article/search
Path specifies the exact location of the web page, file, or any resource that the user wants access to. Like here the path indicates a specific article in the blog webpage.
5. Query String Separator :https://www.example.co.uk:443/blog/article/search?
The query string which contains specific parameters of the search is preceded by a question mark (?). The question mark tells the browser that a specific query is being performed.
6. Query String :https://www.example.co.uk:443/blog/article/search
docid=720&hl=en
The query string specifies the parameters of the data that is being queried from a website’s database. Each query string is made up of a parameter and a value joined by the equals (=) sign. In case of multiple parameters, query strings are joined using the ampersand (&) sign. The parameter can be a number, string, encrypted value, or any other form of data on the database.
Domain Name System,
DNS stands for Domain Name System, a system that translates domain names like "www.amazon.com" into IP addresses like "192.0.2.44". DNS is a vital part of the internet's infrastructure, and it's used by browsers to load web pages.
1. User Request
When we type a domain name like https://amazon.com into our browser, our computer starts the process of finding the corresponding IP address needed to connect to the website.
2. Check Local Cache
The first place our system looks is in its local cache, which may include:
Browser Cache: The browser might have recently stored the IP address if we’ve visited the site before.
Operating System (OS) Cache: The OS maintains a DNS cache to speed up lookups.
Router Cache: Our router might also store previously requested IP addresses.
If the IP address is found in any of these caches, the process ends here and the browser connects to the website. Otherwise, the process moves forward.
3. Check Host Files
If the IP address is not in the local cache, the system may check host files, which are manually configured mappings of domain names to IP addresses. This is rare in modern systems, but it might still be used for certain network configurations.
4. Query DNS Resolver
If no IP address is found locally, the request is sent to a DNS Resolver. The Resolver is a server provided by our Internet Service Provider (ISP) or a public DNS service like Google DNS (8.8.8.8) or Cloudflare (1.1.1.1). The Resolver acts as the intermediary that communicates with various DNS servers to find the IP address.
5. Contact the Root Server
Resolver first contacts the Root DNS Server, which is the starting point for DNS lookups. The Root server doesn’t know the exact IP address of https://amazon.com but directs the query to the Top-Level Domain (TLD) Server responsible for .org.
6. Query TLD Server
Resolver sends the query to the TLD Server for .org domains. The TLD server handles domain names ending in .org and knows where to find the authoritative nameserver for https://amazon.com.
7. Query the Authoritative Server
The Resolver then queries the authoritative nameserver for https://amazon.com. This server is responsible for storing DNS records for the domain, including the mapping of the domain name to its IP address.
8. Retrieve the IP Address
Authoritative nameserver responds to the Resolver with the exact IP address (e.g., 192.0.2.1) for https://amazon.com.
9. Return IP Address to Resolver
Resolver receives the IP address from the authoritative nameserver and sends it back to our computer. At this point, our computer knows how to connect to the website.
10. Connect to the Real Server
With the IP address in hand, our browser sends a request to the real server that hosts https://amazon.com. This server processes the request and sends the necessary data back to our browser.
11. Website Loads
Our browser receives the response from the real server and the website content is displayed on our screen. All of this happens in just milliseconds, making the process seamless for the user.
TCP 3-way Handshake Process
The process of communication between devices over the internet happens according to the current TCP/IP suite model(stripped-out version of OSI reference model).
Step 1 (SYN): In the first step, the client wants to establish a connection with a server, so it sends a segment with SYN(Synchronize Sequence Number) which informs the server that the client is likely to start communication and with what sequence number it starts segments with
Step 2 (SYN + ACK): Server responds to the client request with SYN-ACK signal bits set. Acknowledgement(ACK) signifies the response of the segment it received and SYN signifies with what sequence number it is likely to start the segments with
Step 3 (ACK): In the final part client acknowledges the response of the server and they both establish a reliable connection with which they will start the actual data transfer
Subscribe to my newsletter
Read articles from CHANDAN SWAIN directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
