Ethernet Switch vs Hub: What’s the Difference?

Let’s discuss Ethernet Switch vs Hub. Ethernet hubs can be the central point for connecting various systems to shared networks. Ethernet switches provide an exclusive electrical signal path for any two network nodes.

Do you want to learn more? You have come to the right place. This article will provide a detailed introduction to Ethernet Switch vs Hub, helping you understand their differences.

Let’s dive deeper into it.

What is a hub?

The Collins Dictionary explains hub as follows: “When a place is a vital center of an activity, you can describe it as the hub of that activity.” In fact, the working principle of the hub is quite similar to this explanation, which you will understand in the following introduction.

A hub, a device that operates at the ISO physical layer, is a simple and standard shared device. Unlike switches, it does not have a MAC address table. This means it sends data not in a targeted manner but in a broadcast manner. In other words, when it needs to send data to a specific node, it doesn’t send it directly to the destination node. Instead, it sends the packet to all the nodes connected to the hub.

The network formed by the hub is a shared network, and the hub can only work in a half-duplex, whereas the switches mentioned below can work in a duplex.
To add one more point of knowledge, as shown below:

 specificitiesexplain by giving an example
half -duplexThe interface can only receive or send data at any given moment, and the maximum transmission distance is limited.A half-duplex is like a walkie-talkie. If someone wants to transmit a voice to another person, they must press a certain button and then speak. When the button is pressed, the message is transmitted in one direction only, so they can’t hear the other person while transmitting the voice. In order to receive the other person’s voice, they have to release the button.
duplexThe interface can receive and transmit data simultaneously, with a maximum throughput of up to double the rate and eliminating the physical distance limitations of half-duplex.A good example of full duplex communication is telephone communication. When you are talking to someone on the phone, you can speak to and listen to the other person simultaneously. So you don’t have to wait; you can talk and listen simultaneously.
half-duplex vs duplex

For its working mode, let me give you a simple example as shown below:

Examples of Hub Operating Modes

Advantages and disadvantages:

Hubs make it possible to reduce the number of network cables and ports, and the whole layout is quite clean and relatively inexpensive.

However, the original message that only needs to be sent to a certain computer now has to be sent to all computers connected to the hub, which is not safe nor saves network resources, and at the same time, when sending data, it is also prone to congestion and conflicts.

What is an Ethernet switch?

The switch (Switch) and hub look alike but are more powerful. A switch is a network device for electrical (optical) signal forwarding. It provides an exclusive electrical signal path to any two network nodes connected to the switch. The most common switch is the Ethernet switch. Other common ones are telephone voice switches, fiber optic switches, etc.

The switches mentioned in this section are Layer 2 switches, which work at the ISO data link layer. Layer 3 switches are switches that work at the third ISO layer, the network layer, and are actually routers.

All data sent to the switch goes into the switch’s cache first. Then, the message is forwarded to the corresponding machine. Note the use of forwarding here, not broadcasting from a hub. How does the switch do this? The switch forwards the data through the MAC address. The switch maintains an internal MAC address table, which records the correspondence between the port number and the MAC address. The data in this table results from continuous learning by the switch.

For its working mode, let me give you a simple example as shown below:

When A sends a message to the switch and realizes that the message is coming in from port 1, the switch records in the MAC address table that A’s MAC address corresponds to port 1. If A does not send a message to port 1 for a long time, this record will expire and be deleted. Then, when enough time has passed for ABC to send messages to the switch, the address table will be complete.

The next time A is ready to send a message to B, A will take B’s MAC address, put it in the packet to be sent, and reach the switch. The switch will bring up the destination MAC address in the packet, compare it with the MAC address table, and then find that B’s MAC address happens to be on port 2, so it will forward the data to port 2. At this point, computer B receives the data from port 2 of the switch over the network cable.

Advantages and disadvantages:

The switch can learn the source MAC address and port information and forward the packets directly to the destination address, thus improving the transmission efficiency. It can perform VLAN segmentation according to the ports to realize network isolation and resource sharing.

However, switches can only exchange data within the local network. They cannot handle IP protocols, so they cannot perform routing and are relatively expensive. As the number of ports increases, the cost will increase accordingly.

Ethernet Switch vs Hub: What’s the Difference?  

Although Ethernet switches are currently replacing hubs, each product has its value. Let’s examine their differences.

hubswitch
Data packets are broadcasted to all connected devices during transmission, causing network conflicts and bandwidth waste.Only sending data packets to the target device improves network efficiency.
Hubs function on layer 1 of the OSl framework.Switches function on layer 2 of the OSl framework.
Hubs group Ethernet devices on a LAN, broadcasting all data to all devices.Switches connect devices to a singular LAN to transmit data from one device to another.
The hub only supports half-duplex communication and can only send or receive simultaneously.The switch supports full duplex communication and can simultaneously transmit and receive data.
The cost of hubs is relatively low.The cost of switches is relatively high.
Hubs are suitable for minor or temporary networks.The performance of switches is better and ideal for large networks.
The hub only serves to synchronize, amplify, and shape data transmission.The switch can achieve synchronization, amplification, and shaping of data transmission and can filter short frames, fragments, etc.
No matter how many ports a hub has, all ports share the same bandwidth.Each port of the switch has an exclusive bandwidth.
ethernet switch vs hub

The questions you may ask

Question1:When the switch queries the address table and finds that the destination MAC address’s destination port and this packet’s source port are the same, what should be done?

Answer: The packet will be dropped directly when the switch queries the address table and finds that the destination and source ports are identical.

Question 2: Can’t find the corresponding MAC address in the MAC address table?

Answer: This could be because the device with that address has not sent a packet to the switch yet, or it has not worked for some time, causing the address to be removed from the address table.

In this case, the switch cannot determine which port to forward the packet to but can only forward it to all ports except the source port. The packet will be received on whatever port that device is connected to. At this point, the switch broadcasts just like a hub. After sending the packet, the target device will respond; as long as the response packet is returned, the switch can write its address into the address table. Next time, sending the packet to all ports is unnecessary.

Conclusion

This article discusses almost all the information you need to know about an Ethernet Switch vs. Hub, and I hope you enjoy it. Although an Ethernet hub is cheaper than a switch, a switch has better performance. Choosing a network device is entirely up to you, as both serve specific users. If you want to learn more valuable tips and insights, please visit our technical blog!