what is the difference beteen..

tsoek

Distinguished
Aug 2, 2001
15
0
18,510
Sorry, but I've become quite confused on this one thing and I am askin to know just exactly what is the difference between a hub, and switch, and a router? Can you share ip's with a hub or just a router? Can someone please clear this up for me? I just want to know the basics about each. Thanks!
 
A hub is a multi-port repeater. It will send a signal out all it's ports if it can. It doesn't work by IP addresses.

A switch is effectively a hub with the capability of deciding the best route for the data, based on the MAC address (unique NIC number) on the NIC. It will prevent the signals being sent out it's other ports, and prevent unnecessary traffic.

The router is the most effective device of the three. It directs network traffic according to IP address. Some routers have the ability to store in memory a routing table the IP addresses of connected devices and their connected devices and so on. Some also have built in firewalls.

As for sharing.....

If you have a static IP address (a permanent one assigned to you), you can subnet it. If it's dynamic (randomly assigned for every connection) you need to assign a default IP which I hope someone with more knowledge can help you with. Subnetting is a fairly heavy subject, but to try to put it simply, you apply a subnet mask to your IP number to split it, so you can split your IP number up into several networks and assign several IPs to multiple nodes.
---------------------------------------------------
Quick refresher on binary here:

11111111 = 255 (128 + 64 + 32 + 16 + 8 + 4 + 2 + 1)
10101010 = 170 (128 + 32 + 8 + 2)
1101000.01111000.01010101.00111001 = 208.220.85.57
---------------------------------------------------
Right here's an example. You are assigned the IP number 192.55.100.10 and you want to split it over three machines. For a start it's a class 'C' IP number due to the first nyumber being 192.

This means the default subnet mask is 255.255.255.0
The first 3 numbers are classed as network numbers and the last one is the node number. Now you have to convert the numbers to binary.

11111111.11111111.11111111.0000000 = 255.255.255.0
11000000.00110111.01100100.0001010 = 192.55.100.10

You 'and' the IP number and the subnet mask to get the network number.

11000000.00110111.01100100.0000000 = 192.55.100.0

To subnet you 'steal' bits from the node number. You can steal a minimum of 2 and maximum of 6. You have three machines so you need 3 IP addresses + your network address and the broadcast address = 5 numbers. To get five you need to steal the first 3 bits (2 x 2 x 2 = 8 which allows for the 5 you need) of the node number. Therefore your Subnet Mask becomes 255.255.255.224 (11111111.11111111.11111111.<b><font color=red>111</b></font color=red>00000). The new subnet mask will let the router know you have divided the network up.

Now for the tricky part...heh!

You have the 5 remaing bits on the node number. This allows for 30 IP address per subnet + network number + broadcast number = 32 (2 x 2 x 2 x 2 x 2).

Now you calculate your IP address ranges in your subnets. They will be in increments of the lowest stolen bit, in this case the '32' bit (11<b><font color=red>1</b></font color=red>00000). Notice the increment matches the 32 IPs in the paragraph above. So the first subnet is the 0-31 and is called subnet 0. You can't use this without clever router configuration, so forget it. <b>Your</b> first range is 32-63, the second is 64-95 and the third is 96-127.....

Range 1 : 192.55.100.32 - 192.55.100.63 (32 & 63 are the network & broadcast addresses, so the IPs are 33-62)

Range 2 : 192.55.100.64 - 192.55.100.95 (IPs are 65-94)
Range 3 : 192.55.100.96 - 192.55.100.127 (IPs are 97-126)

So thats it. You could assign a subnet mask to make each machine have it's own subnet, or you could assign them all to one subnet.

I do apologise for the in depth answer. I started typing and found myself going in too far. If nothing else, someone may read this and get a better idea of the way things happen, or maybe someone with better knowledge or experience will have a better way of explaining it.

<b><font color=blue>~ What do you mean "It isn't working!"...Now where's my sonic screwdriver? ~ </font color=blue></b>
 

btvillarin

Distinguished
Apr 10, 2001
2,370
0
19,780
<A HREF="http://compnetworking.about.com/library/tips/blfaq011.htm" target="_new">What's the difference between a hub and switch?</A>

<font color=red><A HREF="http://www.btvillarin.com" target="_new">btvillarin.com</A> - My Windows XP-based Website</font color=red>
 

CALV

Distinguished
May 17, 2001
1,731
0
19,780
some very good info on subnetting at <A HREF="http://www.howtosubnet.com" target="_new">howtosubnet.com</A>
However, you didnt say in the initial post what it is you want to do!, it may be a lot easier to route your external ip to you lan, saves the headache of subnetting, especially if you dont understand it. That way you still have the one external ip, which is routed (via a hardware router or a pc with 2 lan cards) to your lan.


If they squeeze olives to get olive oil, how do they get baby oil?