Personal computing discussed

Moderators: renee, Steel, notfred

 
dolemitecomputers
Minister of Gerbil Affairs
Topic Author
Posts: 2600
Joined: Wed Dec 26, 2001 7:00 pm
Location: Utah

Help with subnetworking

Wed Jun 04, 2003 9:47 pm

I am studying subnetworking in my network essentials class and am a little stumped with it. I understand the basic concept of the different classes and how you match up the subnet mask with each one but I'm not sure how to create the different ip ranges. For an example I have the following. This would start with an network address of 192.168.1.0 and contain 3 networks with 5 hosts each. Does this look right?

network
192.168.1.0
IP range
192.168.1.1 - 192.168.1.5
broadcast IP
192.168.1.6

network
192.168.1.7
IP range
192.168.1.8 – 192.168.1.12
broadcast IP
192.168.1.13

network
192.168.1.14
IP range
192.168.1.15 – 192.168.1.20
broadcast IP
192.168.1.21
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Wed Jun 04, 2003 11:33 pm

It helps to think in binary. :)

Your subnet mask is always be a string of "1" bits, followed by a string of "0" bits. The first address in the subnet (all masked bits set to "0") is the network address, which is not usable as a host IP address; the last address in the subnet (all masked bits set to "1") is the broadcast address for the subnet. Because of this, the size of a subnet (including the network and broadcast addresses) must always be a power of 2.

So you would need to create 8-address subnets, each of which will contain 6 usuable host IP addresses. In the following examples, the numbers in parantheses are binary equivalents of the decimal numbers:

network: 192.168.1.0 (11000000.10101000.00000001.00000000)
netmask: 255.255.255.248 (11111111.11111111.11111111.11111000)
IP range: 192.168.1.1 - 192.168.1.6 (11000000.10101000.00000001.00000001 - 11000000.10101000.00000001 00000110)
broadcast: 192.168.1.7 (11000000.10101000.00000001.00000111)

network: 192.168.1.8 (11000000.10101000.00000001.00001000)
netmask: 255.255.255.248 (11111111.11111111.11111111.11111000)
IP range: 192.168.1.9 - 192.168.1.14 (11000000.10101000.00000001.00001001 - 11000000.10101000.00000001.00001110)
broadcast: 192.168.1.15 (11000000.10101000.00000001.00001111)

network: 192.168.1.16 (11000000.10101000.00000001.00010000)
netmask: 255.255.255.248 (11111111.11111111.11111111.11111000)
IP range: 192.168.1.17 - 192.168.1.22 (11000000.10101000.00000001.00010001 - 11000000.10101000.00000001.00010110)
broadcast: 192.168.1.23 (11000000.10101000.00000001.00010111)

(If you only need 5 usable IP addresses per subnet, one IP address per subnet will be wasted.)
 
dolemitecomputers
Minister of Gerbil Affairs
Topic Author
Posts: 2600
Joined: Wed Dec 26, 2001 7:00 pm
Location: Utah

Wed Jun 04, 2003 11:40 pm

Looks like that is right. My teacher said that usually the network ip will end in a even number and the broadcast ip will be odd.
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Wed Jun 04, 2003 11:47 pm

Yes, but the even/odd rule is not sufficient to guarantee that the subnets are valid. In addition, the sizes of the subnets must be powers of 2; the network address must have all 0s in the bit positions where the subnet mask has 0s; and the broadcast address must have all 1s in the bit positions where the subnet mask has 0s.

Whoever decided that IP addresses should be written in dotted decimal notation should be shot. Hexadecimal would have been much clearer, since each digit corresponds to exactly 4 bits -- much easier to picture the bit patterns without having to use a calculator that supports binary conversion.
 
Aphasia
Grand Gerbil Poohbah
Posts: 3710
Joined: Tue Jan 01, 2002 7:00 pm
Location: Solna/Sweden
Contact:

Thu Jun 05, 2003 1:59 am

Easier to visualize maybe, but for me its way easier to remember the dotted decimal digit format. But i have a way with remembering numbers so maybe thats just me. But i agree its way easier to use hex when translating binary numbers. And people have a tendency to forget that the netmask really is a binary mask.
 
dolemitecomputers
Minister of Gerbil Affairs
Topic Author
Posts: 2600
Joined: Wed Dec 26, 2001 7:00 pm
Location: Utah

Thu Jun 05, 2003 7:12 am

How did you come up with the netmask of 255.255.255.248?
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Thu Jun 05, 2003 7:26 am

dolemitecomputers wrote:
How did you come up with the netmask of 255.255.255.248?

The netmask must have 0s in the bit positions that are used to select between different computers on the subnet, and 1s everywhere else. You need three bits to select between 8 possible addresses; so the last byte must be 11111000 (binary), which is 248 (decimal). The use of netmasks is also why the size of subnets must be a power of 2.
 
Despite
Gerbil XP
Posts: 496
Joined: Thu Dec 27, 2001 7:00 pm
Location: Oklahoma
Contact:

Thu Jun 05, 2003 7:40 am

good job, brewy. smartly done!
 
zgirl
Grand Gerbil Poohbah
Posts: 3998
Joined: Tue Jan 01, 2002 7:00 pm
Location: The dark side of the moon
Contact:

Thu Jun 05, 2003 8:05 am

It seems to me that your instructor is not doing a good job of explaining how a mask affects the range of numbers. Also how the bits work in a octet.

For Example

255.255.255.0

Between each period is called and octet, because eight bits are use to form it. Then you need to look at it like this

128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
1 1 1 1 1 1 1 1

If you added up the all positions with a 1 bit, guess what you get? That's right 255. See where these numers come from. The reason for this is that when your using two bits you only have 2 valid combination of those bit.
10
11

Since a value cannot begin with a '0'. Now IP addressing works from left to right. So if your subnet was 255.255.255.0 you get 254 usable addresses. '0' being the network ID and 255 the broadcast. The more you slide the subnet bits to the right. The more you divide up those 254 addresses into smaller ranges of subnets.

192.168.1.0 divided into 4 ranges will look like:


Network Hosts Broadcast Address
from to
192.168.1.0 192.168.1.1 192.168.1.62 192.168.1.63
192.168.1.64 192.168.1.65 192.168.1.126 192.168.1.127
192.168.1.128 192.168.1.129 192.168.1.190 192.168.1.191
192.168.1.192 192.168.1.193 192.168.1.254 192.168.1.255

The subnet is 255.255.255.192 because your using the first two bits from the last octet. From the chart above 128+64=192 <- that is where we get that number from.

Also remember you can only due things in a power of 2. So if you need 5 subnets your will have to create 8. But then you reduce the number of host that are avaible on each subnet. So you might have to use a larger class to achive this.

I recommend a good IP book. cause I know I've glossed over quite a bit but I could spend pages on this. Most of the CCNA study guides by Todd Lammle are really good at describing subnetting. Work out the problems in the subnet chapter to learn how the math and ideas work. Once you get the hang of it it is pretty easy.
"I used to think the brain was the most amazing organ in the entire body. Then I realized who was telling me this."
If ignorance were painful, half the posters here would be on morphine drips.

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On