LAN, MAN, WAN and Network Topologies

Networking Basics · 25 min

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
Scale answers who owns the wire. Topology answers what survives when the wire is cut. Almost every question in this lesson is one of those two wearing a different hat.

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.

Scale decides who owns the medium, and that owner decides speed, delay and cost per bit. Topology decides what still works when one node or one cable fails. Neither one answers the other one's question.
LinkOne connection between two points: a cable, a fibre pair, or capacity leased from a carrier. Topology arithmetic counts links, and every link costs money to install and to keep.
Propagation delayHow long a signal takes to cross the medium: distance divided by propagation speed. In copper and in glass that is about 2 × 108 m/s, which is 5 microseconds per kilometre. Bandwidth does not change it.
Single point of failureOne component whose loss disconnects other, healthy components from each other. A star has exactly one, a ring has as many as it has nodes and cables, and a full mesh has none. Naming them is what a topology question is really asking for.

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.

PAN · a few metresearbuds, phone, laptop over Bluetooth; you own every part of it
LAN · one building24 machines on one switch; the college owns the cable, so speed is a purchase
CAN · one propertyfive buildings, 800 m of the college's own fibre; nobody to ask before laying more
MAN · one citytwelve colleges, 25 km apart; the fibre crosses public roads, so a carrier owns the span
WAN · a countrythe 2,000 km hop to a cloud region; you buy capacity and inherit the delay

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:

1
Across the labThe longest twisted-pair run allowed for 1000BASE-T is 100 m, so take the worst case in the room.100 m ÷ (2 × 10^8 m/s) = 5 × 10^-7 s = 0.5 µs
2
Across the campus800 m of the college's own fibre between the far corners of the property.800 m × 5 µs/km ÷ 1000 = 4 µs
3
Across the city25 km on the metro fibre, and the cable does not run in a straight line, so treat this as a floor.25 km × 5 µs/km = 125 µs
To the cloud region2,000 km of fibre, one way. Double it for a request and its reply, and that is the floor under every round trip the application makes.2000 km × 5 µs/km = 10,000 µs = 10 ms one way · 20 ms round trip

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.

ScaleSpanWho owns the mediumTypical speedOne-way propagation delayErrors and lossCost per bit
PANa few metres, around one personyou a few Mbps on Bluetoothunder 0.1 µs high raw error rate on a shared unlicensed band, hidden by retransmissionnegligible, nothing recurring
LANa room to a building; 100 m per twisted-pair runthe organisation, outright 1 Gbps at the desk, 10 to 100 Gbps between switchesunder 1 µs very low; wired Ethernet is specified at a bit error rate of 10^-12 or betterlowest, and the cable is a one-off
CANseveral buildings on one property, up to a few kmthe organisation, including the fibre between buildings same as a LAN, 1 to 10 Gbps between buildingsa few µs as low as a LAN, because it is the same kind of linklow, still mostly a one-off
MANone city, roughly 5 to 50 kmusually a metro carrier, because the fibre crosses public land 100 Mbps to 10 Gbps on Metro Ethernettens to hundreds of µs low on fibre, but now it is somebody else's SLA rather than your own handsmiddle, and recurring
WANa country to the globe, hundreds to thousands of kmtelecom carriers; you buy capacity, not cable a few Mbps to many Gbps, priced per Mbpsms to hundreds of ms most loss is congestion in router queues, not noise on the wirehighest, and recurring
Internetglobal, and not a scale at all: an internetworknobody; tens of thousands of independently run networks whatever the worst hop on the path gives youadds up hop by hop best-effort by design; nothing on the path promises deliveryyou 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.

