In TCP/IP, the DARPA Internet support includes the concept of the subnet, sometimes called a subnetwork. This is a mechanism that enables several local networks to appear as a single Internet network to off-site hosts. You should consider using subnets in the following instances:
Setting up a subnet consists of:
To set up subnet addresses, you must use a segment of the host portion of the IP address to use as the subnet address. For example, consider the following IP addresses and netmasks:
For class A and B networks, you can create subnets by converting the second and third octets, respectively, from host addresses to subnet addresses. Notice how the netmask changes accordingly:
The class A network 16 can now have up to 254 subnets (16.1 - 16.254). The class B network 10.0 can also have up to 254 subnets (10.0.1 - 10.0.254). While the netmask masks the network portion of the address, the broadcast address exposes the network address and hides the host portion. For example, the broadcast address for the subnet 10.0.246, with a netmask of 255.255.255.0, is 10.0.246.255.
For more information on setting netmask and broadcast addresses, see ``Configuration parameters''.
Partitioning a class C address is slightly more complex, as you must take a portion of the fourth octet as the subnetwork. For example, you might partition the first three (high order) bits of the fourth octet to represent the subnetwork, with the last five bits representing the host:
This scheme allows for up to 6 subnets of 30 hosts each, for a total of 180 hosts. The netmask for the hosts on these subnets is 255.255.255.224; 224 is a decimal representation of the binary octet 11100000, which masks the subnet portion of the IP address.
Possible subnets for the class C network 126.96.36.199, with associated broadcast addresses, are: