Consider ip subnet zero?

Hi Qifeng,
You will often see questions like this on a test because they are good at probing whether you know all the rules of the game. In the case, the correct answer is, in fact, B. The reason is because you didn’t account for what’s called the network address or subnet identifier. Every subnet has two IP addresses that can’t be assigned to hosts: 1) the subnet identifier and 2) the broadcast address.

It is easier to understand when looking at it in terms of a network range that is more common. Let’s say 192.168.1.0/24. In this network, it would look strange indeed to try to assign an IP of 192.168.1.0 to a machine, right? Just as it would if you tried to use 192.168.1.255. That’s because those are the subnet identifier and broadcast address respectively.

I am more of a math guy, so let me tell you my trick to figuring out subnetting. It requires no calculators, no pieces of paper, and no converting to binary. The key is to remember this formula:
N = 2^X - 2
This reads as N equals to the Xth power minus two. N is the number of hosts or networks you are trying to subnet, while X is the number of bits in the subnet mask you need to reserve. X must be a whole number, and it is rounded up. Notice the minus two part of the formula. This accounts for the broadcast address and subnet mask.

Let’s apply that formula to your problem specifically. You have been asked to create a subnet that allows for 3 usable addresses that has the largest number of subnets possible. In this case, N = 3, and you want to solve for X. So …

(2^X) - 2 = 3. Next,
2^X = 5.

Now ask yourself, 2 to what power equals 5? 2 is too low (because it is 4), while 3 is too high (because it is 8). Remember, that X must be a whole number rounded up. This leaves up with no choice but to choose that X = 3.

Knowing that X = 3 let’s us do two things right away. 1) We know what the slash notation of the mask is (32 - 3 = 29), so it would be /29. 2) Since we know that 2 ^3 = 8, we know the mask which is 256 - 8 = 248.

I hope that helps.