What is the difference between a Router and a Hub? Ethernet specific

OP pretty much says it all. I’m running a hardwired network today for a pal.

I happen to have both hubs and routers in my home. What is the fundamental difference, and do I need one over the other?

The Router is at the DSL Modem in my home, and splits down the signal. The Hub is downstairs and makes one wire into two.


Basically a hub is a dumb repeater device that sends incoming signals out all ports indiscriminately.
A switch is a smart device that can decipher packet headers and will send data out to the destination port only. It has the added advantage that if a packet arrives on two ports at the same time, it can accept and re-transmit the data without collision, whereas using a hub would cause the packets to collide and require retransmitting.

Switches are cheap enough now that nobody should be buying (or really even making) hubs, but if you happen to have some lying around your typical home PC user isn’t going to notice the difference.

A hub or bridge operates at layer 2 of the OSI networking model. This means it routes based on the Ethernet header (assuming an all-Ethernet network). The main result of this is that when the bridge is connecting network A to network B, it will route all packets on network A to B and vice versa. Thus a message between two devices on the same network will produce redundant traffic on the unused network. Most store-bought “router” are actually bridges, and unless you are connecting two separately maintained networks (unlikely in a home application), a hub will do the job quite nicely.

A router operates at level 3, meaning it routes packets based on the destination IP address. This allows a router to move packets such that it can keep intra-network traffic on a single subnet, rather than spray it across all connected networks. It does this by maintaining a router table on the device; a special protocol (RAP) is used by the router to periodically poll the networks and determine who is where.

An old networking adage says “Bridge if you can, route if you must”. Decent advice, although with the cost/simplicity of router installation today, perhaps not as iron-clad as it once was.

If you are starting a network from scratch (as in, no existing network that you’re just expanding off of) then you’ll need a router to “create” the network. This is especially true if you are trying to network the computers to gether to share an internet conenction. You can’t go right from a DSL/cable modem and then into a hub and then expect the computers to network and have internet access. You need to go from the modem to a router. Maybe there are DSL/cable modems out there with built in router functionality, but none of the ones I’ve encoujtnered have had that.

I’ve also heard ways to set up a network using one computer (with internet access) that has two network cards. One in the incoming from modem, the other is outging to the network, and all the other computers use that one to get internet access. It acts as the router*. But, since you have a pre-made router handy, then by all means just use that.
(*in fact, in college, the house I lived in did things this way. We had Time Warner cable internet. It went from a modem, to an old 486 PC running a DOS router software thingy. From there, it went to a wireless access point, and from there, to a large switch, then off to all the rooms.)

Routers connect different networks.

Hubs and switches connect the machines within a network. Hubs are dumb, they simply send all traffic to every machine on the network, and let them decide for themselves whether the message was intended for them.

Switches know which machines are connected to each of their ports, and only send data to the machines it needs to get to.

Obviously, in large/high-traffic networks, switches are better. And they’re so cheap nowadays, there’s no reason to buy a hub.

There are a variety of technical reasons why you need a router to provide internet access to several computers from a single modem, as opposed to just hooking up a switch. A simplified explanation would be that

You might want to google for ‘DSL router’ or ‘cable router’ sometime. They are not exactly standard equipment from ISPs yet, but most offer them as an option and nearly every single network equipment vendor sells them. The home/SOHO versions usually consist of a single box with modem, router, hub(or switch), and sometimes firewall or Wifi AP.

By the sounds of it, the OP has something exactly like this to connect the house to the internet, and a bog-standard hub to save running two wires from it down to two machines downstairs. Pretty normal arrangement.

Do you mean you are building one for a friend and would like to know what you need, or you have one up and running in your house and would like to know what the various bits are doing? My reading comprehension ain’t what it was before the coffee machine broke.

I will just add that is extremely common to have a router with a built-in hub, switch, or wireless access point.

Routers usually work on level 4 as well. Most service providers only supply you with a single IP address which has to be shared among the network. Since it can’t tell by address, the router determines the destination for incoming packets by remembering which computer had already opened a TCP connection or sent out UDP/ICMP packets to that address and (except for ICMP) port.

Yes they are, at least with some ISP’s. My DSL provider sent me a Speedstream 4200 router without me requesting it or paying more for it. It’s somewhat of a cheap piece of crap, but it gets all the computers on the internet.

I meant to say, and am sorry I did not, that I am running Ethernet wire around my pal’s home. He bought two new machines. He has a sick machine that I personally believe needs a Win XP re-install like I need to drop 30 lbs quick and it’ll be fine, and his wife works on an anthracite coal-fired Win 98SE laptop.

I needed to split the cable modem’s highspeed signal out. To be very honest, though I’d love to learn to truly build a network, my goal was just to distribute highspeed internet throughout their home (which I can handle, wiring-wise ) and make sure each machine is able to access the Internet.

Making each machine access eachother is something I’ve never learned to do, and would love to learn to do, but not on my pal’s home systems. Not yet, anyway.

I bought a router, assuming it will split out the signal just fine AND allow me to network his machines after I learn how to do it on my machines here at home. I’m very grateful for all of the great answers here, thank you so much and keep em comin’- I’m officially hijacking slightly.

Having bought the router, how do I network? I have a nice Netgear router sitting in front of me now. I’ve 3 Dell’s and a Macintosh in the house with an added Mac laptop sometimes thrown in. I’ll learn on my home, then do it in his. Thoughts?

AS to your hijack question, routers are pretty easy to set up. In my case, I had to set the router up so that the cable modem and ISP would see it as my computer. Mostly this involved just setting the router with the same name given to me on the ISP’s network. I found this by typing ipconfig at a dos prompt. Once the cable modem recognizes the router, it’s just a matter of plugging in to it. The extremely basic instructions that came with my router explained this pretty completely.
Good luck.

Each type of ‘networking’ is going to require some specific knowledge. I can fileshare, use ssh, http and some other stuff on my network. Assuming you just want to share files using Windows shares, you need to

  1. Plug your cable modem/whatever in to the WAN side of your router. This gives your network internet access.
  2. Plug all PCs in to the LAN side of the router. This puts them on the network and will let them talk to each other.
  3. Turn filesharing on and any firewall filtering off for the PCs you’re going to share files with.

Problems are bound to happen, but covering all of them would mean I’d be typing for hours. Your router will come with basic instructions that are good to read. For anything else it’s better to ask individual questions if you have any.

Also, many DSL/cable routers only have one ethernet port. If this is the case with the one you bought, you will also need a hub/switch.

I believe Absolute is more correct later saying

“Switches know which machines are connected to each of their ports, and only send data to the machines it needs to get to.”

A learning bridge or switch shouldn’t forward all packets. (The following sounds backwards but works) It will forward from Network A to Network B only those packets that it knows are not destined only for Network A.

[ I’m talking about basic data flow and ignoring things like multicast, spanning tree effects, etc. etc but I bet the OP didn’t want to know about that anyhow ]

I am indeed reading all of this, and will try to suss it out on Monday when I finish the job at their home. :slight_smile:

( I did buy a Router with 4 outgoing Ethernet ports )

Don’t tell the hubmakers that. I need dumb hubs to do data capture at work, and some customer sites have network admins who are ( I SWEAR to Og! ) simply too stupid to enable hierarchical port spanning, or occasionally have switches that simply won’t let me span two destination ports together with a third destination port.