Core CS · Computer Networks
How far it reaches, and what breaks when a cable does
Two independent choices describe any network. How far it reaches decides who owns the medium, and the owner decides your speed, delay and cost per bit. How the links are arranged decides what still works when one part of it dies.
Cut a cable in four topologies →01 The idea
Two questions, and everything else follows from them
The first question is how far the network reaches: a desk, a room, a building, a property, a city, a continent. That distance decides who owns the cable, because past your own boundary wall the cable crosses land you do not control. The owner then decides everything you care about commercially: how fast the link is, how quickly you can make it faster, how errors and loss behave, and what one bit costs you.
The second question is which node is wired to which. That decides almost nothing about speed and almost everything about failure. Two networks can be identical in scale, speed and cost and behave completely differently the first time a cleaner pulls a cable out of the wall, purely because of how the links were arranged.
Marks get lost by mixing the two up. Star is not a scale and LAN is not a shape. A LAN is nearly always wired as a star, but a WAN can also be a star, a ring or a partial mesh, and a two-node network is a single link that is every topology at once. Read the question, decide which of the two it is asking, then answer.
02 Worked example
One college, five scales, and where the ownership flips
One example carries the whole lesson: a college. A student sits at a desk with earbuds paired to a phone. The desk is in a lab of 24 machines on one switch. The lab is in one of five buildings on the college's own land. The college is one of twelve joined across the city by an education network. And the college's servers talk to a cloud region 2,000 km away. Nothing changed except how far the signal has to go, and every property of the network changed with it.
The highlighted node is the one that matters. Between CAN and MAN the ownership flips. On the left of it the college can dig its own trench, splice its own fibre and upgrade a link over a weekend. On the right of it the cable crosses land the college does not own, so it needs a right of way, which in practice means renting the span from a carrier and living with a contract. Every difference in the table below is downstream of that one flip.
Now put numbers on it. Signals move through copper and through glass at roughly 2 × 108 m/s, which is one kilometre every 5 microseconds. Work the ladder out one row at a time:
Read the ladder as one number: 0.5 µs → 4 µs → 125 µs → 10 ms. The last row is twenty thousand times the first. Bandwidth is a thing you buy, and on all four of those links you can buy more of it. The 10 ms is not for sale. It is a distance divided by the speed of light in glass, and the only ways to reduce it are to move the data closer or to stop asking so many questions.
One family is deliberately missing from that row: the Internet. It is not a sixth, larger scale. It is an internetwork, a network built out of other networks that are independently owned and independently run, joined by routers and held together by IP addressing and BGP. A WAN has one administrative owner who can be phoned. The Internet has tens of thousands of them and nobody in charge, which is exactly why it is best-effort.
03 Mechanics
Two tables, and the arithmetic behind them
The first table compares the scale families on the six properties that actually differ between them. The second compares the topologies on what they cost and what they lose. Every question this lesson can be asked is answered out of one of these two, so read the columns, not the row labels.
| Scale | Span | Who owns the medium | Typical speed | One-way propagation delay | Errors and loss | Cost per bit |
|---|---|---|---|---|---|---|
| PAN | a few metres, around one person | you | a few Mbps on Bluetooth | under 0.1 µs |
high raw error rate on a shared unlicensed band, hidden by retransmission | negligible, nothing recurring |
| LAN | a room to a building; 100 m per twisted-pair run | the organisation, outright | 1 Gbps at the desk, 10 to 100 Gbps between switches | under 1 µs |
very low; wired Ethernet is specified at a bit error rate of 10^-12 or better | lowest, and the cable is a one-off |
| CAN | several buildings on one property, up to a few km | the organisation, including the fibre between buildings | same as a LAN, 1 to 10 Gbps between buildings | a few µs |
as low as a LAN, because it is the same kind of link | low, still mostly a one-off |
| MAN | one city, roughly 5 to 50 km | usually a metro carrier, because the fibre crosses public land | 100 Mbps to 10 Gbps on Metro Ethernet | tens to hundreds of µs |
low on fibre, but now it is somebody else's SLA rather than your own hands | middle, and recurring |
| WAN | a country to the globe, hundreds to thousands of km | telecom carriers; you buy capacity, not cable | a few Mbps to many Gbps, priced per Mbps | ms to hundreds of ms |
most loss is congestion in router queues, not noise on the wire | highest, and recurring |
| Internet | global, and not a scale at all: an internetwork | nobody; tens of thousands of independently run networks | whatever the worst hop on the path gives you | adds up hop by hop |
best-effort by design; nothing on the path promises delivery | you pay an ISP, not "the Internet" |
Two of those cells deserve a sentence each, because they are where confident answers go wrong. The delay row is the one you can check: a geostationary satellite sits 35,786 km up, so a signal covers 71,572 km going up and back down, and at 3 × 108 m/s that is about 240 ms one way and roughly half a second for a round trip, whatever the link is sold as. The error row is the one to be careful about. Exams expect "WANs have higher error rates", and that answer came from analogue leased lines and modems; modern long-haul fibre has a raw error rate as good as your office cable. What is genuinely worse on a WAN is the end-to-end path: more hops, more queues, and packets dropped because a router was full rather than because a bit flipped. Say the exam answer, then say why, and you have answered both the question and the follow-up.
Now the topologies. Read the link column as arithmetic you can check by counting lines in a picture, and the failure column as the thing the question is actually about.
| Topology | How it is wired | Links for n nodes | Ports per node | Single point of failure | Adding a node | Actually seen in |
|---|---|---|---|---|---|---|
| Bus | one backbone cable; every node taps into it | 1 backbone + n drops | 1 | the backbone: one cut splits the network | tap in, and the segment is disturbed while you do it | the Controller Area Network bus in vehicles, RS-485 industrial lines, historic 10BASE2 and 10BASE5 |
| Star | every node has one cable to a central hub or switch | n | 1, and n on the centre | the central device: all n go dark | run one cable to a free port; nothing else is touched | every modern wired LAN, and every Wi-Fi cell with the access point at the centre |
| Ring | each node cabled to the next; the last one closes back to the first | n | exactly 2, forever | any node and any cable: one break opens the loop | you have to open the ring to splice the new node in | SONET/SDH and Metro Ethernet rings; historic Token Ring and FDDI |
| Tree | a hierarchy of stars; every node hangs off exactly one parent | n - 1 | 1 upward, one per child | any internal node: its whole subtree goes with it | plug into the nearest switch, exactly like a star | three-tier campus designs, PON fibre to the home, cable TV distribution |
| Full mesh | every node cabled directly to every other node | n(n-1)/2 | n - 1 |
none | n new cables, one to every node that already exists | a handful of core routers, links between an ISP's points of presence, small wireless meshes |
| Hybrid | different topologies at different layers of the same network | the sum of its parts | varies by layer | whatever the weakest part contributes | depends which part you are adding to | every real campus and every real carrier network |
One of those formulas gets asked far more than the others, so derive it rather than memorise it. Take five nodes, A to E, wired as a full mesh:
One more thing about the star, because it is the fact interviewers use to separate the candidates who have wired something from the ones who have read about it. A star is drawn the same way whether the box in the middle is a hub or a switch, and the box decides how the network behaves. A hub is a layer 1 repeater: it copies every incoming bit out of every other port, so all the nodes share one collision domain and the star is physically a star and logically a bus. A switch is a layer 2 device: it learns which MAC address lives on which port and forwards a frame only there, so every port becomes its own collision domain. A repeater is layer 1 like a hub, and it regenerates the digital signal rather than boosting the analogue one, so the noise picked up along the way is discarded instead of amplified with it. A bridge is layer 2 like a switch, and the difference between them is scale: a bridge joins two or a few segments and decides in software, while a switch does the same job across dozens of ports in dedicated hardware. A router is layer 3.
Finally, three words that cost marks every year because they differ by one capital letter, plus a fourth that turns up in the same question.
05 Cheat sheet
All six topologies on one card
Learn each row as a triple: the cable count, the failure that hurts, and the one sentence you say out loud. The cable count alone impresses nobody, and the sentence without the count sounds memorised.
| Topology | Links for n | Ports per node | The failure that hurts | Say this |
|---|---|---|---|---|
| Bus | 1 + n | 1 | one cut in the backbone | Cheapest cable, worst fault isolation. Every node shares one medium, so only one node may transmit at a time. |
| Star | n | 1, and n on the centre | the central device | One cable per node and one box that owns everything. A node failure costs one node; the centre costs all of them. |
| Ring | n | 2 | any node or any cable | Two ports per node however large it grows, and one break anywhere opens the loop. |
| Tree | n - 1 | 1 up, one per child | any internal node | A hierarchy of stars. The higher up the failure, the bigger the subtree that goes with it. |
| Full mesh | n(n-1)/2 | n - 1 | nothing single | No single point of failure, paid for in cable that grows with the square of n and in n-1 ports on every box. |
| Hybrid | the sum of its parts | varies by layer | the weakest part | What every real network actually is, because each layer can afford a different failure mode. |
06 Where & why
Where each of these is actually running
None of these shapes is a diagram from a textbook. Each one is running somewhere right now, chosen because of a constraint that had nothing to do with elegance: the cost of copper, the number of ports on a box that was already bought, or whether anyone is allowed to dig up the road.
In infrastructure mode every station sends to the access point and the access point sends it back out, even when the two stations are a metre apart. That makes a basic service set a star with the AP as the single point of failure, which is why campuses overlap cells from different APs. Wi-Fi Direct and 802.11s mesh are the deliberate exceptions.
Access switches hang off distribution switches, which hang off the core: a tree, with the n-1 links a tree always has. Then the two core switches are cross-linked to each other and each distribution switch is dual-homed to both, so the top of the tree stops being a single point of failure. That is a hybrid, and it is what "hybrid topology" means in a real building.
A carrier laying fibre around a city closes the loop and runs two fibres in opposite directions. A backhoe through one duct cuts one span, and traffic wraps back the other way, with a protection switch target of 50 ms. This is the ring topology as actually deployed: the bare ring's one fatal break, engineered away in hardware.
CAN here is Controller Area Network, which shares its initials with the campus network in section 02 and nothing else. Ethernet abandoned the bus in the 1990s, but a vehicle still runs a two-wire bus with a 120 Ω terminator at each end, because a bus needs the least wire and a car counts grams of copper. Every node hears every frame and only one transmits at a time, exactly as 10BASE2 coax did, and a break in the middle splits the car's network in two.
07 Interview questions
What they actually ask
This is the first block of questions in almost every networking interview, and it is the one candidates rush. Expect to be given a scenario and asked to classify it, then asked what fails, then asked to justify the shape you just named.
What actually separates a LAN from a WAN?
Where does a MAN sit, and does anybody still use the word?
Is the Internet just a very large WAN?
internet, Internet, intranet: say the difference.
How many links does a full mesh of n nodes need, and how many ports per node?
Star versus bus: which one fails better?
Why does one break kill a ring when the surviving nodes are still physically strung together?
A hub and a switch both make a physical star. What is the difference?
Which topology do modern wired LANs actually use?
Why does propagation delay matter more on a WAN than on a LAN?
Where would you genuinely use a full mesh?
What is a hybrid topology, and why is every real network one?
08 Practice problems
Six to work through
For every one of these: write down the two questions first. How far does it reach, and how are the links arranged. Answering before you have separated those two is how a scale question gets a topology answer.