Chapter 01 — How the Internet Works
Chapter 01 — How the Internet Works
Hey everyone! Welcome to Namaste Computer Networks! 🙏
The internet feels like magic — you type something and a page appears from a computer thousands of kilometers away. But underneath, it's a beautifully simple idea: computers passing small packets of data to each other, hop by hop, until they reach the destination. Let's build the mental model that everything else in this series hangs on.
What we will cover:
- What a network actually is
- Clients, servers, and packets
- The postal-system analogy
- IP addresses & ports (the address & apartment number)
- Routers & the "network of networks"
- Interview Questions
1. What Is a Network?
┌─────────────────────────────────────────────────────────────┐ │ A NETWORK = two or more computers connected so they can │ │ exchange data. The INTERNET = a giant network OF networks │ │ — billions of devices linked worldwide. │ └─────────────────────────────────────────────────────────────┘
The word "internet" literally means inter-network — networks connected to other networks. Your home WiFi is a small network; your ISP connects it to bigger networks; those connect to the global backbone. It's networks all the way up.
2. Clients, Servers & Packets
CLIENT = the device asking for something (your phone, laptop). SERVER = the device providing it (Google's, Netflix's machines). [ Client ] ──"give me the page"──▶ [ Server ] [ Client ] ◀──"here it is"──────── [ Server ] The data doesn't travel as one big blob. It's chopped into small PACKETS, sent separately, and reassembled at the other end. If one packet gets lost, only IT is resent — not the whole thing. This is "packet switching," the core idea of the internet.
3. The Postal System Analogy
Sending a big document by post? You can't mail it as one giant
sheet — you split it into numbered envelopes:
Envelope 1/3, 2/3, 3/3 → each with the destination address
→ they may take DIFFERENT routes
→ arrive possibly OUT OF ORDER
→ the receiver reassembles them by number
Packets work EXACTLY like this:
• each packet has the destination address (IP)
• each is numbered (sequence number)
• routers forward them like postal sorting offices
• the receiver reassembles them in order
4. IP Addresses & Ports
┌─────────────────────────────────────────────────────────────┐ │ IP ADDRESS = a device's unique address on the network │ │ (like a building's street address). │ │ e.g. 142.250.____.____ (IPv4) │ │ │ │ PORT = which PROGRAM on that device (like an │ │ apartment number in the building). │ │ e.g. :443 (HTTPS), :80 (HTTP), :22 (SSH) │ └─────────────────────────────────────────────────────────────┘
IP + PORT together identify an exact destination:
142.250.72.14 : 443
└── which machine ──┘ └ which program (the web server) ┘
Your laptop's browser also has its own IP+port so the reply
knows where to come back. (Deep dive on IPs in Chapter 03.)
5. Routers & The Journey of a Packet
Your packet doesn't fly straight to the server. It HOPS across
many ROUTERS (traffic directors), each forwarding it closer:
[ You ] → [ Home router ] → [ ISP ] → [ backbone routers... ]
→ [ server's ISP ] → [ Server ]
Each router looks at the destination IP and decides the best
next hop — like postal sorting offices passing mail along.
No single router knows the WHOLE route; each just knows
"which direction gets it closer." (Run "traceroute" to SEE
the hops your packets actually take!)
6. Putting It Together
LET'S TRACE (the big picture — details in later chapters): ────────────────────────────────────────────────────────── 1. You type a website name → it's converted to an IP (DNS, Ch 06) 2. Your device opens a connection to that IP:port (TCP, Ch 04–05) 3. It sends an HTTP request "GET me this page" (HTTP, Ch 07) 4. Data is split into packets, routed hop-by-hop to the server 5. Server sends the page back as packets 6. Your device reassembles them → the browser renders the page ✅ Every chapter in this series zooms into one of these steps.
Interview Questions — Quick Fire!
Q: What is the internet?
"The internet is a global network of networks — billions of devices connected together so they can exchange data. The name itself means inter-network. Data travels between devices in small units called packets, which are routed independently across many interconnected networks and reassembled at the destination."
Q: What is a packet and why is data sent in packets?
"A packet is a small chunk of data with addressing information attached. Data is split into packets so it can be sent efficiently and reliably: packets can take different routes, and if one is lost, only that packet is resent rather than the entire message. This approach, called packet switching, is fundamental to how the internet works."
Q: What's the difference between an IP address and a port?
"An IP address identifies a specific device on the network, like a building's street address. A port identifies a specific program or service on that device, like an apartment number within the building. Together, an IP and port pinpoint an exact destination — for example, a web server listening on port 443 at a given IP."
Q: What is the role of a router?
"A router forwards packets between networks, moving each packet closer to its destination. It examines the destination IP address and decides the best next hop. No single router knows the entire path; each just forwards in the right direction, like postal sorting offices passing mail along until it reaches the recipient."
Q: What's the difference between a client and a server?
"A client is the device that requests a service or resource — like a browser asking for a web page — while a server is the device that provides it. The client initiates the communication and the server responds. A single machine can act as both depending on the interaction."
Key Points to Remember
| Concept | Key Takeaway |
|---|---|
| Internet | A network of networks; data moves as packets (packet switching). |
| Client/Server | Client requests, server responds. |
| Packets | Data split into numbered chunks; lost ones are resent individually. |
| IP + Port | IP = which device (address) · Port = which program (apartment). |
| Routers | Forward packets hop-by-hop toward the destination. |
What's Next?
All this — packets, IPs, HTTP — is organized into neat layers, each with one job. Chapter 02 introduces the OSI and TCP/IP models, the mental filing cabinet that makes networking make sense.
Keep learning, keep connecting! See you in the next one!
Post a Comment