← Module 01 · Networking Fundamentals FUND

Hubs vs Switches vs Routers

Three boxes that all "connect devices," but each one decides where your data goes using a completely different — and increasingly smart — method.

Hub — the loudspeaker

A hub has no idea who's connected to which port and doesn't try to find out. Whatever comes in one port gets repeated out every other port, blindly. It's like a party host who repeats every single announcement to the entire room over a megaphone, even a private message meant for one guest — everyone hears everything, and it's up to your own device to ignore what isn't addressed to it. This wastes bandwidth and only allows one conversation on the whole hub at a time. Hubs are effectively obsolete.

Switch — the receptionist who knows everyone's desk

A switch learns which device is on which port by watching source MAC addresses go by, and builds a MAC address table from that. Once it knows where a device lives, it forwards traffic only to that specific port instead of flooding everywhere. It's like an office receptionist who's memorized exactly which desk everyone sits at — a call for "Priya" gets transferred straight to Priya's desk phone, not announced over the building intercom. Each port also gets its own collision domain, so multiple conversations can happen at once at full speed. This is what almost every physical network port connects to today.

Router — the sorting office between cities

A switch only knows about devices on its own local network. A router's job starts where the switch's knowledge ends: it connects two or more different networks and decides which one a packet needs to go out on next, based on the destination IP address and its routing table. This is a postal sorting office: a letter addressed to a different city doesn't get delivered by the local carrier — it gets handed off to the truck or plane heading toward that city's own sorting office, which then hands it to a local carrier there.

HUB Hub — floods every port SW Switch — forwards to one port SW-A R1 SW-B Router — connects two networks
Same request, three devices, three completely different decisions about where it goes.
DeviceDecision basisScopeAnalogy
HubNone — floods everythingOne shared segmentMegaphone announcement to the whole room
SwitchDestination MAC addressOne local network / VLANReceptionist who knows every desk
RouterDestination IP addressBetween different networksPostal sorting office between cities