Theory
The boxes in the path
Between your laptop and a distant website, your data passes through several kinds of network devices, each a specialised box with one job. Some just pass signals along; others are smart enough to make decisions about where data should go.
This lesson introduces the main devices, hub, switch, router, modem, access point, and gateway, and notes which layer of the network each works at. That layer idea (from the OSI model, taught in full soon) is the neatest way to see how these devices differ: broadly, the higher the layer, the smarter the device.
At a glance
| Device | Job | OSI layer |
|---|---|---|
| Hub | Repeats an incoming signal out to ALL ports (no addressing) | Physical (1) |
| Switch | Forwards frames to the correct port using MAC addresses | Data Link (2) |
| Access point | Connects wireless (Wi-Fi) devices to a wired network | Data Link (2) |
| Router | Directs packets BETWEEN networks using IP addresses | Network (3) |
| Modem | Converts digital data to and from a carrier signal to reach the ISP | Physical (1) |
| Gateway | Connects and translates between different networks/protocols | Up to Application (7) |
Theory
Hub, switch, router: dumb to smart
Three devices show a clear progression in intelligence.
A hub is the simplest: it takes a signal arriving on one port and blindly repeats it out every other port, with no idea who it is for. Wasteful, and now largely obsolete.
A switch is smarter: it learns the MAC (hardware) address of the device on each port and forwards a frame only to the correct port. Much less wasted traffic, which is why switches replaced hubs.
A router is smarter still: it works with IP addresses and forwards data between different networks, deciding the best path. Routers are what stitch networks together into the internet.
Formula
Higher layer, smarter decision
Notice the pattern in the table: as a device works at a higher OSI layer, it makes smarter decisions. A hub at the physical layer just moves signals. A switch at the data link layer decides by hardware (MAC) address within a local network. A router at the network layer decides by IP address between networks. A gateway can go all the way up to the application layer to translate between entirely different systems.
So 'which layer does it work at?' is really asking 'how smart is its decision?'. That single idea organises all these devices.
Quiz
Which device forwards data between two different networks using IP addresses, and therefore operates at the network layer?
- A hub, which operates at the network layer
- A router, which uses IP addresses to forward packets between networks (network layer)
- A switch, which routes between networks using IP addresses
- A modem, which chooses the best path by IP
Show the answer
A router, which uses IP addresses to forward packets between networks (network layer)
A router operates at the network layer (layer 3) and uses IP addresses to forward packets BETWEEN different networks, choosing a path, which is exactly what connects networks into the internet. Option A is wrong: a hub works at the PHYSICAL layer (1) and does no addressing at all; it blindly repeats signals to every port. Option C is a common mix-up: a switch works at the DATA LINK layer (2) using MAC (hardware) addresses to forward frames WITHIN a local network, not IP addresses between networks, that inter-network, IP-based job is the router's. Option D is wrong: a modem converts signals to reach the ISP (physical-layer signalling); it does not path-select by IP. Remember: switch = MAC within a network (layer 2); router = IP between networks (layer 3).
Think first
Why did switches replace hubs almost everywhere?
Hubs and switches both connect devices in a local network. Why is the switch so much better that hubs vanished? Then tap.
Show the answer
Because a switch sends each frame ONLY to its intended recipient, while a hub floods every frame to EVERY device, which wastes bandwidth and hurts both performance and privacy. A hub is a dumb repeater: whatever arrives on one port is copied to all other ports, so every device on the hub receives every message and must examine and discard the ones not meant for it. As traffic grows, this causes constant COLLISIONS (two devices transmitting at once on the shared medium) and congestion, so a busy hub network slows badly, everyone is effectively sharing one conversation. A switch is intelligent: it learns which device (by MAC address) is on each port and forwards a frame only to the exact port where the recipient lives. That means separate conversations can happen simultaneously without colliding, so total throughput is far higher, and devices no longer see traffic that is not theirs, which is better for both speed and privacy. Switches became cheap enough that there was no reason to keep using hubs, so hubs disappeared from modern networks. The lesson generalises the whole topic: smarter, address-aware forwarding (a higher-layer decision) beats blind repetition. Targeted delivery beats broadcasting to all.
Summary
Key takeaways
- Data passes through specialised network devices, each with one job, and each operating at a particular OSI layer.
- Hub: physical layer (1), blindly repeats a signal to all ports, no addressing (now obsolete).
- Switch: data link layer (2), forwards frames to the correct port by MAC (hardware) address.
- Router: network layer (3), forwards packets between different networks using IP addresses.
- Modem: converts data to and from a carrier signal to reach the ISP; access point: adds Wi-Fi at the data link layer.
- Gateway: connects and translates between different networks/protocols, up to the application layer.
- Memory hook: higher layer means smarter decision; switch by MAC within a network, router by IP between networks.