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.

  • 1
    Have you tried Wikipedia? If so, what concepts don't you understand, specifically? Maybe tried, you know, Google? Google Suggest autocompletes "level 3 switch" with "vs router", and the first result delivers, AFAICT. If you read about these topics, and you know what aspects you didn't understand fully for your interview, you should be able to form much better, much more specific questions. – Daniel Beck May 20 '11 at 7:40
  • 1
    Seconded. If you have "read about these questions plenty of time" then you wouldn't have to ask what a router, a switch and a hub is. You should do your research first and then ask specific questions. Many people won't provide you with more than Wikipedia has to offer (yes, they have some useful articles) – slhck May 20 '11 at 8:08
  • 4
    Honestly, I can see how the Wikipedia articles could be confusing to someone facing these basic questions. Take a look at them. Here's the lead for the Hub article: "An Ethernet hub, active hub, network hub, repeater hub or hub is a device for connecting multiple twisted pair or fiber optic Ethernet devices together and making them act as a single network segment. Hubs work at the physical layer (layer 1) of the OSI model.[1] The device is a form of multiport repeater. Repeater hubs also participate in collision detection, forwarding a jam signal to all ports if it detects a collision." – Louis May 20 '11 at 9:12
  • 1
    @Louis Continues: "A network hub is a fairly unsophisticated broadcast device. Hubs do not manage any of the traffic that comes through them, and any packet entering any port is regenerated and broadcast out on all other ports. Since every packet is being sent out through all other ports, packet collisions result—which greatly impedes the smooth flow of traffic." Everything one needs to know, really. Regarding the difference search for "hub" in the Switch article, linked from the Hub article in "see also". – Daniel Beck May 20 '11 at 9:18
  • 2
    If the terminology on Wikipedia is too complex, there is always the option of the Simple English Wiki. While not having as much content as the main english wiki, it can help for easier understanding of the topic (although, for example, don't expect it to have an explanation on quantum physics). – tombull89 May 20 '11 at 9:24

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...).
  • 4
    Using switches rather than hubs should eliminate collisions, not just reduce them (assuming full duplex). – sblair May 20 '11 at 9:01
  • Yep good point @sblair – M'vy May 20 '11 at 9:06
  • 1
    A reduction to zero :) – Sirex May 20 '11 at 9:40
  • 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. – M'vy May 20 '11 at 9:43

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

  • > 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. – Bob Jan 19 '13 at 15:16

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.

  • 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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.