Home / Configuration Tips / Subnet-Zero and All-Ones-Subnet explained

Subnet-Zero and All-Ones-Subnet explained

The Subnetting is used to partition a network into sub-networks (also called subnets) that are smaller in terms of addressing space. The first and the last subnets calculated during the subnetting process follow special rules that we are going to present.

As example let’s use the subnetting of Class-A IP address 80.0.0.0/11 that gives 8 sub-networks:

Subnet #SubnetFirst Usable IPLast Usable IPBroadcast
080.0.0.080.0.0.180.31.255.25480.31.255.255
180.32.0.080.32.0.180.63.255.25480.63.255.255
280.64.0.080.64.0.180.95.255.25480.95.255.255
380.96.0.080.96.0.180.127.255.25480.127.255.255
480.128.0.080.128.0.180.159.255.25480.159.255.255
580.160.0.080.160.0.180.191.255.25480.191.255.255
680.192.0.080.192.0.180.223.255.25480.223.255.255
780.224.0.080.224.0.180.255.255.25480.255.255.255

If you are not familiar on how to calculate the subnetting presented in the table above, you might want to have a look at our Easy Subnetting Technique that allows to solve any subnetting problem in less than a minute.

All-Zeros-Subnet (Subnet-Zero)

The first subnet that we obtain from the subnetting process, that is 80.0.0.0, is called All-Zeros-Subnet or Subnet-Zero because in the IP address all the bits in the subnet field are set to ‘0’. If we convert from decimal to binary, we obtain the following:

80.0.0.0 = 01010000.00010100.00010100.00010100

The three bits highlighted in red are the ones “stolen” from the host field and used to create the subnet field. As we can see, in the Subnet-Zero they are all set to the value zero.

All-Ones-Subnet

The last subnet calculated through the subnetting is called All-Ones-Subnet because all the bits are set to ‘1’. From the table above the last subnet is 80.224.0.0 which converted in binary:

80.224.0.0 = 01010000.11100000.00000000.00000000

The three bits highlighted in red are the ones “stolen” from the host field and used to create the subnet field. As we can see, in the All-Ones-Subnet they are all set to the value one.

Problems using All-Zeros/All-Ones Subnets

Traditionally it was strongly recommended avoiding the use of all-zeros-subnet and all-ones-subnet for addressing, as indicated in the RFC-950 where the subnetting rules are defined. For this reason, in the calculation of the available subnets, those sub-networks can’t be used. For example, in the above table we have 3 bits for the subnet field so 2^3 possible subnets, from which we need to subtract the 2 unusable networks: ((2^3) – 2) = 6 available subnets.

Besides recommendations, the whole IP addressing space has always been usable so it was the System Administrator responsibility ensuring the correct use. The RFC-1878 states that all modern software need to be able to use all the possible subnets, so there no more necessity of avoiding the all-zeros-subnet and all-ones-subnets.

Also RFC-1812 now permits the utilisation of the all-zeros and all-ones subnets in a CIDR compliant network architecture. Modern routing protocols do not have a problem with the all-zeros and all-ones subnets.

The use of the subnet zero for addressing was discouraged because of the confusion when having a network and a subnet with indistinguishable addresses.

The use of the all-ones subnet for addressing was discouraged in the past because of the confusion when having a network and a subnet with identical broadcast addresses.

Advertisement

Modern hardware has no problem with the all-zeroes or all-ones subnets, but some very old hardware might get you in trouble.

Router configuration example

In Cisco IOS there is a command to deal with subnet-zero:

ip subnet-zero

Before Cisco IOS version 12, the use of zero subnet was forbidden by default, which means “no ip subnet-zero” command.

Starting with IOS version 12, the default has been changed to “ip subnet-zero”, so now the subnet-zero can be used without amendment to the configuration.

Let’s see an extract of a router configuration involving the use of subnet-zero 80.0.0.0/11:

router#configure terminal
router(config)#interface loopback 0
router(config-if)#ip address 80.0.0.1 255.224.0.0

As we can see above, no errors when using the subnet zero on a loopback interface. Now let’s disable the subnet-zero use:

router#configure terminal
router(config)#no ip subnet-zero
router(config)#interface loopback 1
router(config-if)#ip address 80.0.0.1 255.224.0.0
Bad mask /11 for address 80.0.0.1        

As indicated by the error “Bad mask /11 for address 80.0.0.1”, when the use of the subnet-zero is disabled, it’s not possible to configure it on an interface. You can find detailed explanation about Subnet Masks in this article.

Certification advice

The all-zeros and all-ones subnets are the typical tricky questions in network certification exams. When preparing the test, you need to make sure you investigate how the all-zeros and all-ones subnets are treated in that particular certification path.

For example, in a subnetting calculation question the restrictions about all-zeros and all-ones do not normally apply, since the subnetting is basically a math exercise. But if the question is asking about the use of those specific addresses on a router, then you need to think twice before answering.

Normally the best way is checking the blueprint of the certification for which you are studying. You can check if all-zeros and all-ones subnets are covered, and investigate if their use is allowed in router configuration questions.

Conclusions

We have presented the all-zeros and all-ones subnet problem, and the implications that might arise in using them in a real network. As mentioned, all modern equipment should be able to deal with these specific networks, but it’s something to keep in mind when dealing with legacy devices.

Nowadays, pretty much all router operating systems have a command to control the use of subnet-zero, as showed in the Cisco example in a previous section. Just make sure which default setting is present in your legacy devices, so to prevent possible issues when an interface is configured with a all-zeros and all-ones subnet.

Subnet-Zero and All-Ones-Subnet explained
3.9 (77.78%)
Advertisement

About Valerio Plessi

Valerio is a CCIE R&S certified Network Consultant Engineer with 10+ years of experience in IT. In the past he worked for Cisco Systems as High Touch Technical Support Engineer, then he switched to Network Consulting taking care of large Enterprise and Service Provider customers. When not in front of his MacBook, he is probably travelling and photographing the world!

Check Also

How to configure HSRP on a Cisco router

How to Configure HSRP on a Cisco Router (with GSN3 lab)

Article Contents1 Basic HSRP Configuration2 HSRP Priority: Controlling the Active Router3 HSRP Preempt: Avoid Fail-Back4 …

Leave a Reply

Your email address will not be published. Required fields are marked *