Hubs, Switches & Routers
The three devices that build networks — and how traffic is addressed to one, all, or a group
We have talked about routers a lot, but they are one of three classic devices that move frames and packets around. Understanding hub vs switch vs router — and the layer each works at — ties the whole physical picture together.
The hub (layer 1)
A hub is the simplest and dumbest device. It has no intelligence: any signal arriving on one port is blindly repeated out of every other port. That wastes bandwidth and causes collisions, which is why hubs are essentially obsolete today. A hub operates at layer 1 (physical).
The switch (layer 2)
A switch is the smart replacement for a hub. It learns which MAC address lives on which port and builds a MAC address table. When a frame arrives, it forwards it only to the correct port — no flooding. Switches operate at layer 2 (data link) using MAC addresses, and they are what connects devices within a network.
The router (layer 3)
A router connects different networks together. It works at layer 3 (network) using IP addresses and a routing table to decide the next hop, exactly as we saw in the routing chapter. Switches move frames within a network; routers move packets between networks.
Hub vs switch vs router
- Hub
- Layer 1 · copies to all ports · no addressing.
- Switch
- Layer 2 · forwards by MAC · within a network.
- Router
- Layer 3 · forwards by IP · between networks.
Unicast, broadcast, multicast
Traffic can be addressed to different audiences:
- Unicast
- One sender to one specific receiver (the usual case).
- Broadcast
- One sender to everyone on the network — how ARP and DHCP Discover work.
- Multicast
- One sender to a subscribed group — e.g. streaming to many receivers.
Broadcast domains
A broadcast reaches every device in its network — but routers do not forward broadcasts, so they act as boundaries. Everything a broadcast can reach is one broadcast domain. This is a big reason we split large networks into subnets: to keep broadcast traffic contained.