Subnetting Class A Network
Let’s begin with explaining the purpose of subnetting and what subnetting actually is, but before we do we need to understand what an IP address is and what it is made up of. Also, we need find out where, in this whole puzzle, the subnet mask falls in and what effect it has on the IP address.
There are a 5 classes of IP addresses, but only 3 are actually used on most networks. There are referred to as class A, B and C. To determine what class an IP address is we only need to look at the first octet:
Class |
Address Range |
Default Subnet Mask |
CIDR |
| A | 1 – 126 | 255.0.0.0 | /8 |
| B | 128 – 191 | 255.255.0.0 | /16 |
| C | 192 – 223 | 255.255.255.0 | /24 |
What happened to 127? Well, let’s just say that 127 is a special place called “home”. Its a reserved IP address that points to the “localhost”. It is mostly used to find out if the TPC/IP is working on the network card. How is it used? Simply by pinging the IP address of 127.0.0.1 with the command prompt.

Pinging 127.0.0.1 can be used to test your network card and TPC/IP stack. Click image for larger view.
Each class of IP addresses has something called “private IP ranges”. These special addresses are used on the inside of your network. They can not be used to connect directly to the internet. You must be saying to yourself now: “Hey ! You’re wrong ! I’ve got one of these addresses and I can get to the internet!” Yes you can. Due to a little great tool called NAT (Network Address Translation), which “translates” your private IP address into a public one that your ISP (Internet Service Provider) gave you. If you want to find out what your “public” IP address is just go to www.whatismyip.com.
Here are the private IP ranges for each class:
Class |
Address Range |
Number of IP’s |
| A | 10.0.0.0 – 10.255.255.255 | 16,777,216 |
| B | 172.16.0.0 – 172.31.255.255 | 1,048,576 |
| C | 192.168.0.0 – 192.168.255.255 | 65,536 |
An IP version 4 address is made up of four 8-bit parts called octets, so the whole IPv4 address is 32-bit (IPv6 addresses are 128-bit and subnetting is not needed, because of the large number of IP addresses available). This is important because, later on, we are going to use that number (32) to find out about how many bits are being used for network (or subnet) information and how many are being used for hosts. The clue to this information is revealed by the subnet mask. Each class has, what we call, a default subnet mask. This default mask creates only ONE big network for each class.
To understand bits we need to go back to binary and how it translated into regular (decimal) numbers, so here is an example:
255.0.0.0 = 11111111.00000000.00000000.00000000
How do we arrive at this? It’s quite simple; each bit can be either on (1) or off (0). Since each part of the IP address (and subnet mask) is 8 bits they can add up to a total of 255. Take a look at these 2 examples and how binary translates into decimal.
| TOTAL | |||||||||
| Bit Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 255 |
| On or Off | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| All we did in this example was add all the Bit Values together and voila! Here is another example: |
|||||||||
| TOTAL | |||||||||
| Bit Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 212 |
| On or Off | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | |
When we add 128+64+16+4 we get 212. Hopefully binary to decimal conversion doesn’t seem so scary anymore. Feel free to experiment with other combinations and you will realize something: the total value of the 8 bits will NEVER be more than 255. This is why we would never see an IP address or a subnet mask with a number greater than 255 in it.
Here is an example of an invalid IP address: 196.276.456.123. See the two middle octets? Those number are greater than 255, so this is not a valid address.
When it comes to subnet masks that rule stays the same, BUT we have an additional rule.
Subnet masks bits can also be ON (1) or OFF (0), but they HAVE TO be turned on in order, from left to right.
Here is a few examples:
255.128.0.0 (nine bits ON)
255.192.0.0 (ten bits ON: 128+64=192)
255.255.224.0 (19 bits ON: 128+64+32)
As you can see the bits are on from left to right.
Here is an example of a few INVALID subnet masks, that can not be used on any network:
255.147.0.0
255.156.0.0
255.255.100.0
255.255.255.183
Can you figure out why they are invalid? Just convert the values to binary and the answer should jump right at you (hint: if (in each octet) there are any zero’s between the one’s – the subnet mask is invalid )
Anatomy of an IP Address and a Subnet Mask
Each IP address and each subnet mask has 2 parts to it.
- Network part
- Hosts part
Let’s take a look at an example:
IP address: 10.14.232.173
Subnet Mask: 255.0.0.0 (also can be written as /8)
From the first octet we can find out that it is a Class A address. It is also a private IP.
The subnet mask tells us that the first 8 bits are on, and this is actually the “default” subnet mask.
The network portion of the address is 10.x.x.x (using the first 8 bits)
The hosts part is: x.14.232.173 (using the last 24 bits)
Let’s see now… 8+24=32. Isn’t an IP address 32-bit ! Yes it is. It all adds up !
Since we are using the default mask, in this example, this setup is going to yield ONE huge network.
How can we figure out how many hosts OR subnets are there? There are 2 formulas that can help you.
To figure out the number of hosts we can use this formula:
2n-2
where n is the number of bits used for hosts. So, let’s plug the information in and find the answer for this example.
Two to the power of 24 – 2 = 16,777,214
This is how many hosts are possible on this network.
To find out how many subnets we get use:
2n
where n is the number of bits “borrowed”.
Since we used a “default” subnet mask for this Class A address, we did not borrow any bits, so
Two to the power of zero = 1
(Hint: Any number to the power of zero is 1. Always and forever)
Let’s get subnetting !
Let’s take that same network and subnet it:
Network: 10.0.0.0
Subnet Mask: 255.192.0.0
Once again we are dealing with a Class A address, but this time we are using more than the first 8 bits. How many are we using? Let’s find out:
8 bits add up to 255, so that’s the first octet. What adds up to 192? 128+64, so the next TWO bits. Remember that number TWO – we’re going to use it to find out the number of subnets later.
So this subnet mask is using TEN (10) bits for the network part and, how many for the hosts? If you said twenty two (22) – you’re correct.
To figure out the number of hosts we can use the formula:
2n-2
where n is the number of bits used for hosts. So, let’s plug the information in and find the answer for this example.
Two to the power of 22 – 2 = 4,194,302
This is how many hosts are possible on this network PER SUBNET.
To find out how many subnets we get use:
2n
where n is the number of bits “borrowed”.
Since we borrowed TWO (2) bits
Two to the power of two = 4
So this new subnet mask is going to give us FOUR SUBNETS.
Here comes the “fun” part:
Wait, there is a fun part? Not really. It is all math (relatively simple math too) and math has never been fun, but it has ALWAYS been very useful and good excercise for that space between your ears.
In this next part we’re going to figure out what those FOUR (4) subnets are. Each subnet is going to consist of 3 parts:
1. Network ID (also known as subnet ID)
2. IP address range (assignable to hosts, computers, printers, etc.)
3. Broadcast address.
So, once again we are working with:
Network: 10.0.0.0
Subnet Mask: 255.192.0.0
IMPORTANT: The change (from default to the new one) in the subnet mask happened in the SECOND OCTET. This tells us that the subnet IDs (as you will see in Step 1) will change at the SECOND OCTET. If the new subnet mask was different from the “default” one in second and third octet – the subnet IDs would also change in both of those octets.
To figure out the subnets we are going to use the following steps.
STEP 1:
(HINT: From 0 to 255 is 256 numbers !!!)
Subtract 192 from 256 and we get 64. (256-192=64)
64 is your new best friend that will help you figure out all the rest of the information about the subnets.
Here is why and how:
This new best friend of yours (64) is going to tell us two things:
First: SECOND Network ID
Second: increment at which the subnet IDs are increasing
STEP 2:
Let’s put the the number 64 to use. Since it is telling us the SECOND subnet ID it would indicate this:
2nd Subnet ID: 10.64.0.0
With this information we can figure out first subnet ID, range and broadcast address !!!
1st and 2nd Subnet:
SUBNET ID |
First IP |
Last IP |
Broadcast IP |
| 10.0.0.0 | 10.0.0.1 | 10.63.255.254 | 10.63.255.255 |
| 10.64.0.0 | 10.64.0.1 | ? | ? |
How do we figure out the missing (?) information? Simply by using that good old number 64 again. According to out earlier information in STEP 1, 64 tells us the increment at which the subnet IDs are increasing. That is why we have 10.0.0.0 and then 10.64.0.0
Keep ADDING 64 to the second octet and you will find out what the 3rd and 4th subnet IDs are !
1st subnet: 10.0.0.0
2nd subnet: 10.64.0.0
3rd subnet: 10.128.0.0
4th subnet: 10.192.0.0
Now we can take this information and plug it into the previous table:
SUBNET ID |
First IP |
Last IP |
Broadcast IP |
| 10.0.0.0 | 10.0.0.1 | 10.63.255.254 | 10.63.255.255 |
| 10.64.0.0 | 10.64.0.1 | 10.127.255.254 | 10.127.255.255 |
| 10.128.0.0 | 10.128.0.1 | 10.191.255.254 | 10.191.255.255 |
| 10.192.0.0 | 10.192.0.1 | 10.255.255.254 | 10.255.255.255 |
So these are the 4 subnets that we got from the formula before. You can use any of the IPs between First IP and last IP for hosts (computers, printers, routers, switches, etc.), but the Subnet ID and Broadcast IP CAN NOT be assigned to any machine on the network. This is why the formula to figure out the number of hosts is 2n-2. The “minus two” part is referring to those 2 IP addresses.
In this example we subnetted a Class A network in to 4 parts. This information is very useful for setting up SCOPES in DHCP (We are going to have a tutorial about DHCP in a few weeks). For example, we can use this subnet scheme to divide a network into 4 parts (like Users, Admins, VPN connections, Printers), so just by looking at an IP address of a troublesome device – you can find out what kind of device it is.
