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

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

ws00sw
Guest
Posts: n/a

 03-02-2005
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.
..

Walter Roberson
Guest
Posts: n/a

 03-02-2005
In article <(E-Mail Removed)> ,
ws00sw <(E-Mail Removed)> wrote:
: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
--
Would you buy a used bit from this man??

Doug McIntyre
Guest
Posts: n/a

 03-02-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) (ws00sw) writes:
>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

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

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.

Guest
Posts: n/a

 03-02-2005

ws00sw@gmail.com
Guest
Posts: n/a

 03-02-2005
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???

Arnold Nipper
Guest
Posts: n/a

 03-02-2005
On 02.03.2005 22:03 (E-Mail Removed) wrote

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

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, AN45

ws00sw@gmail.com
Guest
Posts: n/a

 03-02-2005
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@gmail.com
Guest
Posts: n/a

 03-02-2005
Sorry Arnold I wish to know how to do it with out any application..

BTW Thanks, I will use it as a comprobation tool...

Walter Roberson
Guest
Posts: n/a

 03-02-2005
In article <(E-Mail Removed) .com>,
<(E-Mail Removed)> wrote:
: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???

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.

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
--
Warhol's Second Law of Usenet: "In the future, everyone will troll
for 15 minutes."

Walter Roberson
Guest
Posts: n/a

 03-02-2005
In article <(E-Mail Removed). com>,
<(E-Mail Removed)> wrote:
: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).
--
Live it up, rip it up, why so lazy?
Give it out, dish it out, let's go crazy, yeah!
-- Supertramp (The USENET Song)