how to calculate subnet bits from ip address with CIDR