Network is a core part of software, as the frontend needs data and the backend sends it. All of this happens through the network. How is data transferred over the internet? How does it reach the client, and what protocols are required? These are essential concepts for software development.
We need to understand what happens when we type "google.com," what DNS is, and its role in the process.
We commonly use REST APIs, but we'll also explore how the web works, including GraphQL, gRPC protocols, and more. We'll dive into networking fundamentals, how the internet works, frontend-backend interactions, REST concepts, HTTP methods, headers, CORS, and other key aspects.
To understand this, we need to know the client-server model. A client is the entity requesting information, while a server is the entity providing it. Essentially, the client asks for something, and the server serves it. This is the basic definition of client-server architecture.
Each system on the internet has an IP address.
IP Address: An IP address is like a home address for devices on the internet. It uniquely identifies devices (like computers or phones) so they can find and communicate with each other.
Examples:
192.168.1.1
A domain is a human-readable address linked to a unique IP address.
When you say https://www.google.com
, there are specific parts, each with its own significance:
.edu
, .org
, .gov
, .com
, .au
.[www.example.com](http://www.example.com)
download.microsoft.com
sales.microsoft.com
A data center is a physical facility that stores computing equipment and digital data for companies. It's like a server, but without displays—only CPUs and hardware managing incoming requests.
Where are data centers located?
Data centers can exist in multiple physical locations worldwide, all interconnected through optical fibers. These fibers connect across oceans and land, forming a global network. (You can learn more about optical fibers later.)
Similarly, everything is interconnected, and we get internet connectivity. Data centers provide the data we request via the internet through our browsers. In India, we use internet providers like Jio, VI, and Airtel. These are ISPs (Internet Service Providers). When you relocate to a new city, you may get broadband services like "ABC Internet Broadband" offering speeds like 100 Mbps. These are also ISPs. Let’s explore more about ISPs and how they work.
An ISP (Internet Service Provider) is a company that provides internet access to individuals and businesses.
ISPs connect users to the internet backbone, assign IP addresses, and route data requests to the correct servers. They manage the local infrastructure and provide bandwidth for internet use.
So we have local ISPs connected to the internet, governed by the country’s regulatory organizations. There are local, regional, and global ISPs, and these follow specific rules and regulations.
Whenever you type google.com, the request goes through the router to the ISP via the internet. Then it hits a DNS server, which provides the IP of the domain. Using that IP, the server is contacted, and it responds with HTML, CSS, and JS files.
Now, let’s dig deeper: what happens when you hit a URL like google.com
?
When you type a URL, it doesn’t directly go to the router. First, the browser performs some internal operations:
The router then communicates with the ISP, which handles the rest of the process.
To observe how service workers and network requests work:
200
for success, 304
for cached responses).We will discuss HTTP status codes (200
, 304
, etc.) and other details later, or you can explore them online.
So, when you're getting data from the server, in some cases, the server does not serve the request directly. Instead, a service worker plays a role in providing the data. Let’s look at this scenario.
I reloaded the page and clicked on a request with a status code 200
. I noticed the service worker responded faster. It's not just about speed; the service worker also provides caching and offline support in the browser.
Service workers enhance the performance of requests made by the browser. Now we understand that before reaching the ISP, caching occurs, and service workers may play a role. Let’s now focus on the ISP layer.
What we currently know is that ISPs deal with the internet, but that’s not entirely true.
When you request data via an IP, it often passes through multiple layers of ISPs:
Then, it reaches the server in the respective country.
However, this is not always the case. Big companies like Netflix and Google optimize their systems by deploying data centers in multiple countries. This minimizes cross-region requests and ensures faster access to data. For example, Netflix stores data at the regional ISP level, so users experience minimal latency.
To check details related to any domain, visit https://www.whois.com/.
Let’s discuss what happens when a request goes from the ISP to the server.
If you’ve studied computer networks, you might know this already. If not, let’s review:
This process ensures a secure and efficient connection between the client and the server.
An SSL handshake is a series of communications between a client and a server that establishes a connection and verifies the security of both parties.
During this process:
Finally, you receive HTML, CSS, JS, and other resources like images, which are rendered in the browser.
When a page is requested, we receive HTML, CSS, and JS.
For more detailed insights, you can refer to this article.
The Document Object Model (DOM) is a programming interface that represents the structure of a web document as objects and nodes. This allows programs to interact with and manipulate web documents dynamically.
After parsing CSS, the CSS Object Model (CSSOM) is created.
CSSOM stands for CSS Object Model. It is a set of APIs that enables reading and modifying a document's CSS information. While the DOM is for HTML, the CSSOM serves the same purpose for CSS.
Next comes the phase where JS execution takes place. The loading of the script happens, followed by AST internalization, compilation, and bytecode conversion. Finally, the code is executed. By now, HTML, CSS, and JS have been processed, and we are in the Rendering Phase.
In the Rendering Phase, layouting happens. Layouting means merging the DOM and CSSOM into the Render Tree. It's like creating the layout of a home and organizing the materials needed to build a villa. This process uses computer graphics and C++ code to draw the content on the browser.
To learn more about how scripts load, check this video.
Finally, remember that the DOM tree and CSSOM get merged, and rendering and layouting occur to paint the content on the screen.
So that's all for this article. Let's meet in the next one. Take care, bye-bye!
Thank you so much for reading. If you found it valuable, consider subscribing for more such content every week. If you have any questions or suggestions, please email me your comments or feel free to improve it.
I am waiting for your feedback, See you in next episode,
Thanks 👋🏻
I'm Rahul, Sr. Software Engineer (SDE II) and passionate content creator. Sharing my expertise in software development to assist learners.
More about me