The Hardware Hierarchy
Hub vs Switch vs Router
1. The Hub: The Dumb Repeater (Layer 1)
A Hub is a multiport repeater. It has zero intelligence. When a signal arrives on Port 1, the hub simply copies that electrical signal to every other port on the device.
- Collision Domain: One. If two devices talk at once, the signal is destroyed.
- Security: None. Every computer on the hub sees all the data meant for everyone else.
- Modern Use: Almost non-existent, except for legacy industrial systems.
2. The Switch: The Bridge of Learning (Layer 2)
A Switch looks at the MAC Address of the incoming frames. It builds a CAM (Content Addressable Memory) table to remember which device is on which port.
This allows for "Unicast" communication: data is sent only to the port where the destination device is plugged in.
3. The Router: The Gatekeeper (Layer 3)
A Router connects completely different networks together (e.g., your home network to the Internet). It makes decisions based on IP Addresses.
4. Technical Comparison
| Feature | Hub | Switch | Router |
|---|---|---|---|
| Intelligence | None (Repeats) | Low (Learns MACs) | High (Calculates Paths) |
| Transfer Type | Broadcast Only | Unicast / Multicast | Routed / NAT |
| Collision Domain | Shared (1) | Individual (Per Port) | Individual (Per Port) |
5. Collision vs Broadcast Domains
To truly master these devices, you must understand the two types of "Traffic Borders":
- Collision Domain: Hubs group all ports into one collision domain. Switches split them into individual domains (Full Duplex).
- Broadcast Domain: Switches group all ports into one broadcast domain (unless using VLANs). Routers split them into separate domains.
6. The Layer 3 Switch: The Modern Hybrid
In a modern data center, we don't use traditional routers for local traffic. We use Layer 3 Switches. These devices have specialized hardware (ASICs) that allow them to route between IP subnets at massive speeds, far faster than a traditional software-based router could manage.
Conclusion: Choosing the Right Tool
Choosing between a Hub, Switch, and Router is no longer a matter of cost—it is a matter of architecture. Hubs are a relic of the past, useful only for specific sniffing tasks. Switches are the heartbeat of our local networks, providing dedicated lanes for our data. Routers are the brains of our global infrastructure, navigating millions of possible paths to find the right destination.
Frequently Asked Questions
Can I use a Router as a Switch?
Most consumer routers have a built-in 4-port switch. If you disable the DHCP server and ignore the WAN port, you can technically use it as a standard switch.
Is an 'Unmanaged Switch' basically a Hub?
No. Even the cheapest unmanaged switch still learns MAC addresses and prevents collisions. A Hub is physically incapable of distinguishing between ports.
What is 'Flooding'?
When a Switch receives a frame for a MAC address it hasn't learned yet, it "floods" the frame out of every port except the one it came in on. Once the target device replies, the switch "learns" its position and stops flooding.