Subnetting is a foundational concept in IP networking. Although it is often misunderstood and even dreaded, this is a simple concept if we could look at things from the perspective of binary. However the combination of binary concepts, IP addressing and subnet masking is a lot to attempt to understand at once.
In this article, we will look at some simple examples that are meant to illustrate the process of IPv4 subnetting. This is not meant to be a comprehensive study. It is meant to build my previous subnetting article and should introduce only basic concepts. In future articles, we will delve into more complex and complete examples of IP subnetting.
In an earlier article, I outlined the concept of Classful IP Addressing. That knowledge is a fundamental starting point for the IP Subnetting discussed here. In that article, I outlined three classes of unicast IP addresses. The class an IP address belongs to determines what part of the address is the network and what part is the host. That assumption can be overridden when by applying a subnet mask to the configuration of a modern IP stack.
Example IP Addresses
Address Class Network Host 10.100.55.20 A 10. 100.55.20 172.16.22.13 B 172.16. 22.13 192.168.0.44 C 192.168.0. 44
While the Class A example above shows a single host, there is an incredible number of possible hosts addresses that could be created using this network.
Class A–Host Addresses (16,777,214 hosts)
10.0.0.1 //Host 1 10.0.0.2 //Host 2 ... 10.0.0.255 //Host 255 10.0.1.0 //Host 256 ... 10.100.55.20 // Address Given ... 10.255.255.254 //Host 16,777,214
As can also be seen in the above chart, Class A addresses have many more addresses available for hosts than Class C addresses. The concept of subnetting is defined in RFC950. The idea is to create sub-networks by using some portion of the host address (shown above in blue) to identify multiple, smaller networks. In simplest form, this can be understood using the Class A and Class B examples below.
As you will see in the first example, the Class A network has 16,777,214 possible addresses (in a single network). The need for this many hosts is less typical than the need for more networks. Therefore, we often need a way to use a portion of the host address to identify subnetworks (or subnets). In the example below, I outline the concept of borrowing two octets of host from a Class A Network. This creates 65,536 subnets and allows for 254 hosts per network.
Subnet 1 (using mask 255.255.255.0)
10.0.0.x (10.0.0.1 - 10.0.0.254)
10.0.1.x (10.0.1.1 - 10.0.1.254)
10.0.255.x (10.0.255.1 - 10.0.255.254)
10.1.0.x (10.1.0.1 - 10.1.0.254)
10.255.255.x (10.255.255.1 - 10.255.255.254)
Looking at the examples above, we see the classful network in green. We also see the host addresses in blue. However, there are two octets of numbers between the host and the classful network. This would be indicative that a subnet is being used.
The important question is how do we make our hosts and our network devices aware of this subnet information. The answer to that question is that we combine the IP address with a subnet mask. While more complex examples of subnetting may have other values, this article focuses on subnet masks containing only values of 255 and 0.
IP Address and Subnet Mask
IP Address: 10. 22. 55.2 Subnet Mask: 255.255.255.0
In the example above, both the subnet mask and IP address are shown. Each octet of the IP address corresponds with an octet of subnet mask. The IP address portion that corresponds with a subnet mask value of 255, is part of the Network (or subnet). Each octet of the IP address that corresponds with a subnet mask value of zero is part of the host address. This is how hosts and network devices understand the components of subnetted IP addresses.
Key Concept–To break an IP address into components of classful address, subnet and host, write the IP address above the subnet mask. Take care to align the octets. Place a vertical line based on the classful address rules. Then locate the area where the subnet mask transitions from 255’s to 0’s. Place a second vertical line in the corresponding area of the IP address.
//write the IP address above the subnet mask 10. 22. 55. 2 255.255.255. 0 //locate the classful boundary of the IP address 10 | 22. 55. 2 255.255.255. 0 //locate the transition between 255 and 0 in the mask //place a second vertical line in that area of the IP address 10 | 22. 55 | 2 255.255.255 | 0 The address is now in form of: network | subnet | host
Another example of subnetting a Class A address might use the mask of 255.255.0.0. As compared to the previous example, there would be fewer subnets, but more hosts per subnet.
10.0.0.0 (10.0.0.1 - 10.0.255.254) Example Address Assigned-- IP address: 10. 0.20.8 Subnet Mask: 255.255.0.0
10.1.0.0 (10.1.0.1 - 10.1.255.254) Example Address Assigned-- IP address: 10.1.200.5 Subnet Mask: 255.255.0.0
In this example, two octets of subnet masking (255.255.0.0) indicate that the first two octets of the IP address are identifying the network. The remaining two octets are for host addressing. This allows for 256 possible subnets with 65,534 hosts per subnet.
Subnetting Class B Addresses
Subnetting a Class B address, when compared to the same process on a Class A address, is very similar. The only difference is the classful network that is used as the starting or reference point. When we used a mask of 255.255.255.0 to subnet our Class A network, it produced 65,536 subnets. Using the same mask on a Class B network address only produces 256 subnets.
172.16.0.0 (172.16.0.1 - 172.16.0.254)
172.16.1.0 (172.16.1.1 - 172.16.1.254)
172.16.255.0 (172.16.255.1 - 172.16.255.254)
This article looked at more basic IP Subnetting concepts. For those still struggling with these concepts, there is no reason to be discouraged. Over the next few weeks, I will share more advanced concepts and rules used in the subnetting process. Baby steps…