System Atlas
the atlas

Hub, switch and router explained

Three boxes that look alike but work at completely different layers.

the gist

A hub is a dumb Layer 1 repeater that copies every signal to every port; a switch is a Layer 2 device that learns MAC addresses and forwards frames only to the right port; a router works at Layer 3, moving packets between separate networks by IP. A modem converts signals for the ISP line, and the router's LAN address is your default gateway — the exit to everywhere else.

ANALOGY // In an office: a hub is an intercom that blasts every message to all rooms, a switch is a mail clerk who delivers each envelope to exactly the right desk, and a router is the front-door courier who carries mail between your building and the rest of the city.
living diagram01 / 06
floodPC APC BHubL1 · repeats to allSwitchL2 · MAC tableRouterL3 · gatewayModemsignal convertInternetother networks
01

The hub (Layer 1)

A hub is the simplest device: it operates at the physical layer and does nothing but repeat electrical signals. Whatever arrives on one port is blasted out of every other port, whether or not it was meant for them. Because all ports share one medium, only one device can talk at a time — everything sits in a single collision domain — which is why hubs are obsolete.

02

The switch (Layer 2)

A switch is the intelligent replacement for a hub. It reads the MAC address in each frame and builds a table mapping addresses to ports, so it forwards a frame only out of the port where the destination actually lives. Each port becomes its own collision domain, letting many devices communicate simultaneously at full speed.

03

The router (Layer 3)

A switch only moves traffic within one network; a router connects different networks together. It works at the network layer, reading the destination IP address and consulting a routing table to decide the next hop toward that network. This is the device that lets your home LAN reach the entirely separate networks that make up the internet.

04

The modem

A modem sits between your network and the ISP, translating your equipment's digital signal into whatever the line carries — cable, fibre or DSL — and back again. It is often confused with a router but does a different job: the modem provides the link to the ISP, the router shares that link across your devices. Many home boxes simply combine both functions in one unit.

05

The default gateway

When a device wants to reach something outside its own subnet, it does not know the path — so it sends the packet to its default gateway, which is the router's address on the LAN (often 192.168.1.1). The router then forwards it onward toward the destination network. The gateway is simply the agreed exit door for all off-network traffic.

06

Broadcast vs collision domains

These devices are best understood by the domains they create. A hub is one shared collision domain; a switch gives each port its own collision domain but keeps a single broadcast domain across them. A router bounds broadcast domains — broadcasts do not cross it — which is why routers segment large networks into manageable, isolated pieces.

the full picture
01

Why these devices exist

Connecting computers seems like it should need just wires, but the moment you have more than two machines you face real questions: how does a signal reach the right recipient, how do many devices share a medium without shouting over each other, and how do separate networks reach one another? Hubs, switches and routers are the historical answers to those questions, each solving a harder version of the problem at a higher layer of the network stack.

The single most useful lens for keeping them straight is the OSI layer each operates at. A hub works at Layer 1 (physical), a switch at Layer 2 (data link, MAC addresses), and a router at Layer 3 (network, IP addresses). As you climb the layers the device gets smarter — it understands more about the traffic and makes better decisions — and the story of home and office networking is essentially the story of moving up these layers.

02

The hub — a dumb repeater

A hub is the most primitive multi-port device. It operates purely on electrical signals with no understanding of what they mean: a bit arriving on one port is simply regenerated and pushed out of every other port. It is a repeater with more than two ports, nothing more.

That simplicity is also its fatal flaw. Because every port receives every transmission, all connected devices share one collision domain — a single conversation space. If two devices transmit at once their signals collide and both must back off and retry, so effective throughput collapses as you add machines. There is also no privacy: every device sees traffic meant for others. For these reasons hubs are essentially extinct, replaced entirely by switches, but they remain the perfect teaching example of "Layer 1 with no intelligence."

03

The switch — learning who is where

A switch looks like a hub — a box full of ports — but it is fundamentally smarter because it reads the MAC address in each Ethernet frame. Every network interface has a unique MAC address burned in, and the switch watches the source addresses of frames to build a table mapping each MAC to the port it lives behind.

Armed with that table, the switch forwards a frame only out of the single port where the destination sits, instead of flooding all ports. (It only floods when it encounters an unknown destination or a broadcast.) The payoff is large: each port becomes its own collision domain, so many pairs of devices can communicate simultaneously at full speed without interfering. This is why a modern LAN can have dozens of machines all busy at once. A switch is the workhorse of the local network — invisible, fast, and doing far more thinking than it appears to.

04

The router — connecting networks

A switch is brilliant within one network but has no concept of a different network. That is the router's entire purpose: it connects distinct networks and forwards traffic between them. It operates at Layer 3, reading the destination IP address of each packet and consulting a routing table to choose the best next hop toward that address.

This is what makes the internet an *inter*-net — a network of networks — possible. Your home LAN is one network; your ISP's infrastructure and every website you visit are others, and the router is the hinge between them. Routers also bound broadcast domains: a broadcast sent inside your LAN does not cross the router into the wider internet, which keeps local chatter local and stops networks from drowning each other. In practice the home "router" is a combo device that also runs DHCP, NAT and a firewall, but its defining job is that Layer 3 forwarding decision.

05

Modems, gateways, and the domains that tie it together

Two more pieces complete the picture. A modem (modulator-demodulator) converts your network's digital signals into the form your ISP's physical line carries — radio frequencies over coax, light over fibre, tones over phone lines — and back again. It provides the *link* to the ISP but does no routing; people conflate it with the router only because home units usually bundle both. The default gateway is the address a device sends any off-subnet packet to; in a home it is the router's LAN IP, commonly 192.168.1.1. A device compares the destination against its own subnet, and if it is elsewhere, hands the packet to the gateway to deal with.

The cleanest way to remember the whole family is by the domains they manage. A hub is a single collision domain and a single broadcast domain — everything shared. A switch breaks the collision domain into one per port while keeping one broadcast domain. A router breaks the broadcast domain, segmenting networks entirely. Move up a layer, gain a smarter device, and shrink the blast radius of the traffic — that progression is the heart of how modern networks are built.

what to remember
01

Hub (Layer 1): repeats incoming bits out of every other port — one big shared collision domain, no intelligence.

02

Switch (Layer 2): learns which MAC address lives on which port and forwards frames only there — one collision domain per port.

03

Router (Layer 3): connects different networks and forwards packets by IP address, making routing decisions between them.

04

A modem converts between your network's digital signal and the ISP's medium (cable, fibre, DSL); it is not a router.

05

The default gateway is the router's LAN IP — the address devices send traffic to when the destination is outside their subnet.

06

Switches split collision domains but share one broadcast domain; routers bound broadcast domains.

check yourself

Quick quiz

Q1

How does a switch differ from a hub?

Q2

What is the default gateway?

follow the thread