There's a free subnet calculator available from Solarwinds which
should help with your understanding of it.
http://www.solarwinds.net/downloads/index.aspx
Jim.
This really eludes a lot of people at first. To understand it, you have
to break it down into binary. Once you do that, it's just counting bits.
Given your example subnet mask of 255.255.240.0, the bitwise
representation is:
11111111 11111111 11110000 00000000
255 255 240 0
Now just count each "1". There are 20 of them, so this is a /20 network.
I have found at least one "tutorial" site (and many references to the
same tutorial) where the author uses the / to denote how many bits
determine the SUBNET, based on the CLASSFUL definition of the IP
address, i.e. a "Class A"). Since a Class A has the first 8 bits set (1)
by default, that author refers to this subnet mask as a "/12" (the
original /8 plus the /12 = the full /20). This is very confusing, and in
my view is just wrong, so if you find those references, just ignore
them. The definition of a CIDR notated mask includes ALL the bits. Since
it's not practical to write out a subnet mask in binary each time you
need to convert, you should just memorize the sequence from left to right:
10000000, 11000000, 11100000, 11110000 etc.
128 192 224 240 (...248, 252, 254, 255)
...kurt
You asked how to find out the CIDR address when the subnet mask and an IP
address is provided.
In addition to the other responses you have received, I would like to
mention RFC 1878, "Variable Length Subnet Table For IPv4", available at
e.g. ftp://ftp.isi.edu/in-notes/rfc1878.txt .
Wishing you the best of luck with your studies,
--
Thor Kottelin
CISM, CISSP
telefax +358 102 961 064
th...@anta.net, PGP 0x327B7345
http://www.anta.net/