Send a photo to a friend on WhatsApp and it usually lands in under two seconds — even if your friend is in another city, 1,200 km away, connected through a different mobile operator entirely. Nothing about that should feel ordinary. Somewhere between your phone and theirs, your photo travelled through mobile towers, fibre-optic cables possibly running under the sea, routers owned by companies that have never heard of each other, and arrived in one piece, in the right order, with no missing bytes. This chapter is about how that actually happens — not "the internet is magic," but the specific rules, devices, and arithmetic that make it work.
What exactly is a network?
A network is simply two or more devices connected so they can share data or resources. Your home Wi-Fi is a network: your phone, laptop, and smart TV all connect to one router so they can all reach the internet and, often, share one printer. A school computer lab wired to one central switch is a network. The global collection of connected networks — the "network of networks" — is what we call the Internet (capital I, because it's one specific, enormous network of networks; "an internet" with a lowercase i just means any set of connected networks).
The point of a network is always the same: let devices that are not physically the same machine act as if they can talk to each other. Everything else in this chapter — the cables, the addresses, the rules — exists to make that talking reliable.
Networks by size: PAN, LAN, MAN, WAN
Networks are usually classified by how far they physically reach:
- PAN (Personal Area Network): a network within a few metres of one person — your phone talking to your Bluetooth earphones, or your phone talking to a smartwatch.
- LAN (Local Area Network): a network confined to one building or campus — your school's computer lab, or every device connected to one home Wi-Fi router.
- MAN (Metropolitan Area Network): a network spanning a city — for example, a city's traffic-camera network connecting signals and cameras across many neighbourhoods to one control centre.
- WAN (Wide Area Network): a network spanning a country or the globe — Jio's or Airtel's mobile network across India is a WAN; the Internet itself is the largest WAN that exists.
Notice this is a matter of scale, not a different technology each time. A LAN and a WAN both move data in packets (you'll see exactly what that means shortly) — a WAN is just built from many LANs and the long-distance links that connect them.
The devices that make a network work
Four devices show up constantly, and students often blur them together. Each does a distinct job:
- Modem (modulator-demodulator): converts the digital signals your devices use into a form that can travel over your ISP's line — a telephone line, a cable line, or fibre — and converts incoming signals back into digital data. It's the bridge between your home and your Internet Service Provider (ISP), such as Jio, Airtel, or BSNL.
- Router: decides where data should go between networks. Your home router looks at each packet leaving your house and figures out the next hop toward its destination on the wider Internet. It also usually assigns a local address to every device on your home network.
- Switch: connects multiple devices within one LAN — say, 20 computers in a school lab. A switch learns which device sits on which cable (using each device's hardware address, called a MAC address) and forwards each piece of data only to the port that device is plugged into.
- Hub: an older, much simpler device that does what a switch does but badly — it blindly repeats every incoming signal out to every connected port, whether that device needs it or not. This wastes bandwidth and causes collisions when two devices send at once, which is why switches replaced hubs almost everywhere.
A useful way to remember the difference: a modem connects you to the outside world; a router directs traffic between networks; a switch (or the much cruder hub) connects devices within one network.
How devices are wired together: network topologies
Once you know a LAN needs a switch or hub, the next question is: what shape does the wiring take? This physical (or logical) layout is called the network's topology. Three patterns matter most:
Bus topology: every device connects to one shared backbone cable, like beads threaded on a single string. It's cheap and simple — early Ethernet networks worked this way — but it has a serious weakness: if the backbone cable breaks anywhere, the entire network splits or stops, and because every device shares the same cable, only one device can transmit at a time without its signal colliding with another's.
Star topology: every device connects with its own cable to one central device — a switch or hub. This is how almost every modern LAN, including your school's computer lab and your home Wi-Fi, is actually wired. If one device's cable fails, only that device drops off; everyone else keeps working. The trade-off is that the central switch becomes a single point of failure — if it dies, the whole star goes down at once.
Mesh topology: devices connect directly to several other devices, so there are multiple possible paths between any two points. A full mesh connects every device to every other device, which is extremely fault-tolerant — if one link breaks, data simply flows around it — but expensive to wire, because the number of cables grows fast. With n devices, a full mesh needs n(n−1)/2 cables: 4 devices need only 6 cables, but 10 devices already need 45. That's why full mesh is reserved for critical backbone links (connecting major cities or data centres) rather than ordinary offices — but the underlying idea of "many possible paths, not just one" is exactly what makes the wider Internet resilient, as you'll see in the next section.
(A fourth pattern, ring topology, connects devices in a closed loop where data passes from device to device in one direction until it reaches its destination — used in some older "token ring" networks. It's rare today, but worth knowing the name for exams.)
Breaking a message into packets
Now the central question: when your phone sends that photo, does it travel down one continuous wire as a single unbroken stream, the way water flows through a pipe? It does not — and this is the single most important idea in this chapter.
Every network link has a maximum size for the individual chunks of data it will carry in one go, called the MTU (Maximum Transmission Unit). On most Ethernet-based networks, that limit is 1500 bytes of data per chunk. Any file larger than that — and almost every file you send is larger than that — gets sliced into many small chunks called packets before it ever leaves your device. Each packet carries a small header (containing, among other things, the destination address and a sequence number) plus a slice of the actual file.
Let's work out exactly how many packets a real file needs. Suppose you're sending a photo that is 2,500,000 bytes, over a link with a maximum payload of 1,500 bytes per packet.
Step 1 — divide: 2,500,000 ÷ 1,500 = 1,666.67 packets. You can't send two-thirds of a packet, so you round up to the next whole number: 1,667 packets.
Step 2 — check how full the last packet is: 1,666 full packets carry 1,666 × 1,500 = 2,499,000 bytes. The photo has 2,500,000 bytes total, so what's left over for packet number 1,667 is 2,500,000 − 2,499,000 = 1,000 bytes. That last packet is only 1,000 ÷ 1,500 ≈ 66.7% full — it still gets sent as its own separate packet, header and all, even though it's not carrying a full payload.
This "round up" operation is called ceiling division, and it shows up constantly in networking and computing generally, any time something must be split into whole units. Here's the same calculation as a short program:
import math
def packets_needed(file_size_bytes, mtu_payload=1500):
return math.ceil(file_size_bytes / mtu_payload)
print(packets_needed(2500000)) # 1667
Trace it by hand: 2500000 / 1500 evaluates to 1666.666...; math.ceil rounds that up to the nearest whole number, 1667 — matching what we computed above.
Each of those 1,667 packets is then sent independently onto the network, and — this is the part that surprises most students — they are not required to take the same route to get there.
Packet switching: why packets don't need to travel together
In the early 1960s, an engineer named Paul Baran, working at the RAND Corporation in the United States, proposed a radically different way to build communication networks. At the time, telephone calls used circuit switching: when you dialled a number, the phone system reserved one dedicated, continuous electrical path between you and the other person for the entire length of the call. That path was exclusively yours until you hung up, even during the silent pauses — reliable, but wasteful of capacity, and if any single point along that dedicated path failed, the whole call dropped.
Baran's idea — refined over the following years by other researchers including Donald Davies in the UK, and eventually built into ARPANET, the direct ancestor of today's Internet — was packet switching: break every message into small, independently addressed packets, and let each one find its own way through the network, possibly via completely different routers, possibly arriving out of order. The receiving device uses the sequence numbers in each packet's header to reassemble the original file correctly, no matter what order the packets actually arrived in. If one path through the network gets congested or a link goes down entirely, packets simply get routed around the problem — nothing has to wait for one single fragile path to stay intact.
This is also why packet switching is efficient in a way circuit switching isn't: because packets from thousands of unrelated conversations can share the very same physical cable, interleaved with each other, a link is never sitting idle just because it's "reserved" for one call the way a phone circuit was.
Common misconception: "the Internet sends my file through one wire"
Because a video call or a file download feels continuous, it's natural to imagine data flowing like water through a single pipe, in one unbroken stream, along one fixed path from source to destination. That mental model is wrong, and it matters: it's why students are often surprised that a network can keep working even while individual links are congested or fail. The correct model is the one you've just seen — even a single photo is chopped into hundreds or thousands of independent packets, each carrying its own destination address and sequence number, each capable of travelling by a different route, and reassembled only after all of them (or, for some applications, however many make it) arrive. The "smooth stream" you experience on your screen is an illusion built on top of a system that is constantly splitting, scattering, and reassembling your data many times per second.
Addresses on a network: IPv4 and binary octets
For a router to know where to send a packet, every device on a network needs an address — just like every house needs a postal address. On the Internet, the most common addressing scheme is IPv4, where every address is written as four numbers separated by dots, such as 172.16.254.1. Each of those four numbers is called an octet, and — this is the important part — each octet is really an 8-bit binary number underneath, even though we usually read it in decimal for convenience. That's why every octet in an IPv4 address is always between 0 and 255: an 8-bit number can represent at most 2⁸ = 256 different values (0 through 255).
Let's convert one octet, 172, into its actual 8-bit binary form, using the place values of a binary number: 128, 64, 32, 16, 8, 4, 2, 1 (each one double the last, since binary is base 2).
Start with 172 and work from the largest place value down, asking at each step "does this value still fit?":
- 128: 172 ≥ 128, so this bit is 1. Remaining: 172 − 128 = 44.
- 64: 44 < 64, so this bit is 0.
- 32: 44 ≥ 32, so this bit is 1. Remaining: 44 − 32 = 12.
- 16: 12 < 16, so this bit is 0.
- 8: 12 ≥ 8, so this bit is 1. Remaining: 12 − 8 = 4.
- 4: 4 ≥ 4, so this bit is 1. Remaining: 4 − 4 = 0.
- 2: 0 < 2, so this bit is 0.
- 1: 0 < 1, so this bit is 0.
Reading the bits in order: 10101100. Check it: 128 + 32 + 8 + 4 = 172. Correct. The same process, done four times, turns any IPv4 address into the 32-bit binary number a computer actually stores and compares — a full IPv4 address is genuinely just 32 bits (4 octets × 8 bits), which is why there are exactly 2³² ≈ 4.29 billion possible IPv4 addresses in existence. That number sounds huge, but it is nowhere near enough for every phone, laptop, smart TV, and sensor connected today, which is the entire reason a newer scheme, IPv6, was created using 128-bit addresses instead — enough addresses that running out again is not a realistic concern.
Here is the same bit-by-bit process as code, so you can check any octet yourself:
def decimal_to_8bit_binary(n):
bits = ""
for i in range(7, -1, -1):
power = 2 ** i
if n >= power:
bits += "1"
n -= power
else:
bits += "0"
return bits
print(decimal_to_8bit_binary(172)) # 10101100
Trace it: i counts down 7, 6, 5, ..., 0, so power takes the values 128, 64, 32, 16, 8, 4, 2, 1 in exactly the order we used by hand. At each step the function checks whether n still contains that power of two, appends the matching bit, and subtracts it if so — producing the identical string, "10101100", that we derived above.
Bandwidth vs. latency — two different kinds of "speed"
People say a connection is "fast" or "slow," but that word is hiding two genuinely separate quantities, and mixing them up leads to wrong predictions.
Bandwidth is how much data a link can carry per second — its capacity, usually advertised in megabits per second (Mbps). Think of it as the number of lanes on a highway. Latency is how long a single bit takes to travel from one end of the link to the other — a delay, usually measured in milliseconds (ms). Think of it as how long the highway itself is, regardless of how many lanes it has. A link can have huge bandwidth and still have high latency, and vice versa.
Bandwidth confusion has a very concrete, very common trap: ISPs advertise speed in megabits per second (Mbps), but file sizes are almost always shown in megabytes (MB) — and 1 byte = 8 bits, so 1 MB = 8 Mb. Mixing these up makes people wildly overestimate download speed. Suppose your broadband plan is advertised as 40 Mbps, and you want to download a 100 MB game.
Step 1 — convert the file size into the same unit as the speed: 100 MB × 8 = 800 megabits.
Step 2 — divide by the bandwidth: 800 Mb ÷ 40 Mbps = 20 seconds.
If you'd forgotten to convert bytes to bits and just divided 100 by 40, you'd have guessed 2.5 seconds — eight times too optimistic. This is the second common misconception worth naming explicitly: a "40 Mbps" connection does not download 40 megabytes in one second; it downloads 40 megabits, which is only 5 megabytes.
Latency, meanwhile, is governed by physics, not by how generous your ISP's plan is — and nowhere is that clearer than with satellite internet. A geostationary satellite orbits at an altitude of about 35,786 km, and no signal can travel faster than the speed of light, roughly 300,000 km per second. A single hop from the ground up to the satellite and back down again therefore takes at least (2 × 35,786) ÷ 300,000 ≈ 0.239 seconds, or about 239 ms — and a request-and-response exchange (your request travels up and down to reach the satellite provider's ground station, then the reply travels up and down again to reach you) needs roughly two such hops, putting the unavoidable minimum round-trip delay near 480 ms, before the provider's own equipment has even processed anything. In practice, real satellite links measure 500–700 ms of latency, because the physics-only minimum gets added to. That is why a satellite internet connection can advertise perfectly respectable bandwidth and still make a video call feel laggy and awkward to talk over — the problem isn't capacity, it's the literal distance the signal must travel at a fixed maximum speed. Fibre-optic connections on the ground don't have this problem nearly as badly, because the straight-line distance between two cities is a tiny fraction of 35,786 km.
Networking in India: cables, campuses, and tatkal traffic jams
India's connection to the rest of the global Internet physically depends on undersea fibre-optic cables that come ashore at a small number of coastal landing stations — Mumbai and Chennai are the two biggest hubs, connecting India to cable systems that run under the Arabian Sea and the Bay of Bengal to the Middle East, Southeast Asia, and beyond. Every international website you reach, and every rupee of UPI traffic that has to touch a server outside India, ultimately depends on capacity in a handful of these physical cables.
Within India, two large-scale government-backed networks are worth knowing by name for exams: the National Knowledge Network (NKN), which links IITs, IISc, universities, and research institutions across the country over dedicated high-speed fibre links, so that researchers can share large datasets and run remote experiments without competing with ordinary consumer internet traffic; and BharatNet, a project to extend optical-fibre broadband connectivity down to individual Gram Panchayats (village councils), aiming to close the urban-rural connectivity gap rather than leaving rural broadband to satellite or mobile towers alone.
For a very concrete, everyday illustration of congestion, consider IRCTC's Tatkal booking window, which opens at a fixed time each morning. In the seconds after the window opens, an enormous number of users across the country try to submit booking requests to IRCTC's servers at almost exactly the same instant. Every one of those requests is broken into packets exactly the way a photo is, competing for space on the same links into IRCTC's data centres — and when demand briefly exceeds available capacity, some packets queue, some connections time out, and the booking page appears to freeze or fail, even though nothing about the network itself is broken. This is bandwidth contention in its purest everyday form: the total pipe is finite, and everyone is trying to use it in the same one-second window.
Check your understanding
-
A school's computer lab wires 20 computers, each with its own cable, into one central switch. Name the topology, and give one advantage and one disadvantage of it.
Answer: This is a star topology. Advantage: if any one computer's cable fails, only that computer loses connectivity — the other 19 keep working normally. Disadvantage: the central switch is a single point of failure; if it fails, all 20 computers lose their connection at once.
-
Classify each as PAN, LAN, MAN, or WAN: (a) a phone connected to Bluetooth earphones, (b) every computer inside one bank branch, (c) a mobile operator's network covering all of India.
Answer: (a) PAN, (b) LAN, (c) WAN.
-
A student needs to send a video clip of 3,300,750 bytes over a link whose maximum packet payload is 1,500 bytes. How many packets are needed, and how full is the last packet?
Answer: 3,300,750 ÷ 1,500 = 2,200.5, so we round up (ceiling division) to 2,201 packets. The first 2,200 packets carry 2,200 × 1,500 = 3,300,000 bytes; the remaining 3,300,750 − 3,300,000 = 750 bytes go into the last packet, which is therefore 750 ÷ 1,500 = 50% full.
-
Convert the decimal octet 205 into 8-bit binary, showing your working.
Answer: Using place values 128, 64, 32, 16, 8, 4, 2, 1: 205 ≥ 128 (bit 1, remainder 77); 77 ≥ 64 (bit 1, remainder 13); 13 < 32 (bit 0); 13 < 16 (bit 0); 13 ≥ 8 (bit 1, remainder 5); 5 ≥ 4 (bit 1, remainder 1); 1 < 2 (bit 0); 1 ≥ 1 (bit 1, remainder 0). Result: 11001101. Check: 128 + 64 + 8 + 4 + 1 = 205. Correct.
-
A broadband plan is advertised as 50 Mbps. Ignoring overhead, how long will it take to download a 250 MB file?
Answer: Convert the file size to megabits first: 250 MB × 8 = 2,000 megabits. Time = 2,000 Mb ÷ 50 Mbps = 40 seconds.
-
Explain, in your own words, why a satellite video call can lag noticeably even when the connection's advertised bandwidth is high.
Answer: Bandwidth (capacity) and latency (delay) are different things. A geostationary satellite sits roughly 35,786 km above the Earth, and no signal can travel faster than the speed of light (~300,000 km/s). Even with unlimited bandwidth, each round trip up to the satellite and back down again takes a physically unavoidable amount of time — roughly 240 ms per hop, and about 480 ms or more for a full request-response exchange — which is enough delay for a live conversation to feel awkward, with people talking over each other. High bandwidth only means more data can be carried per second; it does nothing to shorten the physical distance the signal has to travel.
Summary
A network is any set of devices connected to share data, and networks are classified by scale — PAN, LAN, MAN, WAN — built from devices with distinct jobs: modems bridge you to your ISP, routers direct traffic between networks, and switches (not the cruder, largely obsolete hubs) direct traffic within one LAN, wired in a bus, star, ring, or mesh topology, each with a different failure pattern. Data itself does not travel as one continuous stream: every file is sliced into packets no larger than a link's MTU, using ceiling division to work out exactly how many packets are needed, and — thanks to packet switching, the idea pioneered by Paul Baran in place of the old dedicated-circuit telephone model — each packet can take its own route through the network and still be reassembled correctly at the far end using sequence numbers. Every device is reachable via an address; IPv4 addresses are four 8-bit binary octets written in decimal for convenience, giving about 4.29 billion possible addresses, which is why IPv6 exists. Finally, "speed" is really two separate quantities — bandwidth (capacity, in Mbps, easy to confuse with megabytes) and latency (delay, governed by physical distance and the speed of light, as satellite internet demonstrates starkly) — and both matter, in India's undersea cable landings, NKN and BharatNet infrastructure, and even in why the Tatkal booking window jams every single morning.