IP Subnetting Part 5: Subnetting Across the Octet Boundary

Throughout this series, we have examined several fundamental building blocks of subnetting. In IP Subnetting Part 4, we looked at what was required to subnet a Class C network. This article takes the fundamentals one step further and looks at subnetting a Class A address. We will also add the complexity of crossing octet the octet boundary for both the subnet and the host portions of the address.

A Class A IP address has the following characteristics–

  • I’s first octet begins with binary 0…….
  • The first Octet will be in the range of 1 to 63 (0 is invalid)
  • The first Octet (leftmost) represent the Network
  • The last three Octets (rightmost) represents a Host on a network

You will also recall that a single network can be subnetting into multiple, smaller networks.

Using a consistent syntax, we could represent a Class A network as follows.

In this example--

Green represents the Classful Network
Blue represents the Host address is would be a Network based on the fact that the host portion is 0.0.0. This is literally zero. Had the address been, or, the host portion of the address would have a non-zero value. Therefore the address would not be the network, but a host on the network. This classful example assumes no subnetting.

Question–Without subnetting, how many hosts can exist on the network?

The answer to this question is 16,777,214. This can be arrived at several ways. Each method requires subtracting 2 (the broadcast and network address)

Possible binary digits (24 bits in the rightmost 3 octets) raised to power of 2
2^24 = 16,777,216 – 2

Multiplying the possible values of each octet
256 * 256 * 256 = 16,777,216 – 2

The bottom line is that is a very large number of hosts. It is very likely that this address space could be more efficiently utilized by breaking it into smaller groups of hosts. To accomplish this, we utilize the concept of subnetting.

Scenario–As a network administrator, you have chosen to use a Class A range of addresses from the RFC1918 (private) address space. You realize that you will have some rather large subnets and need to support up to about 1000 hosts per network.

Given this question, there are at least four questions that we can answer–

  1. What is the classful network that the network administrator chose?
  2. What subnet mask will allow 1000 hosts per subnet and maximize the number of subnets?
  3. How many subnets are possible with this subnet mask and Class A network?
  4. How many hosts can each subnet support?

The first question is fairly straightforward. RFC1918 specifies a range of IP addresses for Class A, Class B and Class C.

RFC1918 Address Ranges

Class A10.0.0.0
Class B172.16-31.0.0
Class C192.168.0-255.0

So there is only one possible answer to our first question–

The next part of our question requires us to determine a subnet mask that will support 1000 hosts.

Based on our understanding of binary, we know that each bit has two possible values. We also know that we should subtract two host addresses from each network. This is for the network and broadcast addresses, which are not useable on hosts. So we might work this as follows:

# of Bits -- Possible Values (-2 possible hosts)

1         --  2    (0 hosts)
2         --  4    (2 hosts)
3         --  8    (6 hosts) 
4         --  16   (14 hosts)
5         --  32   (30 hosts)
6         --  64   (62 hosts)
7         --  128  (126 hosts)
8         --  256  (254 hosts)
9         --  512  (510 hosts)
10        --  1024 (1022 hosts) <- Meets Requirement

Another way to work this would be starting with our knowledge that an eight bit octet has 256 possible values, 0 – 255.

8 bits -> 256 possible values
1 bit  -> x 2 possible values
------   ----- 
9 bits -> 512 possible values

9 bits -> 512 possible values
1 bit  -> x 2 possible values
-------   ----
10 bits-> 1024 possible values

1024-2  = 1022 host addresses

The confusing thing here is that we are actually crossing the eight bit octet boundary and we’re working with larger numbers. Using either method, we can see that 10 bits are needed for addressing hosts. Knowing that IP addresses are 32 bits total, we can calculated the slash notation of the subnet mask.

IPv4 Bits  –  Host Bits = Subnet Mask Bits

32 – 10 = 22

So the subnet mask is /22 and can be converted to dotted quad format.

   255  .   255  .   252  .  0

At this point, we have determined the answer to the second question to be /22 or

Since we’ve already done the math, let’s go ahead and skip to question four. We know the /22 leaves us 10 bits for hosts. We also know that 10 bits have 1024 possible values and that 2 must be subtracted (to account for the network and broadcast addresses). So the answer to question four is 1022.

To answer question three, we need to look at the subnet bits. To do so, we must use the Classful address as a starting point. Since we are working with a Class A address, the first octet (8 bits) is the Classful network. The rest of the “1” bits in the subnet mask align with address bits used to indicate the subnet.   <- Classful Network 16,777,214 (hosts)

10.00000000.00000000.00000000 <- /22 network (note last 3 octets expanded to binary)

Each octet of an IP address represents 8 bits. So the second octet is 8 bits. The third octet is partially allocated to host addressing and partially allocated to subnet addressing. As indicated above, the first 6 bits of the third octet represent the subnet. That’s a total of 14 (8 + 6) bits of subnetting. To determine the number of possible subnets, we would need to calculate 2^14.

2^14 = 16,384  <- This answers the third question


Subnetting is a fundamental building of IP networking. Each component is fairly simple. However, learning and combining concepts over a short period of time can create confusion. If you struggle with a particular concept in subnetting, share your struggles by commenting below.

In a future article, I will share some sample questions and work through how they should be interpreted (both for exams and real-world networking).

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 Career. Bookmark the permalink.

3 Responses to IP Subnetting Part 5: Subnetting Across the Octet Boundary

  1. Awesome !! Did all 5 parts and have a much better picture.. Have you posted the QnA type as well ?

  2. Erwin says:

    For Class A, the first octet should have a range of 1(0000 0001) to 127(0111 1111)? As you said in part 1?

Comments are closed.