Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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
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
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
@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
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
up vote 21 down vote accepted

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...).
share|improve this answer
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
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
Thanks a lot buddy. It cleared many things. – narayanpatra May 20 '11 at 14: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 cannot handle things like assigning a system an ip address

A router basically handles things such as which system has a specific address amongst other things. This is what most consumer equipment tends to be. You might consider it a switch with traffic lights ;)

A router is a switch with traffic lights

share|improve this answer
> 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.

share|improve this answer

A common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.

In networks, a device that filters and forwards packets between LAN segments. Switches operate at the data link layer (layer 2) and sometimes the network layer (layer 3) of the OSI Reference Model and therefore support any packet protocol. LANs that use switches to join segments are called switched LANs or, in the case of Ethernet networks, switched Ethernet LANs.

A device that forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its ISP.s network. Routers are located at gateways, the places where two or more networks connect. Routers use headers and forwarding tables to determine the best path for forwarding the packets, and they use protocols such as ICMP to communicate with each other and configure the best route between any two hosts.


enter image description here

Source of image

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .