Layers: A hub operates on the physical layer of the open system interconnection (OSI) model (layer 1), whereas a switch operates on the data link layer (layer 2) of the OSI model. The router is based on the OSI model's network layer.
A Hub can connect several Ethernet devices into a single segment, whereas a switch can connect numerous devices into a single LAN. A router may connect both LAN and WAN networks.
The hub is the least intelligent device because it merely forwards a received data packet to all connected devices. Because they deliver received data packets to appropriate devices, the
switch and router are also called intelligent devices.
Form of Data Transmission: A hub transmits data in the form of an electrical signal or bits, whereas a switch transmits data in the form of frames and packets. It is transmitted in the form of a packet through a router.