What is a router? What is a switch? and What is a hub?

6,197

Solution 1

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...).

Solution 2

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

Share:
6,197

Related videos on Youtube

narayanpatra
Author by

narayanpatra

Updated on September 18, 2022

Comments

  • narayanpatra
    narayanpatra over 1 year

    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.

  • sblair
    sblair about 13 years
    Using switches rather than hubs should eliminate collisions, not just reduce them (assuming full duplex).
  • M'vy
    M'vy about 13 years
    Yep good point @sblair
  • Sirex
    Sirex about 13 years
    A reduction to zero :)
  • M'vy
    M'vy about 13 years
    Not completely @Sirex. You can still have collisions on each branch of the switch, but they do not propagate to others. You can still have multiple computer on one branch.
  • tvdo
    tvdo over 11 years
    > such as which system has a specific address Wouldn't that be a DHCP server, which may or may not be part of a router? And clients can pick their own IP addresses... that's not really the role of a router, merely an additional function often performed by consumer routers.