A hub, a switch and a router are all network connectivity devices, used to connect multiple PCs and network devices with one another. At the beginning, the Ethernet networks consisted of a thick co-axial cable (called the trunk or backbone) in the middle, with drop cables leading out from the trunk to the PCs. Each PC had to wait for the backbone cable to be idle before it could send out any signal. In case more than one PC started sending out signal at the same time, there would be “noise” in the backbone and the signals would get distorted, possibly leading to lost or corrupted data. For this reason, the Ethernet network was also called a “collision domain”.
Later, when Unshielded Twisted Pair (UTP) cables were used as connecting media, hubs replaced the backbone cable successfully, serving as a central connector. For this reason, hubs are still referred to as a “collapsed backbone”. The hubs, are, however, the least intelligent networking device among the three, and are just used to connect PCs with one another. Although hubs are networking devices, these have no method of directing network traffic towards specific ports. All PCs connected to the hub can still see the information that passes through it.
The switch is technologically superior to the hub, and can direct traffic to specific ports based on the 48-bit MAC address included in the data packets themselves. Thus there is little chance of noise in a switch. All the ports in the switch are oblivious to the data packets traveling through it, except the one for which the data packets are intended. In short, the switch resembles the telephone switching system, eliminating the concept of collision domain altogether. Besides that, switches work in full duplex mode, meaning a port can send and receive data at the same time. This leads to increased performance of the entire network.
Routers are the most complex, but also the most intelligent among the three types of devices. Unlike the other two types of devices, routers can connect PCs to two or more networks, which may or may not be located at the same geographical region. Routers form the base of internet connectivity. Without routers, there would be no internet. The way traffic would be directed through a router can be configured in detail, with advanced routers providing full fledged programming languages, to allow administrators to configure the exact path of data through these devices.
Hub, switch and router are all connectivity devices. The difference lies in the options available in each one, and the efficiency with which these devices can direct network traffic, from one PC to another.