def METHOD_NAME(target_size):
    aws_reserved_ip = 6
    min_bitmask = 28
    subnet_bitmask = min(32 - ((next_power_of_2(target_size + aws_reserved_ip) - 1).bit_length()), min_bitmask)
    subnet_size = 2 ** (32 - subnet_bitmask)
    return subnet_size, subnet_bitmask