Kahibaro
Discord Login Register

6.6 Hubs vs Switches

Shared Medium vs Switched Network

In early Ethernet networks, hubs were the center of the wiring. Today, switches have almost completely replaced them. Both devices let multiple computers connect to one network, but they handle traffic in very different ways.

A hub creates a shared medium. All connected devices are on the same electrical segment and share the same bandwidth. A switch creates separate logical paths between devices and controls how traffic flows between its ports. This difference affects speed, collisions, and how scalable and secure the network can be.

How a Hub Works

A hub is a very simple device. It operates only on electrical signals and does not look at MAC addresses or frames. It belongs to the same conceptual space as repeaters and works at the Physical Layer of the OSI model.

When a device sends bits into one port of a hub, the hub regenerates and repeats those bits to all other ports. Every connected device sees every signal that any other device sends. The hub does not know or care which device is talking to which. Its job is only to repeat.

Because every port of a hub is part of the same collision domain, only one device can successfully transmit at a time. If two devices transmit at once, their signals interfere and a collision occurs. All devices detect the collision and each one waits and retries after a random time. This behavior comes from Ethernet’s original access method, which will be covered in Ethernet basics and collision domains later.

Hubs also work in half duplex only. A device can send or receive at a given moment, but not both at the same time, because the medium is shared in both directions.

How a Switch Works

A switch is more intelligent than a hub. It works with Ethernet frames instead of only signals and uses MAC addresses to forward traffic. It belongs to the Data Link Layer of the OSI model, and its behavior is closely tied to MAC addresses, Ethernet frames, MAC learning, VLANs, and spanning tree, all of which are covered in their own chapters.

When a switch receives a frame on a port, it inspects the frame header to read the source and destination MAC addresses. It stores the source MAC along with the incoming port in its internal table. When it needs to forward a frame, it checks this MAC address table to decide on which port to send the frame.

If the destination MAC is known, the switch sends the frame only out of the single correct port. If it is unknown or a broadcast, the switch floods the frame to multiple ports, but still does not send it back out of the port where it arrived.

Each port on a modern switch has its own collision domain. This changes how the network behaves. In full duplex mode, both ends of the link can send and receive at the same time without collisions. Switches support this behavior natively and it is the normal mode for modern Ethernet.

Collisions and Collision Domains

On a hub, all devices share one collision domain. Every port is part of the same shared environment. Multiple devices are competing for access to the same physical medium, so collisions are expected. As more devices are added, collisions increase and the effective throughput drops.

On a switch, each port is its own collision domain. A collision on one link between a switch and a computer does not affect other links. In full duplex mode, there are effectively no collisions at all, because sending and receiving occur on separate paths.

This is why networks built with switches scale much better in terms of the number of devices and the total traffic they can carry. The switch isolates the traffic on each port and only forwards frames where they need to go.

Broadcast Domains and Traffic Scope

Although both hubs and switches behave differently for collisions, they treat broadcast traffic the same way within their segment. Both devices forward broadcast frames to all active ports in the same broadcast domain. The difference is that a hub does this by repeating every signal, while a switch chooses to flood specific frames when they are broadcasts or when the destination MAC is unknown.

Routers are the devices that separate broadcast domains. This behavior belongs to the Network Layer and is covered in the routing fundamentals and broadcast domains chapters. Within one broadcast domain, a hub or switch forwards broadcasts so that all hosts can participate in protocols that rely on them.

Performance and Efficiency

Because a hub sends every bit out of every port, all devices must listen to all traffic. Each NIC must inspect incoming bits and decide if the frame is for it. This wastes bandwidth and CPU time on every host, even when they are not the destination.

A switch reduces this waste by directing unicast traffic only to the intended port. As a result, multiple pairs of devices can talk at the same time on different ports without interfering with each other. Each pair gets a dedicated slice of bandwidth.

For example, on an 8 port 100 Mbps hub, all 8 devices share a single 100 Mbps collision domain. If two devices are exchanging a large file, all other devices see the traffic and compete for the same bandwidth. On an 8 port 100 Mbps switch, each port can run at 100 Mbps at the same time. Four separate conversations can occur in parallel at close to full speed, as long as the switch’s internal design supports that throughput.

A hub shares one collision domain and one bandwidth pool across all ports.
A switch gives each port its own collision domain and can forward multiple conversations at once.

Security and Traffic Visibility

On a hub, every frame is visible to every device on the network segment. Even if a frame is not intended for a particular computer, the bits still reach its NIC. This makes passive eavesdropping trivial. A simple capture tool can see all traffic. There is no isolation.

On a switch, unicast frames are sent only to the destination port. Other devices do not see the data and cannot simply listen to everything by default. Broadcast and unknown unicast traffic are still visible to multiple devices, but overall exposure is reduced.

Switches also provide the basis for additional security features, such as port security or VLAN segmentation. These capabilities depend on the switch’s intelligence and are not possible on a hub. Although switches are not complete security devices, they reduce casual sniffing and provide tools for stricter separation.

Duplex Modes and Modern Practice

Hubs support only half duplex, because transmitting and receiving share the same medium. If two sides try to send at once, they collide. Full duplex is not possible in a shared collision environment.

Switches support both half and full duplex. In modern networks, full duplex is standard. The link between a computer and a switch port is point to point, not shared with anyone else, so both ends can send and receive at the same time.

Full duplex links remove the need for collision detection. This simplifies operation and allows higher effective throughput. Combined with higher link speeds, this is a major reason why switched Ethernet has replaced hub based networks.

Use Cases and Historical Context

Hubs were popular when Ethernet speeds were low and hardware was expensive. They were simple, cheap, and adequate when networks were small and lightly loaded. As more devices and higher speeds were needed, their limitations became severe.

Switches have replaced hubs in almost all professional and home networks. Even low cost home routers that you buy in stores contain a built in Ethernet switch, not a hub. Actual hubs are now rare and are mostly kept for special testing or legacy situations.

If you see a simple box with multiple Ethernet ports in a modern network, it is almost certainly a switch. Pure hubs are considered obsolete because they waste bandwidth, do not scale, and provide no basic traffic isolation.

Comparing Hubs and Switches

The essential differences between hubs and switches can be summarized in a simple table.

FeatureHubSwitch
OSI layerPhysical LayerData Link Layer
Traffic handlingRepeats bits to all portsForwards frames based on MAC addresses
Collision domainsOne shared collision domainOne collision domain per port
Duplex modeHalf duplex onlyTypically full duplex
Bandwidth usageShared among all devicesDedicated per port, supports parallel flows
MAC address tableNoneLearns and stores MAC to port mapping
EavesdroppingAll traffic visible to all devicesUnicast traffic limited to correct port
Modern usageObsolete in normal networksStandard in all modern Ethernet networks

Modern Ethernet networks should use switches, not hubs, for better performance, scalability, and isolation.
Hubs are fundamentally shared, half duplex, and collision prone.
Switches provide per port isolation, full duplex, and intelligent forwarding.

By understanding these differences, you can immediately recognize whether a diagram or device description implies a shared medium environment or a switched one. This will help you reason about collisions, throughput, and traffic visibility when you study collision domains, broadcast domains, MAC addresses, and VLANs in more detail.

Views: 50

Comments

Please login to add a comment.

Don't have an account? Register now!