| Switch | Hub | 
| As per the OSI model,  network switches are classified as Data Link Layer devices, i.e. they  operate at Layer 2. However, certain multi-layer switches can operate at  higher layers as well.
 | As per the OSI model, a hub is a Physical Layer device, i.e. it  operates at Layer 1.
 | 
| A switch is a more sophisticated network device and is more  expensive than a hub.
 | A hub is a very primitive device and is comparatively much cheaper.
 | 
| A switch is an intelligent device, it transmits the data  packets from the source computer to only those network computers  to which the data packets are originally intended.
 | A hub is a 'dumb' device to say the least. It broadcasts the data  packets to each and every networked computer, and not just the target  computer or set of computers to which the data packets were originally  intended to be sent.
 | 
| There is optimum utilization of network bandwidth in case  of switches, and bandwidth wastage is minimal.
 | Due to their broadcast mechanism of data transmission, there is  unnecessary wastage of network bandwidth which results in slow operation  and data transfer speeds.
 | 
| Switches are full-duplex devices, i.e. both, data  transmission and reception can take place simultaneously.
 | Hubs are half-duplex devices, i.e. both, data transmission and  reception cannot take place simultaneously.
 | 
|  | Thanks to its broadcast mechanism, network security becomes a big  issue and a loophole in the case of a hub.
 |