How the Internet Works: A Beginner Programmer's Guide to Requests, Responses, and the Web
You type google.com into your browser and a webpage appears in less than a second. But where did that page come from? Who sent it? How did your computer know where to find it? If you are learning to build websites or web apps, understanding this journey is not optional — it is foundational.
The Big Picture
Every time you visit a website, two things are happening:
- Your browser (the client) sends a request asking for information
- A distant computer (the server) sends a response with that information
This is called the Client-Server Model.
YOUR COMPUTER SERVER
(Client) (Server)
┌─────────────┐ REQUEST ──────► ┌─────────────┐
│ Browser │ │ Web Server │
│ │◄────── RESPONSE ───── │ │
└─────────────┘ └─────────────┘
"Give me "Here is
google.com" google.com"
The internet is essentially billions of clients and servers constantly exchanging requests and responses.
What Is a Server?
A server is just a computer that is always on and connected to the internet, waiting to respond to requests. When you visit cypherasync.in, a server somewhere stores the HTML, images, and code that make up that website and sends them to you on demand.
SERVER
┌──────────────────────────────────────┐
│ Always powered on │
│ Always connected to the internet │
│ Stores website files │
│ Responds to incoming requests │
│ Can handle thousands of users │
└──────────────────────────────────────┘
Step 1: The DNS Lookup — Finding the Address
When you type a domain name like cypherasync.in, your computer does not inherently know where that is. Domain names are for humans — computers need IP addresses (like 104.21.3.47) to find each other.
The DNS (Domain Name System) is like the internet's phone book. It converts domain names into IP addresses.
You type: cypherasync.in
│
▼
Your browser asks the DNS server:
"What is the IP address for cypherasync.in?"
│
▼
DNS server replies:
"It is at 104.21.3.47"
│
▼
Your browser now knows where to send the request
DNS Resolution — Step by Step:
Browser
│
▼
Check local cache ──► Found? Use it immediately
│
Not found
│
▼
Ask Recursive Resolver (your ISP's DNS)
│
▼
Ask Root Name Server → "Try .in servers"
│
▼
Ask .in Name Server → "Try cypherasync.in servers"
│
▼
Ask Authoritative Name Server → "IP is 104.21.3.47"
│
▼
Browser gets the IP address ✓
This entire lookup takes milliseconds.
Step 2: The TCP Connection — Opening a Channel
Once the IP address is known, your browser needs to open a connection with the server. It uses a protocol called TCP (Transmission Control Protocol).
Think of TCP as a formal phone call setup:
CLIENT SERVER
│ │
│── "Hello, can we talk?" ────►│ (SYN)
│ │
│◄─ "Yes, I hear you!" ────────│ (SYN-ACK)
│ │
│── "Great, let's begin." ────►│ (ACK)
│ │
│ ← Connection Open → │
This three-step process is called the TCP Three-Way Handshake. Once complete, data can flow reliably in both directions.
Step 3: The HTTP Request — Asking for a Page
With the connection open, your browser sends an HTTP request — a structured message that says what it wants.
HTTP GET REQUEST
─────────────────────────────────────────────────
GET /engineering HTTP/1.1
Host: cypherasync.in
User-Agent: Mozilla/5.0 (Chrome)
Accept: text/html
─────────────────────────────────────────────────
Breaking it down:
GET → The method (I want to READ data)
/engineering → The path (the specific page I want)
HTTP/1.1 → The protocol version
Host → The domain I am contacting
User-Agent → What browser/software is making the request
The main HTTP methods:
METHOD PURPOSE Example
──────── ─────────────────────── ──────────────────────
GET Read / fetch data Load a webpage
POST Send / create data Submit a form
PUT Update existing data Edit your profile
DELETE Remove data Delete a post
Step 4: The HTTP Response — Getting the Answer
The server receives the request, processes it, and sends back an HTTP response:
HTTP RESPONSE
─────────────────────────────────────────────────
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Content-Length: 5243
<!DOCTYPE html>
<html>
<head>...</head>
<body>...</body>
</html>
─────────────────────────────────────────────────
The first line is the status code. Here are the most important ones:
STATUS CODE MEANING
─────────── ─────────────────────────────────────
200 OK Everything worked perfectly
301 Moved The URL has permanently changed
400 Bad Req Your request was malformed
401 Unauth You need to log in first
403 Forbidden You do not have permission
404 Not Found The page does not exist
500 Server Something broke on the server side
Step 5: Rendering the Page
Your browser receives the HTML and starts building the page. This involves multiple stages:
BROWSER RENDERING PIPELINE
─────────────────────────────────────────────────────────
Receive HTML
│
▼
Parse HTML → Build DOM (Document Object Model)
│
▼
Find CSS links → Fetch CSS → Build CSSOM (style tree)
│
▼
Find <script> tags → Fetch and run JavaScript
│
▼
Combine DOM + CSSOM → Render Tree
│
▼
Calculate layout (where does each element go?)
│
▼
Paint pixels to screen
│
▼
Page is visible to user ✓
─────────────────────────────────────────────────────────
Each linked CSS file and image triggers a new HTTP request behind the scenes. A single page load can involve dozens of requests.
HTTP vs HTTPS
You may have noticed websites start with http:// or https://. The S stands for Secure.
HTTP HTTPS
───────────────────────── ─────────────────────────
Data sent in plain text Data is encrypted
Anyone on the network No one can read it even
can read it if intercepted
No certificate needed Requires SSL/TLS certificate
Not safe for passwords Required for login, payments
HTTPS uses TLS (Transport Layer Security) to encrypt the communication between browser and server. The padlock icon you see in the browser confirms HTTPS is active.
The Full Journey — End to End
You type: cypherasync.in/engineering
│
▼
[DNS Lookup] → IP address found: 104.21.3.47
│
▼
[TCP Handshake] → Connection established
│
▼
[TLS Handshake] → Encrypted channel set up (HTTPS)
│
▼
[HTTP GET Request] → Sent to server
│
▼
[Server processes] → Finds the page content
│
▼
[HTTP 200 Response] → HTML sent back to browser
│
▼
[Browser renders] → Page built and painted on screen
│
▼
You see the Engineering blog page ✓
Why Programmers Need to Know This
As a web developer, you will encounter these concepts constantly:
| Scenario | Related Concept | |-------------------------------------|------------------------| | Page not loading | DNS failure or server down | | Login page not working | POST request / 401 status | | Page redirecting endlessly | 301 redirect loop | | "Secure connection failed" | TLS certificate issue | | Form data not saved | POST body not processed | | Images loading slowly | Too many HTTP requests | | API call returning 404 | Wrong URL path |
Understanding the request-response cycle helps you debug problems quickly and write better code.
Summary
| Concept | What it does | |------------|--------------------------------------------------------| | DNS | Converts domain names to IP addresses | | IP Address | The unique numeric address of a computer on the network | | TCP | Ensures data is delivered reliably between two machines | | HTTP | The protocol for sending web requests and responses | | HTTPS | Encrypted version of HTTP using TLS | | GET | Request to read/fetch data | | POST | Request to send/create data | | Status 200 | Success | | Status 404 | Resource not found | | Status 500 | Server-side error |
The internet is not magic — it is a precise, layered system of protocols working together. Once you understand the request-response cycle, you stop being intimidated by "how the web works" and start being curious about how to build on top of it.
Published by Cypher Async — Agartala's offline coding school, building real engineers one concept at a time.