What is a router? What is a switch? and What is a hub?
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 :
- They have more hardware capabilities instead of pieces of software used in routers
- 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