[vox-tech] netmask question

Jeff Newmiller vox-tech@lists.lugod.org
Sun, 10 Mar 2002 09:06:27 -0800 (PST)


On Sun, 10 Mar 2002, Peter Jay Salzman wrote:

> how would someone write a range of IP addresses
> 
> 61.220.0.0 - 61.227.255.255

00111101.11011100.00000000.00000000
00111101.11100011.11111111.11111111

If you want to write it in netmask form, you have to be able to divide it
into two parts cleanly... the first part has to have identical bits, and
the second part has to be all zeroes in the lower address and all ones in
the higher end of the address range.

Hmm... adding a dividing point at a power of two rollover (the first bit
that is different)...

00111101.11011100.00000000.00000000
00111101.11011111.11111111.11111111

00111101.11100000.00000000.00000000
00111101.11100011.11111111.11111111

it fits into two ranges, characterized by the first 13 bits, or

61.220.0.0/255.252.0.0
61.224.0.0/255.252.0.0

Other arbitrary starting and ending points might not work out as two
ranges... might have to split at more than one power of two to get the
"same network bits, host bits roll from all zeroes to all ones" pattern.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k
---------------------------------------------------------------------------