[Techtalk] sub/super-netting

Malcolm Tredinnick malcolm at commsecure.com.au
Wed May 1 16:27:38 EST 2002


On Wed, May 01, 2002 at 11:42:34AM +0600, kansas_kennedy at phreaker.net wrote:
> My questions are on the area of subnet masking and super netting.
> 
> If say, I have an address 203.191.0.0/8. From here I can tell that this 
> class C address has been fitted into a large network where 203 is the 
> network and 191.0.0 to 254.255.255 can be assigned as host to the network 
> 203.

That's not exactly correct. The '/8' portion of the address says that
the top eight bits of the IP address specify the network address. So
203.191.0.0/8 is part of the network spanning 203.0.0.0 to
203.255.255.255.

Also, class C network addresses (192.0.0.0 through to 223.255.255.0)
historically have the top 24 bits fixed, but are usually subnetted to
have less than 254 hosts per network.

> Now, my question is can we, by looking at this simple address, tell 
> how many maximum hosts can be assigned to this address?

In the example you mentioned, the network address is 203.0.0.0, the
broadcast address is 203.255.255.255, all other addresses are available
for hosts. So the number is 256 * 256 * 256 - 2 = 16777214 hosts.

> Also, 172.16.26.32 has a mask of 255.255.255.254 can also be written as 
> /27. I can't seem to find the correlation.

This isn't correct. An IP that is written 172.16.26.32/27 would be on a
network with a netmask of 255.255.255.224 (not 254). You can work this
out by writing out the binary number 11111111 11111111 11111111 11100000
(which I have split up into groups of eight). This the number with the
top 27 bits set to one (unless I have made a typo).

Then, converting each group of eight bits to decimal, we get three 255's
and a 224.

Continuing this on a bit: Since 32 is 00100000 in binary and we know
that the top 27 bits are the network address in this example, we can see
that on this network:

	172.16.26.32 == network address.
	172.16.26.63 == broadcast address (all host bits set to 1).
	172.16.26.33 -> 172.16.26.62 == host machine addresses.

The trick here is to see that you can only fiddle with the bottom five
bits of the last octet when you are assigning addresses on the
172.16.26.32/27 network. So the network address is when those bits are
all zero, the broadcast address is when they are all 1's and the
intervening addresses are the host addresses.

> Again, a broadcast address has 255 in the host part of the address.

Only when you are on a /8, /16 or /24 network. The example above shows a
case of a broadcast address where the last byte is 63.

> Packets send to the broadcast address reaches every address under that
> network.

Without wanting to seem overly pedantic, this may not be true if, for
example, your switch is set up to reject broadcast messages. However in
a "pure setup" it is true (although I can't right now find the RFC that
says this).

> Does it mean that if I send a mail to a 203.127.255.255 then
> this will reach every user of NetID 203.127?

No. Almost every mail system is setup to reject messages sent to the
broadcast address. Otherwise too many accidents happen.

> As till my understanding the unicast address is the address assigned to a 
> single host in a network and it can be static or dynamic IP and multicast 
> address is assigned to a group of pc's.

Essentially correct. Although I would rather see that the multicast
address is a synonym for every IPv4 address on that particular network.

> like the accounting department has 
> been assigned 203.127.137.0 to 203.127.137.255. Is this correct?

If you are wanting a multicast address that would just reach the
accounting department, then they would need to have a netmask of
255.255.255.0 (or /24). If you are using a network address of
203.0.0.0/8, as at the start of your mail, then 203.127.137.255 would
just be another host on the network.

I truly hope I haven't made this more complicated than necessary. No
doubt any gross blunders will be corrected by others anyway.

Cheers,
Malcolm

-- 



More information about the Techtalk mailing list