How to find the total number of subnets available for one subnet mask?.
For example, take this subnet mask:
255.255.255.224
and IP address as 192.168.5.139
, book shows that there are 6 subnet for the given subnet mask, ranging from 192.168.5.32
to 192.168.5.192
, how 6 ?
I tried to solve it like this 2^3 = 8 and 8-2 = 6 But I thought that we should subtract 2 only when we find number of hosts (because of network ID and Broadcast).
Why do we subtract 2 for subnets?
Best Answer
If a network address is subnetted, the first subnet obtained after subnetting the network address is called subnet zero and the last subnet obtained is called the all-ones subnet.
In your example:
Network: 192.168.5.0
Subnet Mask: 255.255.255.224
Subnets:
Traditionally, it was strongly recommended that subnet zero and the all-ones subnet not be used for addressing.
According to RFC 950 from 1985:
Remember that this is a 1985 recommendation. More than 30 years have passed from then.
Using subnet zero for addressing is discouraged because of the confusion inherent in having a network
(192.168.5.0)
and a subnet(192.169.5.0)
with indistinguishable addresses, and the all-ones subnet for the confusion inherent in having a network and a subnet with identical broadcast addresses(192.168.5.255)
.This recommendation was overruled in 1995 by RFC-1878 and RFC-1812. So, nowadays we can use all the subnets and the devices' hardware /software support it.