...

Subnet Zero and All-Ones-Subnet explained

ip subnet-zero

In this article we are going to explain what the ip subnet zero is, but first we need to introduce subnetting. 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 # Subnet First Usable IP Last Usable IP Broadcast
0 80.0.0.0 80.0.0.1 80.31.255.254 80.31.255.255
1 80.32.0.0 80.32.0.1 80.63.255.254 80.63.255.255
2 80.64.0.0 80.64.0.1 80.95.255.254 80.95.255.255
3 80.96.0.0 80.96.0.1 80.127.255.254 80.127.255.255
4 80.128.0.0 80.128.0.1 80.159.255.254 80.159.255.255
5 80.160.0.0 80.160.0.1 80.191.255.254 80.191.255.255
6 80.192.0.0 80.192.0.1 80.223.255.254 80.223.255.255
7 80.224.0.0 80.224.0.1 80.255.255.254 80.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.

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.

2 Responses

  1. Hello,
    your article is very clear. Thank you!

    Please change this
    80.0.0.0 = 01010000.00010100.00010100.00010100
    with all 0s after the second 1s, could induce something unclear.
    Thanks again.

Leave a Reply

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

Share this article.

Recommended
Noction Ad
Advertising Disclaimer

RouterFreak is a participant in various affiliate advertising programs and sponsorships designed to earn advertising fees by advertising and referring traffic. These earning are essential to supporting RouterFreak but we only recommend products we have vetted and would use ourselves.

Find out more about supporting RouterFreak.

Popular Articles

More Articles