Networking · 11 · 3 min read
Switch vs router
Both move traffic, but at different levels: a switch inside one network, a router between networks.
Side by side
| Switch | Router | |
|---|---|---|
| OSI layer | 2 | 3 |
| Looks at | MAC | IP |
| Keeps a | MAC table | routing table |
| Connects | devices in a LAN | networks (LAN ↔ internet) |
And the hub?
A hub (layer 1) copies every signal to every port — everyone hears everything. Switches replaced hubs because they send each frame only where it needs to go.
Your home “router”
The box at home is really several devices in one: a router, a small switch, a Wi-Fi access point, a DHCP server and a firewall.