From owner-freebsd-hackers Thu Feb 15 12:54:18 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA22214 for hackers-outgoing; Thu, 15 Feb 1996 12:54:18 -0800 (PST) Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA22197 for ; Thu, 15 Feb 1996 12:54:14 -0800 (PST) Received: by halloran-eldar.lcs.mit.edu; (5.65/1.1.8.2/19Aug95-0530PM) id AA13444; Thu, 15 Feb 1996 15:54:03 -0500 Date: Thu, 15 Feb 1996 15:54:03 -0500 From: "Garrett A. Wollman" Message-Id: <9602152054.AA13444@halloran-eldar.lcs.mit.edu> To: Nate Williams Cc: hackers@FreeBSD.org Subject: Re: Broadcast, Netmask, and other such information 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> Sender: owner-hackers@FreeBSD.org Precedence: bulk < 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