Having been recently Inspired by a post I read here at AntiOnline, I decided to put this information together about how to map out the possible hosts on an host IP network when you know at least one IP address of the host network and the subnet mask using the anding method. What this tutorial is not, is a introduction to subnetting. I could go into that as well, but there is plenty of readily avialable info about that topic already on the web that can exlain it better than I could. I highly recomend http://www.learntosubnet.com/ if you want fully want to learn the in's & out's of subnetting.


Ok, like I stated before, we need a IP address from a host network, in this case we will use 63.146.109.212 (whoa, that ip looks awfully familiar!) and the subnet mask, and since this is a semi-fictional network I will make one up: 255.255.255.128.

Note: you can determine the subnet mask of remote network for the same purposes, but thats another discussion for a later date.

Alright, now we need to do a little binary conversion. Both the IP address and the subnet mask need to converted to 1's and 0's so we can get down to brass tacks!

63.146.109.212 = 00111111.10010010.01101101.11010100
255.255.255.128 = 11111111.11111111.11111111.10000000

Note: it's always good to know how to convert decimal to binary in your head in case of dire emgencies (even though I can't think of one) but for the lazy, here is a handy-dandy decimal to binary (& hex) and back again calculator:
http://www.physics.udel.edu/wwwusers...ry-to-hex.html

It's important here to note the class and default submask at this point, so that we may determine how many bits were borrowed from the host portion of the address for the network portion of the address:

Class A: 1-127 default mask: 255.0.0.0
Class B: 128-191 default mask: 255.255.0.0
Class C: 192-223 default mask: 255.255.255.0

So, we see we are dealing with a class A network, which means the first octet is the assigned network portion or 63.0.0.0, leaving room for 16777214 hosts. Whoa, thats quite a lot, good thing they subnetted this thing down!

63.146.109.212 = 00111111.10010010.01101101.11010100
255.255.255.128 = 11111111.11111111.11111111.10000000

As we see here, all the bits in the second & third octets, and one from the fourth, were borrowed for the purpose of subnetting. Anding uses a very complex mathmatical operation known as "multipulcation" (little joke, ha!) to extract the network address from the know host IP address. From this point we just multiply the 1's and 0's :

63.146.109.212 = 00111111.10010010.01101101.11010100
255.255.255.128 = x11111111.11111111.11111111.10000000
___________________________________
00111111.10010010.01101101.10000000

Now, convert this binary address back to decimal:

00111111.10010010.01101101.10000000 = 63.146.109.128

What we have here is the address of the network, 63.146.109.128, which the host with the IP of 63.146.109.212 belongs to. We can now determine the range of host IP address which exsist on this network:

All the 1's in the subnet mask, except the 1's in first octet because this is a class A network, represent the possible number of networks which can be created in this range = 2 to the 17th power - 2 = 131072 possible networks
All the 0's in the subnet mask represent the possible number of host addresses that can be assigned in this range = 2 to the 7th power - 2 = 126 host IP's per network.

Note: if you are wondering about the - 2 in the equation, it is removing the first address in the range, which cannot be assigned because it is the network address, and the last address in the range, which is the broadcast address.

Now we see that the range of possible IP addresses in the network 63.146.109.128 is:

63.146.109.129 through 63.146.109.254

Congratulations, you now know how to IPmap a network using the ANDing method!

This concludes this little session on IP mapping. Hopefully, someone, somewhere will learn something from this lesson.

Please submit all complaints, flames and criticism to my boss at president@whitehouse.gov

(ok, that was a parting joke , please don't email the president unless you something REAL to tell him )