Call Us: (888) 403-3833
NetAdminWorld - Finding network solutions, not excuses.

Subnetting IPv4

IPv4 Subnetting Explained with Examples

Related Articles

Network Setup
Network Types
IPv4 Addressing
IPv6 Addressing
Storage and Backup
Server Maintenance


Subnetting IPv4 Addresses

Introduction to Subnetting

The logical subdivision of an IP network is known as a subnet or subnetwork. Dividing a network into two or more networks is called subnetting.

Hosts belonging to a subnet are addressed with a common, identical, most-significant bit-group in their IP address with results in the logical division of an IP address into two fields, a network number or routing prefix and the rest field or host identifier. The identifier for a specific host or network interface is known as the rest field.

The routing prefix can be expressed in Classless Inter-Domain Routing (CIDR) notation written as the first address of network followed by a forward slash (/) and ending with the bit-length of the prefix. An example of this would be to Class C address This shows it has 24 bits allocated for the network prefix, and the remaining 8 bits reserved for host addressing. (Remember there are 32-bits in an IPv4 address.)

In IPv4 a network may also be characterized by its subnet mask. This is where the bitmask when applied by a bitwise AND operation to any IP address in the network, yields the routing prefix. The Subnet masks are also expressed in dot-decimal notation like an address. And example of this would be as the network mask for the prefix.

Benefits of subnetting an existing network vary depending on the deployment scenario. It is necessary to allocate address space efficiently in the address allocation architecture of the Internet using CIDR and in large organizations. Subnets may be arranged logically in a hierarchical architecture, partitioning an organization's network address space into a tree-like routing structure.

Creating Subnets

You have an address range and you need to divide it into separate networks. This is where subnetting an IPv4 address is a skill that is helpful to have and there are many factors and techniques used to create a subnetting plan.

Calculating Subnets

The formula for calculating the number of subnets is: 2n, where n is the number of bits borrowed. And example of this is: 21 = 2 subnets.

Taking this further, for each subnet we examine the last octet of the subnet address in binary. The values of these octets for the two subnets are:

Subnet 1: 00000000 = 0
Subnet 2: 10000000 = 128

Calculating Hosts

Calculating the number of hosts per network is found by using the formula 2n-2 where n = the number of bits left for hosts. An example of this is: 27 - 2 = 126. This formula shows that each of these subnets can have 126 hosts.

You may ask why the formula subtracts two from the equation when finding hosts. Well, just using 27 shows that we have 128 hosts, but we need to find the available hosts. Not all of the 128 hosts are available. We must keep in mind that we have to take into account the Network and the Broadcast addresses as well, so this is the reasoning behind the subtraction of two from the formula. 27 - 2 = 126 available hosts (minus the two reserved for the Network and Broadcast.)