- Linux networking Q
- Posted by Ohmster on October 12th, 2003
Dances With Crows <danSPANceswitTRAPhcrows@usa.net> wrote in
news:slrnbognln.pb4.danSPANceswitTRAPhcrows@samant ha.crow202.dyndns.org:
I have a setup like this with a rh9 box for server/gateway on a nic to an
adsl modem and a second nic to a hub for two xp machines. All of this stuff
works really well. I made sure I bought a hub for my setup. Question: what is
the difference between a hub and a switch?
Thanks.
--
~Ohmster
- Posted by Dances With Crows on October 12th, 2003
On Sun, 12 Oct 2003 14:33:18 GMT, Ohmster staggered into the Black Sun
and said:
(This explanation is incomplete, and may contain errors. Corrections
welcome.)
A hub acts as a dumb repeater device. It receives data from one
interface and broadcasts that data to every interface on the hub. This
works well when you don't have many machines connected, but the number
of collisions increases very quickly when you add more machines. A
16-port hub with all ports filled, and every machine trying to
send/receive a lot of data would be wretchedly slow.
A switch has a little more intelligence. It can determine that the
device plugged into port 1 has MAC address 01:02:03:04:05:06 , and
transmit packets to port 1 only if the packets' destination MAC matches,
or if the device on port 1 is in promiscuous mode. This means no
collisions, which means your Ethernet is faster.
I bought a little 5-port switch for $40 1.5 years ago, so I figured
wired hubs had been driven to extinction by now. ICBW. Wireless is a
totally different story.
--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / "He is a rhythmic movement of the
-----------------------------/ penguins, is Tux." --MegaHAL
- Posted by Robert E A Harvey on October 12th, 2003
Ohmster <ohmster@newsguy.com> wrote in message news:<Xns94126BCE04304ohmsternewsguycom@216.77.188 .3>...
A hub is the cat-5 equivalent of a length of co-ax cable. Traffic
from any one device is echoed to all the others.
A switch is cleverer - it works out who is connected where (at the
physical address level) and routes the traffic only to the required
listener.
The advantage on a small network is negligable - on a larger one pairs
of devices get full bandwidth regardless of what elese is going on.
- Posted by Ian Northeast on October 12th, 2003
Dances With Crows wrote:
Pretty much correct, but it is possible to have more than one MAC
address on a single port, for instance if it is connected to a bridge or
another switch. Switches recognise this possibility and allow for it.
This isn't true. The switch has no way of knowing a device is in
promiscuous mode and will not replicate all traffic to such interfaces.
This does cause problems with network probes, which would see all the
traffic on hubs and don't on switches. Some expensive managed switches
offer facilities to replicate traffic onto specific ports for the
benefit of probes but the basic "plug and go" cheap ones don't.
Collisions are extremely rare but they are possible - broadcasts can
collide. My router has transferred about 62 million packets on its LAN
interface since it was last brought up about 2 months ago and has seen
one collision. So it is certainly true that collisions no longer matter.
Also switches are normally full duplex and hubs are normally half.
My 16 port job was 64UKP, about $100, last year.
Pretty much. You still see them being sold second hand very cheaply. I
havn't seen them being sold new recently. I keep one around in case I
need to use a network probe (and also as a backup should the switch
fail).
Regards, Ian