These are the differences of the devices that help connect between two machine with other machine in the network.
It is typically least expensive, least intelligent and least complicated.
It principal job is to sent out the messages/ data to the others port.
If the data is come from machine A, the message will then be send to all the other ports regardless of which one the message/data intended to be send.
Moreover when the machine A respond, it will send also to other port on the hub.
Every computer connected to the hub will know the message/data that be send by machine A. In other word there is no discretion of communication for sender to receiver.
The concept of Switch is like Hub but more efficient. By taking into consideration the traffic that comes across it, it learn where particular address are.
For the beginning, Switch will send the messages to all ports because it no nothing who is the recipient. After the message arrived at his destination, the switch learned/memorize the location of the recipient. Thus, when the machine of the recipient responds it will send to one connection only.
In addition after knowing the location of sender and receiver, now the machine will send to one connection only because it has learn/memorize the location of sender and receiver.
A router is the smartest and most complicated of the bunch. It can comes with different shapes and size.
A simple way to think of a router is as a computer that can be programmed to understand, possibly manipulate, and route the data that it’s being asked to handle. It is seemingly operates as a Switch.
source link : https://askleo.com/whats_the_difference_between_a_hub_a_switch_and_a_router/