Link to home
Start Free TrialLog in
Avatar of CraigSNYC
CraigSNYCFlag for United States of America

asked on

Difference between a router, a hub, and a switch.

I can't seem to find a good, clear answer on this.  Can someone offer a distinction between the three?  

Thanks!!
Avatar of Soulja
Soulja
Flag of United States of America image

A
SOLUTION
Avatar of Soulja
Soulja
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CraigSNYC

ASKER

QUESTION AMENDMENT:

Can you tell me in what situation would each be used?
A hub is the most simple of the three. It allows multiple computer to communicate, but the downside is that is broadcasts a signal coming from a computer to all computers connected to it. If you have a small LAN, hubs are fine, but when the traffic and number of clients increase a switch is better suited.
A router is used to separate networks and to communicate between different networks.
I wouldn't ever use a hub.  Basic switches are pretty much as cheap as hubs now, anyway.  Whereas a hub will do what Soulja said, repeat incoming data from one port out of all other ports (and let the recipient computers sort out what is meant for them and what isn't), a switch maintains a table of addresses that allows it to send incoming data to only the port where the intended destination for the packet can be found.

In very simple terms, you use a switch for connections within a single subnet and a router to move data between different subnets.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
An example of the above:

All machines on my home network (server, four workstations, network printer) uses the 192.168.9.0 subnet and are connected with a switch.  I also connect by VPN to a client's network (using subnet 192.168.5.0) - these two subnets are connected by routers via the internet, but if they were in one physical location, we could use a single router between the two.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DVation191
DVation191

For whatever it's worth...

A Router is 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. Very little filtering of data is done through routers.

A Switch is 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 Hub is 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. A passive hub serves simply as a conduit for the data, enabling it to go from one device (or segment) to another. So-called intelligent hubs include additional features that enables an administrator to monitor the traffic passing through the hub and to configure each port in the hub. Intelligent hubs are also called manageable hubs. A third type of hub, called a switching hub, actually reads the destination address of each packet and then forwards the packet to the correct port. (AKA a "Switch" as described above)

Hi.  Thanks for the "A".  Glad I could help :-)
To simplify this:
If you are using a broadband internet connection (Cable, DSL, Sattelite) you should use a router.  These are relatively inexpensive and can be found at Walmart.  

Unless you have tons of simultaneous users on the network, a hub is as simple as you need.  If one of your computers is handling the incomming internet signal, you would not need a router.

Switches?  if you have tons of people using the network at the same time this is the way to go.  Can be a little more complicated.

Go to the Linksys, Dlink webistes and they can give you a lot of help in figuring out which ones to use.  
Hubs:
Check it out : http://www2.rad.com/networks/1997/nettut/hub.html
*The bottom of the networking food chain
*Connect device and create larger networks
*Small hubs 5-8 ports (workgroup hubs)
*Some hubs have more ports, up to 32 normally
*Direct data packets to all devices connected to the hub - shared bandwidth
*Scalability, Collision, inefficient

Switches:
*Like hub, connectivity points of Ethernet network
*Forward only to the port that connects to the destination device
     -knows MAC address
      -Match the MAC address in the data it receives.
*Fully switched network, a dedicated segment for each device is connected to switch. *Expensive.
*Allow full duplex Ethernet
        -It was half duplex before – one device can transmit at one given time
         -Nodes only communicate with switch, never directly to each other
         -Use twisted pair or fiber optic cabling, using separate conductors for sending and      receiving data.
        - double the capacity, 100Mbps become 200Mbps
*Most LAN are mixed with hubs and switches.

                                                               Switch and Router


Different with router:
               -Typically switch works on lower level (Data link Layer)  while Router works in higher level (Network Layer)
             -Algorithms for router and switch about how to forward packers are different
For example, switch will forward broadcast, so does hub, not router- the address has to be specific.


                                                                           Bridges

*Divide larger networks into smaller sections
*Check MAC address, forward or block the data
*Learning bridge builds list of MAC address by watching the traffic on the network.
      Two issues to consider:
            Placement 80/20 rule
             Bridging loops
                        (IEEE 802.1d Spanning tree protocol)
*Types of bridges:
 -Transparent bridge
 -Source route bridge
 -Translational bridge

                                                                   ROUTER
*Create larger networks by joining two networks segments.
*Dedicated hardware device or computer systems with more than one network interface and routing software.
*Routing table
 -Static routing
 -Dynamic routing
*Use special routing protocols to pass info to other routers.
   Distance Vector Routing (RIP)
  Link state routing (OSPF)

                                                                         

GO TO
http://www.csl.mtu.edu/cs4451/www/notes/Networking%20Devices.ppt
FOR MORE




I see people are taking it out on the little hub. I am not 100% clear on the issues, but I have a feeling that they do have their place. Here are a couple of situations that I *think* they might have an advantage over the higher-end kin :

1) if you *want* to restrict bandwidth to certain computers, stick them on a 10Mbps/half hub - the only other way I can think of to restrict bandwidth is to use a managed switch or router, which are usually more expensive;
2) if you have one server broadcasting to every other computer - hubs will send the traffic to every other computer anyway, with little in the way of return traffic, so a hub maybe sufficient.

Of course, I could be completely wrong about this.

