A hub and switch essentially accomplish the same thing, although their methods are different. Both can be used to regenerate degraded signals (acting as a repeater), and both can be used to split a signal into multiple signals (handy for splitting up an internet connection to your home network, for instance). But should you really care how they do it? If they both accomplish the same thing, what’s the difference?
What is a Hub?
Think of a hub as a rather naïve device- it operates on the Physical Layer of the OSI model. Switches, on the other hand, are much more intelligent- and operate on the Data Link Layer of the OSI model.
When a hub receives information on one port, the information is then broadcasted to all of its ports. This wouldn’t be such a bad plan if it didn’t waste bandwidth and cause collisions. Imagine if two computers transmitted data at the same time: the packets of information would collide and the information would be corrupted. We would have to rebroadcast the data through the process of Ethernet Carrier Sense Multiple Access with Collision Detection- but you can just call it CSMA/CD. In simple terms, it is the protocol we use to resend data after a collision occurs.
Collisions are obviously a problem with hubs, but we just hit the tip of the iceberg. More importantly, hubs are notorious for wasting bandwidth. Hubs operate at half-duplex, which means data can only flow one way at a time. (As compared to full-duplex, where we can send and receive data between two devices at the same time.) Since we are operating at half-duplex, the bandwidth must be shared between each port on the hub. Imagine you have a 20 port hub with a 20Kb/s line to share. Tough luck, but you’ll only get 1Kb/s to each computer on the network.
What is a Switch?
A switch operates on the Data Link Layer of the OSI model. This means that switches are fairly smarter than hubs, as they can route data on a dynamic level. If information is destined for computer A, for example, the switch will only send the data to computer A.
This addresses our collision problem, since switches use what is called microsegmentation. Microsegmentation will allow for multiple collision domains. Which would you rather have- one collision domain or many?
Let’s look at an example. In the below diagram, there are many collision domains (or segments) for the switch network. If computer A and computer B sent data to each other at the same time, for instance, you may have a collision. Computer A and computer C or D, however, will not experience a collision in the process. In the hub network, there is just one collision domain. That means if the first computer wants to transmit data, it could be interrupted by any of the other computers on the network.
But the fun doesn’t stop there! Switches can keep track of which computer address belongs to a certain port. If there is information destined for computer A, it will only travel through computer A’s port. Remember how the hub split the bandwidth between each port? Microsegmentation allows for us to keep the bandwidth as high as possible for each computer. If you have a 20Kb/s line coming in, each computer can have the full 20Kb/s. (But note that switches aren’t magic, if two or more computers are using the line at the same time, they must share it. Still- this is much better than hubs, which automatically split up bandwidth to ports that you might not even be using!)
Should You Upgrade to a Switch?
The short answer here is: definitely. Hubs were primarily used because they are inexpensive and easy to setup. The good thing about “dumb” devices is that they don’t require much configuration or maintenance.
Switches are a bit more expensive, and allow for more configuration options. They can be programmed much like routers, something hubs can’t accomplish. The average home user likely won’t need the extra configuration options- but they will appreciate the speed. If your network is already blazing fast, you may not need the upgrade. If you could appreciate some extra performance, or if you have many computers on the same network, then the upgrade is almost mandatory.
Popularity: 9% [?]