What's the difference between a hub, a switch, and a router?

Thursday, January 14, 2021

The definition

  •          Hub

A hub is a general network component mostly used in a LAN, which connects multiple computers or other network devices together. A hub operates at the physical layer of the OSI model. It has no routing table or intelligence, and simply broadcasts all network data across each connection.

That means, every computer or device connected to the hub “sees” everything every other computer or device on the hub does. It’s up to the computers themselves to decide if a message is for them and whether or not it should be paid attention to. The hub is uncapable of distinguishing where a data frame should be sent to. Passing it along to every device ensures that it will reach its intended destination.

However, this raises security and privacy concerns, because traffic could not be safeguarded or controlled. Moreover, this places a lot of traffic on the network and can lead to poor network response times.

  •          Switch

A switch does what a hub does, connecting computers or devices, but more efficiently. It uses the MAC address to identify the location of the connected devices and forwards data frame to and from destined devices. In other words, the network traffic only goes where it needs to, instead of to every device.

There are two different kinds of switches. Layer-2 switches move data within one LAN, while layer-3 switches perform traffic directing between WANs.

  •          Router

A router connects at least two networks, commonly two LANs, or two WANs, or one LAN and its ISP’s network. It select optimal paths for data packets to cross networks and reach their destinations. Moreover, a router is like a computer that can be programmed to understand, manipulate, and act on the data it handles. A router is much more functional, intelligent and complicated than hub or switch.

A router operates at the network layer of the OSI model.

Most fundamental difference

Today most routers have become something of a Swiss Army knife, combining the features and functionality of a router and switch/hub into a single unit. So conversations regarding these devices can be a bit misleading, especially to someone new to computer networking. However, there are still quite some fundamental differences.

 

Hub

Switch

Router

Layer

Physical layer (layer 1)

Data link layer (layer 2) or network layer (layer 3)

Network layer (layer 3)

Function

Connect or interlink multiple system or components to each other

Allow connections to multiple devices, manage ports, manage VLAN security settings

Connect different types of network and direct data across networks

Data transmission format

Electrical signal or bits

Frame (L2 switch) & packet (L3 switch)

Packet

Port

4/12 ports

Multi-port bridge, 24/48 ports

2/4/5/8 ports

Transmission type

Frame flooding, e.g. unicast, multicast or broadcast

Broadcast initially, then unicast and/or multicast depends on the need

 Broadcast initially, then uni-cast and multicast

Device type

Non-intelligent, passive device

Intelligent, active, software-based device

Intelligent, active device

Application

LAN

LAN

LAN, MAN, WAN

Transmission mode

Half duplex

Half/Full duplex

Full duplex

Speed

10Mbps

10/100Mbps, 1Gbps

1-100Mbps(wireless); 100Mbps-1Gbps(wired)

Address used for data transmission

-

MAC address

IP address

MAC address

not stored

stored in the lookup table

support storing

Broadcast domain

Based on the single broadcast domain

Based on one broadcast domain unless any VLAN is incorporated

Router provides a discrete domain for each port.

Types of collision

A collision occurs frequently in hubs at time of installation.

There is no possibility of collision.

There are five domains of collision in a router.

Spinning tree

It has no spinning tree.

The switch has a high probability of many spinning trees.

It has an intermediate chance for spinning trees.

Bandwidth sharing

Bandwidth is split between all connected devices.

No sharing

Bandwidth sharing is dynamic.

In short, a hub glues together an Ethernet network segment, a switch can connect multiple Ethernet segments more efficiently and a router can do those functions plus route TCP/IP packets between multiple LANs and/or WANs; and much more of course.

 

 

Leave your comment

Loading...