1.7 Creating Subnets

One IP network can be divided into smaller networks, called subnets. The following are reasons to divide your network:

1.7.1 Subnet Addresses and Masks

Communication between a node on a local subnet and a node on a different subnet is similar to communication between nodes on two different networks. To a user, routing between subnets is transparent. Internally, the IP software recognizes any IP addresses that are destined for a remote subnet and sends those packets to the router on that subnet.

As in network-to-network communication, the routing information for communication between subnets is maintained in the routing table (by IP).

When a network is divided into subnets, the host address portion of the IP address is divided into two parts, just as the IP address itself is divided into two parts. The host address portion specifies both the subnet of the IP network and the node on that subnet.

The four-byte IP address consists of a network address and a host portion, as shown in Figure 1-10.

Figure 1-10 4-byte IP Address

A 4-byte IP address that consists of a network address and a host portion

For instance, if a network has the Class B IP network address portion 129.47, the remainder of the IP address can be divided into subnet addresses and host addresses. Controlled by the local network administrator, this division allows the most flexibility for network development at the local site. For example, the subnet address could comprise 4 bits of the remaining 2 bytes. This allows 15 subnets, each with 4,094 nodes. Or, in another case, the subnet address could comprise 8 bits, allowing 255 subnets (a subnet address of all ones is not valid), each with 254 nodes.

NOTE:NetWare® routing software supports the use of all zeros in the subnet field (subnet zero). However, a subnet field with all ones denotes all subnets of a particular network; therefore, a subnet field with all ones cannot be used as a local IP address.

Figure 1-11 shows a single IP network divided into two subnets. The router shown has physical attachments and IP addresses on both subnets (129.47.128.1 and 129.47.192.1). It might also have physical devices and IP addresses (nn.nn.nn.nn) connecting it to other networks.

Figure 1-11 Single IP Network Divided into Two Subnets

A single IP network divided into two subnets

A subnet mask indicates how the host portion of the IP address is divided into a subnet address and a local host portion. The network mask is a 32-bit number with all ones for all network and subnet address portions, and all zeros for the host field. With a Class B network portion of 129.47 and a 4-bit subnet address, for instance, the subnet mask consists of 20 ones and 12 zeros. In essence, a subnet mask locally extends the network address portion of an IP address and reduces the host portion.

The table below shows an example of a Class C subnet with an IP address of 200.2.1.209. To create a subnet address, bits are taken from the local host portion. As the size of the subnet mask increases, the number of hosts decreases and the number of subnets increases.

Table 1-2 Example of Class C student with IP Address 200.2.1.209

Class C IP Address 200.2.1.209

Network Number

Subnet Number

Host Number

Available Networks, Subnets, and Hosts

FF.FF.FF.0

200.2.1.0

None

0.0.0.209

1 network, 0 subnets, and 254 hosts

FF.FF.FF.E0

200.2.1.0

200.2.1.192

0.0.0.17

7 subnets and 30 hosts per subnet

FF.FF.FF.F0

200.2.1.0

200.2.1.208

0.0.0.1

15 subnets and 14 hosts per subnet

Figure 1-12 shows examples of IP network addresses, their relationship to the subnet mask, and the corresponding subnets.

Figure 1-12 Examples of IP Network Addresses

An IP network address, its relationship to the subnet mask, and the corresponding subnets

1.7.2 Subnet Zero

Subnet zero is a subnet with all the bits in the subnet field of the IP address set to 0. For example, subnet 130.57.0.0, with a mask of 255.255.240.0, is a subnet zero of network 130.57, as shown in Figure 1-13.

Figure 1-13 Subnet Zero

A subnet zero with all the bits in the subnet field set to zero

The official IP specification reserves the subnet addresses with all zeros and all ones and does not allow them to be used as subnet addresses. However, this policy wastes one subnet in the IP address space. To counteract this limitation, the Novell® TCP/IP implementation enables the use of subnet zero.

1.7.3 Variable Size Subnets

The subnets of a network can have different length subnet masks, called variable length subnet masks. These subnets are called variable because the size, or length, of the subnet varies from subnet to subnet.

