In network equipment and devices, data is usually transmitted in the form of a frame. When a frame is received, it is amplified and then transmitted to the port of the destination PC (Personal Computer). The big difference between hub and switch is in the method in which frames are being delivered.
In a hub, a frame is passed along or “broadcast” to every one of its ports. It doesn’t matter that the frame is only destined for one port. The hub has no way of distinguishing which port a frame should be sent to. Additionally, a 10/100Mbps hub must share its bandwidth with each and every one of its ports. In comparison, a switch keeps a record of the MAC (Media Access Control) addresses of all the devices connected to it. With this information, a network switch can identify which system is sitting on which port. So when a frame is received, it knows exactly which port to send it to, without significantly increasing network response times. In addition, unlike a hub, a 10/100Mbps switch will allocate a full 10/100Mbps to each of its ports. So regardless of the number of PCs transmitting, users will always have access to the maximum amount of bandwidth.
Unlike an Ethernet hub or switch that is concerned with transmitting frames, a router is to route packets to other networks until that packet ultimately reaches its destination. One of the key features of a packet is that it not only contains data but the destination address of where it’s going. What’s more, router is the only one of these three devices that will allow you to share a single IP (Internet Protocol) address among multiple network clients.
You can have a clear view of the comparison among hub vs switch vs router here:
|Data link layer
|To connect a network of personal computers together, they can be joined through a central hub
|Allow connections to multiple devices, manage ports, manage VLAN security settings
|Direct data in a network
|Data Transmission form
|electrical signal or bits
|frame & packet
|multi-port, usually between 4 and 48
|Frame flooding, unicast, multicast or broadcast
|First broadcast, then unicast and/or multicast depends on the need
|At Initial Level Broadcast then Uni-cast and multicast
|Used in(LAN, MAN, WAN)
|LAN, MAN, WAN
|Address used for data transmission