The subnet mask is a required setting on any host that
communicates on an IP network. It is commonly represented in the same
format as an IP address, except that the values usually are either
255 or 0. (Exceptions to this are becoming more common--we'll talk
about those later). If you've ever seen a subnet mask, you will notice
that a series of one or more 255 values are always designated in succession,
followed by a series of 0 values. If you line a subnet mask up over
an IP address by the dots, each number below a 255 will be part of
the network address. The remaining numbers under the 0s will be the
node address.
255.255.255.0
= mask
128.230.100.4
= IP address
With this type
of subnet mask, the boundary between the network and node address
is always on a dot between the last 255 and the first 0, sometimes
referred to as the byte boundary.
What really matters to a computer of course is
the binary representation. The above mask and IP address are represented
in the following manner as binary:
11111111.11111111.11111111.00000000
Mask
10000000.11100110.01100100.00000100
IP
Address
With the binary representation, an uninterrupted
sequence of 1s in the mask, line up exactly over the subnet portion
of the address. With this type of mask, seeing the binary version
doesn't add any value, but later it will be necessary to see the
binary data to fully understand masks that don't end neatly on one-byte
boundaries.
Part of the decision as to how to set up the subnet
mask is left to the network designer, but the subnet mask must be
configured consistently throughout the network. Another factor that
limits the definition of a subnet mask is its class. For example,
with a "Class B" address, the first two bytes always have to be
included in the network portion of the address, and thus the subnet
mask will always start out with 255.255 or 11111111.11111111. With
a "Class C" address, the first three bytes have to always be included
in the network portion of the address. In this case the subnet mask
would have to start with 255.255.255.
In each instance, there is a lot of flexibility
in the way that the rest of the address is masked. The example above
is a Class B address. The network address is 128.230.100. The node
address is 4. The example above used a subnet mask of 255.255.255.0.
This makes it possible to have 254 unique, routed networks or subnets
because the mask can include the third byte in the network address.
(You can't use 255 because that's reserved for broadcast address,
and 0s, used in an older style of broadcast address, can't be used
either; 0s at the end of an address are also used to symbolize network
addresses.) Even though the first two bytes cannot be changed, the
third byte can have any value from 1 to 254. This means that with
a three-byte or 24-bit subnet mask, the following distinct networks
or subnets are possible with the address:
128.230.1.0
--
128.230.254.0
There is one byte left over for node addresses, so
each network or subnet will have 254 node addresses. If the minimum
subnet mask of 255.255.0.0 were used, there could only be one routed
network. But two bytes would be left over for node addresses. So
the range of possible node addresses would be 128.230.1.1 to128.230.254.254
or approximately 65,000 nodes. The disadvantage of this is that
you cannot divide your network into routed subnets.
With this particular address, if you divide only
the subnet mask on the byte boundaries, you have 254 subnets limited
to 254 nodes each, or you have one big network with 65,000 nodes.
These two extremes have some obvious trade-offs. There may be cases
where you would want more than 254 nodes on a routed subnet, but
the other extreme flattens the network completely, giving you no
ability to divide your network into routed subnets.
Fortunately, the subnet mask doesn't have to divide
the network address and the node address on a dot boundary. In some
cases it can be divided somewhere in between. When the network address
and node address are not divided on a dot boundary, the subnet mask
is called a variable-length subnet mask. A variable-length subnet
mask is commonly represented in decimal form, such as 255.255.254.0.
But its binary representation has to be considered to understand
where the network address ends and the node addresses can begin.
The following example uses a subnet mask of 255.255.254.0:
255.255.254.0
= mask
128.230.00.2
= IP address
To understand this, we'll have to look at it in binary
form. Here the mask does not line up on the byte boundaries:
255.255.254.0
=
11111111.11111111.11111110.00000000
Mask
128.230.004.2
=
10000000.11100110.00000100.00000010
IP Address
One thing you should notice is that there are contiguous
1s from left to right in the subnet mask. This is one of the rules
of a subnet mask: All the binary 1s have to be contiguous, and all
the following 0s overlaying the node address have to be contiguous.
A mask that doesn't follow this pattern is not valid. In any case,
the valid node addresses are all possible numbers that can be represented
under the 0s, so the lowest number is going to be: 128.230.4.1 or
10000000.11100110.00000100.00000001. And the highest number is going
to be 128.230.5.254 or 10000000.11100110.00000101.11111110. You will
also notice that this mask has one less one bit than the previous
mask. This is sometimes referred to as a 23-bit mask.
11111111.11111111.11111110.00000000
=
255.255.254.0
=
mask
10000000.11100110.00000100.00000000
=
128.230.004.0
=
network address
10000000.11100110.00000100.00000010
=
128.230.004.2
=
node address
10000000.11100110.00000100.00000001
=
128.230.004.1
=
lowest possible node address
10000000.11100110.00000101.11111110
=
128.230.005.254
=
highest possible node address
Because subnet masks have to be contiguous 1s followed
by contiguous 0s, the last byte of a subnet mask can only have the
following binary or decimal values:
REPORTS
Analyize In-Line NAC strategies and products.
ANALYTICS Plan and design your enterprise blade server deployments
InformationWeek U.S. IT Salary Survey 2008
Salaries for business technology professionals are falling. Here's what you need to know in order to make good hiring decisions and personal career choices. Download Today