A subnet mask defines the number of bits that can be used to define the subnet and the number of bits to define the host. As the subnet mask increases, the number of hosts on a subnet decreases. As the subnet mask decreases, the number of hosts that can be defined increases.

Some network configurations have individual subnets with a large number of hosts and other subnets with a small number of hosts. Using the same subnet masks on all subnets can mean either of the following:

  • The mask is too small and you do not have enough subnet numbers for all your subnets.

  • The mask is too big and you do not have enough host IDs for all your hosts on a subnet.

If the mask is too small or too big, use a variable size subnet. By varying the size of the subnet mask used on a network, you can match the number and size of subnets to your configuration.

For example, subnet 16 of network 130.57.0.0 with mask 255.255.240.0, 130.57.16.0, can be further divided into 16 sub-subnets with 256 hosts each. (Actually, this division creates 15 sub-subnets with 254 hosts each because sub-subnet 130.57.31.0, host 0, and host 255 are not used.)

NOTE:OSPF and RIP II recognize subnet masks and support variable size subnets. RIP I does not work when the network is partitioned into variable length subnets because RIP I assumes that all subnets belonging to the same network use the same subnet mask.

1.7.4 Assigning Subnet Addresses

HINT:Because RIP I packets do not carry subnet mask information, the RIP I routing protocol imposes several restrictions on the use of subnets. If you are using RIP I, use the same subnet mask for all subnets belonging to the same network. Using RIP II lifts this restriction.

If you are installing the routing software on a network with subnets, use the subnet mask already established for the network.

Subnet addresses and host addresses are typically assigned in numeric order, where both the subnet and host addresses are assigned from the right edge of their field. By this method, the border between the subnet address and the host address becomes fixed when the first subnet (subnet address = 1) is assigned. If the number of hosts on a subnet or the number of subnets required exceeds the limits of the subnet mask, using this method makes it difficult to adjust the subnet mask because each host must be renumbered.

To prepare for changes in the size of the subnet mask, RFC 1219 suggests that subnets be assigned from the left of the subnet address field, and that hosts be assigned, in numeric order, from the right of the host address field. In this way, the subnet bits become a mirror image of the host bits. (You must still select an initial subnet mask and use it for all subnets in the network.) For example, to apply this method to a Class B IP network with a subnet mask of 255.255.255.0, you assign subnet addresses as follows:

Then, you assign host addresses on each subnet as follows:

...

Using this method leaves a buffer zone between the subnet and host addresses, which enables future network growth.

The method of assigning subnet addresses described in this section summarizes the method suggested in RFC 1219, On the Assignment of Subnetwork Numbers. For a complete description of this method, refer to RFC 1219.

1.7.5 Broadcast Addresses

There are four types of broadcast addresses: directed broadcasts, subnet directed broadcasts, all-subnets directed broadcasts, and limited broadcasts. A directed broadcast has a destination IP address with the network portion of the IP address set to Class A, B, or C network, and the host field set to all ones. Directed broadcasts are sent to all hosts on the specified network.

If the network is divided into subnets, each subnet has a subnet directed broadcast. A subnet directed broadcast has an IP address with the network field set to the network identifier, the subnet field set to the subnet identifier, and the host field set to all ones.

An IP address with both the subnet and host field set to all ones is interpreted as a broadcast directed to all the subnets on the network. That is, the first router on the specified network broadcasts the IP address to one of its subnets. If broadcast forwarding is enabled, the receiving routers in that network forward the broadcast to other subnets.

An IP address with all bits set to 1 that is, 255.255.255.255 is called a limited address. It is directed to all hosts on the subnet from which the broadcast originated.

1.7.6 Multicast Addresses

A multicast address is used to send packets to a group of hosts or routers. A packet with a multicast address is received by all hosts and routers belonging to that multicast group. Class D addresses are reserved for multicast addresses. They range from 224.0.0.1 to 239.255.255.255.

The Novell TCP/IP implementation uses five multicast addresses. Two are used by OSPF to multicast packets to OSPF routers. These addresses are 224.0.0.5 and 224.0.0.6. Two are used by Router Discovery messages to multicast router advertisements and solicitation messages. These addresses are 224.0.0.1 and 224.0.0.2. RIP II uses multicast address 224.0.0.9.