Clicky

What Is The Difference Between A Hub And A Switch?

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.

osi model switch hub

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.

collision domain

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.


There Are 10 Responses So Far. »

  1. […] More Info: What Is The Difference Between A Hub And A Switch? […]

  2. How does a hub lower the bandwidth for all the connected computers?

    Is Ethernet full-duplex?

  3. Zachrey – Hubs divide bandwidth between all ports. If you have an 8-port hub in use, the bandwidth is being split 8 ways. This is compared to a switch, which will let the bandwidth be 100% on every port.

    Ethernet can be full-duplex, half-duplex, or simplex. You can review these three types of operation at this link:
    http://learn-networking.com/network-design/carrier-sense-multiple-access-collision-detect-csmacd-explained

  4. What is the difference between managed and unmanaged switches?
    Thanks

    Love the site

  5. Greg – Think of an unmanaged switch as a hub, since it’s a “dumb” device that gives the owner little access to flow control in a network.

    Think of a managed switch as a way to channel traffic based on rules we set.

    Thanks for the comments!

  6. networking con be helpful to our country in Ghana.so i need more series of books.i am a an electrical student.whom i can be very fast in learning networking programs.i hope to hear from you.

  7. your information about networking is useful .but one thing please add
    details for networking fundamentals
    thanking you

  8. clearly explained. A recommend to add other network hardware components with the OSI Reference Model. Then it will be a clear understanding on this topic.
    Thanks.

  9. I want to share a network ready printer but we don’t have internet. The book says to use a hub but can I use a switch instead? (I also want wireless accessability).

    Thanks

  10. Please lemme know know about the bandwidth share with ports.

Comment on This Article