A hub repeats every signal it receives out of all its other ports, so every connected device sees all the traffic and all of them share one collision domain. A switch learns which MAC address is on which port and sends each frame only where it needs to go, which is why switches replaced hubs.
If you are choosing hardware today, buy a switch. Hubs are obsolete, and nothing a hub does is something a cheap unmanaged switch does worse. The rest of this article explains the difference, because the hub is still the clearest way to understand why Ethernet changed.
Hub vs switch at a glance
| Hub | Switch | |
|---|---|---|
| What it does with a frame | Repeats it out of every other port | Sends it out of the port where the destination is |
| Looks at MAC addresses? | No | Yes, builds a table of addresses per port |
| OSI layer | Layer 1 (physical) | Layer 2 (data link) |
| Collision domain | One for all ports | One per port |
| Duplex | Half duplex only | Full duplex |
| Bandwidth | Shared by all devices | Each port gets its own link |
| Other devices see your traffic? | Yes, every port gets every frame | No, apart from broadcasts and frames to unknown destinations |
| Status today | Obsolete | The standard way to connect wired devices |
What a hub does
A hub is a multi-port repeater. It has no memory and makes no decisions. When an electrical signal arrives on one port, the hub regenerates it and sends it out of every other port. Because it works on the signal rather than on the frame, it has no idea what a MAC address is. The IEEE 802.3 Ethernet standard describes the use of "Repeaters" for multi-segment shared access networks, and a hub is the star-shaped version of that idea.
The consequence is that all devices plugged into a hub behave as if they were on one shared cable. Only one device can usefully transmit at a time. Two devices that transmit at the same moment cause a collision, and both must stop and try again later.
What a switch does
A switch works with Ethernet frames, not raw signals. Each frame carries the MAC address of the device it is meant for. The switch keeps a table that records which source MAC address it has seen on which port. When a frame arrives, the switch looks up the destination address and sends the frame out of that one port. If the destination is not in the table yet, or the frame is a broadcast, the switch sends it out of all the other ports, and the table fills in as devices send traffic. What a MAC address is covers where these addresses come from.
This learning needs no configuration on an unmanaged switch. The IEEE 802.1Q standard describes how the MAC Service is supported by bridged networks and covers "the operation of MAC Bridges and VLAN Bridges". A modern multi-port switch is a bridge in this sense. RFC 1812 uses the same vocabulary: "Packet switching devices may also operate at the Link Layer; such devices are usually called bridges." Devices connected this way without a router in between share one IP subnet.
Collision domains: the real difference
The old shared-cable Ethernet used a method called CSMA/CD, short for Carrier Sense Multiple Access with Collision Detection. The IEEE 802.3-2022 page describes it as a MAC protocol for a shared medium, labelled half duplex. A device listens, and if the line is quiet it sends. If two devices send at once, they detect the collision, back off for a random time and retry.
A hub extends that single shared medium to more devices. Ten devices on a hub are one collision domain: the more devices that want to talk, the more collisions and retries, and the less useful bandwidth each device gets. A worked example makes this concrete. Say a hub runs at 100 Mbps and four devices all want to transfer files. They share one 100 Mbps channel, so the best case is about 25 Mbps each, before any collisions are counted. On a 100 Mbps switch, each device has its own 100 Mbps link to the switch, so two separate pairs of devices can each use close to full speed at the same time.
A switch also ends the collision problem on each link. Each port is its own collision domain, and with a device on the other end, the link can run in full duplex mode, so a device can send and receive at the same time. The 802.3 standard covers full duplex operation as well as shared-medium operation. With full duplex there is no collision to detect, so CSMA/CD is not needed on that link.
Privacy and security: a hub shows everyone your traffic
Because a hub copies every frame to every port, any device on a hub can capture traffic meant for other devices. Network cards normally ignore frames addressed to someone else, but a capture tool can ask the card to accept everything. On a hub that shows all conversations. On a switch, a device normally sees only its own traffic, plus broadcasts and frames sent to addresses the switch has not learned yet.
A switch is not a security feature on its own. Attacks that poison the address table or ARP cache exist, and a managed switch has settings to limit them. But the default behaviour of a switch is far less revealing than that of a hub, where nothing needs to be attacked at all.
Can a switch replace a hub directly?
Yes. You can unplug the hub, plug the switch into the same cable and power, and connect each device to the switch. No settings change. Devices keep their IP addresses, and the router's DHCP server works as before. Check the port speeds: if one device has an old 10 Mbps card, a modern switch will usually negotiate the speed per port, which a hub cannot do for a mixed group because all of its ports share one speed.
A switch only adds ports and carries frames. It does not hand out addresses or connect you to the internet; that is the router's job. The difference between those two devices is covered in router vs switch.
Why hubs are obsolete
- Shared bandwidth. Every device on a hub divides one channel. A switch gives each port its own.
- Half duplex only. A hub cannot carry traffic in both directions on a link at once. A switch can.
- Collisions. They grow with the number of devices and the amount of traffic, which is wasted effort that a switch removes.
- No isolation. A hub sends your frames to everyone. A switch does not.
- Cost. The hardware advantage of hubs was low cost. Once switches became cheap, that advantage disappeared.
How to tell if you have a hub or a switch
Hubs are rare enough now that you are unlikely to find one in current equipment. If you have an old box with Ethernet ports and no model information, look at these clues:
- A Collision or Col indicator light is a hub feature. Switches rarely have one, because collisions are not a normal part of how they work.
- A Uplink port or an uplink toggle switch was common on hubs, to join one hub to another. Many switches have auto-detecting ports and need no such switch.
- A model label that says "hub", "repeater" or a speed with "10Base-T" only is a strong sign of a hub.
- If it is labelled "switch", "switching" or shows a speed per port in the link lights (for example separate lights for 100 and 1000 Mbps), it is a switch.
Where the label is missing, the safest course is to replace the box. A basic unmanaged Gigabit switch costs little and removes the question.
Hub vs switch vs router, in one paragraph each
Hub: repeats signals to every port; one shared collision domain; obsolete.
Switch: forwards frames by MAC address to the right port; each port is its own collision domain; this is what you plug wired devices into.
Router: joins different networks, such as your home network and the internet, and forwards packets by IP address. Home routers usually include a small built-in switch for their LAN ports.
Is there anything a hub still does better?
Only one thing, and only historically: because a hub copies every frame to every port, it was a convenient way to capture all traffic on a segment with a laptop. A managed switch does the same job properly with port mirroring, a setting that copies traffic from one or more ports to a chosen port. That option is found on managed switches rather than basic unmanaged ones, so check the product documentation before relying on it. For any ordinary home or office network, a hub has no remaining advantage.
Frequently asked questions
- Is a hub the same as a switch?
- No. A hub is a repeater: whatever arrives on one port is sent out of every other port, and all connected devices share one collision domain. A switch learns which MAC address sits on which port and sends each frame only to the port that needs it.
- Can I use a hub instead of a switch?
- It will work for a very small, light-use network, but there is no reason to. Hubs are half duplex and every device sees every frame, so the devices share the bandwidth and can collide. A basic switch costs little and avoids both problems.
- Is a hub faster than a switch?
- No. A hub does not forward any faster than a switch, and it has to share one link between all devices. A switch can carry several conversations at the same time and can run full duplex, so it is faster in practice on any network with more than one active conversation.
- Are hubs still sold?
- Hubs are obsolete for Ethernet networking. The word survives in other places: a USB hub, for example, is a different device that adds USB ports to a computer and has nothing to do with an Ethernet hub.
- Why would anyone still want a hub?
- The main historic reason was that every port sees all traffic, which suits a simple packet capture. Modern switches offer port mirroring for that job, so you can copy traffic to one port without sharing bandwidth among every device.