Blog • SHM Soft

Switch vs Hub: Key Differences

A hub and a switch look almost identical — same box, same ports. But inside, they work in opposite ways. One shouts every message to everyone, the other delivers it quietly to the right device. Here is the difference.

Published 28 November 2026 • SHM Soft

Put a hub and a switch side by side and you cannot tell them apart. Both are small boxes with a row of Ethernet ports and a row of blinking lights. Plug computers into either one and the computers will talk to each other. So why did the switch replace the hub everywhere? Because of what happens inside the box.

In this guide, we explain what a hub does, what a switch does, how they differ, and why you will almost never see a hub in a modern network. If you are studying for the CCNA, this is also one of the classic comparison questions, so it is worth knowing well.

Ethernet switch device with network cables connecting computers

Switch vs Hub: The Short Answer

A hub is a simple repeater. When a packet arrives on one port, the hub copies it out of every other port, to every device, whether the packet is for them or not. A switch is intelligent. It learns which device is on which port, and it sends each packet out of only the port that leads to the right device. Short version: a hub broadcasts everything to everyone, and a switch delivers each packet to its destination only.

The difference sounds small, but it changes everything. A hub wastes bandwidth, because every packet uses the whole network. A hub is insecure, because every device can see every other device's traffic. A hub causes collisions, because two devices can talk at the same time and garble each other's data. A switch fixes all three problems, which is why hubs are now obsolete.

There is also a layer difference. A hub works at Layer 1 of the OSI model, the physical layer. It does not understand addresses at all. It just repeats electrical signals. A switch works at Layer 2, the data link layer. It reads MAC addresses, builds a table, and makes forwarding decisions. That one layer of intelligence is the whole difference.

What does a hub do?

A hub is a multi-port repeater. It takes the signal that arrives on one port, cleans it up a little, and sends it out of all the other ports. It does not look at the packet. It does not know or care who sent it or who it is for. Every device connected to the hub receives every packet, and each device checks whether the packet is addressed to it. If it is not, the device throws it away.

Because every packet goes everywhere, all the devices on a hub share one collision domain. A collision happens when two devices send at the same time, and their signals interfere. Both devices notice, wait a random amount of time, and try again. On a busy hub with many devices, collisions happen constantly, and the network slows to a crawl. The total bandwidth is also shared. A 100 Mbps hub does not give each device 100 Mbps. It gives all of them 100 Mbps to share between them.

Hubs also work in half-duplex only. A device can send or receive, but not both at the same time, because the shared wire can only carry one conversation at a time. Switches, by contrast, are full-duplex, so each device can send and receive at the same time.

What does a switch do?

A switch learns. When a frame arrives, the switch reads the source MAC address and notes which port it came from. That goes into the MAC address table. When the switch needs to forward a frame, it looks up the destination MAC address in the table and sends the frame out of the right port only. No other device sees it. Each port gets its own collision domain, so collisions effectively disappear, and each port gets the full bandwidth, so a 24-port gigabit switch can carry 24 gigabits at once.

A switch also understands VLANs, which let one switch act as several separate networks, and managed switches can be configured with security rules like port security. None of that is possible on a hub, because a hub has no idea what is passing through it. If you want the full story on VLANs, read our guide on what a VLAN is.

Switch vs Hub: Side by Side

Here are the differences that matter. A hub broadcasts to all ports, and a switch unicasts to one port. A hub works at Layer 1, and a switch works at Layer 2. A hub has one shared collision domain, and a switch gives each port its own. A hub is half-duplex, and a switch is full-duplex. A hub shares bandwidth between all devices, and a switch gives each port dedicated bandwidth. A hub has no intelligence, no table, and no configuration. A switch learns MAC addresses, keeps a table, and can be managed.

On speed, the difference is dramatic in practice. A hub network with ten active computers might run at a fraction of its rated speed, because collisions force constant retransmissions. A switch network with the same ten computers runs at full speed on every port. That is why the first upgrade any old network got, back when switches became affordable, was replacing the hubs. The difference was visible the same day.

On security, the difference is just as big. On a hub, anyone with a packet sniffer can see all the traffic on the network, including passwords sent in plain text. On a switch, a device only sees traffic addressed to it, plus broadcasts. A switch is not a security device on its own, and an attacker can still poison its tables, but it is far better than a hub. If you want to see how switches and routers compare, read our guide on switch vs router.

Why Hubs Are Obsolete