Comments?

Max.
Router are normally used to connect to a cable modem/adsl and ROUTE packets from the internet into your local area network or LAN.
A router is what you would want to use if you have 1 internet connection and want to share it with several computers in your house (using NAT or network address translation).

Inside your house you may have several computers and printers you want to network to fully get the use of your internet.

Hubs are rather old and simply SHARE packets of information between the computers.  Lets say Computer A sends out a signal to Computer D - it would BROADCAST the message to all computers over the hub.. then Computer D would see it and respond.  Kinda a loosey system if you have 20 computers all broadcasting.

A switch is a more intelligent hub.. basically SWITCHING packets.. so when Computer A sends a signal to D it goes from A's port on the switch directly to D without the need to broadcast every single request between the two computers.
A Router is the device you use that connects you to the internet and is connected between the ethernet cable on the cable, DSL, or T1 ethernet connection of your internet connection and the switch.  It is usually a firewall, DHCP server, and sometimes wireless device in smaller networks.

A switch is what you plug in all your client computers into that switches the IP packets between the appropriate ports.  For example one computer and the internet connection from the router would both be plugged into the switch.  All data going from the computer to the internet and vice versa is addressed appropriately, and the switch bypasses all other computers on the switch and sends them to the right location.  

A Hub is a simple device that treats packets and ethernet cables as a series connection and broadcasts all IP packets to all ports on the hub.  It has no switching table and intelligence to route only to the appropriate port.  This device is older and can slow down a network.
ok now let me throw my two cents in.  As network devices get better and better all the time, the lines become blurred.  As has been mentioned in previous comments routers act on Layer 3 of the OSI model.  In otherwords they route packets and limit broadcast storms.  But as switching gets better and better we are seeing layer 3 switching.  Depends on the platform that one is using.  Cisco puts out alot of big gun platform where the lines now become blurred.  Now i am talking about the big gun router/switches that we use at work.

Your hubs are a shared medimum generally 10mb half dup. or they used to be pardon me.   Now they also go up to 100Mb and can be full dup.     The great thing about switches is they limit collison issues and each port has a dedicated bandwidth to the pc, desktop or whatever.  So that makes it great if you as a Network person is trying to monitoring exactly how much b/w is being used to the desktop.
This has got to be the longest thread that would not die... =) I assume the most recent posters realize the question has already been satisfactorily answered? And you are just being nice people and contributing more information out of the goodness of your hearts... =)
Hi

Router is intelligent enough to understand the ip header of the packet , ip header will have the source ip and destination ip, and routing options to determine the best path across the internet . Router has its own routing table and keep updating the routing table from the routing updates getting from other routers.  it checks the destination ip of the packet
and route that packet on to corresponding interface after checking the routing table.
Since IP protocol in N/w layer so routers works in N/w layer .
right now in the market there are layer2 ,3,4 and some layer 7 switches also available , it is based on the switch intelleigence Layer 2 switches will not be able to understand ip headers and it understands only datalink layer header that is frame , it reads the source and destination MAC Adresss of the frame , and switch has the mac table
it frowards the frame to the corresponding switch port after looking in to the mac table.

Layer 3,4,7 switches will be able to understand ip header  Layer 3  switches are used in a huge LAN segments ( IP VLAN Segments) , Layer 4 switches can understand the TCP Header of the packet and makes the decision based on the policies configured on layer 4 switches based on tcp ports.
Layer 7 switches will be able to understand the application header of the packet  ie HTTP header,SMTP header,FTP ..application protocols  Layer 7 switches used in ISP's to redirect the traffic to cache engine based the URL address in HTTP header.

Hubs only works in physical layer and bandwidth is shared between all the ports and all hub ports are in single collision and broadcast doamin. where as each port in switch its own collision domain .

Thanks
Rama Dodda.
I am planning to buy what (LinkSys and others) are calling a 'wireless access point', in order to add wireless access for my laptop by connecting it to my router (which is connected to the cable modem - and I'm planning to leave my desktops connected to the wired router for security reasons...). Am I correct is assuming that the wireless 'access point' is the equivalent of a wireless hub?
Hi
the major diffrence between Hub ,switch and router see the following link
http://handsonhowto.com/lan102.html

thank you

chalapathi
One problem I found using hubs is connecting a PC with A 10mb network card to my 100mb only hub which serves the internet (The router is single port and has to serve other PC's). The soloution was to use my dual speed hub which was able to connect to the 100mb hub and to the 10mb card effiectively bridging the connection.
routers connect subnetworks together. It breaks down large n/w's into smaller sub n/w's. routers introduce longer delays and have lower throughput rates than bridges. however mutiprotocol routers support ethernet , FDDI , token ring and a variety of LAN interfaces.

A hub is the central component (point) of a n/w. its responsible for * station configuration : reposition stations in any order and  connects new stations to the ring
* ring configuration : creates new rings , expands them etc.
* topology configuration : implements flat , structured or multitiered topologies with the aim of minimising the disruption to n/w operations.
the hub should therefore be reliable,fault tolerantand fully redundant system. the hub should be flexible enough to allow the n/w to grow gracefully.

a switch is responsible to manage control and links between verious nodes of a n/w. various examples are the crossbar switch , crosspoint switch etc.