2. How the Internet Works
How the Internet Works
You use the internet every day โ but do you actually know what happens when you type google.com and press Enter? Understanding this is not optional for a developer. Almost everything you will build lives on the internet. Knowing how data travels gives you an enormous advantage when things break โ and things will break.
๐ The Internet vs. The Web โ Not the Same Thing
Most people use these words interchangeably. They are completely different things:
The global physical infrastructure โ undersea cables, routers, satellites, and data centres โ that connects billions of devices. It is the hardware layer.
A system of web pages and apps that runs ON TOP of the internet using HTTP. Email, Zoom calls, and WhatsApp messages also use the internet but are not the web.
๐ What Happens When You Type a URL
When you type https://learn.voidxhq.com and press Enter, here is exactly what happens in under 300 milliseconds:
- DNS Lookup: Your browser asks a DNS (Domain Name System) server: "What is the IP address of learn.voidxhq.com?" DNS is the internet's phone book โ it translates human-readable names into numerical IP addresses like
104.21.55.178. - TCP Connection: Your browser connects to that IP address over the internet. A TCP handshake confirms both sides are ready to communicate.
- HTTPS / TLS Handshake: Because the URL starts with
https://, your browser and the server agree on an encryption key. All data is now encrypted โ no one in the middle can read it. - HTTP Request: Your browser sends a request: "GET me the content at the path /". The server receives this.
- Server Response: The server sends back HTML, CSS, and JavaScript files โ the raw code that makes the page.
- Rendering: Your browser reads the HTML, applies CSS styles, runs JavaScript, and paints the visual page on your screen.
๐ฅ๏ธ Clients and Servers
The internet runs on a client-server model. Understanding this model is the foundation of all web development:
Your browser, your phone app, your laptop. The client makes requests โ "give me this page", "log me in", "show me my profile".
A computer in a data centre (like AWS or Google Cloud) that receives requests, processes them, and sends back responses. It runs 24/7.
The agreed-upon language clients and servers use to talk. When your Instagram app loads photos, it calls Instagram's API โ which returns data the app turns into a visual feed.
๐ฌ HTTP Methods โ The Vocabulary of the Web
When your browser (client) talks to a server, it uses HTTP methods to express intent. These four are the foundation of every web interaction you will ever build:
Retrieve data. Loading a webpage, fetching a user's profile, getting a list of products. Read-only โ GET should never change anything.
Send data to create something new. Submitting a form, creating an account, posting a tweet.
Update existing data. Editing your profile name, updating a post, changing a setting.
Remove data. Deleting your account, removing a file, cancelling a subscription.
๐ HTTP vs HTTPS
HTTP sends data in plain text โ anyone between you and the server (your ISP, a hacker on the same Wi-Fi, a government router) can read it. HTTPS encrypts everything using TLS. The padlock icon in your browser confirms HTTPS is active. As a developer, every application you build must use HTTPS โ never HTTP. Browsers now actively warn users about non-HTTPS sites.
Knowledge Check
Ready to test your understanding of 2. How the Internet Works?