Tuesday, May 31, 2011

IP Subnet-Zero

I thought it would be interesting to take a little stroll through history and look at something that really isn't relevant to today's network, but was something that you weren't allowed to use in days gone by.  As the blog title says, that something is IP Subnet-Zero.
ZER0 ZER0 ZER0 ZER0
What is IP Subnet Zero?  Well, it's a legacy command on Cisco routers the controls whether or not the use of the all zeros subnet is permitted.  What's the all zeros subnet?  To properly understand what the all zeros subnet is we need to first remember what classful networking was, and how things all got started in IP beginning with RFC 791
ZER0 ZER0 ZER0 ZER0
RFC 791 originally specified three "classes" of IP addresses, reserving all the remaining for future use.  On page 24 of RFC 791 you will find a table that defines these three classes.  In that table 2 distinct portions of the IP address are identified,:the Network and the Host.  What that looks like in dotted decimal format is something like so:
ZER0 ZER0 ZER0 ZER0
Class A -- N.H.H.H.
Class B -- N.N.H.H
Class C -- N.N.N.H
ZER0 ZER0 ZER0 ZER0
If you read this blog then I doubt this is anything new to you.  What's really important to us here is the next bit of text that immediately follows the table defining the classes, and that text is the following:
ZER0 ZER0 ZER0 ZER0
A value of zero in the network field means this network.  This is only used in certain ICMP messages.
And so the All Zeros host address was born.
ZER0 ZER0 ZER0 ZER0
To take this one step further, RFC 943 cemented this rule in the "Special Addresses" section found on pages three and four:
ZER0 ZER0 ZER0 ZER0
Special Addresses:

In certain contexts, it is useful to have fixed addresses with functional significance rather than as identifiers of specific hosts.  When such usage is called for, the address zero is to be interpreted as meaning "this", as in "this network".  The address of all ones are to be interpreted as meaning "all", as in "all hosts".  For example, the address 128.9.255.255 could be interpreted as meaning all hosts on the network 128.9.  Or, the address 0.0.0.37 could be interpreted as meaning host 37 on this network.
This is kind of cool.  This quite literally means that the address 0.0.0.0 represents this Internet
ZER0 ZER0 ZER0 ZER0
This is all well and everything, but what does it have to do with IP Subnet Zero?  Well, now that we know what the all zeros host address is we can now look at the roots of subnetting!  The practice of subnetting was standardized in RFC 950 since a mechanism was needed to more efficiently use the classful network ranges that were being allocated out. What happened is that the the practice of not using the all zeros host address was extended to subnetting in that the use of the all zeros subnet was also disallowed.  The following text is found on page 6 of RFC 950:
ZER0 ZER0 ZER0 ZER0
It is useful to preserve and extend the interpretation of these special addresses in subnetted networks.  This means the values of all zeros and all ones in the subnet field should not be assigned to actual (physical) subnets.
OK.  Great!  We have out IP Subnet Zero.  But why?  What's so bad about actually using it?  Well the answer to that lies in the classful use of addresses of the day.  You see, anytime you subnet the network address of the first subnet is going to be exactly the same as the network address of the classful network from which the subnet originates.  To illustrate that let's take the Class B private ranage as an example.  The network address for the first classful network in the reserved Class B range is 172.16.0.0.  If we were to subnet this using 24 bit masks our first subnet is 172.16.0.0/24 with a network address of 172.16.0.0.
ZER0 ZER0 ZER0 ZER0
Hah! We have a collision!
ZER0 ZER0 ZER0 ZER0
What does all of this mean to us today?  Well, about nothing really.  Classes are a thing of the past and therefore there is no such thing as a network address of a classful network.  This means we are free to use the all zeros subnet all we like.
ZER0 ZER0 ZER0 ZER0
With all that in hand let's turn back to the ip subnet-zero global command on Cisco IOS routers.  
ZER0 ZER0 ZER0 ZER0
So as stated in the command reference for ip subnet-zero this command controls whether or not he use of the all zeros subnet is permitted.  Prior to IOS release 12.0 ip subnet-zero was disable by default and you had to enable it if you wanted to use the all zeros subnet.  In modern IOS versions it's disabled and you are free to do as you like.
ZER0 ZER0 ZER0 ZER0
I seem to recall seeing "ip subnet-zero- in the default configurations of 12.2-era IOS all the time, likely a little throwback to the days it used to be disabled by default and to serve as a reminder of the change.  Newer IOS versions don't include this command in the default config anymore since it really is a part of history, and I'm at this time unable to confirm if it was present in 12.2-ish IOS versions.
ZER0 ZER0 ZER0 ZER0
And that is IP Subnet-Zero!
ZER0 ZER0 ZER0 ZER0
ZER0 ZER0 ZER0 ZER0
ZER0 ZER0 ZER0 ZER0
ZER0 ZER0 ZER0 ZER0
As a bit of a epilogue I just wanted to go off on a tangent about how shitty the Blogger auto save feature is.  I had this post at 880 words and just about finished when I must have hit something ( I swear it was ctrl-z...) and it erased the whole post.  Auto-save kicked in before I could undo it (about 2 seconds)  and the whole post was lost.  It was better written, more detailed, better examples, and far wittier than this effort is.  I realize that none of this makes any difference to you, and I'm in all likelihood just wasting your time by putting these useless words here for you to read, but dammit this is my blog and I'll rant if I want to!

Thank you for taking the time to listen to me bitch :)


ZER0 ZER0 ZER0 ZER0

3 comments:

  1. Not bad at all.
    Thanks for the explanation.
    Cheers,'

    Yannis

    ReplyDelete
  2. Thanks :)

    It's funny how this post, that was actually written as a clue to a contest we did on networking-forum.com (there's some hidden information in this post), actually generates quite a few hits for this site. I am actually quite surprised how many people are searching for this exact information and end up here.

    ReplyDelete
  3. Thank you!
    Very clear and detailed explanation. Helped me a lot through learning what "ip subnet-zero" actually is.

    Great work

    ReplyDelete