8

I always mess up with the basic concepts in networking. This are the very basic questions.

  1. What is a router, its functions and what is meant by routing?
  2. What is a switch, its functions? Many time I heard that there are layer 3 switches. If there are layer three switches , why they are not called as router? since they are doing work of a router. What is the exact difference by which we decide this router and this is switch?
  3. What is a hub?

I have read about these questions plenty of time and then to I have messed up in my interviews. Please let me know or give me a link to study about these things in very detail.

4 Answers4

22

A hub is the simplest hardware device that is used to interconnect equipments. It provides network ports from which he reads packets and duplicates them to all other ports.

The switch (layer II) is an enhanced hub. The simplest switch can decide on which port to send a received packet so as to not disturb a sub-network where no one is interested with this packet. This is to reduce the traffic collisions.

The router role is to separate two or more networks. Let's say R&D department network, Commercial department network and the internet.

Routing is the action of taking a packet from one network and do something with it (like dropping, relay on another network, ...). Without routing, it is not possible to communicate from one network to another.

Layer III switches are rather like routers but they are used for internal LANs :

  1. They have more hardware capabilities instead of pieces of software used in routers
  2. Since their purpose is to serve as LAN interconnections, they don't have WAN ports and capabilities (VPNs, etc...).
M'vy
  • 3,950
3

Well, a good way to think of it is in terms of traffic. Think of each packet as a car, identified by its licence plate number

A hub is a roundabout. The cars go round and round, up until they reach their exit. Anyone can see what cars are on the roundabout, and note down their numbers, and see what's in them

A hub has no logic telling where a packet needs to go - it sends it to ALL ports available and lets the client sort it out

A switch is a very special type of intersection -Imagine all the cars enter a tunnel, and take whatever route they need to- no one can see what's in the cars, and they only go in the direction they need to go. However the drivers have to be told before they enter the tunnel where the exit is.

A switch sends packets to the client systems, but only within the same network segments - so within the same 'neighbourhood'

A router basically links different segments

Most consumer router's are basically a switch + a router + a dhcp server and a few other things

Journeyman Geek
  • 133,878
0
  • Hubs and Switches are used to create networks.
  • Routers are used to connect networks.
  • Hubs broadcast packets all network devices within LAN
  • Switches send packets to one network devices only based on MAC address LAN
  • Routers send packets to one network devices based on IP address on WAN

tldr;

A Hub contains multiple ports, which are used physically connects computer via ports. When a packet arrives at one port, it is copied to the other ports, it causes Security risk, Collisions and One conversation at a time.

A Switch is same as hub, it is also contains multiple ports, which are used connect computers via ports but Smarter than Hub. Based on MAC Address it identifies a packet which computer is sending request and whom to send. So minimum Ethernet collisions and Multiple conversations at a time.

Both Hub and Switch are provides communication between computers on the same network. If we want to communicate two separate network, we need a Router. Router is also called a gateway(of network) which are used to for Inter-networking.

Premraj
  • 2,356
0

works on third layer i.e Network Layer. Does path selection, routing etc. Creates multiple collision domail and multiple broadcast domain.

Switch: works on second layer i.e datalynik Layer. Does framinng.Error Detection etc. Each port on the switch has a seperate collision domain. It has single broadcast doamin and multiple collision domain.

Hub: It works on physical layer. It simply forwards the data to each port of it. Its a non intelligent device. Has Single collision Domain and single broadcast domain.