Subject: Re: Network mask contiguity

From: Igor Miroshnik <[email-masked]>
Date: Mon, 15 Dec 2003 12:26:57 -0500

Venkata,

Indeed, it's very succinct and beautiful formula. The iterations, though,
are hidden inside "log"-routine as a payback for added value - mask length.

Thanks,
Igor

On Mon, 15 Dec 2003 12:09:41 -0500, Naidu, Venkata
<[email-masked]> wrote:

>->   You can check whether "log((~mask)+1)" is a natural number or not.
>->   If it is a natural number then mask is contiguous, else it is not.
>
>  Realize the hidden beauty in the above algorithm. If the mask is
>  continuous then the result will return the "mask length".
>  (32 - log(~mask + 1)) is in fact the mask length. Converting
>  back to mask is also straight forward (~(~0 >> masklength)).
>
>Venkata.

---

From: Acee Lindem <[email-masked]>
Date: Mon, 15 Dec 2003 12:30:47 -0500

> are hidden inside "log"-routine as a payback for added value - mask length.

Hey Guys,

Let's shut this thread down or take it offline before subscribers
that are interested in OSPF start unsubscribing (although I agree that
the log() function probably performs worse than going back to the an
iterative bit compare and shift to get the prefix length :^).

Thanks,
Acee

-- 
Acee