[CLUE-Tech] WAS: Netmask trivia question...

Keith Hellman khellman at mcprogramming.com
Sat Aug 30 18:30:36 MDT 2003


On Sat, Aug 30, 2003 at 04:25:18PM -0600, David Anselmi wrote:
> Trivia question:  Why would you want to write a netmask the long way 
> (e.g., 255.255.255.0) rather than the short way (e.g., /24), assuming 
> your application can accept either?

IIRC, netmasks do not *HAVE* to be a sequence of 'all-on' bits,
255.255.1.0 or 255.0.255.0 are valid netmasks - though I doubt they
would work all that much in the wild.  The hiccup (I think) being
whether your network card takes only the lower bits for the node numbers
of simply does a ~netmask to determine all node addresses (the latter
woiuld be the more correct, I think...).

Think I read this in Perlman's Bridges and Routers book.  If I'm right,
I'm sure I got all the details wrong, but I'll leave the corrections to
DA.

-- 
Keith Hellman                             #include <disclaimer.h>
khellman at mcprogramming.com                from disclaimer import standard

"We will perhaps eventually be writing only small modules which are identified
by name as they are used to build larger ones, so that devices like
indentation, rather than delimiters, might become feasible for expressing local
structure in the source language."

-- Donald E. Knuth, "Structured Programming with goto Statements", Computing
Surveys, Vol 6 No 4, Dec. 1974



More information about the clue-tech mailing list