IP Subnetting Part 2: Simple Subnetting Examples

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)

Subnet 2

10.0.1.x (10.0.1.1 - 10.0.1.254)

Subnet 256

10.0.255.x (10.0.255.1 - 10.0.255.254)

Subnet 257

10.1.0.x (10.1.0.1 - 10.1.0.254)

Subnet 65536

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.

Subnet Mask

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.

Subnet 1

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

Subnet 2

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.

Subnet 1

172.16.0.0 (172.16.0.1 - 172.16.0.254)

Subnet 2

172.16.1.0 (172.16.1.1 - 172.16.1.254)

Subnet 256

172.16.255.0 (172.16.255.1 - 172.16.255.254)

Conclusion

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…

Related Articles

About Paul Stewart, CCIE 26009 (Security)

Paul is a Network and Security Engineer, Trainer and Blogger who enjoys understanding how things really work. With over 15 years of experience in the technology industry, Paul has helped many organizations build, maintain and secure their networks and systems.
This entry was posted in CCNA, Certification, General, Network, Technology and tagged , , , , . Bookmark the permalink.

4 Responses to IP Subnetting Part 2: Simple Subnetting Examples

  1. Why are you even mentioning classful networks? It’s 2014.

    • Ideally we would just look at everything from a bitwise perspective. However we do not live in an ideal world and subnetting is still an important concept that a lot of people struggle with. Answering questions about subnetting is impossible without considering classful networks. For example–

      Given the IP address of 172.16.1.1 with a mask of 255.255.255.0–How many total subnets could be created? (assume all subnets use the same subnet mask)

      That question is something that could be found on a certification exam. It is impossible to answer without knowing that 172.16.1.1 is a /16 from a classful perspective.

      There are also certain function in network devices that work classfully. In a Cisco routers, unspecified network statements default to classful and auto-summarization with DV protocols do so on classful boundaries.

      I’d prefer that we didn’t have to deal with these classful rules, but they are still necessary to understand. And it’s certainly necessary to understand in the context of subnetting.

  2. I love learning why things are broken in the real world, the history of technology is just as fun as the creation of it in your own hands.

    Having to learn the details of how people used to do it though? It’s not necessary.

    You do a lot of certification and reading about this stuff don’t you? If you see these “kind of” questions then why don’t you fix it and go on record as saying “This CCxx course is broken.”

    Asking a beginner to understand what they have learnt is a /24 is not really a /24 if you colour it with IOS code from 1993… then I feel like you’re adding misinformation to the mix and not fixing it where you should be – at the certification level, where you have the trust and platform to do it right.

  3. Pingback: IP Subnetting Part 4: Subnetting a Class C Network - PacketU

Leave a Reply