Calculates the optimal prefix length for subdividing a CIDR block to accommodate a given number of subnets.
The CIDR block to subdivide
The number of subnets needed
The optimal new prefix length
If the CIDR is invalid or can't accommodate the requested number
Calculates the optimal prefix length for subdividing a CIDR block to accommodate a given number of subnets.