LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2004, 10:13 PM   #1
JCdude2525
Member
 
Registered: Mar 2004
Location: Berlinsville
Distribution: Slackware/Fedora
Posts: 103

Rep: Reputation: 15
Router vs hub vs swtich?


Hello-

I am probably going to buy a WAP11, it's a wireless access point. As I was looking over the Linksys products, I saw routers, hubs, and switches. I looked on google to try to figure out what all these were, but I just got confused. So, could somebody tell me what each one is, what it's for, and how it works, about? And, for those of you who have a WAP11 or know wireless well, what would a WAP11 be considered?

Thanks
-Jim
 
Old 11-15-2004, 12:21 AM   #2
linuXBOX
Member
 
Registered: Jul 2003
Location: Stuart,FL
Distribution: Fedora Core 3 and Slackware 10.0
Posts: 179

Rep: Reputation: 30
I'm sorry I don't know much about about wireless products. But in terms of wired technology let me attempt to break it down.
A hub is low cost, but it does not discriminate between data source and data recipient. It will send information to all it's ports. It's like a cable splitter. It does not filter data which is sent through it. A hub is an inexpensive way to split an internet connection to 2 or more computers.
A switch is like a hub, but it performs intelligent actions to determine which port to send data to. It does not automatically send data to all ports. For this reason it creates less latency (or lag) on the network. This would be the preferred method of creating a network, however switches are more expensive than hubs.
Routers perform two functions, path determination and switching. They are primarily used to get you out to the internet. However if you are using broadband, your modem acts as a router to get you on the internet. Routers also usually have a built in switch to allow computers on the network to "talk" to each other so you can use them to build a network. However routers also have built in firewalls, which are used to help filter out threats on the internet. This is good and bad for you. Good because you are better protected, but bad because it requires the router to perform computations on the incoming data to determine if its friend or foe. This increases latency on your network. In other words it increases the time it takes for data to get to you from the net. It is only on a scale of milliseconds, and when browsing the web, you won't notice. But in terms of gaming, where you are always seeking the lowest latency possible, it may seem unsatisfactory.
Let me know if that was too confusing, follow up with whatever questions, I'll try to answer them.
 
Old 11-15-2004, 01:28 AM   #3
fluff
LQ Newbie
 
Registered: Sep 2003
Location: NZ
Distribution: Red Hat
Posts: 17

Rep: Reputation: 0
Heres my two cents worth.

A hub only amplifies the signal, it does not have any intelligence at all. Ie. when a packet is received from a computer, it is then sent out all ports, for the computers to decide whether it is for them or not.. very network resource intensive as you can imagine.

A switch works by keeping a "cached database" of MAC (hardware) addresses. It keeps track of which machine is plugged into which port and knows them by mac address. Trouble is, all ip packets are sent to ip address, so it has to maintain a lookup table of ip address to mac address. But it will only send the data out to the specific port it knows the computer is on. Less resource used on the network, but still a little extra time to perform the lookup.

A router will keep a record of the ip address that is attached to each port. therefore it is the quickest of them all but also, due to the extra processing required, usually the most expensive. it will only send data out to the port that has the destination ip address on it. It will also perform "routing", ie it will perform "network address translation" on the information going from one network to another (ie your home network to the www).
 
Old 11-15-2004, 02:15 AM   #4
RWallett
Member
 
Registered: Jan 2002
Location: Anchorage, AK
Distribution: Gentoo, Ubuntu and Slackware
Posts: 38

Rep: Reputation: 15
Quote:
Originally posted by fluff
A router will keep a record of the ip address that is attached to each port. therefore it is the quickest of them all
Ummmm...not exactly. While you are correct that a router does maintain ip addresses, routing is usually implemented in software, while switching is usually implemented in hardware through "ASIC"'s (application specific integrated circuits)--chips that are specifically optimized for a specific purpose. Because switching is done through "hot rodded" hardware rather than software, switching is usually much faster than routing.

So why use routers? Without getting into the nitty-gritty of the OSI model, what happens is that switching doesn't break up networks into subnetworks, but routers do. While switching will only send data to the addressed host (unlike a hub), a broadcast on a network (like negotiating a DHCP address) sends traffic to every connected device on a switch. However, broadcast are limited to a single network, so routers will break up broadcasts--someone on Verizon's network cannot broadcast to hosts on AT&T's network, for example. So anytime you need to internetwork, you need a router, but for a single network, you can use either a hub or switch.

Sorry if that was a little long winded

A WAP11 is a combination switch and router, as is common on most home/small office "routers". On the inside, you will have a four port switch (actually five ports, if you include the port that connects to the "router" portion) and then there will be a router between the four port switch and your internet connection. Because it is a wireless device, too, then I believe there is the moral equivalent of a 256 port switch for the wireless portion, too. But, I'm not a wireless expert, so don't quote me on that.

Hope this helps!
 
Old 11-15-2004, 02:25 AM   #5
linuXBOX
Member
 
