Hub vs Switch vs Router: What's the Difference?
These three devices are constantly confused, but they work at different layers and do different jobs: a hub blindly repeats (Layer 1), a switch forwards frames by MAC address within a network (Layer 2), and a router forwards packets between networks by IP address (Layer 3).
Side by side
| Device | OSI Layer | Forwards by | Key behaviour |
|---|---|---|---|
| Hub | 1 (Physical) | Nothing — repeats to all ports | One collision domain, obsolete |
| Switch | 2 (Data Link) | Destination MAC address | Per-port collision domains, one broadcast domain |
| Router | 3 (Network) | Destination IP address | Separates broadcast domains, connects networks |
The details that matter
A hub is a dumb repeater — everything in, everything out, causing collisions; it's effectively extinct. A switch learns MAC addresses and forwards frames only to the right port, giving each device its own collision domain — but all ports share one broadcast domain. A router is the boundary between networks: it stops broadcasts and routes between subnets using IP. Modern networks use switches within a LAN and routers to connect LANs — a core CCNA concept covered in our routing & switching guide.
Frequently asked questions
What is the main difference between a switch and a router?
A switch forwards frames within a network using MAC addresses (Layer 2); a router forwards packets between networks using IP addresses (Layer 3) and separates broadcast domains.
Why are hubs obsolete?
A hub repeats every signal to all ports, creating one big collision domain and wasting bandwidth. Switches replaced them by forwarding intelligently.
Does a switch separate broadcast domains?
No — a standard switch has one broadcast domain across all ports (unless VLANs are used). Routers separate broadcast domains.
Related articles
Want hands-on training?
Learn this on real Cisco lab devices with placement support at Attila Technologies, Ahmedabad.