RyanTAdams.com

Technology Advice by Ryan Taylor Adams

What is the Difference Between Hubs, Switches, And Routers?

May 26th, 2008 · No Comments · Printer Friendly Version

WARNING! THIS POST IS MORE THAN 180 DAYS OLD!

While I make an effort to update older posts to keep them relevant and technically accurate, the rapidly changing nature of the tech world makes it possible that the content of this post may no longer be relevant, current, or even accurate. Additionally, because of this post's age, adding new comments has been disabled. If you would like to contribute new information to this post, or have questions pertaining to this post, please use the Contact Form.


If you are setting up a network of more than two devices, cahnces are you will be confronted with all three of these terms. Hubs, switches, and routers are are crucial network components, and they each perform a unique role. Mix them up and your network won’t operate efficently…or at all. So jsut what is the difference between a hub, a switch, and a router? And what are they used for?


Let me start off with a disclaimer. This post is geared towards a novice reader, who is dealing with a home or small office network. I will be using analigies and examples which help to simplyfy the infromation. However, if you are dealing with any sort of large or advanced network setup, these analogies might over simplyfy thigns.

Before we can discuss the three devices mentioned, we need to quickly disscuss netowkr basics. First off, the networking standard we are using is called “ethernet.” It uses a system of cables (“ethernet cords”) and devices to conenct computers together so they can communicate with each other. When 2 or more computers are hooekd together so that they can talk (communicate) with each other, we have a network. And when a network connisists of connected computers in a small geographic area (say your home), it’s caleld a “local area network” or “LAN” for short. If a computer has information it shares, it is caleld a “host” whearas if a computer is retreivign data it is a “client.” Most computers opperate simultaionsly as hosts and clients.

Now onto routers. Let’s begin with an analogy. Pretend it’s 1920 and you live in California. You want your aunt (who lives in Arizona) to send you a picture of her family. You write a letter to her, asking for the picture, then put it in an addressed envelope and drop it in the mail. Your aunt gets the letter, puts a picture in an addressed envelope and mails it back to you. Fast forward to 2008. Now, you are using the computer in your livign room and you want to get a picture stored on the computer in your office. To do this, your computer sends a message to the computer in your office askign for the picture, and the office computer sends a message back containing the picture. But how do the messages know where to go? SImple, they have an address just like you put on the envelopes back in 1920. In the computer world, these addresses are called “IP address.” An IP address is a series of numbers unique to each computer. The key here is that each computer has a unique address, just as each house has a unique street address. A routres job is to assign each computer an IP address. Since this one device assigns all the addresses, it can make sure each one is unquie. Routers, as the name implies, also route the messages. When your computer sends a request for a picture, it first goes to the router which decieds where to forward the message so that it gets to the proper computer. Continuing our analogy, you can think of this as the Post Office which sorts your mail and determins which truck to put it on so that it arrives at the correct destination.

Swithces and hubs are closly related. They both physically connect differnt network components together. For example, if you have 4 computers in a room, you would need a switch/hub with atleast 4 ports so that you could plug them all together. Most routers include a builtin switch or hub so that you can conenct your computers directly to it. THe differnece between hubs and switches coems from how they handel the data flowign through them. When a host sends a message over an ehternet cable conencted to a hub, the hub forwards that message out along all the other ethernet cables attached to it. This means that when the computer in your office sends back a picture, it would actually be delivered to all the computers in your house. However, rember that the message is addressed. The other computers look at the address on the message and say “that’s not me” and discard the message. Your computer recognizes it and opens the picture. A switch on the other hand is “smart”. It knows which comptuer is conencted to which port. When your office computer sends the picture message out, it goes through the switch which reads the address and then forwards it out to only your computer. Here’s antoher analogy for you: A network using a hub is sort of like usign a CB radio. When you send out your message, everyone with a CB hears it. This works ok if only two or three of you are trying to communicate, but immagine the chaos of having 5 pairs of people tryign to carry on 5 seperate conversatiosn at the same time. You would have so much overlap, almost noone woudl get their message through. Also, think about how little privacy you would have. The same thing happens with hubs. As more an more digital messages are sent, some “collide” with each other and have to be resent. This slows down the network as it can take several tries to get the message through. Additionally, since every computer gets every message sent to it, there is a possiblity for others to “see” what information you are getting. Switches on the other hand work like a telephone. When you make a call, you specify who you want to call, and only that person gets your message. This is faster, as there are no “collisons” of multiple calls, and it’s more secure as only you and the other party are on the line.

With all the disadvantages, why use a hub over a switch? In some situatiosn there is an administrator who needs to monitor the network ussage. Using a switch allows him to do this as he can see every message sent. Also, there was a time when hubs were WAY cheaper than switchs. Today, switches are cheap ( Under $20 for an 8 port switch) and very few home users want to monitor every message sent (hundreds per second). Bottom line, if you have the choice, get a switch.