|
|
IP Subnets are used to divide one network into two or more distinct subnetworks.
Subnet numbers identify subnetworks in the same way that network addresses
identify physically distinct networks. Subnetting divides the node address
portion of an IP address into two portions — one for identifying a
specific subnetwork and one for identifying a node on that subnetwork.
Why Use Subnets?
The use of subnets is optional. Subnets are typically used
in organizations that have a large number of computers. You may
want two or more physically distinct networks to share the same
network address. This may occur, for example, if your organization
has acquired only one network number, but any of the following is true:
A few nodes on a single network create the bulk of the network
traffic and you want to isolate those nodes on a subnetwork to reduce
overall congestion.
You have a single LAN and have reached the limit of its technology
in terms of node numbers or cable length.
LANs are located too far apart to be joined with bridges.
How Subnetting Works
You may use subnets to divide your current network into subnetworks without
informing remote networks about an internal change in connectivity.
A packet will be routed to the proper subnet when it arrives at
the gateway node. However, if you want a remote node to know about
only some of the subnets on your network, this must be configured.
The network portion of an IP address must be the same for
each subnetwork of the same network. The subnet portion of an IP
address must be the same for each node on the same subnetwork.
Assigning Subnet Masks
Before you can determine subnet numbers, you first must determine which
bits of the node address will be used to contain your subnet numbers.
The bits that you designate for subnet identifiers compose
the subnet mask. The subnet mask is configured with NMMGR. The remaining part
of the node address is used to identify the host portion of the IP address.
The following rules apply when choosing a subnet mask and an IP address:
Although any bits in the node address can be used as the subnet
mask, Hewlett-Packard recommends aligning the subnet mask along byte
boundaries, adjacent to the network number.
Although standards allow subnets on the same network to have
different subnet masks, Hewlett-Packard recommends that you assign
the same subnet mask to all subnets on a network.
Do not assign an IP address where the network address and/or node
address bits are all off (all 0s) or all on (all 1s). Likewise, the
subnet address bits cannot be all 0s or all 1s.
To determine the subnet mask, you first need to estimate the
number of networks required and the number of nodes on each subnet.
Allow enough bits for both nodes and subnets, as described in example 1.
Example 1
Assume you are choosing a subnet mask for a class C network
(three bytes for network address, one byte for node address), and
you need four subnets with up to 30 nodes on each subnet. You will
need to reserve three bits for the subnet address (remember, all
0s and all 1s cannot be used) and the remaining five bits for the
node numbers as shown in Figure 2-1 "Class
C Address with Subnet Number".
Figure 2-1 Class C Address with Subnet Number
The 30 nodes per subnet will require at least five bits of
the node portion of the IP address (30 <32, and 32=25,
therefore you need 5 bits). This leaves three bits remaining
in the node portion of the IP address for use as the subnet identifier.
Subnet parts of all 0's or all 1's are not recommended
because they can be confused with broadcast addresses. Therefore,
you can have up to six subnets (23 -2=6)
when three bits are used for the subnet identifier.
Example 2
An IP address on a class B network with an 8-bit subnet mask separates
as shown in Figure 2-2 "Class C Address with
Subnet Number".
Figure 2-2 Class C Address with Subnet Number
Now, refer again to example 1. The subnet mask must indicate
that three bits of the node portion of the IP address will be used
for the subnet identifier. The subnet mask turns on (sets to 1)
all the relevant bits for its subnet scheme. The subnet mask for
example 1 is shown below. Note that the most significant three bits
of the rightmost byte are set.
Subnet Mask
- Binary
11111111.11111111.11111111 11100000
- Decimal
255.255.255 224
Table 2-1 "Valid Addresses of Example
Subnetwork" shows valid addresses for the subnetwork in example 1. You will
need to know this information for NMMGR configuration.
The table shows the possible values of the rightmost byte of the
IP address for each of the subnets, given the criteria described
in the example. (Remember, an address of all 0s or all 1s is not valid).
Column 2 shows the values, in binary, of the six subnet addresses.
Five zeroes are shown in parentheses to indicate where the three subnet-address
bits are located in the byte. The equivalent decimal value for each
subnet address is shown in the third column. The fourth column shows
the range of possible values for the node address of each subnet.
The five rightmost bits make up the node portion, and the range
is the same for all subnets. By combining the subnet address with the
range of node addresses, the possible decimal values of the rightmost
byte are obtained and shown in the fifth column.
The table shows that subnets of 30 nodes each are possible given a subnet mask
of 255.255.255 224. This is derived from the column that shows the
range of possible values for the five bits that make up the node
portion of the IP address. The range for each of the six subnets shows
30 possible values.
Table 2-1 Valid Addresses of Example Subnetwork
Subnet |
Address of Subnetwork in Binary |
Decimal Value of Subnetwork |
Possible Node Address on Subnetwork |
Decimal Value of Rightmost Byte |
1 | 001 (00000) | 32 | 00001-11110 | 33-62 |
2 | 010 (00000) | 64 | 00001-11110 | 65-94 |
3 | 011 (00000) | 96 | 00001-11110 | 97-126 |
4 | 100 (00000) | 128 | 00001-11110 | 129-158 |
5 | 101 (00000) | 160 | 00001-11110 | 161-190 |
6 | 110 (00000) | 192 | 00001-11110 | 193-222 |
By looking at the binary values of two IP addresses, it is
easy to tell if nodes belong to the same subnet. If they do, all
the bits that make up the subnet mask will be the same between IP
addresses in the subnet.
Take, for example, two IP addresses (in decimal and in binary) of subnet number
1 from Table 2-1 "Valid Addresses of Example
Subnetwork":
- 192.6.12.41
1100 0000 0000 0110 0000 1100 0010 1001
- 192.6.12.55
1100 0000 0000 0110 0000 1100 0011 0111
The subnet mask has already been defined as:
- 255.255.255 224
1111 1111 1111 1111 1111 1111 1110 0000
Because the mask has all bits except the five rightmost bits
set to 1, all bits except the five rightmost bits must match between
nodes on the same subnet. Because the two example IP addresses from
subnet 1 do match except for their five rightmost bits, they belong
to the same subnet.
 |
NOTE: Subnet addressing can be used in internetworks (networks with
gateways).
|
|