Hub, router or switch; which one to use?

Status
Not open for further replies.

jobeard

Posts: 13,830   +1,748
Getting one computer connected to the Internet is relatively simple:
Purchase an ISP agreement, install the modem and connect your system to
it. As long as your system has the Network Interface Card set to accept
DHCP for IP addresses and DNS services
, you're good to go.

[First Use the Network setup Wizard tutorial

Selecting DHCP:
open Network Connections, right-click on the LAN Connection->Properties
pull down to TCP/Ip and then click the Property button to the right
Click both "... address automatically" choices
and click OK]​
your network now looks like this: direct connection
Code:
isp .... modem ---- your first system
To verify the IP settings, get a command prompt and enter IPCONFIG /ALL

PLEASE ensure that you have a firewall running on your system -- even
the simplistic default Windows Firewall in Win/XP SP2 is better than nothing. If you're not on XP SP2, then google for a free software firewall.

Now you want all the equipment for the kids, wife, or or your laptop to have Internet
service too. How do you share one ISP connection with all this other stuff?

Step 1: The first thing you add to your network is a ROUTER
NOTICE! Not a hub and not a switch; at least not as the first device attached to the modem.
Planning ahead would be a good idea, as there are several decisions here that may impact or limit your choices later (more on this below).
You may find some routers with a USB and Ethernet port to the modem. You may use
ONE or the OTHER but not both at the same time. If you have the choice, by all means use the Ethernet connection;
it's simpler to install and you do not need the USB driver software that comes with the router (you may need the Wifi software, if any).

  1. do you 'need a wireless' connection?
  2. how far from the router will the wireless(WiFi) device(s) be located?
  3. what's the building construction and how many walls or floors must the signal traverse to reach the WiFi device?
  4. which IEEE standard should I choose? 11.a, 11.b, 11.g, or the newest (yet unadopted) 11.n?

(1) will avoid cables, but a cabled system can not be accessed by your neighbors or someone sitting in a nearby car.
WiFi networks take extra steps to ensure your privacy and keeping your identity information private!

(2,3) impact the signal strength needed. Increasing the signal may make the connection possible,
but then that also exposes the privacy issue from (1) to more visibility. If you need the extra signal,
then investigate (ie google) for Multiple In Multiple Out(MIMO) class WiFi devices.

(4) Everyone wants speed; but at what price? The IEEE 802.11n specification as of the time of this writing not yet been adopted! (April 2008)
If you read carefully the spec sheet on such devices in the market, you will see they are all PRE-802.11n.
The manufacturers are betting that the nominated specification will be finally adopted and/or they can upgrade the firmware (ie the
software within the device) later to make these devices compliant. If you are willing to bet with the manufacturers,
then go ahead and get one. By the way, you better get ALL your networking devices from the same manufacturer,
as there are frequently compatibility issues when you mix and match different vendors!

(I will ignore the WiFi setup here as that's another subject and is specific to the WiFi vendor you selected.
Also deferred is the How-To of Print/File Sharing as well as WiFi security issues.
This subject is concerned with Routers, Hubs and Switches :) )


STEP 2: the wiring layout (or topology)
The first thing to be understood is, every device on the network (specifically the Local Area Network or LAN) needs a unique IP address.
In the direct connection above, it's a non-issue as there is only one device. As soon as you and the second,
it is a big issue. Get it wrong (ie duplicate an ip address) and one system WILL get an error and
no networking and worse, there's a good chance that the whole LAN will shutdown.
So how do you ensure unique IP addresses?

The router (but not a switch nor hub) has a service internally which is known as DHCP. (this is also a reason to have a router first off the modem)
When a system is connected to a router, the first thing it does is contact the nearest DHCP server and import the proper IP
settings into the connection (wired or wireless).

So you add the Router into the layout like this:single system
Code:
isp ... modem---router---your first system
You can again verify the tcp/ip settings using IPCONFIG /ALL.
Notice that the Gateway Address will be something like 192.168.x.1.
This is the LAN side address of your router. Data arriving at the router moves to the WAN side of the device
(ie that which is connected to the modem) and then on to the ISP gateway to the Internet.
Your IP address will likely be like 192.168.x.2: Thank you DHCP.

Your first system has taken one slot on the router. As most simple routers are four port connections,
that leaves three for your other systems or devices. If you purchased a WiFi router, you can have
four wired connections and several additional WiFi connections -- usually a max of ten total.
So now your lan can connect four systems:A full house
Code:
modem ---router --- your first system
              +
              + -- system#2
              + -- system#3
              + -- system#4
Now all the ports on your router are taken and you want to attach a fifth device, say a Networking Printer.
The whole point of a networked printer is to avoid the necessity of having some other system running so you can use Print Sharing from some other system. But how to make the connection?

STEP 3: Using a Hub or Switch
Finally we get to the subject; which one to use and where to place it?
Going for the throat, buy a switch; it's a better device and improves network traffic to all devices attached to it.
A hub was the earliest version device to expand a network and networking has moved beyond 1980's.
So here's what your network looks like with a switch:switch expansion
Code:
modem ---router --- your first system
              +
              + -- system#2
              + -- system#3
              + --  [COLOR="Blue"]switch[/color]
                       + -- [b]system#4[/b]
                       + --- another three devices (eg [b]your printer[/b])
Notice the switch is connected to a LAN port on the router. It (and a hub) has no IP address and no configuration considerations.
Also, as as a switch improves network traffic to all devices attached to it,
I would rearrange the wiring like this:improved performance
Code:
modem ---router --- another two device ports (spares) 
             +
             +  -- [b]your printer[/b]
             +  -- [b]system#4[/b]
          [COLOR="Blue"]switch[/color]
             + -- system#2
             + -- system#3
             + -- your first system
             + -- one spare
As a switch has no configuration nor IP address assignment, it should be clear
that one switch can be daisy-chained to another.

STEP 4: Multiple Subnets
Your IP addresses were seen to be something like 192.168.x.*
For various reasons, you may like to arrange that some systems (say your trusted family users)
use one subnet like 192.168.1.* and your friends or guests when they connect to
your lan would be on another subnet, say 192.168.2.*
This segregation will allow your firewall to ensure that no one accesses your systems,
but may still have Internet access AND the use of your printer :)

Some routers will tolerate this setup and others make it difficult.
Personally, my Netgear router does this well -- allows another router (in my case, a Linksys) to be attached
at the SPARE location on the switch, eg:second router
Code:
modem ---router --- another two devices (spares)
             +  -- system#4
             +  -- your printer
          [COLOR="Blue"]switch[/color]
             + -- system#2
             + -- system#3
             + -- your first system
             + -- [b]Router#2
                      +
                    (new subnet devices)
                      + -- system#5[/b]
the other choice would be router 2 at top
Code:
modem ---router --- [b]Router#2 (new subnet devices) -- system#5[/b]
             +
             +  -- your printer
             +  -- system#4
          [COLOR="Blue"]switch[/color]
             + -- system#2
             + -- system#3
             + -- your first system
             + -- spare
 

NetCablesPlus

Posts: 207   +1
This is excellent. The only thing that I would add is that people should use straight-through Ethernet Patch cables (Cat 5e or Cat 6) for the connections.
 

jobeard

Posts: 13,830   +1,748
  • Thread Starter Thread Starter
  • #3
it's kind of the default and a cross-over is primarily used for direct system-system nic
connections, so I left it out :)
 

NetCablesPlus

Posts: 207   +1
Of course, I am in the cable business, so I do tend to hear about the craziest things people do with the wrong type of cable. Perhaps I am too sensitive to the issue, as a result. :)
 
Status
Not open for further replies.

Latest posts