Short Bytes: Hub vs Switch – which one is better? Which one should be used for faster communication? Which one is more secure? Well, we answer all the aspects of using a hub and a switch against each other in this article.
Let’s take a look:
Hub vs switch — Comparison and differences
Hub’s properties:
- Works at the physical layer of the OSI layer
- Uses ‘Store and forwarding’ when it receives a data packet
- A virtual LAN cannot be created using a hub
- Usually comes with 4 to 12 ports
- Only transmits electrical signals or the bits (relate it with physical layer)
- Does not use any software
- Does not have its own memory for memorizing the devices connected over to the network
- Cannot learn the MAC addresses and neither can forward them
- Supports Half-duplex transmission mode
- A hub has only one broadcast domain
- Cannot support Spanning tree protocol
- Packet collisions occur commonly inside a hub
Switch’s properties:
- Works at the Data link layer or layer two of the OSI model
- Uses ‘filter and forwarding’ when it receives a data packet
- A virtual LAN can be created using a Switch and it can also work as a multi-port bridge
- Usually comes with 24 to 48 ports
- Transmits Frames (layer 2 packets) and Layer 3 packets of the OSI model
- Uses its software for admin access and other configurations
- Has its own memory for memorizing the devices connected over to the network
- Can learn the MAC addresses and stores those addressed in a CAM (Content Addressable Memories)
- Supports Half as well as full duplex transmission mode
- A hub has only one broadcast domain
- Can support Spanning tree protocol
- No packet collisions occur commonly inside a hub
Working differences — Hub vs switch
Before you proceed to further reading, have a look at the basic concepts of the different networking devices and hardware types — hub, switch, router, modem, bridge, repeater.
Let’s say a few computers are connected to a hub in one of the scenarios and in the other scenario, they are connected to a switch.
In the Hub’s case, when all the computers send data packets, those are copied as a signal at the different ports of the hub. That means, the hub simply replicates the signal and the intended recipient gets the packets. Since there is no concept of filtering the packets and forwarding those, there will be a lot of collisions as well.
When the same data packet will arrive at one of the ports of a Switch, the following generic steps will take place:
- A data packet arrives at one of the ports.
- The Switch checks of the address inside the data packet (also called as a frame of layer 2 on OSI model)
- The switch has a CAM table and it will match the address of the frame with one of the addresses of the CAM table.
- If the address matches, the switch known the particular port at which that address resides. So the Switch will forward that packet to that particular port and this is also called as ‘Filter and forwarding’ in computer networks terms
- These things are all possible because of a configuration file and memory inside a Switch which is absent in a hub.
- The network admin can configure the switch according to his preference.
- Because of the filter and forwarding, there is no collision inside a switch.
No comments:
Write comments