How to summarize and how to get the network given a host address.

Discussion in 'Cisco' started by ws00sw, Mar 2, 2005.

  1. ws00sw

    ws00sw Guest

    Hello People, very sorry for this kind of question,
    I was browsing at google for this question (you know cheats on how to
    summarize or to get the network of a given host address) with no luck.

    Is there any way of doing this with out the rule 128 64 32 16 8 4 2 1

    Many Thanks in advance for any information
    Regards.
    ..
     
    ws00sw, Mar 2, 2005
    #1
    1. Advertisements

  2. :I was browsing at google for this question (you know cheats on how to
    :summarize or to get the network of a given host address) with no luck.

    :Is there any way of doing this with out the rule 128 64 32 16 8 4 2 1

    In the case where you are given an IP address which is known to
    be a host address, and you need to know what the smallest enclosing
    subnet is, then there is a simple formula. See
    http://groups.google.ca/groups?selm=bvgul4$okj$
     
    Walter Roberson, Mar 2, 2005
    #2
    1. Advertisements


  3. What specificly are you trying to get?

    With CIDR (valid on the Internet for at least the last dozen years),
    you have to know the IP address and mask (ie. you could split a /24
    into one /25, one /26, three /28's & two /29's).

    To get the "network" of the block, the easiest way would be to treat
    the IP address and mask as 32-bit numbers, and logically AND the IP
    and mask together, and the result is your IP network value.

    After a while, you get to learn to just see the natural boundries, or
    have a cheat chart around showing you the different breaks.

    There's plenty of IP address calculators around on the net too.
     
    Doug McIntyre, Mar 2, 2005
    #3
  4. ws00sw

    Brad Guest

    That doesn't really answer the original question since the mask is
    never sent with the IP address (excluding classless routing updates).
     
    Brad, Mar 2, 2005
    #4
  5. ws00sw

    ws00sw Guest

    Thanks to all, but I cannot use any IP Subnet Calculators...
    For example: I need to summarize these CIDR Blocks 216.0.0.0/16,
    216.2.0.0/16, 216.3.0.0/16, 216.5.0.0/16, 216.6.0.0/16,216.7.0.0/16...
    See that there are no continuos addresses in the CIDRs Blocks, how can
    you do that???
     
    ws00sw, Mar 2, 2005
    #5
  6. On 02.03.2005 22:03 wrote
    Have a look at aggregate (http://osx.freshmeat.net/projects/aggregate/)
    For a given set of prefixes it gives you the smallest set of prefixes
    aggergating as much as possible.



    Arnold
     
    Arnold Nipper, Mar 2, 2005
    #6
  7. ws00sw

    ws00sw Guest

    Also for example.....

    I have this host address 116.15.63.0 that is a valid host address of
    the network 116.15.62.0/23
    But I had to do the
    128 64 32 16 8 4 2 .. 1
    62 0 0 0 1 1 1 1 .. 0 (this is the network ..)
    63 0 0 0 1 1 1 1 .. 1 (This is a Host Address for
    that Network)

    But i'm looking to do it in a faster way, and not to do the Bit
    conversion....
     
    ws00sw, Mar 2, 2005
    #7
  8. ws00sw

    ws00sw Guest

    Sorry Arnold I wish to know how to do it with out any application..

    BTW Thanks, I will use it as a comprobation tool...
     
    ws00sw, Mar 2, 2005
    #8
  9. :For example: I need to summarize these CIDR Blocks 216.0.0.0/16,
    :216.2.0.0/16, 216.3.0.0/16, 216.5.0.0/16, 216.6.0.0/16,216.7.0.0/16...
    :See that there are no continuos addresses in the CIDRs Blocks, how can
    :you do that???

    Start with the lowest address, and mentally propose a mask, and
    mentally find the last IP implied by the low IP and the mask. If the
    high IP would include a block that is not on the list, then your mask
    is too big, so take the next smallest and try again. If the low to high
    range includes only IPs listed in the CIDR list, look to see if the
    next IP is in the list as well: if it is, mentally try the next larger
    mask. Repeat and eventually you would have a mask which includes as
    many elements of the CIDR as possible without including anything not in
    the list ; write that IP and mask down and remove those elements from
    the list and repeat for the new smallest IP.

    In the above, example, one would start with 216.0.0.0/16 and mentally
    propose (say) /15. The high IP implied by that would be 216.1.255.255
    so the low to high range includes IPs (216.1.*.*) that are not in the
    CIDR list, so leave the mask at /16, write that and 216.0.0.0/16
    down, and remove 216.0.0.0/16 from list. The new low element would be
    216.2.0.0/16. Try /15 again. The high IP for it would be 216.3.255.255
    and everything from 216.2.0.0 to 216.3.255.255 is covered by one of
    the CIDR. So try the next bigger mask, /14. The high IP implied
    by that would be 216.5.255.255, but the range 216.2.0.0 to 216.5.255.255
    include some IPs, 216.4.*.* that are not on the CIDR list. So go
    back to /15, mark down 216.2.0.0/15 and remove 216.2.0.0/16 and
    216.3.0.0/16 from the CIDR list. Now, 216.5.0.0/16 is the first on
    the list. If you were to try 216.5.0.0/15 then the base IP would be
    216.4.0.0 which is not on the list, so you know you have to keep /16.
    Then 216.6/16 and 216.7/16 merge to 216.6/15 . Final list:
    216.0/16, 216.2/15, 216.5/16, 216.6/15
     
    Walter Roberson, Mar 2, 2005
    #9
  10. :I have this host address 116.15.63.0 that is a valid host address of
    :the network 116.15.62.0/23
    :But I had to do the
    : 128 64 32 16 8 4 2 .. 1
    : 62 0 0 0 1 1 1 1 .. 0 (this is the network ..)
    : 63 0 0 0 1 1 1 1 .. 1 (This is a Host Address for
    :that Network)

    :But i'm looking to do it in a faster way, and not to do the Bit
    :conversion....

    You pretty much can't get away without -some- bit conversion.
    You will need to learn to recognize the major boundaries within one
    byte. Even if you only memorize a few of them such as
    32, 64, 96, 128, 192, 224 then you can zero in to the exact boundary
    with only a few mental steps (at most 5 in this case).
     
    Walter Roberson, Mar 2, 2005
    #10
  11. ws00sw

    ws00sw Guest

    Thanks Walter, I will buy your bits ;)
     
    ws00sw, Mar 3, 2005
    #11
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.