[ale] IP Calculations

Chris Ricker kaboom at gatech.edu
Sat Dec 15 09:48:41 EST 2001


On Sat, 15 Dec 2001, Matt Shade wrote:

> > Hmm? 255.255.255.4 == 11111111.11111111.11111111.00000100b.
> 
> Oops, I missed a place  ;(
> 
> >
> > > 11111111.11111111.11111111.11110010
> > > incorrect, since all the numbers to the right of the last contiguous 1
> is
> > > not a zero
> >
> > Well, I've actually seen at least one network subnetted
> > that way. I just don't know if it was "correct" or
> > not, but it -did- work. Very confusing to add new
> > hosts, though. I have no idea what the net admin guy
> > was thinking.
> 
> Maybe you can do that...I was always taught it was wrong. Maybe it's
> "technically" possible, but you "shouldn't" do it?

It depends on your needs.  Technically, it'll sometimes work.

If you want to convince yourself that netmasks needn't be contiguous 1's,
think about what happens on a standard /24 if you replace the 24 1s in the
standard netmask with the network address.  For example, for the
192.168.1.0/24 network (11000000.10101000.00000001.00000000), use
11000000.10101000.00000001.00000000 instead of
11111111.11111111.11111111.00000000 as your netmask, and then do all your
standard calculations.

You were probably taught that you shouldn't do it because it doesn't map 
cleanly onto the traditional definitions of netmask (ie, masking either 
network or network + subnetwork).  Try converting it to slash notation (eg, 
/16 or /27) to see what I mean.

You can sometimes do fun things with "non-standard" netmasks.  If you're
really careful, you can set it up so the host IPs are totally discontiguous
;-).  In practice, that's not often useful, but....

later,
chris


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list