Hubs were the standard in the 1990s, when a switch cost many times more than a hub. Then switch prices fell, and by the early 2000s, a switch cost about the same as a hub. There was no longer any reason to buy the slower, less secure device, and hub production stopped. Today you cannot buy a new hub from any major vendor, and if you find one in a cupboard, it belongs in a museum, not in a network.

You might still meet hubs in one place: in exam questions. The CCNA and Network+ both ask about hubs, because the comparison teaches the ideas of collision domains, broadcast domains, and half-duplex versus full-duplex. Those ideas still matter, because they explain why switches work the way they do. A hub is also a useful teaching tool: connect two PCs through a hub and watch the traffic with a sniffer, and you will understand broadcast domains in a way no textbook can teach.

Old computer network hardware including an ethernet hub and cables

How to Tell Them Apart in the Real World

In practice, you will rarely need to tell a hub from a switch by looking at it, because hubs are gone. But there are clues. A device labelled as a hub, repeater, or multi-port repeater is a hub. A device that mentions store-and-forward, MAC address table, or VLANs is a switch. If a device has a console port or a web management page, it is a managed switch, because hubs have no management at all.

The surest test is behaviour. Connect two PCs and send traffic between them, then watch a third PC with a packet sniffer. If the third PC sees the traffic, the box is a hub. If it does not, the box is a switch. That test is also a good lab exercise for anyone learning networking, because it makes the abstract idea of a collision domain concrete and visible.

If you are buying equipment for an office, the rule is simple: always buy a switch, never a hub. A small unmanaged gigabit switch costs very little, and it gives every device full speed and privacy. If the network is large enough to need VLANs or management, buy a managed switch. There is no job left where a hub is the right answer.

Watch on YouTube: Network Devices Explained(Animated): What is a Hub, Switch, Router, Modem & Wireless Access Point

Collision domains and broadcast domains

Two ideas from the hub-versus-switch comparison keep coming up in networking, so it is worth getting them straight. A collision domain is the set of devices that can collide with each other. On a hub, every device is in one collision domain. On a switch, each port is its own collision domain, which means collisions basically do not happen.

A broadcast domain is the set of devices that receive each other's broadcast messages. A hub does not break up broadcast domains, and neither does a switch, by itself. All the ports on a switch in one VLAN share one broadcast domain. Only a router, or a VLAN, breaks up a broadcast domain. That is why a switch fixes collisions but not broadcasts, and why VLANs and routers are still needed on larger networks.

Frequently Asked Questions

What is the difference between a switch and a hub?

A hub broadcasts every packet to all ports, and a switch sends each packet only to the port of the intended device. A hub works at Layer 1 and a switch at Layer 2. A hub shares bandwidth and causes collisions, while a switch gives each port dedicated bandwidth and full-duplex operation.

Are hubs still used?

Almost never. Hubs are obsolete, and no major vendor sells them any more. Switches cost about the same and are faster, more secure, and more capable in every way. You will only meet hubs in old networks, in museums, and in exam questions.

Why is a switch faster than a hub?

Because a switch gives each port its own collision domain and its own full bandwidth, and it works in full-duplex. A hub shares one collision domain and one pool of bandwidth between all devices, and it works in half-duplex, so collisions slow it down.

Can a hub and a switch be used together?

Technically yes, but there is no reason to. Plugging a hub into a switch just creates a slow, shared segment on that port, and it drags down whatever is connected to it. Replace the hub with a switch instead.

What is a collision domain?

A collision domain is a set of devices whose transmissions can collide with each other. On a hub, all devices share one collision domain. On a switch, each port is its own collision domain, so collisions do not happen in practice.

Conclusion

A hub and a switch look the same, but they work in opposite ways. A hub repeats everything to everyone, which wastes bandwidth, causes collisions, and lets anyone see all the traffic. A switch learns where each device is and delivers each packet only to its destination, which is faster, quieter, and safer.

That is why the hub is history and the switch is everywhere. If you are buying, studying, or troubleshooting, remember the one-line version: a hub shouts, a switch delivers. Everything else follows from that.

Related articles:

Switch vs Router: What's the Difference and Which Do You Need?

What each box actually does, and which one your network needs for inter-VLAN routing.

What Is a VLAN? A Simple Guide

How one switch acts like several separate networks, and why offices use VLANs.

What Is the OSI Model? The 7 Layers Explained

The seven layers of networking, and why a hub is Layer 1 while a switch is Layer 2.

Want a clear price for your project?

Tell us what you need and we will send a free quote with no hidden charges.

Get a Free Quote