A switch connects devices on the same local network.
A router connects multiples networks to each other.
| Element | Switch | Router |
|---|---|---|
| OSI Layer | Layer 2 | Layer 3 |
| Address used | MAC (Physical) | IP (Logical) |
| Role | Connects devices on a LAN | Connects different networks |
| Table used | CAM table | Routing table |
| Typical usage | Local network, VLAN, Ethernet ports | Internet, inter-networks |
Switch:
Router:
PC → Switch → Router → Internet