Computer Networking - Subnetting Explained (Part 2)

By: Daniel Imbellino
Updated: Feb 24, 2013

Continuing From The Last Page...

Let’s give an example of subnetting:
Let’s say our network address we are going to work with is This is a class C IP address, and Class C addresses have a default subnet mask of And lets suppose we need 12 subnets for our networks. The nearest power of 2 is 16, which = 2 to the 4th power.
Now we need to borrow 4 bits from the host portion to add to our network portion of the subnet mask. Our default subnet mask was, but we added 4 bits to the end of our subnet, so we now have 11110000. Why 8 bits? Because, there are8 bits per octet in an IPV4 address, and you will always borrow bits from left to right. It’s best to envision all 8 bits when calculating their values. We have 4 bits with the values: 1x2 to the 4th power = 16, + 1x2 to the 5th power = 32, + 1x2 to the 6th power = 64, + 1x2 to the 7th power = 128. So we have 16 + 32 + 64 + 128 = 240. So our new subnet mask equals
Now we need to calculate how many host addresses we will have per subnet. We do this using the bits within the host portions octet that were not assigned to the network portion. We assigned 4 bits to the network portion, leaving us with 4 bits for host addresses. 2 to the 4th power = 16. Remember, the formula to figure out how many host addresses are available is 2 to the nth power – 2 (with N representing the number of bits you have left over in the octet). So we effectively have 2 to the 4th power – 2 which equals 16 – 2, which = 14 host addresses per subnet.
Now we need to figure out the numbers for our subnet addresses. We can do this by cycling through the 4 bits that we added to our subnet mask. Our first address we started with was, and this is where we will start. Remember, there is always 8 bits in an octet. The diagram below shows how we cycle through those 4 bits using the original IP address we started with: (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address = (subnet address =

You may now notice that we have 16 subnets, and we only needed 12, so the calculation worked for us. We also calculated that there are 16 addresses available per subnet. Remember our formula to figure the available host addresses? It was 2 to the nth power – 2. This was because you cannot use the host addresses that end in all ones (this is the broadcast address), or all zeros (this is the network address). EX: Looking back at our first subnet of (subnet address =, there are 16 available addresses, but the first address of (ones included for visual comprehension), or, would be the address assigned to our router. This would be our network address, therefore you could not assign this address to a host (computer) on the network. You also cannot assign the last address, which would be the broadcast address. Our full range of addresses available per subnet is 16, and so for the subnet numbered (subnet address =, our affective addresses would be from to Actually, the first address of each subnet is typically going to be the address of your network, so it cannot be assigned to hosts. Just like the hosts on a network require an IP address in order to communicate with other hosts or networks, so do routers. Most routers use DHCP (Dynamic Host Configuration Protocol) to assign hosts on a given network with an IP address. Routers that use this protocol typically start with a class C private IP address and assign the first address to the router, and the other addresses are assigned IP addresses extending from the routers IP address. When we refer to “host”, we are referring to any device, not just a computer that is assigned an IP address. This could be a smart phone, desktop or laptop PC, tablet PC, printer, or any other mobile device on your network.