Hub, Switch, and Router - What's the difference?

Hub, Switch, and Router - What's the difference?

Hubs, switches, and routers, all three of these devices are similar, but there is a difference in the way they deal with data.


The purpose of a hub is to connect all of the network devices together on an internal network.

It's a device that has multiple ports that accepts Ethernet connections from network devices.

Now a hub is considered not to be intelligent because it does not filter any data or has any intelligence as to where the data is supposed to be sent.  

That's because the only thing a hub knows is when a device is connected to one of its ports.

Therefore, when a data packet arrives at one of the ports, it is copied to all other ports, meaning the packet is visible to all devices on that hub.

For example, if Ian's computer only wanted to communicate with his stepsister’s computer, his stepmom's computer would also receive the data.

That’s not good, right?

It not only creates security concerns but also creates unnecessary traffic on the network, which wastes bandwidth.


A switch is very similar to a hub, which is also a device that has multiple ports that accepts Ethernet connections from network devices.

But unlike hubs, switches are intelligent.  

A switch can virtually learn the physical addresses of the devices that are connected to it and it stores these physical addresses (called MAC addresses) in its table.

So when a data packet is sent to a switch, it's only directed to the intended destination port, unlike a hub where the hub will just rebroadcast the data to every port.

Now if Ian’s computer wanted to communicate with his stepsister’s computer, the data packet first arrives at the switch, and then the switch will look at its table of MAC addresses and matching ports and deliver the data to the correct port. This time his stepmom’s computer would not receive the data packet.

That's the major difference between a hub and a switch.  

As a result, switches are far more preferred over hubs because they reduce any unnecessary traffic on the network.

Hubs and switches are used to exchange data within a local area network, such as in your home network or in a business.

They are not used to exchanging data outside their own network, such as out on the internet because they need to be able to read IP addresses to do so. 

But hubs and switches do not read IP addresses. That's where the router comes in.


A router does exactly what its name implies. It’s a device that routes or forwards data from one network to another based on the IP address.  

When a data packet is received from the router, the router inspects the data's IP address and determines if the packet was meant for its own network or if it's meant for another network. 

If the router determines that the data packet is meant for its own network, it receives it.

But if it's not meant for its own network, it sends it off to another network.

So a router is essentially the gateway of a network.

Now let me give you a glimpse at the expanded view of routers over the internet.  

Let’s say there are ten families in your neighborhood. Each family has a unique network.  

At first, each network was just exchanging information within the network using its hub or switch.  The data was not going out on the internet.

But then you met Jack and you became friends. And you want to reach out to him on the internet.

For this to happen, the data packet has to leave your family’s network and go out on the internet.

Therefore, your laptop sends its data, and it goes to your router.

Once the data packet reaches the router, the router will look at the IP address of the data packet and then forward the data out on the internet to the next router and then make its way to Jack's router and then to his laptop.

So in a nutshell this is how routers work.

In conclusion, hubs and switches are used to create networks while routers are used to connect networks.