Please Whitelist This Site?

I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)

If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads.

If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on tcpipguide.com". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||tcpipguide.com^$document". Then just click OK.

Thanks for your understanding!

Sincerely, Charles Kozierok
Author and Publisher, The TCP/IP Guide


NOTE: Using software to mass-download the site degrades the server and is prohibited.
If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.

The Book is Here... and Now On Sale!

Enjoy The TCP/IP Guide? Get the complete PDF!
The TCP/IP Guide

Custom Search







Table Of Contents  The TCP/IP Guide
 9  TCP/IP Lower-Layer (Interface, Internet and Transport) Protocols (OSI Layers 2, 3 and 4)
      9  TCP/IP Internet Layer (OSI Network Layer) Protocols
           9  Internet Protocol (IP/IPv4, IPng/IPv6) and IP-Related Protocols (IP NAT, IPSec, Mobile IP)
                9  Internet Protocol Version 4 (IP, IPv4)
                     9  IP Addressing
                          9  IP Subnet Addressing ("Subnetting") Concepts

Previous Topic/Section
IP Subnetting: "Three-Level" Hierarchical IP Subnet Addressing
Previous Page
Pages in Current Topic/Section
123
4
Next Page
IP Default Subnet Masks For Address Classes A, B and C
Next Topic/Section

IP Subnet Masks, Notation and Subnet Calculations
(Page 4 of 4)

Rationale for Subnet Mask Notation

So, in practical terms, the subnet mask actually conveys only a single piece of information: where the line is drawn between the subnet ID and host ID. You might wonder, why bother with a big 32-bit binary number in that case, instead of just specifying the bit number where the division occurs? Instead of carrying the subnet mask of 255.255.248.0 around, why not just say “divide the IP address after bit #21”? Even if devices want to perform a masking operation, could they not just create the mask as needed?

That's a very good question. There are two historical reasons: efficiency considerations and support for non-contiguous masks.

Efficiency

The subnet mask expression is efficient, in that it allows routers to perform a quick masking operation to determine the subnet address. This improves performance; remember that computers were much slower when this system was developed. Today this is not really that much of an issue.

Support For Non-Contiguous Masks

RFC 950 actually specified that when splitting the bits in the host ID for subnet ID and host ID, it was possible to split it in more than one place! In the example above, we could, instead of splitting the 16 bits into 5 bits for subnet ID and 11 for host ID, have done it as 2 bits for the subnet ID, then 4 bits for the host ID, then 3 more bits for the subnet ID and finally 7 more bits for host ID. This would be represented by the subnet mask pattern “11000011 10000000” for those sixteen bits (following the sixteen ones for the network ID).

Why do this instead of just dividing as 5 bits for subnet ID followed by 11 bits for host ID as we did before? I have no idea. J In fact, most other people had no idea either. Trying to subnet this way makes assigning addresses extremely confusing. For this reason, while it was technically legal, the use of non-contiguous subnet masking was not recommended, and not done in practice.

Given that non-contiguous masks are not used, and today's computers are more efficient, the alternative method of expressing masks with just a single number is now often used. Instead of specifying “IP address of 154.71.150.42 with subnet mask of 255.255.248.0”, we can just say “154.71.150.42/21”. This is sometimes called slash notation or CIDR notation. It is more commonly used in variable-length masking (VLSM) environments, and as the second name implies, is also the standard for specifying classless addresses under the CIDR addressing scheme. However, it is also sometimes seen in regular subnetting discussions.

Note: Since these weird masks were never really used, some resources say that the subnet mask always had to be contiguous, but this is not true—originally, it was legal but “advised against”. Later this practice became so out-of-favor that many hardware devices would not support it. Today, now that classless addressing and CIDR are standard, it is simply illegal.


If you've never subnetted before, this topic may have left you with your head spinning, despite our looking at an example. Don't worry. It will all become more clear as you become more familiar with subnetting by following the rest of this section. Remember also that I have included a whole section that shows how to subnet step by step, including determining the subnet mask.


Previous Topic/Section
IP Subnetting: "Three-Level" Hierarchical IP Subnet Addressing
Previous Page
Pages in Current Topic/Section
123
4
Next Page
IP Default Subnet Masks For Address Classes A, B and C
Next Topic/Section

If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $



Home - Table Of Contents - Contact Us

The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005

Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.