On Feb 22, 2007, at 4:13 AM, Ralph Shumaker wrote:
Then why would one use /27:
(same host)
12.169.40.36
00001100 10101001 00101000 00100100 - 12.169.40.36 - host
11111111 11111111 11111111 11100000 - /27 netmask (if I got it)
----------------------------------- - bitwise AND the two together
00001100 10101001 00101000 00100000 - 12.169.40.32 ???
Since the last 5 bits will always AND to zeros, does this mean that
12.169.40.0 through 12.169.40.31 all belong to 12.169.40.36 /27?
The whole point of CIDR (Classless Internet Domain Routing, i think)
is to be able to divvy out portions of network space smaller than a
Class C.
Running your example through a nifty tool called 'ipcalc' (which has
seen multiple variations, but this one is a perl script I got off
sourceforge a couple years ago):
[EMAIL PROTECTED](ttyp1):~ 23 % ipcalc 12.169.40.36 27
Address: 12.169.40.36
Address: 00001100.10101001.00101000.001 00100
Netmask: 255.255.255.224 == 27
Netmask: 11111111.11111111.11111111.111 00000
=>
Network: 12.169.40.32/27 (Class A)
Network: 00001100.10101001.00101000.001 00000
Broadcast: 12.169.40.63
Broadcast: 00001100.10101001.00101000.001 11111
HostMin: 12.169.40.33
HostMin: 00001100.10101001.00101000.001 00001
HostMax: 12.169.40.62
HostMax: 00001100.10101001.00101000.001 11110
Hosts: 30
So, your math was a bit off. But, a /27 is a 32-address span. In
any network, though, you lose three addresses right off the top: The
lowest address (in this case, .32) is the network address. The
highest (.63) is the broadcast address.
The third address is whichever one you assign to be the gateway/
router for the subnet. Convention strongly suggests either the
lowest or highest useable host address, either .33 or .62 in this case.
The smallest subnet you can have is a /30, with 4 addresses: network,
two hosts, and broadcast. Given that one of your addresses has to be
a router, you end up with only a single usable host IP address. So,
for one host, you end up carving out 4 IP addresses. This is why
most Cable Internet providers simply give you DHCP addresses for your
hosts on a very large subnet. For example, my router at home (Cox
Internet):
[EMAIL PROTECTED](ttyp2):~ 23 % ipcalc 68.111.245.13 22
Address: 68.111.245.13
Address: 01000100.01101111.111101 01.00001101
Netmask: 255.255.252.0 == 22
Netmask: 11111111.11111111.111111 00.00000000
=>
Network: 68.111.244.0/22 (Class A)
Network: 01000100.01101111.111101 00.00000000
Broadcast: 68.111.247.255
Broadcast: 01000100.01101111.111101 11.11111111
HostMin: 68.111.244.1
HostMin: 01000100.01101111.111101 00.00000001
HostMax: 68.111.247.254
HostMax: 01000100.01101111.111101 11.11111110
Hosts: 1022
Cox uses a /22 for our network node, and, to my recollection, has a 1
IP per house policy, with additional IPs being an additional cost
item on the bill. To preserve as many IP addresses as possible, they
lump the whole neighborhood into that /22 instead of giving each home
a /30 for a colossal savings in IP addresses.
How networks are subnetted is primarily an implementation issue for
the network provider.
Now, did I actually succeed in answering your question, or just throw
a lot of information at you? :)
Gregory
--
Gregory K. Ruiz-Ade <[EMAIL PROTECTED]>
OpenPGP Key ID: EAF4844B keyserver: pgpkeys.mit.edu
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list