[SpamCop-List]
Re: SBCGlobal) Software Factory solutionsSFSFL and PACBell and
Whoa007 @pacbell
Blammo
nttp.sc.s at bigsleep.org
Fri May 13 09:18:27 EDT 2005
On 11 May 2005 N. Miller entered spamcop and left
news:2a5l23mdxndq.dlg at news.spamcop.net:
> I like to use this for CIDR calculations:
>
I finally figured out how to do that with the scientific calculator,
here I use the carot ^ for the button [x^y].
e.g. /24
2 ^ (32 - 24) = 256 - 1 = 255
This gives you the number of addresses minus the one you already have.
Converting to dotted quad is a little clumsy, you need to divide by 256 for
any number greater than 255 to get each quad, (then subtract 1) adding the
result to the first address.
Converting back probably makes this more clear:
e.g. 69.67.64.0 - 69.67.79.255
each dotted quad = 256, and we have to add one to include the "0" address.
(79 - 64 + 1) * 256 = 4096
32 - (4096 log / 2 log) = 20
69.67.64.0 - 69.67.79.255 = 69.67.64.0/20
Another example: 69.67.0.0 - 69.68.255.255
I know this = 69.67.0.0/15
69.68.255.255 - 69.67.0.0 = (68 - 67 + 1) * 256 * 256 = 131072
Or I think you could expand that to say
(69 - 69 + 1) * (68 - 67 + 1) * (255 - 0 + 1) * (255 - 0 + 1) = 131072
32 - (131072 log / 2 log) = 15
converting back...
2 ^ (32 - 15) = 131072
131072 / 256 = 512 [0.0.0.255]
512 / 256 = 2 [0.0.255.0]
2 - 1 = 1 [0.1.0.0]
69.67.0.0 + 0.1.255.255 = 69.68.255.255
or hex(131072 - 1) = 1FFFF
CIDR seems complicated, but its simply the number of fixed bits in the
address range. IPv4 contain 32 bits, so a range of one address would have
32 fixed bits or /32.
2 ^ (32 - 32) = 1
binary is multiples of 2 (2^y), so
/32 = 1
/31 = 2
/30 = 4
/29 = 8
/28 = 16
--
| Ric
|
More information about the SpamCop-List
mailing list