[c-nsp] Calculate wildcard..

bill fumerola billf at mu.org
Sun Jun 22 02:38:46 EDT 2008


On Sat, Jun 21, 2008 at 07:41:18PM +0300, almog ohayon wrote:
> Q : when i have couple of address that i need to know their common wildcard,
> i XOR them and i get excellent result but
>      how can i know that i'm not overlapping any other addresses ??

a wildcard will match 2^x addresses where x= the number of bits set.

examples:
0.0.0.1 = 0 0 0 1 = 2 addrs 
   10.0.0.0 10.0.0.1 = 10.0.0.0 0.0.0.1
0.0.0.3 = 0 0 0 11 = 4 addrs
   10.0.0.0 10.0.0.1 10.0.0.2 10.0.0.3 = 10.0.0.0 0.0.0.3
0.0.0.6 = 0 0 0 110 = 4 addrs
   10.0.0.0 10.0.0.2 10.0.0.4 10.0.0.6 = 10.0.0.0 0.0.0.6
0.1.0.1 = 0 1 0 1 = 4 addrs
   10.0.0.0 10.1.0.0 10.0.0.1 10.1.0.1 = 10.0.0.0 0.1.0.1


-- bill


More information about the cisco-nsp mailing list