Hub and Switch both are networking devices used to communicate within an Local Area Network. Switch is always preferred over Hub. The major difference between them is, Hub is not capable of identifying the destination of a receiver, therefore, it broadcasts the data to all connected devices, on the other hand, Switch is capable of identifying the MAC addresses of all connecting devices, therefore, it only delivers a data packet to the respective receiver.
Difference between Hub and Switch:
Basis | Hub | Switch |
---|---|---|
Layer | Physical Layer | Data Link Layer |
Functionality | It is used to connect various devices on an internal network | It is used to connect various devices on an internal network and capable of storing mac addresses and delivering data to the intended receiver |
Data transmission form | Electrical impulses or bits | frames or packets |
Ports | 4 to12 ports | 24 to 48 ports |
Transmission Approach | Broadcast | Unicast, Multicast and Broadcast |
Transmission Mode | Half duplex | Full duplex |
Packet Filtering | Not supported | Supported |
Mac Address | Not Capable of storing Mac address | Capable of storing Mac address |
Intelligent | No | Yes |
Collision Domain ( Part of network where collision can occur ) | Exactly one | Each and every ports have different collision domains |
What is Hub ?
It is a networking device that is used to connect various devices on an internal network. It provides ports for various devices which can be used to connect with the help of Ethernet cables. It is not capable of filtering data packets and transmuting data to respective destination. When a data packet is received from one of the port, it is copied and broadcast to all the connecting devices, exposing that data to others.
It results in unnecessary traffic on network and creates security issues. It can only identify when a device is connected to a hub.
What is Switch?
It is similar to hub, the only thing that makes it different from hub is, a switch is intelligent. It can read physical addresses or mac address of a connected devices and stored it in a table. Therefore, when a data packet is received from on of the port, it is only delivered to actual receiver’s port.
Key Differences:
1.LAYER
Hub works in the PHYSICAL LAYER and the hubs are often termed as the Layer 1 devices of the OSI model.
A switch works in the DATA LINK LAYER and the switch is often termed as the Layer 2 device of the OSI model.
2. FUNCTION
The main function of a hub is to connect a network which consists of personal computers together. This can be accomplished by the use of a central hub.
The switch has various functions ranging from connecting devices, managing the VLAN (Virtual LAN) security and also manages ports.
3. DATA TRANSMISSION FORM
In the case of a hub, the data is sent in the form of electrical impulses or bits.
In the case of a switch, frames are used for data transmission in L2 switch and packets are used for data transmission in L3 switch.
4. PORTS
A hub has about 4/12 ports.
A switch is considered as a Multi-port bridge, that is why it has 24/48 ports.
5. TRANSMISSION TYPE
A hub follows broadcast transmission.
A switch follows unicast, multicast as well as broadcast transmission.
6. DEVICE TYPE
A hub is also known as a Passive device, which is without any software.
A switch is also known as an Active device, which is with software and also networking device.
7. TRANSMISSION MODE
In a hub, the basic transmission mode which is followed is a half duplex.
In a switch, the basic transmission mode which is followed is full/half duplex.
8. SPEED
The hub device can offer you a speed which is about 10Mbps.
The switch device can offer you speeds ranging from 10-100 Mbps and it can even offer a speed of 1 Gbps.