Defining Subnet Masking
A subnet mask is a 32-bit number that is combined with an IP address to mask specific address bits. Hosts use the subnet masks to determine the segment of an IP address that is the network address. The Class A networks, Class B networks, and Class C networks utilize default subnet masks which encompass the first 8, 16, and 24 bits. The default subnet mask values work fine for networks that do not need to be subnetted. Fairly large networks are divided into smaller subnets to reduce network traffic and to simply management.
An IP address consists of the following portions:
-
Network ID: This identifier uniquely identifies a specific network. All computers and all other devices on the same network, have the identical network address as a segment of their IP address.

-
Host ID: A TCP/IP host on the network has a uniquely assigned host. The host ID has to be unique so that each machine on the network can be uniquely identified. Hosts are devices such as servers, routers or workstations. The host ID is considered variable because it can be changed.
When you divide the network into parts, you are essentially taking bits from the host ID portion of the IP address because this is the variable portion of the IP address. The concepts behind subnets and subnet masking pertain to the bitwise ANDing binding process. The bitwise ANDing binding process is derived from a form of mathematics known as the Boolean algebra. The process works by performing the logical AND function on each bit.
The way the AND bits can be portrayed are:
-
0 + 0 = 0
-
0 + 1 = 0
-
1 + 0 = 0
-
1 + 1 = 1
When both inputs are 1, then the logical AND function results in a 1. If this is not the case, then the AND function results in 0.
All class based networks must have a subnet mask. The default subnet mask is based on the IP address classes listed below:
-
Class A addresses were created for large networks with many hosts. With Class A addresses, the first high-order bit is zero. The first 8 bits or octet is the network address. The second octet, third octet and fourth octet defines the host address or ID. The maximum number of Class A networks that can be created is 128. The number of possible host addresses is 16,777,216.
-
Class B addresses were created for networks that are medium of size and which have an average number of hosts. With a Class B address, the initial two high-order bits are set to 10. The first 2 octets define the network address. The third octet and fourth octet defines the host address or ID. The maximum number of Class B networks that can be created is 16,384. Each Class B network can have 65,534 possible host IDs.
-
Class C addresses were created for networks that are small and that have few hosts. With a Class C address, the initial three high-order bits are set to 110. The first 3 octets define the network address. The fourth octet defines the host address or ID. The maximum number of Class C networks that can be created is 2,097,152. Each Class C network can have 254 possible host IDs.
The default subnet masks for the IP address classes are:
-
Class A: 255.0.0.0
-
Class B: 255.255.0.0
-
Class C: 255.255.255.0
The subnet mask that is associated with the particular IP address class has to be used if the network is not subnetted. However, most networks are subnetted. Custom subnet masks are used when the network is subnetted. Custom subnet masks identify the bits utilized for a network address compared to the bits used for a host address.
In order to determine the correct custom subnet mask for a network, you have to determine a number of factors, including:
-
Define the number of host bits which are going to be used for subnetting: This figure is determined by the number of subnets required. When determining this figure, include all future expansions, and allow for more than the actual the number of subnets that you truly need. You do not want to reassign addresses as your network expands. Remember though that the more bits taken from the host address space, the less the number of available host addresses.
-
Define the new subnetted network IDs: The steps needed to define the addresses of the new subnets is a two part process:
-
Determine all the potential binary combinations of the bits used from the host address space.
-
Calculate the incremental value to each subnet, and then add to the network address
-
-
Define the IP addresses for all new subnets.
-
Determine the subnet mask which will work with each new subnet ID
