[comp.protocols.tcp-ip] IP Addresses

rhott@volleydog.nswc.navy.mil (The VolleyDog) (06/13/90)

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


=============================================================================

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 -

kasten@europa.interlan.COM (Frank Kastenholz) (06/14/90)

 > 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

romkey@asylum.sf.ca.us (John Romkey) (06/14/90)

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)

mep@AQUA.WHOI.EDU (Michael E. Pare) (06/14/90)

>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.

AFDDN.JONSON@GUNTER-ADAM.AF.MIL (Matt Jonson) (06/14/90)

Bob Hott <rhott@relay.nswc.navy.mil> 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
-------

rhott@volleydog.nswc.navy.mil (The VolleyDog) (06/15/90)

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    <ckollars@East.Sun.COM>
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 <kasten%europa.interlan.com@relay.cs.net>
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 <AFDDN.JONSON@gunter-adam.af.mil>
Subject: Re: IP Addresses (Subnets)

Bob Hott <rhott@relay.nswc.navy.mil> 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 -

RWOUNDY@IBM.COM ("Rich_Woundy"_@cup.portal.com@ (06/18/90)

 >From: sdd.hp.com!uakari.primate.wisc.edu!ark1!volleydog!rhott@ucsd.edu (The
 >VolleyDog)
 >Subject: IP Addresses (Subnets)
 >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 e
 >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 wit
 >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
Bob,
   Per RFC 1117, you should specify the addressing using the 3rd octet
of the 32 bit address. The 32 bit address of the 300th host on subnet 1
on network 128.38 should be (by my reading/implementation of RFC 950):

NNNNNNNN NNNNNNNN SSSSSSHH HHHHHHHH N = network,S = subnet,H = host bits
10000000 00100110 00000101 00101100 N = "128.38",S = 1,H = 300
 128    . 38     . 5      . 44      Dotted Decimal Notation

The 6 bit subnet mask you chose allows you to have subnets numbered
1 to 62 (see bottom of page 6 in RFC 950).

As another illustration, note the example (p. 13 bottom, RFC 950)
of the same subnet mask for network 128.99. Address 128.99.4.123
specifies host 123 on subnet 1 on class B network 128.99.0.0.


> From: Frank Kastenholz <kasten%europa.interlan.com@RELAY.CS.NET>
> 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 eah
>    field as a decimal number with the fields separated by periods.  Ths
>    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 degre that
> no one does anything different.
>
> Frank Kastenholz
> Racal Interlan

If this is "common usage", then a router literally following
RFC 950 will handle 128.38.253.44 as net 128.38.0.0, subnet 63 ("252"),
host 300 ("1.44"), assuming the router is privy to the subnet mask.
See RFC 1122 (Requirements for Internet Hosts -- Communication Layers),
pp. 30-31 (condensed here):
  IP addresses are not permitted to have the value 0 or -1 for any of
  the <Host-number>, <Network-number>, or <Subnet-number> fields,
  except in the special cases listed here as either
   <Network-number>,<Host-number>   or
   <Network-number>,<Subnet-number>,<Host_number>
  (a) 0,0   (b) 0,<Host-number>   (c) -1,-1   (d) <Network-number>,-1
  (e) <Network-number>,<Subnet-number>,-1   (f) <Network-number>,-1,-1
  (g) 127,<any>
{See caveats in RFC for cases (a)-(g)}
Note that subnet 63 is equivalent to -1 in the description above.


> From:     Doug Nelson <NELSON%MSU.EDU@CORNELLC.cit.cornell.edu>
> The best answer is "none of the above".  If your netmask is 255.255.25.0,
> and you are on the first subnet of network 128.38, then your address rnge
> begins with 128.38.0.0, and ends with 128.38.3.255 (the latter being yur
> subnet broadcast address).  So, if your first host was numbered 128.381.1,
> then your 300th host would be 128.38.2.44.
>
> Doug Nelson
> Network Software Manager
> Michigan State University

Interpreting RFC 950 literally again, 128.38.2.44 specifies host # 556
on subnet 0 on network 128.38.0.0.
The host number space on subnet 1 of network 128.38.0.0 would be
from 128.38.4.1 to 128.38.7.254.

If my answer seems brain-dead, please notify myself and the list.
Otherwise, we're likely to retain three interpretations of the RFCs
to answer a straightforward question. Bob, this was obviously not
a dumb question to ask.

-- Rich
Richard Woundy, IBM Advanced Solutions Development, Milford, CT
Flames to: rwoundy@ibm.com
Disclaimer: IBM nor any other corporation or entity takes responsibility
 for the irresponsible things quoted in this message.