Router and Hub connection

DeadSeaSquirrels

Senior member
Jul 30, 2001
515
0
0
I understand if you only have 1 IP address then you need a router to basically create up to 254 other IP address for as many computers as you have. But if you put the hub on one of the router's ports what happens?

Does the hub then give an IP address to every computer that is on the hub? How does it work basically? I would like to understand the inner workings between a hub and a router. I ask because I am thinking about saving some money and just buying a hub to expand my network router from 4 and adding an additional 8 (really 7 since I lose one on the uplink).
 

gunrunnerjohn

Golden Member
Nov 2, 2002
1,360
0
0
A hub is a dumb component, it just broadcasts everything received on any port to all the other ports. A switch is a bit smarter, once it "learns" where a MAC address is, it'll only forward IP specific traffic to that port, broadcasts still go to all ports.

It doesn't change how the router assigns addresses at all, and if you exceed the port capacity of your router, a switch or hub is the way to expand it.
 

foshizzle

Member
Aug 16, 2003
95
0
0
basically a hub or switch are essentially just ethernet port splitter(kinda like a phone splitter, just a little bit smarter). So yeah, just buy a hub or switch, and you're set. And technically, you don't buy a router with 4 ports, you buy a router that has a built in switch with 4 ports, if that helps clear up some confusion.

So, a router can split one IP into many, and a switch splits one port into many.
 

DeadSeaSquirrels

Senior member
Jul 30, 2001
515
0
0
If you had only 1 IP would a switch suffice in giving service internet service to all computers?

If all a switch does is split the port into multiple ports, how does the computer know information is for itself and which is for the other computer. My understanding is that the switch is the thing that is smart, and a router's capabilities are usually mistaken for the switch.

The switch, as I understand it, knows who is requesting what information and it will send it to the appropriate computer. A router can do the same, because a router is usually a switch too. But what the router also does is give you those fancy options of blocking things, of routing a specific path to a computer.

Basically can a switch split an internet connection amongst different computers, so that the WAN thinks there is only one computer, and the LAN sees multiple computers, all with 192.168.1.xxx as it's IP (that is if the switch has DHCP).
 

MysticLlama

Golden Member
Sep 19, 2000
1,003
0
0
A switch will *sometimes* allow more machines on the net, but it's more to do with how your provider is set up then the actual mechanics of doing things.

Around here, if you have Verizon DSL, they just give you a bridge that connects your network to theirs via DSL. Since you're on their network, you can just hook up a switch and they will hand IPs to each computer.

Most providers aren't like that though, they will only hand out one IP address per line connected, so if you hooked up two machines, the second on just wouldn't get an IP.

The router is actually the unit that takes requests from all the computers, sends them out, and gives the requests back to the correct machines, a switch isn't capable of doing that. (well, unless you get really fancy, but we won't go there for a home situation)

Basically if you want multiple computers on one public IP you need a router, and if you want to go with more than four computers, you need a switch (or a hub) to give yourself more ports. A switch is considered "smart" because it gives dedicated bandwidth to all the ports by sending the traffic only where it is supposed to go (unlike a hub, which broadcasts to all).

In your situation, the switch would be the "dumb" component in the network, since it doesn't make any decisions on how to connect the computers to the Internet, it simply adds more ports.

In your last post, you have the switch and router exactly backwards.

Does that clear it up a bit?
 

gunrunnerjohn

Golden Member
Nov 2, 2002
1,360
0
0
Originally posted by: DeadSeaSquirrels
If you had only 1 IP would a switch suffice in giving service internet service to all computers?
No, the whole function of the router is to do the NAT (Network Address Translation) to allow your to have a private network on one side, and the WAN (Wide Area Network) with a single IP on the other side. If your ISP only allows one IP address, you can only connect one machine without some sort of NAT taking place.


 

DeadSeaSquirrels

Senior member
Jul 30, 2001
515
0
0
So this may sound redundant (and I've read those AT FAQs a lot, but still have some confusion), but if I had a hub, and only one WAN IP, then there is no way I can have more computers on the network (WAN network) correct?

I mean that is how I understand it, and also I think that is correct. But every once in a while somebody will say something and throw off my understand.

I remember somebody saying that a switch, or the switch aspect of a router is really the most important thing, the thing that allows you to have multiple computers on your side of the network (as opposed to the WAN side). But from what I can tell the switch is a really small part of the router, a switch is just the aspect of the router that allows the machine to send only the necessary packets to any specific port. The NAT and the DHCP service (which is weird to separate since what it would it mean to not have one or the other?) is the thing that keeps a track of the LAN side IPs (192.168.1.xxx) and which computers should be getting what. The NAT does the maping and the DHCP does the doling out of IPs.

Ok now as for hubs...what the hell is a hub good for. If it just broadcast signals to every port on the hub, what good is that. If you only had one IP address, then a hub wouldn't do jack for you if you had multiple computers. Is that right? I mean if it is just broadcasts everywhere, then it seems all the computers hooked up to the hub would just be getting errant signals....only good is for packet sniffers.

What's really confusing me is the switch, and maybe because I always had it backwards. But I always thought of as an old school telephone operator who knows who goes where, and also because allows two comptuers to connect to the internet. So the two computers each tell the switch what it wants and the switch asks for everything on the WAN side and when it gets it is sorts it out for the LAN. But from what everybody is telling me now is that the switch is smart, but it still needs to have separate IPs provider for by the ISP for it two work for multiple computers. Is that right?
 

gunrunnerjohn

Golden Member
Nov 2, 2002
1,360
0
0
Hubs and simple switches are very similar in concept. The significant difference is a switch "learns" where a specific MAC address is connected, and when a addressed packet comes along for that MAC address, it's sent only to the port where it's connected. A hub would send the same packet to all ports. Broadcasts go to all ports on either a switch or a hub, since there's no way to know who might want to see it.

The benefit to a switch is that multiple full bandwidth conversations can potentially take place on the LAN, where a hub limits total network bandwitch to the bandwidth of a single connection.