:: Re: [DNG] Request for information -…
Top Page
Delete this message
Reply to this message
Author: Rainer Weikusat
Date:  
To: dng
Subject: Re: [DNG] Request for information - - re: networking
o1bigtenor via Dng <dng@???> writes:

[...]

>> That IP space is similar to 192.168.0.0/16 in being an agreed
>> "private" address space, although 16 times larger address space.
>
> So if I wanted I could have 192.168.0.0/12 and I have the same address
> space as in 172.16.x.x/12?


Not within the RFC1918 network, because 16 > 12: Any address from the
192.168/16 network will always start with 0xc0a80000. But you can put
65534 different hosts onto this network (both 192.168.0.0 and
192.168.255.255 are reserved addresses). A /12-network would mean
1,048,574 different hosts.

The following Perl one-liner will calculate and print the number of host
addresses for a certain prefix length passed as first argument:

perl -E 'say((1<<(32-$ARGV[0]))-2)'

eg

[rw@doppelsaurus]~#perl -E 'say((1<<(32-$ARGV[0]))-2)' 17
32766