Given that hubs are essentially the same as switches, as far as I know, except they share bandwidth between all connected devices, while switches do not, resulting in faster connections. I am simply wondering if there is any reasonable purpose for hubs in modern networks.
-
2"Given that hubs are essentially the same as switches.." That is not even close. Hubs are layer-1 devices (basically cable extensions), while networks switches (bridges) are layer-2 devices.– Ron Maupin ♦Commented Mar 30, 2018 at 3:54
-
@RonMaupin could you go into more detail as to what you mean?– Ashtin BlanchardCommented Mar 31, 2018 at 16:37
-
Hubs really just repeat the electrical signals they receive to every port. They are like cables with multiple ports. On the other hand, a switch is a bridge with intelligence, and it inspects each frame as it comes into the switch, building a MAC address table of where the source MAC address is seen, and delivering a frame to the individual interface where the destination MAC address was previously seen as a source MAC address. There is no possibility of a collision inside a switch the way there is with a hub that has all its ports electrically connected.– Ron Maupin ♦Commented Mar 31, 2018 at 16:57
3 Answers
For the most part, no. Hubs are also known as repeaters - meaning that they basically echo whatever is coming in to a given port out all other ports in the domain. The idea is (or, more properly, was) to replicate the behavior of a shared piece of coaxial cable, meaning that the individual hosts had to assure that only one member of the LAN was transmitting at a given time (...managing this is where the notion of collisions and CSMA/CD comes in).
Switches, in turn, a actually multi-port bridges. Switches learn what hardware addresses are on what ports and then (ideally) only transmit traffic to the host(s) on a particular port.
As a really crude example, imagine 4 hosts on a network: A, B, C and D. On a hub a conversation between A and B is seen, in full, by C and D. As such, if there's a second conversation between C and D it is now sharing the same bandwidth with the traffic being sent back and forth between A and B. In contrast, on a switch these conversations are kept entirely separate - thus allowing both sets of hosts to communicate at full speed without effecting one another. This (among other behaviors) massively improves overall scalability and performance on most networks.
The other issue here is that as Ethernet speeds have gotten faster the basic mechanisms mentioned above (collision detection) have actually disappeared. In 10 and 100 megabit there were absolutely modes for half-duplex (i.e. single host transmitting at a time) communication while in gigabit it was largely deprecated/unimplemented (there were some 10/100 hubs that bridged to FDX gigabit connections but very few - if any - gigabit hubs) and in 10 gigabit (and beyond) it's nonexistent (...meaning a switch is now the only option).
So is there a reasonable purpose for a hub nowadays? I'd say generally not. Some gigantic portion of modern equipment doesn't even support half-duplex at this point, and 100M is becoming fairly uncommon in its own right. There used to be an argument for hubs as a good way to easily monitor traffic without the use of SPAN ports or taps, but that was a fairly uncommon use-case even 15 years ago.
-
Well put. However, "some gigantic portion of modern equipment doesn't even support half-duplex" - for gigabit+ that is. Generally, all devices supporting 10/100 Mbit/s still support half-duplex mode at these speeds.– Zac67 ♦Commented Mar 30, 2018 at 7:18
-
A pretty big chunk of switches shipping in the DC segment at this point won't support either 10M or half-duplex, for example. Host-side support is typically a lot more varied, of course.– rnxrxCommented Mar 30, 2018 at 8:41
Hubs are bad news, from both a network performance as well as a security point of view.
As a network admin you may find it handy to have a hub or two sitting in the store for the day when you want to do a packet capture (which for some reason cannot be done in the usual way (span etc.)), but don't leave them running in a production network.
In general, no, there's no reason to use a hub over a switch, but they do still have a purpose in some special cases. One case is if you need to capture traffic to a host but the host can't run a capture utility itself and the switch it connects to also can't do a capture or span port. In this case, you could connect a hub between the host and switch, and connect another device to the hub that can do the captures. For example, plug a laptop into the same hub, with Wireshark installed on it, and perform the capture there. Due to the way hubs work (versus how a switch works) all packets are sent out all ports, so you will be able to see all traffic passing through the hub destined to or sourced from the server you need to capture traffic for.