TopologyHow it is wiredLinks for n nodesPorts per nodeSingle point of failureAdding a nodeActually seen in
Busone backbone cable; every node taps into it1 backbone + n drops1 the backbone: one cut splits the networktap in, and the segment is disturbed while you do itthe Controller Area Network bus in vehicles, RS-485 industrial lines, historic 10BASE2 and 10BASE5
Starevery node has one cable to a central hub or switchn1, and n on the centre the central device: all n go darkrun one cable to a free port; nothing else is touchedevery modern wired LAN, and every Wi-Fi cell with the access point at the centre
Ringeach node cabled to the next; the last one closes back to the firstnexactly 2, forever any node and any cable: one break opens the loopyou have to open the ring to splice the new node inSONET/SDH and Metro Ethernet rings; historic Token Ring and FDDI
Treea hierarchy of stars; every node hangs off exactly one parentn - 11 upward, one per child any internal node: its whole subtree goes with itplug into the nearest switch, exactly like a starthree-tier campus designs, PON fibre to the home, cable TV distribution
Full meshevery node cabled directly to every other noden(n-1)/2n - 1 nonen new cables, one to every node that already existsa handful of core routers, links between an ISP's points of presence, small wireless meshes
Hybriddifferent topologies at different layers of the same networkthe sum of its partsvaries by layer whatever the weakest part contributesdepends which part you are adding toevery 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:

1
Count from one nodeA needs a cable to B, to C, to D and to E. That is every node except itself.cables at one node = n - 1 = 5 - 1 = 4
2
Count from every nodeEach of the five nodes has four cables coming out of it, so count the cable ends.n(n - 1) = 5 × 4 = 20 cable ends
3
Halve itThe cable between A and B was counted twice, once at A and once at B, and so was every other cable. Every cable has exactly two ends.n(n - 1) / 2 = 20 / 2 = 10 cables
Check it, then scale itThe console below draws exactly ten lines between five nodes, so count them. Then watch the number leave the ground: it grows with the square of n while the port count grows only linearly.n = 6 → 15   n = 10 → 45   n = 50 → 1225 cables and 49 ports per node

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.

A switch splits collision domains. It does not split broadcast domains, because it floods a broadcast frame out of every port. A hub splits nothing at all. Only a router, at layer 3, ends a broadcast domain, and that is the whole reason the device table is worth memorising.

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.

internetLower-case i, a common noun. Any two or more networks joined by routers so that they behave as one. Two LANs in one office joined by a router are an internet.
InternetCapital I, a proper noun. The one global public internetwork, built from tens of thousands of independently administered networks running IP with globally unique addresses and stitched together by BGP.
intranetA private network that uses exactly the same technologies, IP and HTTP and DNS, but is reachable only from inside one organisation. It is defined by who can reach it, not by what it runs.
extranetAn intranet with controlled access extended to named outsiders such as suppliers or partners, usually over a VPN, which is why the fourth word is one clause long.

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.

TopologyLinks for nPorts per nodeThe failure that hurtsSay this
Bus1 + n1one cut in the backboneCheapest cable, worst fault isolation. Every node shares one medium, so only one node may transmit at a time.
Starn1, and n on the centrethe central deviceOne cable per node and one box that owns everything. A node failure costs one node; the centre costs all of them.
Ringn2any node or any cableTwo ports per node however large it grows, and one break anywhere opens the loop.
Treen - 11 up, one per childany internal nodeA hierarchy of stars. The higher up the failure, the bigger the subtree that goes with it.
Full meshn(n-1)/2n - 1nothing singleNo single point of failure, paid for in cable that grows with the square of n and in n-1 ports on every box.
Hybridthe sum of its partsvaries by layerthe weakest partWhat every real network actually is, because each layer can afford a different failure mode.
The scale ladder in one line: PAN a few metres, LAN a room to a building, CAN one property, MAN one city, WAN a country to the globe. The line that matters sits between CAN and MAN. Below it you own the cable; at and above it you are renting a right of way, and every other difference follows from that.
Ports are the hidden costCable count is what gets asked; port count is what gets bought. A star's n cables all land on one box that needs n ports, and that box is the budget. A ring needs exactly two ports per node however large it grows, which is why rings looked attractive back when ports were the expensive part.
Delay is distance, not moneyAbout 5 microseconds per kilometre, in copper and in glass. Upgrading a 2,000 km link from 1 Gbps to 10 Gbps leaves its 10 ms one-way propagation delay exactly where it was. The only levers are moving the data closer, or making fewer round trips over the same link.
Physical is not logicalA star wired to a hub behaves like a bus: one collision domain, one transmitter at a time. Wired to a switch it is a star both physically and logically. When a question says "star", find out which box is in the middle before you answer anything about collisions.

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.

