# ip subnet-zero question

• posted

For Classless Subnetting as opposed to classfull subnetting. If I'm understanding this right, to find the number of Subnets in a specific Subnet address, the formula, 2 to the power of (number of masked bits) - 2 = Number of Subnets should now be 2 to the power of (number of masked bits) -1 = Number of Subnets. /26 or 192 = 3 Subnets not 2 /27 or 224 = 7 Subnets not 6

240 = 15 and so on.

For host, there can be no one simple formula anymore, for the number of additional host would be determined by the block size - 2, /28 would add 14 additional hosts, /26 would add 62 and so on.

Nooo?????????

• posted

There is no such thing as Classless or Classful subnetting!!

Subnetting (and VLSM and CIDR) is by itself classless addressing because you don't use the classful masks /8, 16 or /24 (class A,B and C respectively) anymore.

It used to be considered unwise to use the all-zeroes (Zero Subnet) and all-ones (Broadcast Subnet) subnets as certain hosts might not be able to differentiate a classful network from a classless one, especially when making decisions related to routing (e.g. 191.1.65.0 /24 and

191.1.65.0 /28 might have appeared to be the same and could confuse some hosts) but nowadays (as we are running out of IP address space) it's a norm to use these 2 subnets. On the Cisco IOS the `ip subnet-zero` command primarily forces the Layer 3 device to be watchful of the Zero-subnet and not confuse it with the zero-subnet's major/classful network, in addition it allows you, the administrator, to implement and make use of the Zero and broadcast subnets.

Let's quickly go over the calculation of subnets and hosts.

The value of X is the Number of bits in the network portion (Classful Prefix). i.e. The value of X for a Class A Network - 8 The value of X for a Class B Network - 16 The value of X for a Class C Network - 24

The value of N is the number of subnet bits, remember to count N from the classful boundary of the class of that network. e.g. In 101.7.45.0/29, N is 21. In 172.18.222.208/28, N is 12. In 191.1.23.0 /25, N is 1.

The formula to calculate # of subnets = (2 ^ N)-2 (no ip subnet-zero) The formula to calculate # of subnets = 2 ^ N (ip subnet-zero) The formula to calculate # of subnets = 2 ^ (32-X+N) (stands the same regardless of the state of the `ip subnet-zero` command).

The number of hosts avialable in Network 172.18.216.208/28 is 14 (as you would expect) but the number of subnets is 4094 (4096*) (172.18.0.0 is class B network here and the value of N is actually 12).

The number of hosts available in network 101.7.45.0/29 is 6 and number of subnets is actually 2,097,150 (2,097,152*) because N is 21.

In case you wish to know more about classless addressing, the following RFCs might be of use.

- Internet Standard Subnetting Procedure.