What are Hubs and Switches ?

How do Hosts connect to a network ?

We need to understand that hosts connect to a network through a Network Interface Card (NIC) . Every host has a Network Interface Card (NIC)  that it uses to connect to the network .
A network cable connects to the NIC on a host at one end and at the other end it connects to the network or to another host.
In case of more than 2 hosts in a network, we will need a separate NIC card for each connection, which is not a viable option. So it is much better to connect a multiple hosts via a a network device called hub.

What is a hub ?

We can say that a hub is a network device that repeats information that it receives from a host, in order to transmit it to all other connected hosts. 

Hub simply relays any information received from one host to another. What it means? It means that all the connected hosts can communicate with each other. Communication between hosts is classified into three types:
  • Unicast Communication from one host to another host only.
  • Broadcast Communication from one host to all the hosts in the network.
  • Multicast Communication from one host to few hosts only.

What is a Switch ?

 Like hubs, switches are used to connect hosts in a network 

Why do we need Switches?

There are a few limitation while using hubs. 
  • A hub can not transfer a unicast message to only one host , that the message was intended for. Rather, it transfers the message to all other hosts also even though the message was unicast i.e intended for a single host.
  • In a network that uses a hub, only a single host is able to send packets at a time. A collision occurs if any other attempts to send packets simultaneously. This shared medium is known as collision domain. It thus creates an inefficient network. Hence the other hosts need to resent the data hoping that this time collision does not occur. This kind of network is often not scalable giving to the reason that data transfer becomes complicated and inefficient as number of hosts and hubs connecting them increase, where hosts are trying to send packets together resulting in collision very often.

Points to remember 

  • 2 hosts connect via NIC cards
  • More than 2 hosts should be connected via a hub
  • A hub can NOT break collision domains
  • Switches break collision domains therefore they are more effective than hubs.
Dear readers , please feel free to share your comments in the comment section. Let us know what all topics you might want to go through.