Wi-Fi 6 · IEEE 802.11
A Wi-Fi cell is a star, and the AP is the centre

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.

Cisco IOS · three-tier campus
Tree at the edge, mesh at the top

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.

SONET/SDH · Metro Ethernet
The metro runs on rings, because fibre follows roads

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 bus · ISO 11898
The bus survived, in your car

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.

Nobody picks a topology off a list. They pick it from a constraint: how much cable, how many ports on the box already bought, which failure the business cannot afford, and whether the cable has to cross land somebody else owns. Name the constraint out loud and the topology names itself.

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?
Span is the textbook answer: a LAN covers one room, floor or building, and a WAN spans cities or countries. The property that changes your engineering is ownership. On a LAN you own the medium, so more capacity is a purchase you make once and install yourself; on a WAN you rent capacity from a carrier and live with a contract. Speed, propagation delay and cost per bit all follow from that one difference.
Where does a MAN sit, and does anybody still use the word?
A MAN covers a single city, roughly 5 to 50 km, and it is the scale at which the cable starts crossing public land, so it needs a right of way and in practice a carrier. What a MAN is today is Metro Ethernet or a SONET/SDH ring; the original standard was IEEE 802.6 DQDB. The term is fading in industry but is still asked in exams, so know the span and know that ownership is what makes it different from a campus network.
Is the Internet just a very large WAN?
No. A WAN has one administrative owner you could phone. The Internet is an internetwork: tens of thousands of independently owned and independently run networks joined by routers, held together by IP addressing and BGP, with nobody in charge. Individual carrier backbones inside it are WANs, and that is where the confusion comes from.
internet, Internet, intranet: say the difference.
Lower-case internet is a common noun: any two or more networks joined by routers so that they behave as one. Capital-I Internet is a proper noun for the single global public one. An intranet is a private network that uses exactly the same technologies but is reachable only from inside one organisation, and an extranet is an intranet opened to named outsiders such as suppliers, usually over a VPN.
How many links does a full mesh of n nodes need, and how many ports per node?
n(n-1)/2 links and n-1 ports. Each node needs a cable to every other node, which is n-1 cables from each of n nodes, and counting it that way counts every cable twice, once from each end, so you halve it. For five nodes that is 10 cables and 4 ports on every box.
Star versus bus: which one fails better?
Neither. They fail differently, and that is the answer. In a star a dead node costs that node and a cut cable costs that node, but the central device costs all of them at once. In a bus a dead node costs nothing to anybody else, and one cut in the backbone splits the network into two halves that cannot hear each other. Name which failure the question cares about and the comparison answers itself.
Why does one break kill a ring when the surviving nodes are still physically strung together?
Because the signal travels one way round the loop and every station repeats it to the next one. Open the loop anywhere and there is no path round the gap, so a dead station and a cut cable are the same event. The survivors really are still connected as a line, which is exactly why the fix is a hardware one rather than a rewiring one.
A hub and a switch both make a physical star. What is the difference?
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 behaves logically as a bus. A switch is a layer 2 device: it learns which MAC address is on which port and forwards a frame only there, so every port is its own collision domain. Neither one splits the broadcast domain, because a switch floods a broadcast out of every port; only a router, at layer 3, ends one.
Which topology do modern wired LANs actually use?
A star, or a tree of stars. Every node has one cable to a switch port, and switches hang off other switches through a distribution layer up to a core. Bus disappeared with 10BASE2 coax because one cut took the segment down and fault-finding meant walking the cable; ring survived in the metro, on carrier fibre, not in the office.
Why does propagation delay matter more on a WAN than on a LAN?
Because it is distance divided by propagation speed, about 5 microseconds per kilometre in copper and in glass, and it is fixed by geography rather than by what you paid. Inside a building the distance term is negligible against everything else in the path; across a country it is the largest term in the round trip. That is why a protocol that sends one request and waits for the reply feels instant on a LAN and unusable over a WAN, and why the fix is fewer round trips.
Where would you genuinely use a full mesh?
Between a small number of nodes that must not lose each other: a handful of core routers in one data centre, or the links between an ISP’s points of presence. Past a few nodes the cable count and the port count decide it for you, so real networks build a partial mesh instead, with enough redundant paths to survive a break and nothing like every pair connected.
What is a hybrid topology, and why is every real network one?
A hybrid joins different topologies at different layers of the same network: a star where users plug into a switch, a tree between the switches, and a ring or a partial mesh between the core devices. Each layer picks the failure it can afford at that layer, and the answer at a desk is not the answer in a backbone, so a single-topology network is a diagram rather than a deployment.

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.

