Difference Between Switch and Hub
In this tutorial i will discuss about difference between Switch and Hub (Switch vs Hub). Before Switch were introduced, Hub were standard device to interconnecting PC or another devices on Local Area Network (LAN).
Hub work in layer 1 at OSI Model. The drawbacks with hubs :
- Hub is very simple device that accept a single data packet then sends it out to all the computers that are connected to it. Only one data packet can pass through the hub at a time and all the data must wait for its turn
- When a hub receives a packet at one of its ports from a PC on the network, it transmits (repeats) the packet to all of its ports and, thus, to all of the other PCs on the network. This mean bandwidth was wasted because all traffic was sent to all ports
- A lot of collisions, because a hub only have one collision domain on it’s device
- If two or more PCs on the network try to send packets at the same time then a collision occur. When that happens all of the PCs have to retransmit with different time to resolve the conflict. The process is prescribed in the Ethernet Carrier Sense Multiple Access with Collision Detection (CSMA/CD) protocol
Here what switch do to overcome drawbacks of hub :
- Switch work in layer 2 at OSI Model. Switches are capable of filtering frames based on any Layer 2 fields. For example, a switch can be programmed to reject (not forward) all frames sourced from a particular network. Furthermore, filters can be helpful in dealing with unnecessary broadcast and multicast packets
- Supports simultaneous connections
- Switches only sends traffic to the destination port for that traffic, saving bandwidth. This can be done because switches keeps a table of all MAC addresses traversing the switch and what port they are on (this table is called the bridge forwarding table or CAM table). If destination MAC address can’t find in its bridge forwarding table, the switch then flood or send that frame out to all ports. After destination MAC address found on one of its port, then this particular MAC address will add to bridge forwarding table, and next frame destined to this MAC will send out only to single port where this destination MAC exist
- Single collision domain for each port. That why each device connected to the switch gets the full bandwidth of the switch port
The biggest benefit of using switches instead of hubs in your internetwork is that each switch port is actually its own collision domain. (Conversely, a hub creates one large collision domain). But even we use a switch, we still can’t break up broadcast domains. Neither switches nor hub will do that, router is the only device can do this kind of job. Switches and hubs can be equally efficient in processing frames, in theory. In practice, switches are generally more efficient as they usually have more CPU and memory allocated to them, and are generally much more expensive than a simple hub.
Thanks, If you like this tutorial please share this article to your friends in FB, Twitter,