In this article, we are going to discuss the difference between a hub, a switch, and a router. These three devices are similar, but there is a difference in the way they handle the data or in the way they handle data.
What is HUB?
The main purpose of a hub is to connect all your network devices together on an internal network. It’s a device that has multiple network ports that accept Ethernet connections from network devices. A hub is considered not to be intelligent because it broadcasts data on all ports. It does not filter any data or have any intelligence as to where the data is supposed to be sent. Hubs only know one thing, that is when a device is connected to one of its ports.
When a data packet comes to one of the ports, it is copied to all the other ports or it broadcasts that packet to all ports. All the devices connected to that hub see data packets. So again, a data packet comes into one port then the hub will just rebroadcast that data to every port that has a device connected to it.
So, if computer A only wanted to communicate with computer B over the network other computers-X, Y & Z would still receive the data, even though that data was not projected for them. When this happens it not only creates security issues, but it also generates needless traffic on the network, which wastes bandwidth.
What is Switch?
The switch is very comparable to a hub. It’s also a network device that has several ports for Ethernet connections from network devices. But a switch is an intelligent device, unlike a hub. A switch can learn the physical addresses (MAC Addresses) of the devices that are connected to it and it stores these physical addresses in a table, called the MAC addresses table.
As soon as a data packet is sent to a switch from computer A, it’s only directed to the intended destination port of computer B, unlike a hub where a hub will just rebroadcast the data to every port.
That’s why switches are far more ideal than hubs because they reduce unnecessary traffic on the network.
So as a review, a hub only detects that a device is physically connected to it and a switch can detect and remember specific devices that are connected to it because it keeps a record of the MAC addresses of those devices.
What is a Router?
The hubs and switches are used to exchange data within the local area network (LAN). For example, your home network or in an Office.
They can not exchange data outside their own network (LAN), such as out on the internet or any remote location in another city, etc.
To send and receive or route data outdoor their own network to another network or remote location system, such as out on the internet, a device is required to be able to read IP addresses. Because hubs and switches do not read IP addresses. So, that’s where the router comes in.
When a data packet is received from the router, the router examines the data’s IP address and determines if the packet belongs to its own network or if it belongs to another network. If the router determines that the data packet belongs to its own network, it receives it and sends it to the concerned system.
But if it does not belong to its own network, it sends it off to another network on a Wide Area Network (WAN). Basically, a router is essentially the gateway of a Wide Area Network (WAN