Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ark1!volleydog!rhott From: rhott@volleydog.nswc.navy.mil (The VolleyDog) Newsgroups: comp.protocols.tcp-ip Subject: Re: IP Addresses (Subnets) Message-ID: <1990Jun14.171904.9106@relay.nswc.navy.mil> Date: 14 Jun 90 17:19:04 GMT Sender: news@relay.nswc.navy.mil (News) Reply-To: rhott@volleydog.nswc.navy.mil (The VolleyDog) Organization: Naval Surface Warfare Center, Dahlgren VA Lines: 319 Followup-To:rhott@volleydog.nswc.navy.mil I would like to thank the folks that responded to my request aabout IP Addresses (Subnetting). The following is a summary of the responses, the attachment at the end are the responses I recieved. Basically, I asked how to specify the IP address for a class B network with a 6 bit subnet field and 10 bit host field. The subnet was # 1, and the host was # 300. (I want to thank you for not flaming my mistake for the octet representation.) I suggested and octet representation and a subnet representation. I suggested an octet representation of 128.38.253.44 (it actually should have been 128.38.5.44) and a subnet representation of 128.38.1.300. The responses indicate that the octet representation should be used! I think it is a shame, since it makes it a little nasty to look at address 128.38.4.2 and 128.38.5.44 and instantaneously know that they are actually the same subnet. I do understand why, and I expected that this was going to be the case. As an aside, the reason I am asking it that I plan to originally assign the subnet mask as 255 (all 8 bits), but I am afraid that I may need less subnets, but more host addresses, some I am "planning ahead". Once again, I appreciate your assistance, and your tolerance with this type of question. Bob Hott Responses Follow ------------------------------------------------------------------------ -------- From: ckollars@Sun.COM (Chuck Kollars - DSGG Technical Marketing - Boston) Subject: Re: IP Addresses (Subnets) Organization: Sun Microsystems, Billerica MA In article <1990Jun13.145153.29190@relay.nswc.navy.mil> you write: >I have a quick question, hopefully you will not flame to loudly with >regard to viewing RFCs. I looked through RFC 950 to try to determine >how to specify a host when using a subnet. In my particular instance we >have a class B network. I am interested in how one would specify >addresses when a subnet of 6 bits is used. > >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 Neither. Host 300 on subnet 1 of net 128.38 with a subnet mask of 255.25.252.0 should be 128.38.5.44. To see why, work it out in binary: net field mask 11111111.11111111.00000000.00000000 (implied by Class B address) net value 10000000.00100110.xxxxxxxx.xxxxxxxx (128.38 w/in its field) subnet mask 11111111.11111111.11111100.00000000 (255.255.252.0) subnet field 00000000.00000000.11111100.00000000 (implied, subnet mask w/o net field) subnet value xxxxxxxx.xxxxxxxx.000001xx.xxxxxxxx (1 w/in its field) host mask 00000000.00000000.00000011.11111111 (implied, inverse of subnet mask) host value xxxxxxxx.xxxxxxxx.xxxxxx01.00101100 (300 w/in its field) final value 10000000.00100110.00000101.00101100 (128.38.5.44) (concatenation of all fields) >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 octet.octet.octet.octet notation is very old, predating subnets by many years. It happens that if your subnet mask falls on a byte boundary (is a multiple of 8 bits long), you can think of one of the fields as the "subnet number". This convenient shortcut doesn't work if your subnet mask splits a byte. -- chuck kollars DSGG Technical Marketing, Sun's Boston Development Center ------------------------------------------------------------------------ -------- From djw@BBN.COM Wed Jun 13 14:00:01 1990 Subject: Re: IP Addresses (Subnets) Hi, In comp.protocols.tcp-ip you write: }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 The a.b.c.d addressing notation has each portion being one octet. So, use 128.38.253.44 for maximum correctness. But, some versions of some operating systems may be more permissive: under SunOS 4.0.3, when I telnet to 128.38.1.300 it responds with: "Trying 128.38.1.44 ...". Telneting to 10.51 responds with "Trying 10.0.0.51 ...". -david ------------------------------------------------------------------------ -------- From: rodk@Corp.Sun.COM (Rod King - Sun Consulting Mtn. View) Subject: Re: IP Addresses (Subnets) Organization: Sun Microsystems, Mt. View, Ca. In article <1990Jun13.145153.29190@relay.nswc.navy.mil> you write: >I have a quick question, hopefully you will not flame to loudly with >regard to viewing RFCs. I looked through RFC 950 to try to determine >how to specify a host when using a subnet. In my particular instance we >have a class B network. I am interested in how one would specify >addresses when a subnet of 6 bits is used. > >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 This is my vote (and I'm not saying its correct). The last 2 bytes look like this: 76543210 76543210 subnet|---host--| host 300 converts to 0x18c in hex. Filling the bits in the 2 bytes, and using subnet 1, you get 76543210 76543210 00000101 10001100 Converting to IP address notation, you get 5.140 for an overall IP address of 128.38.5.140. Life's a lot easier with 8-bit subnets. Can you also summarize your results? Rod King email: rodk@sun.com Consultant office: (415) 336-1897 Sun Microsystems FAX: (415) 968-4356 ------------------------------------------------------------------------ -------- From: cpw%snow-white@lanl.gov (C. Philip Wood) Subject: Re: IP Addresses (Subnets) For Class B network: 128.38.0.0 thats 10000000.00100110.00000000.00000000 in binary If your subnet is 6 bits then subnet 1 would be: 128.38.4.0 thats 10000000.00100110.00000100.00000000 Host number 300 on subnet 1 would have IP address: 128.38.5.44 thats 10000000.00100110.00000101.00101100 Did I get that right? Phil ------------------------------------------------------------------------ -------- From: Frank Kastenholz Subject: Re: IP Addresses (Subnets) > From tcp-ip-RELAY@NIC.DDN.MIL Wed Jun 13 13:08:44 1990 > From: sdd.hp.com!uakari.primate.wisc.edu!ark1!volleydog!rhott@ucsd.edu (The VolleyDog) > Organization: Naval Surface Warfare Center, Dahlgren VA > Subject: IP Addresses (Subnets) > Sender: tcp-ip-relay@nic.ddn.mil > To: tcp-ip@nic.ddn.mil > > I have a quick question, hopefully you will not flame to loudly with > regard to viewing RFCs. I looked through RFC 950 to try to determine > how to specify a host when using a subnet. In my particular instance we > have a class B network. I am interested in how one would specify > addresses when a subnet of 6 bits is used. > > 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? Bob: >From RFC 1117 (Internet Numbers): One commonly used notation for internet host addresses divides the 32-bit address into four 8-bit fields and specifies the value of each field as a decimal number with the fields separated by periods. This is called the "dotted decimal" notation. For example, the internet address of VENERA.ISI.EDU in dotted decimal is 010.001.000.052, or 10.1.0.52. So, the correct number is 128.38.253.44. This is not an "official standard" but it is common usage to the degree that no one does anything different. Frank Kastenholz Racal Interlan ------------------------------------------------------------------------ -------- From: romkey@asylum.sf.ca.us (John Romkey) Subject: IP Addresses (Subnets) The dotted-decimal notation (128.38.253.44) is just a direct representation of the 32 bit IP address. It doesn't (necessarily) break apart neatly into net, subnet and host numbers at dot boundaries. So the 3rd octet field in the dot notation is equivalent to the third octet in the 32 bit number. - john romkey USENET/UUCP: romkey@asylum.sf.ca.us Internet: romkey@ftp.com "There is no loyalty except loyalty to the party. There is no love except love of Big Brother. All competing pleasures we will destroy." - 1984 (film) ------------------------------------------------------------------------ -------- From: Matt Jonson Subject: Re: IP Addresses (Subnets) 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 ------- ------------------------------------------------------------------------ -------- From: mep@AQUA.WHOI.EDU (Michael E. Pare) Subject: Re: IP Addresses (Subnets) Organization: The Internet >I have a quick question, hopefully you will not flame to loudly with >regard to viewing RFCs. I looked through RFC 950 to try to determine >how to specify a host when using a subnet. In my particular instance we >have a class B network. I am interested in how one would specify >addresses when a subnet of 6 bits is used. >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? >Thanks, > Bob Hott The first subnet using 6 bits will be 4. Decimal 300 in binary is 100101100. The rightmost 8 bits belongs to the first field and is 44. The leftmost 1 is part of the next field. The resulting binary format for the first two fields will be : 00000101 00101100 ------ subnet|---------| host The resulting decimal values are 5 and 44 respectively. Thus the IP address will be 128.38.5.44 for the 300th host of the first subnet. ------------------------------------------------------------------------ -------- ============================================================================= Fullname: Robert W. (Bob) Hott Mailing Address: Naval Surface Warfare Center Networks Branch (Code E41) Dahlgren, Virginia 22448 DDN Mail: rhott@relay.nswc.navy.mil DDN Mail: rhott@volleydog.nswc.navy.mil Telephone: (703) 663 - 7745 "If man were not meant to play volleyball, why are there so many beaches?" - Bob Hott -