Hub vs Switch vs Router

Hub vs Switch vs Router

HubSwitchRouter
FunctionConnects devices within a LAN in a simple broadcast mannerConnects devices within a LANConnects networks and allows devices to communicate across them
OSI layerLayer 1 (physical)Layer 2 (data-link)Layer 3 (network)
Data transmissionUnicast and multicastUnicast and multicastBroadcast
AddressingNoneMAC addresses, switch tableIP addresses, routing tables
CostLowModerateHigh