Subnet an IPv4 Network


Subnet on an Octet Boundary

In the previous topic you learned several good reasons for segmenting a network. You also learned that segmenting a network is called subnetting. Subnetting is a critical skill to have when administering an IPv4 network. It is a bit daunting at first, but it gets much easier with practice.

IPv4 subnets are created by using one or more of the host bits as network bits. This is done by extending the subnet mask to borrow some of the bits from the host portion of the address to create additional network bits. The more host bits that are borrowed, the more subnets that can be defined. The more bits that are borrowed to increase the number of subnets reduces the number of hosts per subnet.

Networks are most easily subnetted at the octet boundary of /8, /16, and /24. The table identifies these prefix lengths. Notice that using longer prefix lengths decreases the number of hosts per subnet.

Subnet Masks on Octet Boundaries

Prefix LengthSubnet MaskSubnet Mask in Binary (n = network, h = host)# of hosts/8255.0.0.0nnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh 11111111.00000000.00000000.0000000016,777,214/16255.255.0.0nnnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh 11111111.11111111.00000000.0000000065,534/24255.255.255.0nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh 11111111.11111111.11111111.00000000254
Prefix Length Subnet Mask Subnet Mask in Binary (n = network, h = host) # of hosts

To understand how subnetting on the octet boundary can be useful, consider the following example. Assume an enterprise has chosen the private address as its internal network address. That network address can connect 16,777,214 hosts in one broadcast domain. Obviously, having more than 16 million hosts on a single subnet is not ideal.

The enterprise could further subnet the address at the octet boundary of /16 as shown in the table. This would provide the enterprise the ability to define up to 256 subnets (i.e., – with each subnet capable of connecting 65,534 hosts. Notice how the first two octets identify the network portion of the address whereas the last two octets are for host IP addresses.

Subnetting Network using a /16

Subnet Address
(256 Possible Subnets)
Host Range
(65,534 possible hosts per subnet)
Broadcast – – – – – – – – –

Alternatively, the enterprise could choose to subnet the network at the /24 octet boundary, as shown in the table. This would enable the enterprise to define 65,536 subnets each capable of connecting 254 hosts. The /24 boundary is very popular in subnetting because it accommodates a reasonable number of hosts and conveniently subnets at the octet boundary.

Subnetting Network using a /24 Prefix

Subnet Address
(65,536 Possible Subnets)
Host Range
(254 possible hosts per subnet)
Broadcast – – – – – – – – – 10.2255.255.254

Subnet within an Octet Boundary

The examples shown thus far borrowed host bits from the common /8, /16, and /24 network prefixes. However, subnets can borrow bits from any host bit position to create other masks.

For instance, a /24 network address is commonly subnetted using longer prefix lengths by borrowing bits from the fourth octet. This provides the administrator with additional flexibility when assigning network addresses to a smaller number of end devices.

Refer to the table to see six ways to subnet a /24 network.

Subnet a /24 Network

Prefix Length Subnet Mask Subnet Mask in Binary
(n = network, h = host)
# of subnets # of hosts
2 126
4 62
8 30
16 14
32 6
64 2

For each bit borrowed in the fourth octet, the number of subnetworks available is doubled, while reducing the number of host addresses per subnet:

  • /25 row – Borrowing 1 bit from the fourth octet creates 2 subnets supporting 126 hosts each.
  • /26 row – Borrowing 2 bits creates 4 subnets supporting 62 hosts each.
  • /27 row – Borrowing 3 bits creates 8 subnets supporting 30 hosts each.
  • /28 row – Borrowing 4 bits creates 16 subnets supporting 14 hosts each.
  • /29 row – Borrowing 5 bits creates 32 subnets supporting 6 hosts each.
  • /30 row – Borrowing 6 bits creates 64 subnets supporting 2 hosts each.


Subnet a Slash 16 and a Slash 8 Prefix