Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Feb 1996 15:54:03 -0500
From:      "Garrett A. Wollman" <wollman@lcs.mit.edu>
To:        Nate Williams <nate@sri.MT.net>
Cc:        hackers@FreeBSD.org
Subject:   Re: Broadcast, Netmask, and other such information
Message-ID:  <9602152054.AA13444@halloran-eldar.lcs.mit.edu>
In-Reply-To: <199602152048.NAA01295@rocky.sri.MT.net>
References:  <199602152029.NAA01202@rocky.sri.MT.net> <9602152037.AA13188@halloran-eldar.lcs.mit.edu> <199602152048.NAA01295@rocky.sri.MT.net>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Thu, 15 Feb 1996 13:48:01 -0700, Nate Williams <nate@sri.MT.net> said:

>> 10.5.5.31 is not a valid host address.  (Neither is 10.5.5.0, which
>> you correctly avoided using; it means ``this host''.)

> Ok, so neither is 10.5.5.63 then either?

Right.

>> The netmask must be the same for all subnets of the same size.  In
>> this example, it should be 255.255.255.224.  The network you describe
>> would then be referred to as 10.5.5.0/227, 10.5.5.32/227, etc.

> Where does /227 come from?  I see 224, but it looks like you've pulled
> 227 out of thin air.

I had a brain fart.  It should be /27, not /227.  It's the number of
one bits in the netmask.

> So to determine the netmask, you need to know how many addresses are in
> the subnet, and subtract that from 255.255.255.255, right?

Well, no.  You need to know how many addresses there are total, and
subtract the log_2 of that from 32.  That gives you the number of one
bits in the mask.  You'll probably find it clearer if you write the
masks in hex.

> And, to determine the broadcast, you add one to the highest host #
> assigned to you (which should be one-less than a 2^n boundary based on
> the # of hosts you are using), right?

To determine the broadcast, you take:

	(subnet & netmask) | ~netmask

If you leave the broadcast address unspecified, the system will
automatically figure this out for you.  Basically, all you have to
remember is that the highest and lowest addresses in every subnet are
reserved.

-GAWollman

--
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@lcs.mit.edu  | Shashish is the bonding of hearts in spite of distance.
Opinions not those of| It is a bond more powerful than absence.  We like people
MIT, LCS, ANA, or NSA| who like Shashish.  - Claude McKenzie + Florent Vollant



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9602152054.AA13444>