From owner-freebsd-hackers Thu Feb 15 13:12:57 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA23400 for hackers-outgoing; Thu, 15 Feb 1996 13:12:57 -0800 (PST) Received: from rocky.sri.MT.net (rocky.sri.MT.net [204.182.243.10]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id NAA23394 for ; Thu, 15 Feb 1996 13:12:51 -0800 (PST) Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id OAA01407; Thu, 15 Feb 1996 14:15:17 -0700 Date: Thu, 15 Feb 1996 14:15:17 -0700 From: Nate Williams Message-Id: <199602152115.OAA01407@rocky.sri.MT.net> To: "Garrett A. Wollman" Cc: Nate Williams , hackers@FreeBSD.org Subject: Re: Broadcast, Netmask, and other such information In-Reply-To: <9602152054.AA13444@halloran-eldar.lcs.mit.edu> References: <199602152029.NAA01202@rocky.sri.MT.net> <9602152037.AA13188@halloran-eldar.lcs.mit.edu> <199602152048.NAA01295@rocky.sri.MT.net> <9602152054.AA13444@halloran-eldar.lcs.mit.edu> Sender: owner-hackers@FreeBSD.org Precedence: bulk > I had a brain fart. It should be /27, not /227. It's the number of > one bits in the netmask. 3 * 8 + 3, okay. (Using information from the other article you replied to.) > > 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. What's the different between 'how many addresses in the subnet' and 'how many addresses there are total'. Maybe I'm not making myself clear. When I say 'addresses in the subnet', I'm trying to convey a number which *should* be a power of 2 #. In the above example, there are 32 addresses assigned in each subnet, of which there are only 31 usable as host addresses (except in the first and last subnets due to the .0 & .255 addresses being unusable). This number should be subtracted from 255.255.255.255. I'm trying to apply this in a generic sense, so if I have the network address 128.18.0.0/16 address assigned to me, and I try to be funky and not assign addresses on byte boundaries how I would calculate things. Or, if I try to break things into 4x64 chunks given a 10.5.6/24 address assigned to me. (Using the calculation I used above would mean a subnet on the /24 address broken into 4 chunks would have a broadcast of 255.255.255.192, right?) Nate