Consider ip subnet zero?

Hi all,

I have come across this question on the website and i am trying to relate the knowledge that i have learned from networklessons.com. However , i having issue to understand the why the Answer is B instead of C. I am afraid that there is a concept that I misunderstand.

Q: Come up with a subnet mask that allows all three web servers to be on the same network while having the maximum number of subnets. Which network address and subnet mask should you use?

A. 192.168.252.0 255.255.255.252
B. 192.168.252.8 255.255.255.248 *
C. 192.168.252.8 255.255.255.252
D. 192.168.252.16 255.255.255.240
E. 192.168.252.16 255.255.255.252

I thought was C was my final answer because according to what i’ve learned, I should use the block size of 4 since it caters to 3 subnet/host. Using the formula 256-4 = 252 therefore the subnet mask should be 255.255.255.252 or /30.

So it will goes something like this :

Subnet 1 :
network address: 192.168.252.8
first host: 192.168.252.9
last host: 192.168.252.10
broadcast address: 192.168.252.11

Subnet 2 :
network address: 192.168.252.12
first host: 192.168.252.13
last host: 192.168.252.14
broadcast address: 192.168.252.15

Subnet 3 :
network address: 192.168.252.16
first host: 192.168.252.17
last host: 192.168.252.18
broadcast address: 192.168.252.19

That’s it. Is there any problem on my working ?

Any help will be appreciated, thanks !

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.

One more thing, given the title of the question “subnet zero.”

The concept of using subnet zero (which is on by default with Cisco now) is different than being allowed to use the subnet identifier address.

To understand Subnet Zero, there is a great discussion on it here:
https://learningnetwork.cisco.com/thread/32136

I will paste in Keith Barker’s explanation below:

Lets consider this class A network, with a custom mask:

50.0.0.0/10

Possible subnets are:
50.0000 0000.x.x (first subnet)
50.0100 0000.x.x
50.1000 0000.x.x
50.1100 0000.x.x (last subnet)

A long time ago, it was not allowed to use the all 00 (the first subnet above, also called “subnet zero”) subnet, as the subnet bits were all zeros. In that same thinking, it was not allowed to assign (or use) a subnet where all the subnet bits were all 1’s, such as the last subnet above.

The “subnet-zero” command really should be called:

“Go ahead and use the all zeros and all ones subnets (first and last)” but I suppose that would have been too big of a command.

The subnet-zero would allow 4 subnets above to be used instead of just 2. This command is the default on current IOS, and doesn’t need to be added to the configuration.

Here is an example. Without the use of the subnet-zero, it won’t allow us to assign an IP address in the first subnet (subnet zero):

R1(config)#no ip subnet-zero
R1(config)#int loopback 1
R1(config-if)#ip address 50.0.0.1 255.192.0.0
Bad mask /10 for address 50.0.0.1

If we add the subnet-zero command back into the configuration, now it allows an IP address to be assigned from that subnet:

R1(config)#ip subnet-zero
R1(config)#int loopback 1
R1(config-if)#ip address 50.0.0.1 255.192.0.0

Best wishes,

Keith

you really saved my day, thanks andrew !