Registered: Jul 2003
Location: Stuart,FL
Distribution: Fedora Core 3 and Slackware 10.0
Posts: 179

Rep: Reputation: 30
I have to agree with RWallet, if I remember a router is the slowest of the three because it is software driven. However a hub creates more conflicts because it doesn't differentiate between destinations, it just broadcasts. A switch is best because it strives to create no additional latency. Is this correct RWallet?

PS. Collisions is the word I'm thinking of...hubs create more collisions, routers try to reduce them...is that accurate?

Last edited by linuXBOX; 11-15-2004 at 02:37 AM.
 
Old 11-15-2004, 03:17 AM   #6
dsnuggs
Member
 
Registered: Aug 2003
Location: West Sussex. UK
Distribution: SuSE 11.2-0
Posts: 60

Rep: Reputation: 15
If it is any use to you all. Here is a web site that tells ALL. Not only for Hubs etc, but EVERYTHING.
The web site is...

http://computer.howstuffworks.com/lan-switch.htm

That explains how they work.




Keep on Linuxing - - - - - - -
 
Old 11-15-2004, 05:06 AM   #7
JCdude2525
Member
 
Registered: Mar 2004
Location: Berlinsville
Distribution: Slackware/Fedora
Posts: 103

Original Poster
Rep: Reputation: 15
Now I understand. But I head that switches allow data to flow through the cable in both directions at
the same time, called fullduplux or somthing, where routers and hubs don't?

-Jim
 
Old 11-15-2004, 06:33 AM   #8
dewaalk
LQ Newbie
 
Registered: Oct 2004
Location: South africa
Distribution: RH 8, 9, FD 1 & 2
Posts: 1

Rep: Reputation: 0
Cool

Jim

“I saw routers, hubs, and switches”

On your question I would explain it as follow:

• Routers are used to connect your local area network to your ISP or to another router/LAN over a telecom data line.
• Hub’s and switches are used to connect devices on to a common LAN, Hub will receive a broadcast from one device and echo it to all the other devices connected to the hub. Switch on the other hand will send the broadcast to the device it was addressed to saving on network overhead.
• I think you AP would work on the same principal as a HUB?

Cheers
Karel
 
Old 11-15-2004, 07:12 AM   #9
Geoff Bickford
LQ Newbie
 
Registered: Jan 2003
Location: Honolulu, HI
Distribution: Slackware 8.1
Posts: 3

Rep: Reputation: 0
Hubs, switches, routers and WAP11

The previous discussions of Hubs and switches and routers was mostly correct. The mental image that I have in order to use them is the difference between a PA system and a telephone system. Thee hub is the PA system. All messages go out to everyone. You have to wait your turn to get your message thru. Only one person can talk at a time (that is really pushing the metaphor a little to far but it helps in seeing why the traffic is slower) A switch is more like the phone system. Each machine has a discrete address and the messages tend to go more directly to the other machine. Which to use is determined by the number of users on the subnetwork that it is on. If you are setting up a network with more than 10 - 15 users that mostly only cruise the internet (A classroom or a small business for example) use a switch. The network can get too 'chatty' between the computers and you can start to see some system degradation. Given the cost differencebetween a hub and a switch (minimal) Ialmost always use a switch. Even for small networks.

