Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!GUNTER-ADAM.AF.MIL!AFDDN.JONSON From: AFDDN.JONSON@GUNTER-ADAM.AF.MIL (Matt Jonson) Newsgroups: comp.protocols.tcp-ip Subject: Re: IP Addresses (Subnets) Message-ID: <12597753307.22.AFDDN.JONSON@GUNTER-ADAM.AF.MIL> Date: 14 Jun 90 14:45:44 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 36 Bob Hott writes: >Suppose I want the 300th host on the 1 subnet of a class B network with >a netmask of 255.255.252! Should I specify the IP address as >128.38.1.300 or 128.38.253.44 >I guess my overall question is: Should I specify the addressing using >the 3rd octet field in the dot notation as the subnet or as the 3rd >octet of the 32 bit field? The dot decimal notation must break apart into octets, so there is no way to go over 255 in any given piece. So, depending on what you mean by "the 1 subnet", it should look something like this: 128.38. <6 subnet bits> <2 host bits> . <8 host bits> host 1,300: (1) (256) + (32)+(8)+(4) 128.38. <0 0 0 0 0 1> <0 1>. <0 0 1 0 1 1 0 0> 4 + 1 32 + 8+4 = 128.38.5.44 which is the 300th host on subnet 1, and is on a subnet whose first host is 128.38.4.1, and whose last host (the 1022nd) is 128.38.7.254. You must bear in mind that all ones and all zeros in the host portion is reserved. I think your first subnet would actually be subnet 0, extending from 128.38.0.1 to 128.38.3.254. Note your netMASK is still 128.38.252.0. The netmask is only used for the purpose of masking off the net portion of an ip address, because a logical AND is performed on the netmask and any given host address (so the zeros knock off the host number, and the ones pass just the net number) when you're trying to determine a route for a particular packet. It looks like you got a little confused on how your netmask relates to your address. Hope I've been helpful, MWJ -------