Do I need a hub or a switch?
Short answer: Switch
In general, if you are looking for one such device for home (especially if it is the
first such device), you want a switch. Otherwise, it probably doesn't really matter
much. Primarily, you want a device with enough bandwidth to accommodate both your
slowest network adapter and your fastest network adapter if possible. These days,
most home networks are introduced to a switch first because it is incorporated in another
network device needed for communicating with another network (the Internet), a router.
This question has a much more wordy answer, published in the CompuClues forums in March
of 2001.
...to purchase a hub with more ports (than
you currently need) makes sense because most people that start adding hub ports
eventually use more than they need now. A string of 5 port hubs is not only a mess and
more expensive in the long run, but after 3rd level, could present problems. 'twere me,
ah'd spend the bux$ (not much difference) on an 8 port. ...Unless you are particularly
conservative and know you'll never need more.
A switch is not necessary (and adds money), particularly if there is a switch
incorporated in the router. A 10/100 auto-negotiating switch covers the dominant and
legacy NICs in the world (100BaseT, 10BaseT). 10 is
probably enough, but if you do a LOT of file transfers among your LAN nodes, you'll
appreciate 100. The reason to select a switch could be for 100 Mbps-full duplex support.
With a reserved IP subnet address (non-public such as 192.168.128.x),
the router won't pass the local traffic and the router should also be blocking other
possible protocols (because most have incorporated port filters).
...Between switches and routers, speed is not the issue.
The basic idea is:
For Ethernet, when a computer transmits data on a network segment, where the network
segment incorporates a hub, the computer transmits to all computers on the segment that
are attached to the hub (or to some number of levels of hubs.) If there is signal placed
on the wire by one computer then, by the rules, the other computers must listen. If the
wire is quiet, any of the computers on the segment can elect to transmit. On occasion, two
computers will elect to transmit at exactly the same time (creating a transmission
collision) and garbage results. On discovery of garbage, the two computers stop
transmitting, reset and wait for a random amount of time before they can re-transmit.
Random means that the next time they won't transmit at the same exact time. This is, very
roughly speaking, called CSMA-CD -- Carrier Sense Multiple Access Collision Detection
(IEEE 802.3)
There are various forms of physical media that will permit this. All forms are (logically) a bus topology variation on an RG-8 co-axial backbone
terminated with 50 Ohm resisters, sheath grounded at one end, with transceivers on the
coax connecting via AUI to a NIC. Except for transceiver latency, attenuation, and bogus
anomalies, signal speed on this network is what it is (10 Mbps -- or
at least roughly 40 percent of that depending on implementation.)
"Variations" means that both from a physical design standpoint and an electrical
design standpoint, the devices may look nothing like this just-described prototypical
network. The "transceiver" part, for instance, is usually on the NIC these days.
Nevertheless, the basic concepts are the same.
In it's most simple form, a backbone is a single physical segment that supports a single
logical segment. As long as traffic on the segment remains at a certain level somewhat
below the stated maximum transmission speed, everything communicates with a minimum of
collisions, and therefore with minimum communications lag. As traffic rises and as the
number of stations on a segment rise, collisions rise. With enough collisions, traffic on
the wire can come to a screeching halt.
To limit the number of collisions either take stations off the wire or segment the wire
into two segments, thereby reducing the number of stations on a segment. This brings up
the question on how to let computers on separated segments talk.
Sometimes a single physical segment is broken into two physical segments because of
attenuation of the signal. In this case the two physical segments are connected with a
repeater to maintain the single logical segment. A repeater simply receives a signal,
amplifies it, and rebroadcasts the signal on the next segment. It cares nothing about
addresses and indiscriminately passes all traffic from one segment to the other, back and
forth. Modern circuitry reduces the signal latency that might be inherent to such a device
so that retransmission can be almost at wire speed. A repeater extends the backbone.
A hub extends the backbone. If it is a simple connection, it is a passive hub. If it
incorporates a repeater, it is an active hub or multi-port repeater. The term active hub
is usually used for twisted pair devices while the term, multi-port repeater is usually
used for 10-base2 RG-58 coax devices.
A (basic) bridge has two ports. A single logical network segment is divided by a
bridge into two physical segments. You could say that the bridge connects the two
segments. The purpose of the bridge is to reduce traffic on each of the two segments
(collision domains) and still allow computers on one segment to talk to computers on the
other segment. It does this by being programmed (or by "learning") with the
addresses of the computers that are on one segment attached to one of the bridge ports.
The port for that segment has an address table and the table is populated with the
addresses of the computers with access to that port via the attached segment. This same
bridge also "learns" the addresses of the computers that are on the other port
and places them in a table for that port. By design, computers that talk among themselves
frequently would be placed on one segment while computers, that the first group seldom
talks with, would be put on the second segment. The same situation should be more or less
true for the other segment. The bridge examines the header of the packet transmitted and
if the address is for a computer on the "OTHER" segment then the bridge allows
the traffic to pass to the other segment, and otherwise, the bridge does not allow the
traffic to pass. This reduces the traffic on the remote segment. Modern circuitry can do
this with a minimum of filtering so that the filtered traffic is still very very close to
wire speed. A bridge confines network traffic to a segment until communication between
segments must occur. For tolerating a minimum of latency, the resulting traffic reduction
can cut way down on collisions.
A switch, in common parlance, is a multi-port bridge.
That said, an overloaded switch can stop traffic just like having no switch. Not that the
typical home network would overwhelm a switch. Barring very large file transfers, where
the wire is flooded with SMB traffic, it would be an exceptional home network that would
overwhelm even a 10 Mbps backbone with half-duplex connections. But a switch not only puts
traffic where it should be, it also does not put traffic where it should not be. So
another use for a switch is to keep local traffic, regardless of volume, off remote
segments/ports. Bridges and switches pass all broadcast traffic to all segments, so while
local traffic on remote segments is reduced, it is not completely eliminated.
Different switches have different design elements. These different design elements
typically have different prices.
Hubs have no knowledge of addresses. These are physical layer devices (layer 1). Physical
addresses (aka hardware or MAC addresses) are used at data-link layer (layer 2).
Bridges and Switches employ MAC addresses [6 octets of address (usually) burned into your
NIC or other addressable hardware device] for discrimination. They operate at data-link
layer. Data-link layer is the 2nd layer in the OSI model (a protocol stack model). Some
people call a bridge by the name, layer 2 switch.
A (basic) router has two ports. It connects two physical segments where each of the two
segments supports a different logical network segment. They too allow computers on one
segment to talk to computers on the foreign segment. Routers use higher level
addresses--IP addresses (4 octets configured in software) in the case of TCP/IP protocol.
Routers operate at network layer. Routers don't pass broadcast messages. Routers are
sometimes called layer 3 switches. Because they must filter yet another layer of data,
there is a built in design limitation that means, all things being equal, routers may be
slower than bridges or switches. Fairly often all things are not equal. A properly matched
router can be pretty quick about moving data along. Lately, routers are called upon to
also do other chores such as NAT and firewall implementation which are both above and
beyond the chores of routing.
A gateway is used to communicate between different network protocols. It is a translator.
A gateway would work between a network using TCP/IP protocol and one using IPX-SPX
protocol. Or between TCP/IP and SNA. A gateway might be implemented on a router, but
fairly often this is not a necessary component. Microsoft's use of the term, default
"gateway", is a little *****-eyed (though standard in the
industry), ...
Home networks typically do not employ dedicated repeaters, bridges or gateways. The specs
for the network do not usually require it. Some fair number of the SOHO hubs on the market
are passive and distances for home networks usually don't require anything more. For home
networks, is the router fast enough?--unless you have a very big pipe on the WAN side, it
probably is, by a lot. If you have need for a router between two segments on your Home
LAN, you probably know why. Hub or switch is usually a choice that is made without regard
to necessity, but the market lately is paying more attention to switch technology usually
because they implement 100 Mbps full-duplex capability where the typical inexpensive hub
does not. I have both 10 Mbps half-duplex circuits and 100 Mbps full duplex circuits and
can rarely tell the difference on the home network including for traffic confined to the
latter.
For Microsoft LAN networks, in a peer-to-peer environment (which is typical of home
networks), by far the biggest performance whacker is to designate some unreasonable number
of shares on every node on the wire. This boosts the broadcast traffic immeasurably. Even
on a home network, you should consider implementing file and print sharing conservatively,
perhaps designating one of the peers as a "server." For most home networks
consisting of 2 to 5 computers, even this isn't much consideration for performance.
To network without just blindly plugging in cables to ports and hoping everything works,
this is a start. On the other side of the coin, people blindly plug in cables everyday,
and succeed. |