The diference between a hub, switch and a router is as below;
1. A hub cannot do selective forward and hence generates traffic on all connected links. The router will only forward the packet that carries the assigned network address being handled by the port connected to that specific address, the switch also will segrigate the traffic but it may not follow the optimum route that will be used by the router.
2. If one wants to have 12 to 48 systems connected on a LAN in a star topology, we have to use a switch, but if we are to distribute traffic on four network segments on which many nodes will be connected as a bus then we should be using a router.
3. Both the switch and router are having managable and unmanagable versions but a hub is normaly only unmanagable so if you are interested in a network whose operations you can monitor and control then dont use a hub.
A hub is a dumb device. meaning that it does not think it just physically connects you 2 another port (splits) allowing all devices to communicate if on the same network. Layor 1-Physical
Switch is a slightly smarter device. This device operates on the second layer of the OSi model data. this device cannot assign ip address. Also the Nic card is on the same level
A router is an intelligent device. this device can assign ip address DHCP and operate with pre-set functions for 2 different networks to communicate. This device operates on the 3rd level of the osi model