I believe that there is some confusion about the formula 2n -2. This formula is accurately applied to calculate the number of hosts in a subnet given the number of subnet bits.
That formula is also frequently used in calculating the number of subnets when subnetting. But the formula is really not accurate for that purpose. Many people state that it is to exclude the all zero subnet and the all one subnet. The all zero subnet is what is involved with subnet zero. In very old IOS the default was to not use subnet zero. And the subnet-zero command was invented to allow it to be used. For a long time the default has been to allow the use of subnet zero by default.
And the all one subnet has always been allowed. The IOS has never prevented use of the all one subnet.
sorry i didnt get it i m taking this example as reference
network is 172.16.0.0/16 it is subnetted with 3 bits so now we have 172.16.0.0/19 and these are the subnets
now it is saying that we used to subtact 2 i.e all zero subnet and all ones subnet
all zero subnet -> 172.16.0.0/19
all ones subnet -> 172.16.224.0/19
but on router when i disable ip subnet zero by no ip subnet-zero i m not able to use 172.16.0.0/19 but i can use 172.16.224.0/19 why is that so ??? why did cisco allowed all ones subnet ? were they always allowed ? if not then why can i use them even after disabling subnet zero
Hi,all 1 subnet creates confusion when directed broadcast was used.For example if you receive a packet with destination ip 172.16.255.255, where will you broadcast it? to 172.16.0.0/16 or 172.16.224.0/19 ?
But this is no longer an issue in a classless environment.In classless environment we least bother about classes and all we bother about is prefix/mask.
Both all 0 and all 1 subnets are no longer an issue in classless environment.
Hope this helps.
My previous response very clearly states that Cisco has always allowed the use of the all ones subnet. This has never been a problem in IOS. People do sometimes make the point about possible confusion with directed broadcast as a reason to avoid using the all ones subnet. But IOS has never had any rule or policy that the all ones subnet was not allowed. It has always worked - and it has nothing to do with subnet-zero (as you have discovered).