Hub vs Switch – Which One to Use?
Hub and Switch – Connecting Devices to a Network
John, the IT Infrastructure Support In-charge in our company, was connecting computers to a LAN. He was setting up a bundle of computers in our conference room and he was networking two computers in the board room. John said he will use a switch for the conference room computers and a hub for the two computers in the board room. He held a switch and a hub and they looked very similar. I was wondering how a hub and a switch differ in their functions and features. Well, John was polite to explain me their differences and here is a gist of his explanation.
Basic Differences at a Glance
Switches are smarter devices than hubs, though both of them are used to connect segments in a network. They are the central connection for all of your networked equipment and handle data type called frames. Frames carry your data. When a frame is received, it is amplified and then transmitted to the destination port. The difference between a hub and a switch lies in the method in which the frames are delivered. Cisco manufactures different networking equipment and Cisco switches are widely used in networking for their high performance.
A hub operates using a broadcast model and in a hub a frame is transmitted or broadcasted to all the destination ports. It doesn’t matter if the frame is meant for only one port. The hub cannot distinguish which is the destination port for the frame. By passing the frames to all the ports it ensures that the data will reach its intended destination. So a hub behaves like a multi-port repeater and passes on or repeats all the information it receives. It can be used to extend a network; however, this can result in a lot of unnecessary traffic and poor network response time on the network.
A switch on the other hand has a more efficient way of handling and transmitting data between multiple devices within a LAN. It filters and forwards packets between LAN segments and operates using a virtual circuit model. It receives messages from any device connected to it, and then re-transmits the message only to the devices for which the messages are targeted. A switch can determine the target port for each frame and is more intelligent and efficient. It is thus a higher-performance alternative to a hub and can generate less network traffic in delivering messages on busy networks.
Is Switch a Smarter Option?
When a switch is powered up, it has no knowledge of what is connected to it, so it re-transmits the received data packets or frames to all ports, just like a hub does. However, once it receives a packet from a specific host it associates the source MAC address with that port, and in that way eventually learns the MAC addresses of all the devices attached to it. Once that has been accomplished, it can inspect each incoming frame and determine the destination port from the MAC address embedded in the Ethernet header in the frame. It then sends out the data only to the destination devices for which the frames are meant. This switching operation reduces the amount of unnecessary traffic that would have occurred if the same information had been sent to every port as it happens with a hub.
This also improves the bandwidth of the network. For example, a 10/100Mbps hub must share its bandwidth with each and every one of its ports. So when only one PC is broadcasting, it will have access to the maximum available bandwidth. If, however, multiple PCs are broadcasting, then that bandwidth is divided among all of those systems, which will degrade performance. But 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. That’s why, compared to a hub, a switch is a more efficient and smarter option.
There are store-and-forward switches which save the entire incoming packet to a buffer and check it for CRC errors, or other problems, before sending it onward. If the packet has an error, it is discarded. Otherwise, the switch looks up the destination MAC address and sends the packet on to the destination node. In a cut-through or on the fly switching architecture, a switch begins to forward a frame as soon as it receives the destination MAC address, stored in the Ethernet header of that frame. Many switches combine the two methods, using cut-through until a certain error level is reached and then changing over to the store-and-forward type.
Hub and Switch – Which One Should I Use and When
In a small network, where there are lesser users or devices, a hub can easily cope with the network traffic and is a cheaper option for connecting devices on a network.
When the network gets larger, with about 50 users, using a switch is a better option to cut down on the amount of unnecessary traffic.
Switches and hubs are often used in the same network; the hubs extend the network by providing more ports, and the switches divide the network into smaller, less congested sections. As there are restrictions on the number of hubs that can be connected together to add more users to a network, switches can be used in such situations to extend the number of hubs.
Because of the speed and performance advantages of switches over hubs, and the reduction in the cost of switching technology, nowadays hubs are rarely used in networking applications.
Conclusion
John got me interested in networking and I want to further explore about how to build a network and the fundamentals of computer networking. If you too want to learn about switches and how to configure a Cisco switch then you can check out the training guide Cisco LAN Switching Video Mentor.
Recommended Articles
Top courses in IT Networking Fundamentals
IT Networking Fundamentals students also learn
Empower your team. Lead the industry.
Get a subscription to a library of online courses and digital learning tools for your organization with Udemy Business.