Sort five onto the ladder

Easy
Classify each of these as PAN, LAN, CAN, MAN or WAN, and name the property that decided it: a wireless keyboard and mouse paired to one desktop; forty desks on two switches on one office floor; a hospital’s four blocks joined by fibre the hospital laid across its own grounds; a bank branch in Pune reaching its core banking system in Mumbai over a leased line; a city’s traffic-signal controllers joined by fibre the municipal corporation owns along the roads.
Follow-up
Two of the five are joined by fibre the organisation owns outright, and they still land in different families, so ownership on its own does not settle it either. Only asking both questions in order does.
Show the hint
For each one ask two things in this order: how far does it reach, and whose land does the cable cross.

Count the ports

Easy
Twelve nodes are to be wired first as a star and then as a ring. For each of the two designs, state the total number of cables and the number of ports on the single busiest device.
Follow-up
The star’s cable count and its busiest port count are two different numbers; the ring’s are not. The question is really asking where each design hides its cost.
Show the hint
One of the two designs has a device that is not one of the twelve nodes. Count that device’s ports too.

The twenty-seventh PoP

Medium
An ISP wants each of its 26 points of presence connected directly to every other one. Compute the number of links. Then compute how many links it would have to add to open a 27th PoP, and say which of the two numbers is the one that actually ends the discussion in a budget meeting.
Follow-up
The total grows with the square of n, but the marginal cost of one more node does not. The number everybody quotes and the number that kills the design are not the same number.
Show the hint
The new PoP needs one link to each PoP that already exists. You do not need the formula twice to get the second answer.

Count a three-tier campus

Medium
A campus has 1 core switch, 4 distribution switches each cabled to the core, and 6 access switches under each distribution switch. Counting only switches as nodes, name the topology, compute the total number of switches and the total number of links, and state how many switches lose their path to the core if one distribution switch fails.
Follow-up
The link count can be got two ways, by adding up the tiers or by using the formula for this topology, and getting the same answer both ways is the check. The last part is not a count of devices that broke.
Show the hint
Add the tiers up first to get the number of switches, then ask how many parents each switch has.

Thirty machines, a twenty-four port switch

Medium
A lab has 30 machines and you have been given one 24-port switch. Buying a bigger switch is not an option. Give two different wirings that connect all 30 machines, name the topology each one produces, and name the new single point of failure each one introduces.
Follow-up
Both answers need a second device, and the two designs do not fail in the same place, so "add another switch" is the start of the answer rather than the answer.
Show the hint
Ask what the cable between two switches is, and what happens to the machines on the far side of it when it is unplugged.

Survive any one cut, cheaply

Hard
Six sites must be connected so that every pair still has a path between them after any single cable is cut. A full mesh does it with 15 cables. Find the smallest number of cables that also does it, give one wiring that achieves that number, name which topology from this lesson your answer is, and state the minimum number of cables each site must have with the one-line argument for it.
Follow-up
The only shape in this lesson with no single point of failure is the one that costs 15 cables here, so the answer has to come from somewhere else. The question also asks whether a path still exists between every pair after the cut, not whether traffic keeps flowing exactly as it did before, and separating those two is the whole problem.
Show the hint
If a site has only one cable, cutting that cable disconnects it, so start by working out the smallest number of cables each site is allowed to have.