home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 1200s / rfc1219.txt < prev    next >
Text File  |  1991-04-15  |  30KB  |  731 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                        P. Tsuchiya
  8. Request for Comments: 1219                                      Bellcore
  9.                                                               April 1991
  10.  
  11.  
  12.                   On the Assignment of Subnet Numbers
  13.  
  14. Status Of This Memo
  15.  
  16.    This memo suggests a new procedure for assigning subnet numbers.  Use
  17.    of this assignment technique within a network would be a purely local
  18.    matter, and would not effect other networks.  Therefore, the use of
  19.    these procedures is entirely discretionary.
  20.  
  21.    This memo provides information for the Internet community.  It does
  22.    not specify an Internet standard.  Distribution of this memo is
  23.    unlimited.
  24.  
  25. Overview
  26.  
  27.    RFC-950 [2] specifies a procedure for subnetting Internet addresses
  28.    using a bit-mask.  While RFC-950 allows the "ones" in the subnet mask
  29.    to be non-contiguous, RFC-950 recommends that 1) they be contiguous,
  30.    and 2) that they occupy the most significant bits of the "host" part
  31.    of the internet address.
  32.  
  33.    RFC-950 did not specify whether different subnets of the same network
  34.    may have different masks.  This ambiguity was unfortunate, as it
  35.    resulted in development of routing protocols that do not support
  36.    different masks; see e.g., RIP [6].  The Gateway Requirements RFC [7]
  37.    settled the issue in favor of allowing different masks, and therefore
  38.    future routing protocols may be expected to support this feature;
  39.    OSPF [3] is an example.
  40.  
  41.    The network administrator must of course determine the mask for each
  42.    subnet.  This involves making an estimate of how many hosts each
  43.    subnet is expected to have.  As it is often impossible to predict how
  44.    large each subnet will grow, inefficient choices are often made, with
  45.    some subnets under-utilized, and others possibly requiring
  46.    renumbering because of exceeded capacity.
  47.  
  48.    This memo specifies a procedure for assigning subnet numbers that
  49.    eliminates the need to estimate subnet size.  Essentially, host bits
  50.    (mask = 0) are assigned from the least significant bit working
  51.    towards the most, and subnet bits (mask = 1) are assigned from the
  52.    most significant bit working towards the least.  As subnets grow,
  53.    more host bits are assigned.  As the number of subnets grows, more
  54.    subnet bits are assigned.  While this process does sometimes result
  55.  
  56.  
  57.  
  58. Tsuchiya                                                        [Page 1]
  59.  
  60. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  61.  
  62.  
  63.    in new subnet masks, no host ever need change addresses.
  64.  
  65.    This technique is not new, but it is also not widely known, and even
  66.    less widely implemented.  With the development of new routing
  67.    protocols such as OSPF, it is possible to take full advantage of this
  68.    technique.  The purpose of this memo, then, is to make this technique
  69.    widely known, and to specify it exactly.
  70.  
  71.    This memo requires no changes to existing Internet standards.  It
  72.    does, however, require that the intra-domain routing protocol handle
  73.    multiple different subnet masks.
  74.  
  75. Acknowledgments
  76.  
  77.    The author would like to thank Phil Karn, Charles Lynn, Jeff Mogul,
  78.    and Charles Wolverton for their helpful suggestions.  Special thanks
  79.    go to Joel Halpern for his painstaking debugging of the detailed
  80.    specification and the examples.
  81.  
  82. 1.  Motivation
  83.  
  84.    The Subnetting standard, RFC-950, specifies that the Host part of the
  85.    formally 2-level Internet address can be divided into two fields,
  86.    Subnet and Host.  This gives the Internet address a third level of
  87.    hierarchy, and the concomitant firewalls and savings in routing
  88.    overhead.  It also introduces increased inefficiency in the
  89.    allocation of addresses.
  90.  
  91.    This inefficiency arises from the fact that the network administrator
  92.    typically over-estimates the size (number of hosts) of any single
  93.    subnetwork, in order to prevent future re-addressing of subnets.  It
  94.    may also occur if the routing protocol being used does not handle
  95.    different length subnets, and the administrator must therefore give
  96.    every subnet an amount of space equivalent to that received by the
  97.    largest subnet. (This RFC does not help in the latter case, as the
  98.    technique herein requires different length subnets.)
  99.  
  100.    The administrative hassle associated with changing the subnet
  101.    structure of a network can be considerable.  For instance, consider
  102.    the following case.  A network has three subnets A, B, and C.  Assume
  103.    that the lowest significant byte is the host part, and the next byte
  104.    is the subnet part (that is, the mask is 255.255.255.0).  Assume
  105.    further that A has subnet 1.0, B has subnet 2.0, and C has subnet
  106.    3.0.
  107.  
  108.    Now, assume that B grows beyond its allocation of 254 hosts.
  109.    Ideally, we would like to simply change B's mask without changing any
  110.    of the host addresses in B.  However, the subnets numerically above
  111.  
  112.  
  113.  
  114. Tsuchiya                                                        [Page 2]
  115.  
  116. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  117.  
  118.  
  119.    and below B are already taken by A and C.  (If say 3.0 was not taken
  120.    by C, B's mask could be changed from 255.0 (ff00) to 254.0 (fe00).
  121.    In this case, all of B's existing addresses would still match the new
  122.    subnet.  Indeed, if non-contiguous masks were in use, it might be
  123.    possible for B to find some other mask bit to change to 0.  However,
  124.    non-contiguous masks are generally not in favor, as they impose
  125.    limitations on certain forwarding table lookup algorithms.  Indeed,
  126.    RFC-950 discourages their use.)
  127.  
  128.    So, the choices available to the network administrator are to 1) form
  129.    two subnets out of the existing one, or 2) renumber the subnet so
  130.    that the subnet ends up with a smaller (fewer 1's) mask.  Choice 1
  131.    can either be accomplished physically or logically.  Physically
  132.    forming two subnets requires partitioning the subnet and inserting a
  133.    gateway between the two partitions.  For obvious reasons, this is not
  134.    a desirable course of action.  Logically forming two subnets can be
  135.    done by simply assigning another subnet number (say 4.0) to the same
  136.    subnet, and assigning host addresses under the new subnet.  The
  137.    result of this logical partition is that the hosts with different
  138.    subnet numbers will not recognize that the others are on the same
  139.    subnet, and will send packets to the default gateway rather than
  140.    directly to the host.  In fact, this is not such a bad solution,
  141.    because assuming that the gateway is capable of recognizing multiple
  142.    subnet numbers on the same subnet, the gateway will simply send the
  143.    host an ICMP Redirect [4], and subsequent packets will go directly to
  144.    the host [1] (this may not work correctly on all hosts).
  145.  
  146.    If, however, neither choice is acceptable or possible, then the
  147.    network administrator must assign a new subnet number to B, thus
  148.    renumbering the existing hosts, modifying the Domain Name System
  149.    entries, and changing any other configuration files that have
  150.    hardwired addresses for hosts in subnet B.
  151.  
  152. 2. A More Flexible and Efficient Technique for Assigning Subnet Numbers
  153.  
  154.    In order to help explain the new technique, we shall show what is
  155.    wrong with what is currently done now.  Currently, most subnets are
  156.    assigned by splitting the host part of the address in two fields; the
  157.    subnet field and the host field.  Mask bits are one for subnet field
  158.    bits, and 0 for host field bits.  (In all of our addresses, the least
  159.    significant bit (LSB) is on the right, the most significant bit (MSB)
  160.    is on the left.)
  161.  
  162.         MSB                                LSB
  163.         --------------------------------------
  164.        | subnet field    | host field         |
  165.         --------------------------------------
  166.  
  167.  
  168.  
  169.  
  170. Tsuchiya                                                        [Page 3]
  171.  
  172. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  173.  
  174.  
  175.    The subnet field could be different lengths for different size
  176.    subnets.  For instance, say a network had two large subnets and the
  177.    rest small subnets (by large subnet we mean a large number of hosts).
  178.    Then the network administrator might assign two types of addresses:
  179.  
  180.         --------------------------------------
  181.        | subnet |               host          |  large subnets
  182.         --------------------------------------
  183.  
  184.         --------------------------------------
  185.        |         subnet             |  host   |  small subnets
  186.         --------------------------------------
  187.  
  188.    In this case, the full range of subnet numbers would not be available
  189.    to the small subnets, as the bits in the small subnet that correspond
  190.    to those in the large subnet could not have the same values as those
  191.    in the large subnets.  For instance, say that the large subnets had
  192.    4-bit subnet numbers, and the small subnets had 8-bit subnet numbers.
  193.    If the large subnets had values 0001 and 0010, then subnet numbers in
  194.    the range 00010000 to 00101111 could not be assigned to the small
  195.    subnets, otherwise there will be addresses that would match both
  196.    subnets.
  197.  
  198.    In any event, a network administrator will typically assign values to
  199.    the two fields in numerical order.  For example, within a given
  200.    subnet, hosts will be numbered 1, 2, 3, etc.  Within a given network,
  201.    subnets will be numbered 1, 2, 3, etc.  The result is that some
  202.    number of bits on the right side of the subnet and host fields will
  203.    be ones for some hosts and zeros for others, and some number of bits
  204.    on the left side of the subnet and host fields will be zeros for all
  205.    subnets and hosts.  The "all zeros" bits represent room for growth,
  206.    and the "ones and zeros" bits represent bits already consumed by
  207.    growth.
  208.  
  209.         --------------------------------------
  210.        | subnet field    | host field         |
  211.        |-----+-----------+-------+------------|
  212.        |     |           |       |            |
  213.        | 0's | 1's & 0's |  0's  | 1's & 0's  |
  214.           /\                /\
  215.           ||                ||
  216.         subnets can         hosts can grow here
  217.         grow here
  218.  
  219.    Now, let's assume that the number of hosts in a certain subnet grows
  220.    to the maximum allowed, but that there is still room in the subnet
  221.    field to assign more addresses.  We then have the following:
  222.  
  223.  
  224.  
  225.  
  226. Tsuchiya                                                        [Page 4]
  227.  
  228. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  229.  
  230.  
  231.         --------------------------------------
  232.        | subnet field    | host field         |
  233.        |-----+-----------+--------------------|
  234.        |     |           |                    |
  235.        | 0's | 1's & 0's |     1's & 0's      |
  236.  
  237.  
  238.    While the host field can no longer grow, there is still room in the
  239.    address for growth.  The problem is that because of where the growth
  240.    areas are situated, the remaining growth has been effectively
  241.    reserved for subnets only.
  242.  
  243.    What should be done instead is to assign subnet numbers so that the
  244.    ones start from the left of the subnet field and work right.  In this
  245.    case we get the following:
  246.  
  247.         --------------------------------------
  248.        | subnet field    | host field         |
  249.        |-----------+-------------+------------|
  250.        |           |             |            |
  251.        | 1's & 0's |    0's      | 1's & 0's  |
  252.                          /\
  253.                          ||
  254.                     Both hosts and subnets can
  255.                     grow here
  256.  
  257.    Now, both hosts and subnets individually have considerably more
  258.    growing space than before, although the combined growing space is the
  259.    same.  Since one can rarely predict how many hosts might end up in a
  260.    subnet, or how many subnets there might eventually be, this
  261.    arrangement allows for the maximum flexibility in growth.
  262.  
  263.    Actually, the previous figure is misleading.  The boundary between
  264.    the host and subnet fields is being shown in the middle of the growth
  265.    area.  However, the boundary could exist anywhere within the growth
  266.    area.  Note that it is the mask itself that determines where the
  267.    boundary is.  Ones in the mask indicate subnet bits, and zeros
  268.    indicate host bits.  We will show later that in fact the boundary
  269.    should lie somewhere in the middle.  Putting it there minimizes the
  270.    number of times that the masks must be changed in hosts.
  271.  
  272.    2.1  Specification of the New Technique
  273.  
  274.    Having given the appropriate explanatory material, we can now specify
  275.    the procedure for subnet number assignment.  We need the following
  276.    definitions:
  277.  
  278.    Host-assigned Bits (h-bits):  These are the bits, contiguous from
  279.  
  280.  
  281.  
  282. Tsuchiya                                                        [Page 5]
  283.  
  284. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  285.  
  286.  
  287.       the right, for which host values, within a given subnet, contain
  288.       both ones and zeros.  Different subnets may have different h-bits.
  289.  
  290.    Subnet-assigned Bits (s-bits):  These are the bits, contiguous from
  291.       the left, which 1) are not h-bits, AND 2) are required to
  292.       distinguish one subnet from another, AND 3) include all bits
  293.       to the left of and including the right-most one.  Notice that
  294.       different subnets may have different s-bits.
  295.  
  296.    Growth Bits (g-bits):  These are the "all zeros" bits in between
  297.       the h-bits and s-bits.
  298.  
  299.    s-mask:  For a given subnet, the mask whereby all s-bits are one,
  300.       and all g-bits and h-bits are zero.
  301.  
  302.    g-mask:  For a given subnet, the mask whereby all s-bits and g-bits
  303.       are one, and all h-bits are zero.
  304.  
  305.    Subnet Field:  These are the one bits in the subnet mask (as
  306.       defined in RFC-950).  These bits are on the left.  The subnet
  307.       field must at least include all of the s-bits, and may
  308.       additionally include some or all of the g-bits.
  309.  
  310.    Host Field:  These are the zero bits in the subnet mask.
  311.       These bits are on the right.  The host field must at least
  312.       include all of the h-bits, and may additionally include some
  313.       or all of the g-bits.
  314.  
  315.    Mirror-image Counting:  Normal counting, in binary, causes one
  316.       bits to start at the right and work left.  This is how host
  317.       values are assigned.  However, for subnet assignment, we want
  318.       the one bits to start at the left and work right.  This process
  319.       is the mirror image of normal counting, where the MSB is swapped
  320.       with the LSB, the second MSB is swapped with the second LSB, and
  321.       so on.  So, where normal counting is:
  322.  
  323.                 0       (reserved to mean "this host")
  324.                01
  325.                10
  326.               011
  327.               100
  328.               101
  329.               :
  330.               :
  331.         11...1110
  332.         11...1111       (reserved to mean "all hosts")
  333.  
  334.       and so on, Mirror-image, or MI counting, is:
  335.  
  336.  
  337.  
  338. Tsuchiya                                                        [Page 6]
  339.  
  340. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  341.  
  342.  
  343.         0       (reserved to mean "this subnet")
  344.         10
  345.         01
  346.         110
  347.         001
  348.         101
  349.           :
  350.           :
  351.         011...11
  352.         111...11        (reserved to mean "all subnets")
  353.  
  354.       and so on.  If the current MI counting value is, say, 001,
  355.       the "next" MI value is 101, and the "previous" MI value is 11.
  356.  
  357.    Now we can specify the algorithm.  We have the following functions:
  358.    Initialize(), AddSubnet(), RemoveSubnet(subnet#), AddHost(subnet#),
  359.    and RemoveHost(subnet#,host#).
  360.  
  361.    Notice that the algorithm is described as though one state machine is
  362.    executing it.  In reality, there may be a root Address Authority
  363.    (RootAA) that assigns subnet numbers (Initialize, AddSubnet, and
  364.    RemoveSubnet), and subnet AA, that assign host numbers within a
  365.    subnet (AddHost and RemoveHost).  While in general the AAs can act
  366.    independently, there are two cases where "coordination" is required
  367.    between the rootAA and a subnetAA.  These are the cases where either
  368.    the rootAA or the subnetAA "grabs" the last growth bit (in the former
  369.    case because another subnet has been added, and in the latter because
  370.    another host has been added).  Since it is impossible for the rootAA
  371.    and a subnetAA to simultaneously grab the last growth bit, either one
  372.    or the other must do it.
  373.  
  374.    Finally, note that the following C language style notation is used:
  375.         &               bit-wise AND function
  376.         ==              is equal to
  377.         !=              is not equal to
  378.         x-mask(X)       the x-mask of X (where x is s or g)
  379.  
  380.    Initialize():
  381.       Assign the first subnet value to be 0 (the value reserved to mean
  382.       "this subnet").  This is not assigned to any real subnet.
  383.  
  384.    AddSubnet():
  385.       1.  Find the lowest non-zero (in MI counting) non-assigned subnet
  386.           number S such that (S & g-mask(Y)) != (Y & g-mask(Y)) for all
  387.           existing subnet numbers Y, (Y != S).
  388.       2.  If all bits in S from the rightmost one bit left are ones,
  389.           then label all bits to the left of and including one bit
  390.           position to the right of the rightmost one bit in S to be
  391.  
  392.  
  393.  
  394. Tsuchiya                                                        [Page 7]
  395.  
  396. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  397.  
  398.  
  399.           s-bits. Else, label all bits to the left of and including the
  400.           rightmost one bit in S to be s-bits.  This prevents the "all
  401.           ones" value (which is the "all subnets" broadcast address)
  402.           from being assigned to a subnet.  (Since no hosts have been
  403.           added, the rightmost one bit is a subnet bit.)
  404.       3.  Label all other bits in the address to be g-bits.  (By
  405.           address, we mean that part of the IP address not including
  406.           the network number.)
  407.       4.  Set the subnet mask to include at least all s-bits, and
  408.           optionally some g-bits.  The subnet mask must be contiguous.
  409.           (Section 2.2 discusses the pros and cons of choosing a mask.)
  410.       5.  For all existing subnet numbers Y (Y != S):
  411.           51. If (S & s-mask(Y)) == (Y & s-mask(Y)), then:
  412.               511.  Change the leftmost g-bit of Y to an s-bit.  If
  413.                     the rootAA and YAA (the address authority for Y) are
  414.                     separate AAs, then the YAA must be informed of the
  415.                     change of bit status.  If this is the last g-bit,
  416.                     then this change must be coordinated with YAA.
  417.               512.  Expand the subnet mask for all hosts in Y if
  418.                     necessary (that is, if the subnet mask no longer
  419.                     includes all s-bits).
  420.  
  421.    RemoveSubnet(S):
  422.       1.  Consider B to be the bit position of the rightmost s-bit in S.
  423.       2.  Remove S.
  424.       3.  For all existing subnet numbers Y:
  425.           31.  If the bit in position B is not an s-bit, or if the bit
  426.                in bit position B is a one, or if the bit in bit position
  427.                B is a zero and all bits to the left of bit position B
  428.                are ones, then do nothing (skip steps 32 and 33).
  429.           32.  Change the s-bit in position B to a g-bit.
  430.           33.  If for any other existing subnet numbers X
  431.                (X & s-mask(Y)) == (Y & s-mask(Y)), then change the
  432.                g-bit in position B back into an s-bit for Y.  Else,
  433.                inform YAA that of the change of bit status.
  434.  
  435.    AddHost(S):
  436.       1.  Create an address A consisting of subnet number S concatenated
  437.           with zeros.
  438.       2.  Assign to A the same h-bits, g-bits, and s-bits as the
  439.           other host addresses.
  440.       3.  Find the lowest non-zero (using normal counting) non-assigned
  441.           host number H.
  442.       4.  If all bits from the leftmost one bit to bit position 0 are
  443.           ones, then execute steps 5 and 6 using bit position B equals
  444.           one bit position to the left of the leftmost one bit in H.
  445.           Else, execute steps 5 and 6 with bit position B equals
  446.           the leftmost one bit in H.  This prevents the "all ones" value
  447.  
  448.  
  449.  
  450. Tsuchiya                                                        [Page 8]
  451.  
  452. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  453.  
  454.  
  455.           (which is the "all hosts" broadcast address) from being
  456.           assigned to a host.
  457.       5.  If bit position B is an s-bit, then the host cannot be added.
  458.           Skip the remaining steps.
  459.       6.  If bit position B is a g-bit:
  460.           61.  Change the g-bit to an h-bit for all hosts in S.  Note
  461.                that if this is the last g-bit, this change must be
  462.                coordinated with the address authority assigning subnet
  463.                numbers (see section 2.2).
  464.           62.  Modify the subnet mask in all hosts if necessary.
  465.       7.  Create a new address A consisting of S concatenated with H
  466.       8.  Assign A to the host.
  467.  
  468.    RemoveHost(S,H):
  469.       1.  Remove H.
  470.       2.  If for all remaining host numbers in S, the value of the bit
  471.           position of the leftmost h-bit is zero, and there is a zero in
  472.           at least one of the bit positions to the right of the leftmost
  473.           h-bit, then for all hosts change the leftmost h-bit into a
  474.           g-bit.
  475.  
  476.       It is worth noting here that this technique is a 2-level subset of
  477.       the more general n-level kampai addressing [5].  The main
  478.       difference here is that n-level kampai results in non-contiguous
  479.       masks, while 2-level does not.  In the description of kampai
  480.       addressing in [5], g-bits are called a-bits, h-bits are called
  481.       g-bits, and s-bits are called i-bits.
  482.  
  483.    2.2  An Example
  484.  
  485.    For this example, we assume a class C network, so we will only need
  486.    to work with 8 bits.  We start with 3 subnets, A, B, and C.  Our
  487.    nomenclature is h for h-bit and g for g-bit.  Note that h-bits can be
  488.    one or zero, but g-bits are all zero.  The remaining bits are s-bits,
  489.    but are shown as 1's and 0's according to the subnet number
  490.    assignment.  The space is just to make the addresses and masks easier
  491.    to read.  Finally, we number our bits 0 to 7 from right to left as
  492.    shown below.
  493.  
  494.         Subnet  Address         Mask
  495.         A       10gg ghhh       1111 0000
  496.         B       01gg ghhh       1111 0000
  497.         C       110g ghhh       1111 0000
  498.             bit 7       bit 0
  499.  
  500.    We see that each subnet has at most 6 hosts (because of the three h-
  501.    bits).  Notice that we have chosen the masks so that there is room
  502.    for growth in both hosts and subnets without requiring a mask change.
  503.  
  504.  
  505.  
  506. Tsuchiya                                                        [Page 9]
  507.  
  508. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  509.  
  510.  
  511.    However, we have generally allowed for more growth in subnets than in
  512.    hosts because adding new subnets can cause mask changes in existing
  513.    subnets, while adding new hosts in a subnet only causes that subnet's
  514.    mask to change.
  515.  
  516.    Further, if a subnet's mask must change, but not all hosts are
  517.    reconfigured at the same time, then it is less damaging if the not
  518.    yet reconfigured hosts have too large a mask (too many ones) than if
  519.    they have too small a mask.  This is because with too large a mask, a
  520.    host may think that another host which is in fact on the subnet is on
  521.    another subnet.  In this case, the host will send packets to the
  522.    gateway, and will be redirected to the host.
  523.  
  524.    However, with too small a mask, a host may think that another host
  525.    which is in fact not on the subnet is on the subnet, and will ARP for
  526.    that host but receive no reply.  (Note that broadcasts may fail if
  527.    all masks do not match.)
  528.  
  529.    Finally, notice that subnet C requires three s-bits instead of just
  530.    two.  This is because with just two, the subnet address of C could be
  531.    "11" (rather than "110"), which is a broadcast value.  Step 2 of
  532.    AddSubnet checks for this case.
  533.  
  534.    Now, a fourth subnet, D, also with 6 hosts, is added.  We get:
  535.  
  536.         Subnet  Addr            Mask
  537.         A       10gg ghhh       1111 0000
  538.         B       01gg ghhh       1111 0000
  539.         C       110g ghhh       1111 0000
  540.         D       001g ghhh       1111 0000
  541.  
  542.    Notice that none of the original subnets required a change in any of
  543.    their status bits.  This is because, when D compared its subnet
  544.    number with the others (step 5 of AddSubnet(), using the s-mask),
  545.    they were all different.  In other words, a router would be able to
  546.    distinguish an address in D from addresses in A, B, and C.
  547.  
  548.    Next, a fifth subnet, E, is added.  We get:
  549.  
  550.         Subnet  Addr            Mask
  551.         A       100g ghhh       1111 0000
  552.         B       01gg ghhh       1111 0000
  553.         C       110g ghhh       1111 0000
  554.         D       001g ghhh       1111 0000
  555.         E       101g ghhh       1111 0000
  556.  
  557.    Notice that this time, A was forced to change its leftmost g-bit (bit
  558.    5) into an s-bit, because bit 5 is needed to distinguish subnet A
  559.  
  560.  
  561.  
  562. Tsuchiya                                                       [Page 10]
  563.  
  564. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  565.  
  566.  
  567.    from subnet E (step 511 of AddSubnet()).  Changing bit 5 into an s-
  568.    bit prevents hosts from being added to A to the point where bit 5
  569.    would be changed into a one (that is, step 5 of AddHost() would
  570.    fail).
  571.  
  572.    Notice also that if the masks in A, B, and C were originally set to
  573.    1100.0000, then the addition of E would have caused A's mask to
  574.    change to 1110.0000 (Step 512 of AddSubnet()).
  575.  
  576.    Next, 8 hosts each are added to subnets A and C, thus causing the
  577.    right-most g-bit in each to change to an h-bit.
  578.  
  579.         Subnet  Addr            Mask
  580.         A       100g hhhh       1111 0000
  581.         B       01gg ghhh       1111 0000
  582.         C       110g hhhh       1111 0000
  583.         D       001g ghhh       1111 0000
  584.         E       101g ghhh       1111 0000
  585.  
  586.    Notice again that no masks have changed.  If the masks for A, B, and
  587.    C were originally set to 1111 1000, then they would have required
  588.    changing (step 62 of AddHost()).
  589.  
  590.    Next, enough hosts are added to subnet B that all of its remaining
  591.    g-bits become h-bits.
  592.  
  593.         Subnet  Addr            Mask
  594.         A       100g hhhh       1111 0000
  595.         B       01hh hhhh       1100 0000
  596.         C       110g hhhh       1111 0000
  597.         D       001g ghhh       1111 0000
  598.         E       101g ghhh       1111 0000
  599.  
  600.    Notice here that the masks in B's subnet had to be changed to
  601.    accommodate the new h-bits (step 62 of AddHost()).  Notice also that
  602.    if the person assigning host addresses for B (B Address Authority, or
  603.    BAA) is different than the person assigning network numbers (RootAA),
  604.    then BAA must coordinate the change of its last g-bit to an h-bit
  605.    with the RootAA.  This allows the RootAA to properly assign
  606.    additional subnet numbers, as in the next step, where we add another
  607.    subnet F:
  608.  
  609.         Subnet  Addr            Mask
  610.         A       100g hhhh       1111 0000
  611.         B       01hh hhhh       1100 0000
  612.         C       110g hhhh       1111 0000
  613.         D       001g ghhh       1111 0000
  614.         E       101g ghhh       1111 0000
  615.  
  616.  
  617.  
  618. Tsuchiya                                                       [Page 11]
  619.  
  620. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  621.  
  622.  
  623.         F       1110 ghhh       1111 0000
  624.  
  625.    Notice that F received subnet number 1110 rather than subnet number
  626.    011 (which is what comes after 101 in MI counting).  The reason is
  627.    that 1) 011 is not distinguishable from B's subnet address using B's
  628.    mask, and 2) we can't increase B's mask to make it distinguishable
  629.    because B has already assigned hosts at bit position 5.  In other
  630.    words, when the comparison of step 1 in AddSubnet() was tried on
  631.    number 011, the two values were equal, and so the next number was
  632.    tried.  In fact, no subnet numbers with 01 in bit positions 7 and 6
  633.    can be assigned (unless B loses hosts).
  634.  
  635.    Next, subnet E is removed:
  636.  
  637.         Subnet  Addr            Mask
  638.         A       10gg hhhh       1111 0000
  639.         B       01hh hhhh       1100 0000
  640.         C       110g hhhh       1111 0000
  641.         D       001g ghhh       1111 0000
  642.         F       1110 ghhh       1111 0000
  643.  
  644.    Notice that this caused subnet A to change an s-bit back into a g-
  645.    bit.  This is because the equality of step 33 of RemoveSubnet() did
  646.    not hold true for subnet A with respect to the remaining subnets.
  647.  
  648. References
  649.  
  650.    [1] Braden, R., "Requirements for Internet Hosts -- Communication
  651.        Layers", RFC 1122, USC/Information Sciences Institute, October
  652.        1989.
  653.  
  654.    [2] Mogul, J., and J. Postel, "Internet Standard Subnetting
  655.        Procedure", RFC 950, USC/Information Sciences Institute, August
  656.        1985.
  657.  
  658.    [3] Moy, J., "OSPF Specification", RFC 1131, Proteon, October 1989.
  659.  
  660.    [4] Postel, J., "Internet Control Message Protocol", RFC 792,
  661.        USC/Information Sciences Institute, September 1981.
  662.  
  663.    [5] Tsuchiya, P., "Efficient and Flexible Hierarchical Address
  664.        Assignment", TM-ARH-018495, Bellcore, February 1991.
  665.  
  666.    [6] Hedrick, C., "Routing Information Protocol" RFC 1058, Rutgers
  667.        University, June 1988.
  668.  
  669.    [7] Braden, R., and J. Postel, "Requirements for Internet Gateways",
  670.        RFC 1009, USC/Information Sciences Institute, June 1987.
  671.  
  672.  
  673.  
  674. Tsuchiya                                                       [Page 12]
  675.  
  676. RFC 1219          On the Assignment of Subnet Numbers         April 1991
  677.  
  678.  
  679. Security Considerations
  680.  
  681.    Security issues are not discussed in this memo.
  682.  
  683. Author's Address
  684.  
  685.    Paul F. Tsuchiya
  686.    Bellcore
  687.    435 South St.5 South St.
  688.    MRE 2L-281
  689.    Morristown, NJ 07960
  690.  
  691.    Phone: 201 829-4484
  692.  
  693.    EMail: tsuchiya@thumper.bellcore.com
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. Tsuchiya                                                       [Page 13]
  731.