From owner-freebsd-hackers Thu Feb 15 12:27:08 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA20091 for hackers-outgoing; Thu, 15 Feb 1996 12:27:08 -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 MAA20086 Thu, 15 Feb 1996 12:27:03 -0800 (PST) Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id NAA01202; Thu, 15 Feb 1996 13:29:36 -0700 Date: Thu, 15 Feb 1996 13:29:36 -0700 From: Nate Williams Message-Id: <199602152029.NAA01202@rocky.sri.MT.net> To: hackers@FreeBSD.org CC: wollman@FreeBSD.org Subject: Broadcast, Netmask, and other such information Sender: owner-hackers@FreeBSD.org Precedence: bulk I'm peering through my O'Reilly TCP/IP book and it's not jumping out at me, so I'm asking for the net-wisdom. Part of this has to do with recent questions posed to the list, so I want to make sure I understand things (I'm beginning to think I'm confused). Standard class B and class C stuff is pretty straightforward. I don't have any problems with understanding it. However, when we want to subnet a class C (into let's say 8 segmens of 32 apiece), how do you setup the broadcast and netmask? According to O'Reilly, 'The standard broadcast address is an address where all the host bits are set to one', but there's no description for netmask. However ifconfig(8) states as follows: The mask contains 1's for the bit positions in the 32-bit address which are to be used for the network and subnet parts, and 0's for the host part. The mask should contain at least the standard network portion, and the subnet field should be contiguous with the network portion. So, to help me out I'll create a sample system with a bogus class C network assigned to us. NOT assigned the class C network 10.5.5.255 to me, and I want to break it into 32 host segments (realizing the overhead of being unable to allocate some IP #'s due to broad-cast addresses and such). So, the subnets get this addressing scheme: hosts: hosts: 10.5.5.1 - 10.5.5.31 10.5.5.32 - 10.5.5.63 netmask: netmask: 255.255.255.224 255.255.255.192 broadcast: broadcast: 10.5.5.31 10.5.5.63 hosts: hosts: 10.5.5.64 - 10.5.5.95 10.5.5.96 - 10.5.5.127 netmask: netmask: 255.255.255.160 255.255.255.128 broadcast: broadcast: 10.5.5.95 10.5.5.127 hosts: hosts: 10.5.5.128 - 10.5.5.159 10.5.5.160 - 10.5.5.191 netmask: netmask: 255.255.255.96 255.255.255.64 broadcast: broadcast: 10.5.5.159 10.5.5.191 hosts: hosts: 10.5.5.192 - 10.5.5.223 10.5.5.224 - 10.5.5.254 netmask: netmask: 255.255.255.32 255.255.255.0 broadcast: broadcast: 10.5.5.223 10.5.5.254 But that doesn't sit well with me, especially that the broadcast address is the same IP as the last host, and that the netmask of the last group is the same as the entire class C. Am I really confused, or can someone else tell me how to calculate these? Nate