I always ask google for a subnet calculator at this stage.
Ah, yes, the answer is important; I have that, in fact. It's the process that I don't have quite right...
If you just want the maximum number of subnets then the smallest (useful) subnet you can have is /30 which gives you two hosts (subnet address, host1, host2, and broadcast address). You can go further by having only host routes (/32), but that would be something of a degenerate case.
Largest subnet you can have (given what you have provided) is a /25 with 126 usable hosts.
Here is how it is done, more or less:
address: 133.44.0.0: 10000101.00101100.00000000.00000000 netmask: 255.255.255.128: 11111111.11111111.11111111.10000000
Bitwise AND address and netmask gives the subnet address (which in this case is what you have given):
10000101.00101100.00000000.00000000 AND 11111111.11111111.11111111.10000000 = 10000101.00101100.00000000.00000000 133.44.0.0
When you have an address assigned to a host, that exercise is slightly more interesting, say:
133.44.0.65 10000101.00101100.00000000.01000001 AND 11111111.11111111.11111111.10000000 = 10000101.00101100.00000000.00000000 133.44.0.0
To find the broadcast address, we take the subnet mask and do a bitwise NOT. Then we OR it with the subnet address:
10000101.00101100.00000000.00000000 OR 00000000.00000000.00000000.01111111 = 10000101.00101100.00000000.01111111 133.44.0.127
To find the total possible number of hosts, just invert the subnet mask and add one.
00000000.00000000.00000000.01111111 + 00000000.00000000.00000000.00000001 = 00000000.00000000.00000000.11111111 0.0.0.128
Total possible addresses is 128. We then subtract 1 for the subnet address (133.44.0.0) and one for the broadcast address (133.44.0.127) and we have 126 possible addresses remaining.
If we want n sized subnets, then we divide our total number of addresses (128) by n (n must include broadcast and subnet addresses). So lets say we wanted the maximum number of subnets, /30 which is 4 addresses:
128/4=32
So we can have a maximum of 32 subnets of 4 addresses each when given a subnet with /25. Or if we want x subnets and want to know the size (where m1 = inverted mask + 1):
m1/n=x or m1/x=n
Remember everything has to be powers of two. You have to split subnets on the 2^2 bounderies, if that makes sense. Here is an illustration that might make more sense. If we are given a /25 = 255.255.255.128 then we can further subdivide (subnet) that network like:
2 subnets at /26 = 255.255.255.192 4 subnets at /27 = 255.255.255.224 8 subnets at /28 = 255.255.255.240 16 subnets at /29 = 255.255.255.248 32 subnets at /30 = 255.255.255.252
Supernetting works the same way, but in the opposite direction. Supernetting is really a misnomer anyway, you are just subnetting a larger starting address space to begin with. Anyway, for a /25 subnet broken down we get:
subnet broadcast 133.44.0.0/25 133.44.0.127/25
133.44.0.0/26 133.44.0.63/26 133.44.0.64/26 133.44.0.127/26
133.44.0.0/27 133.44.0.31/26 133.44.0.32/27 133.44.0.63/26 133.44.0.64/27 133.44.0.95/26 133.44.0.96/27 133.44.0.127/26
See how the boundries form? Always at a power of 2 down to 2^2.
The dotted decimal notation is really just for human convenience. IP addresses are actually just plain old 32 bit numbers.
This was just written off the cuff. I used to have a whole lesson plan I used to teach from, but I haven't used it in a while. If you want more detail on the process, I would be happy to provide it.
Adam Augustine
____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
