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.
IP Subnetting Step #3: Determining The Custom Subnet Mask
(Page 1 of 2)
Once we have decided how many bits
to use for the subnet ID and how many to leave for the host ID, we can
determine the custom
subnet mask for our network. Now, don't
go running for cover on me. J
A lot of people's eyes glaze over at mention of the subnet mask, but
it's really quite simple to figure out once we have done our homework
in making the design decision we did in Step
#2. In fact, there are two ways of doing
this; one is less work than the other, but they're both quite easy.
I was going to call them the hard way and the easy
way, but instead, I'll call them easy and easier.
Calculating The Custom Subnet Mask
Let's start with the easy
method, in which we determine the subnet mask in binary form from the
information we already have about our network, and then convert the
mask to decimal. To refresh your memory and guide the process, remember
this: the subnet
mask is a 32-bit binary number where a
1 represents each bit that is part of the network ID or subnet ID, and
a 0 represents each bit of the host ID.
Class C Custom Subnet Mask Calculation Example
Refer back to the Class C example
in the previous topic. We decided to use 3 bits for the subnet ID, leaving
5 bits for the host ID. Here are the steps we will follow to determine
the custom subnet mask for this network (illustrated in Figure 76):
Figure 76: Determining The Custom Subnet Mask for A Class C Network
- Determine Default Subnet Mask:
Each of Classes A, B and C has a default
subnet mask, which is the subnet mask
for the network prior to subnetting. It has a 1 for each network ID
bit and a 0 for each host ID bit. For Class C, the subnet mask is 255.255.255.0.
In binary, this is:
11111111 11111111 11111111
- Change Left-Most Zeroes To Ones
For Subnet Bits: We have decided to use 3 bits for the subnet ID.
The subnet mask has to have a 1 for each of the network ID or subnet
ID bits. The network ID bits are already 1 from the default subnet mask,
so, we change the 3 left-most 0 bits in the default subnet
mask from a 0 to 1, shown highlighted below. This results in the following
custom subnet mask for our network:
11111111 11111111 11111111
- Convert Subnet Mask To Dotted Decimal
Notation: We take each of the octets in the subnet mask and convert
it to decimal. The result is our custom subnet mask in the form we usually
see it: 255.255.255.224.
- Express Subnet Mask In Slash
Notation: Alternately, we can express the subnet mask in slash
notation. This is just a slash followed by the number of ones
in the subnet mask. 255.255.255.224 is equivalent to /27.
|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!|
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.