A router does divide up the network into subnets directing infomation to each appropriate subnet. Routers tend to perform one other important function in a small network (Like your home I am assuming) They act as DHCP servers. Each computer on your system needs a separate IP address that is specific to its own subnet. (Roughly seaking your home is a subnet of your ISP's network) When you turn your computer on, It sends out a broadcast message asking for an IP address so that it can talk to its neighbors. A DHCP server gives it one. This functionality is incorporated in most machines that perform routing functions these days. This functionality can also be turned off because it is VERY bad juju to have 2 dhcp servers on one subnet. Causes all sorts of problems.

On to you WAP11. Its technical name is a bridge. It bridges the divide between your wired network and your wireless portion. It is basically a radio transciever that converts the radio signal into something that the network can understand. It acts like a hub in that aspect because you cannot have specific ports that you can send signals over via radio waves. Personnally, I have used and been very pleased with the Linksys bridge.

Good luck.
 
Old 11-15-2004, 09:09 AM   #10
pouceo
LQ Newbie
 
Registered: Apr 2004
Posts: 5

Rep: Reputation: 0
The question everyone is missing.

The difference between a hub, switch, and a router has been explained very well, however I think there is a very important question that is being missed. What are you trying to connect too?

If you are connecting to a broadband connection (ie cable, dsl, satellite, ect.), and you want to connect more than one computer at the same time, chances are you will HAVE to use a router, unless you are using another computer as a "gateway". Unless you are paying for multiple IP addresses, cable modems (and i believe dsl but i'm not sure) will only allow one computer online at a time. They will remember the mac address of the first computer that asks for an IP and only allow that computer online at a time. A router will act like a computer (because it really is one) to the cable modem and assign internal IPs to the individual machines on your network. This will allow multiple computers to access the internet at the same time.

To use a hub, or hopefully a switch for speed on the internal network, and have multipul computers connected to the internet, you will have to use one of your computers as a gateway. This is definately not the most efficient method.

If at all possible, get a router.

Sorry if this was already covered sorry for the post.
 
Old 11-15-2004, 10:14 AM   #11
mcnix
LQ Newbie
 
Registered: Mar 2004
Posts: 1

Rep: Reputation: 0
Check www.howstuffworks.com/home-networking.htm for some good basic info on home networking devices and practices. This site contains information on just about anything else you can imagin too.
mcnix
 
Old 11-15-2004, 10:19 AM   #12
rsheridan6
Member
 
Registered: Mar 2003
Location: Kansas City
Distribution: Debian unstable
Posts: 57

Rep: Reputation: 22
Regarding which is faster, I don't know if it really matters for the average user. This computer is connected through a switch to a router to a wireless bridge to a wireless router to my DSL modem, and it's not noticeably slower than when it was connected directly to the DSL modem.

I would get the cheapest and simplest thing that works for your needs.
 
Old 11-15-2004, 10:40 AM   #13
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
i think alot of people here are confused on what a router is here.


A router is a device that routes one network to another network usually used to subnet a network. what you do when you add a router is you allow one network to belong to a biger network of other computers. Routers dont nativly have more then 2 eathernet connections.


Here is where the confusion gets worse.

Most of todays routers have built in switches and hubs so everyone things routers have more then 2 connections


a switch routes trafic via hardware and also eliminates the need for a uplink port. <-- you see this on hubs because they cant switch the connections in a basic network cable


use this to clarify

network cable

incomming line in cable -----| | ---outgoing line
outgoing line in cable -------|uplink port| ----incomming line




ok so now we got that idea down here is a little more depth


networking works on many levels but none of that is needed for understanding all you need to know is there is a hardware level and a software level


routers do stuf on a software level or a network level they make one network have a centeral point to connect to another one


switches and hubs work on a hardware level they distribute a local network to other computers

comp1
|
hub----------------------comp2
|
|
comp3



now in order to do something like this

but this is ineffective on a larg network because you get too much traffic


basicly on the example above comp1 wants to talk to comp2 when it sends traffic to comp2 the hub sends it to everyone on the network and comp3 just igonres it because comp 1 isent trying to talk to him. Thik of this like if you went into a room with 10 other people you want to talk to one person but you have to shout out to them and everyone can hear. As you can image if everyone was doing this at once it would get confusing and in fact in a network causes laggyness.




ok so whats a switch well here we go
comp1
|
switch---------------------comp2
|
|
comp3



ok so in this example lets say comp1 wants to talk to comp2. Well in this example the packets for comp1 go directly to comp2 and comp3 never recives any or isent supposed to . think of it like the room again with everyone shouting now they are going to the person talking to them one at a time rather then shouting.

A switch does other things too like allows 100mb networks to work with 10mb networks and such but thats hardware stuff.


now a router is somthing diffrent as well
comp2
|
|
switch------------------------------comp1
|
|
Router
|
Internet


now what the router has done is add something to the network called a gateway the gateway is where all the trafic that is not ment for our network goes to find another network.


so ok this is where all hell breaks loose on confusion
comp1 wants to talk to comp2 so the traffic gets sent to comp2 via the switch.


lets say comp2 wants to talk to yahoo.com
well what happens is yahoo.com is not on our internal network so it sends this request to the router the router then pushes the request out to the internet because it knows everyone on the internal network and yahoo.com is not on there. Think of our room again. with all the people well everyone is haveing a good ol time talking to each other but say someone wants to talk to somone in the room across the hall. Well in order to do this they give the usher at the door a message he then takes this message down the hall for that person and gives them whatever the reply is.

here is a example of this kind of communication
comp1
|
|
switch------------------------------------comp2
|
router
|
|
router
|
|
switch-----------------------------comp5
|
comp6



in this example comp1 talks to comp5
path of packets would be

comp1------>switch------->router------->router------->switch------->comp5



I know this is over simplifying what networks do but its enough to get a understanding

Last edited by exvor; 11-15-2004 at 10:48 AM.
 
Old 11-15-2004, 10:42 AM   #14
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Damnit the post screwed up my diagrams

Ohh well just imagine the | are over the swiches not comp1
 
Old 11-15-2004, 10:50 AM   #15
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Never mind i fixed it
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hub or router? kuplo Linux - Wireless Networking 1 11-26-2005 03:39 PM
networking with router+hub mithereal Linux - Networking 3 10-30-2005 05:22 PM
hub vs. router mikeshn Linux - Networking 16 11-08-2004 10:33 AM
Using PC as an Ethernet hub (and router) damon12campagna Linux - Networking 1 02-23-2004 12:14 AM
router or hub loganwva Linux - Networking 9 04-11-2002 06:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration