hub is a device which simply acts an amplifier it does not divides the broadcast domain and the collision domain as well
switch on the other hand is a device which divides the collision domain but cannot divide the broadcast domain i.e a message sent from a server to a host A will be delivered to all the hosts connected in a network
router divides broadcast domain as well as collision domain