The principle behind
bitmasks and netmasks is simple, but often confusing to new users
as it requires knowledge of binary numbers. For a quick reference,
the following table illustrates what network ranges are indicated
by the corresponding bitmasks/netmasks up to a default class C
netmask.
Bitmask |
Netmask |
Total IP's |
Usable IP's |
32 |
255.255.255.255 |
1 |
1 |
31 |
255.255.255.254 |
2 |
1 |
30 |
255.255.255.252 |
4 |
2 |
29 |
255.255.255.248 |
8 |
6 |
28 |
255.255.255.240 |
16 |
14 |
27 |
255.255.255.224 |
32 |
30 |
26 |
255.255.255.192 |
64 |
62 |
25 |
255.255.255.128 |
128 |
126 |
24 |
255.255.255.0 |
256 |
254 |
22 |
255.255.192.0 |
16320 |
16318 |
20 |
255.255.128.0 |
32768 |
32766 |
16 |
255.255.0.0 |
65536 |
65534 |
12 |
255.128.0.0 |
8.388608+e6 |
8.388606+e6 |
8 |
255.0.0.0 |
256^3 |
(256^3)-2 |
0 |
0 0.0.0.0 (all IP's) |
256^4 |
(256^4)-2 |
As you can see, there is a definite pattern. The number of total
IP's always doubles, and the number of usable IP's is always
total - 2. This is because for every IP network/subnet there
are two IP's reserved for the network and broadcast addresses.
The netmask's last octet starts at 255 and constantly decreases
by multiples of 2, while the bitmask decreases by multiples
of 1, because in binary, each shift over to the left halves
the number, not divides by ten like in the decimal number system.
This same pattern goes for all possible netmasks and bitmasks.
Go to http://jodies.de/ipcalc
to calculate the information about subnets. You can also download
the script that does the calculations.
|