Explainer

Hub vs Switch: What's the Difference?

The core difference is the OSI layer they operate at, and everything else follows from that. A hub is a Layer 1 (physical) device: it's a "dumb" multiport repeater that takes every bit arriving on one port and blindly copies it out every other port. It has no idea what a MAC address is. A switch is a Layer 2 (data-link) device: it reads the source MAC address of each frame, builds a MAC address table, and forwards frames only out the port where the destination actually lives.

That single distinction cascades into performance and design. Because a hub repeats everything to everyone, all of its ports share one collision domain and can only run half-duplex — two devices talking at once collide, and everyone has to back off. A switch gives every port its own collision domain and runs full-duplex, so a full-duplex link has no collisions at all and each device gets dedicated bandwidth. That's why switches completely replaced hubs; a hub is obsolete gear you'll only meet in a history lesson.

At a glanceHubSwitch
OSI layerLayer 1 (physical) — a multiport repeaterLayer 2 (data link) — reads MAC addresses
Forwarding behaviorFloods every incoming bit out all other portsLearns MACs and forwards each frame only to the destination port
Collision domainsOne shared collision domain for all portsA separate collision domain per port
DuplexHalf-duplex only (send or receive, not both)Full-duplex per port (no collisions on the link)
MAC address awarenessNone — no MAC address table, no addressing logicBuilds and maintains a MAC address table
BandwidthShared among all connected devicesDedicated to each port
Broadcast domainOne broadcast domainOne broadcast domain (per VLAN); routers/VLANs bound it
Status todayObsolete / legacyStandard access-layer device

What a hub is

A hub is the simplest possible network device: a Layer 1 multiport repeater. When a signal comes in on one port, the hub regenerates it and pushes it out every other port, bit for bit. It doesn't read addresses, doesn't make decisions, and doesn't remember anything about who is connected.

Because every port hears every transmission, all ports live in a single shared collision domain and the whole hub runs half-duplex. Only one device can talk at a time; when two transmit at once, the signals collide and both must retransmit. As you add devices, collisions rise and usable throughput falls. Sending every frame to every port is also a security weakness — anyone plugged in can passively see all the traffic.

What a switch is

A switch is a Layer 2 device that makes forwarding decisions based on MAC addresses. As frames arrive, it records each source MAC and the port it came in on, building a MAC address table. Once it knows where a destination lives, it forwards that frame out only the correct port instead of flooding it everywhere.

Every switch port is its own collision domain and runs full-duplex, so devices send and receive simultaneously with no collisions on the link, and each port gets dedicated bandwidth. The switch only floods a frame out all ports (within the VLAN) in specific cases — a broadcast, a multicast, or an unknown-unicast destination it hasn't learned yet.

The key differences explained

Forwarding intelligence is the root difference. A hub floods blindly at Layer 1; a switch learns MACs and forwards selectively at Layer 2. That's what makes a switch faster, quieter, and more secure on the wire.

Collision domains follow from it. A hub is one big shared collision domain, so contention grows with every device. A switch isolates each port into its own collision domain, and full-duplex links eliminate collisions entirely — which is why a switch scales while a hub chokes.

Broadcasts are the exception both share. A switch does not break up broadcast domains: a switch (or a single VLAN on it) is still one broadcast domain, and a broadcast frame is flooded to every port in that VLAN. It's routers — and VLAN boundaries — that separate broadcast domains, not the act of switching itself.

When to choose each

In practice you always choose a switch. For any modern LAN — connecting PCs, servers, phones, APs, or other switches — a Layer 2 switch is the standard access device. If you also need traffic to move between VLANs, a Layer 3 switch adds SVIs and routed ports to do inter-VLAN routing in hardware, but that's a separate capability layered on top.

A hub has no real use case left. You'd only encounter one in legacy equipment, a training exercise about collision domains, or occasionally as a crude way to mirror traffic to a sniffer (a job a switch does properly with a SPAN/mirror port). For new designs, treat the hub as museum hardware.

A common gotcha

The classic mistake is assuming a switch "breaks up" broadcast traffic the way it breaks up collisions. It doesn't. Each switch port is its own collision domain, but the whole switch (per VLAN) is a single broadcast domain, and broadcasts flood to every port in that VLAN. To bound broadcasts you need a router or additional VLANs.

The second trap is expecting a switch to instantly know every destination. Until a MAC is learned, a frame to an unknown unicast address is flooded out all ports — behaving hub-like for that one frame. The switch learns the address the moment that device replies, and forwarding becomes selective from then on.

Frequently asked questions

Which is better, a hub or a switch?

A switch, without exception. It forwards frames only where they need to go, gives each port its own collision domain and full-duplex dedicated bandwidth, and is more secure because it doesn't broadcast every frame to every port. A hub is slower, collision-prone, and obsolete — there's no scenario where a hub is the better choice for a modern network.

When would I use a hub?

Essentially never in a real network today. Hubs are legacy Layer 1 devices you might only see in old equipment, a lab demonstrating collision domains, or as a makeshift traffic tap for a packet sniffer — and even that job is done better by a switch's SPAN/mirror port. For anything new, use a switch.

What's the main difference between a hub and a switch?

A hub is a Layer 1 device that floods every bit out all ports, putting all ports in one shared collision domain and running half-duplex. A switch is a Layer 2 device that learns MAC addresses and forwards each frame only to the correct port, giving every port its own collision domain and full-duplex operation. In short: a hub repeats blindly, a switch forwards intelligently.

Now build it on real Cisco IOS

Concepts stick when you configure them. Try a free graded lab, then grade your own config against the answer key.