What is Subnetting?

(Rene Molenaar) #1

This topic is to discuss the following lesson:

Subnetting Clarification
(Rick D) #2

I have a few questions around subnetting:

  • My understanding is that networks were broken into classes. This was inefficient. So CIDR was released to allow for “subnet” bits to be browed from the host and additional networks to be created. Is my understanding correct?
  • When subnetting do we always start from the default mask. i.e for a Class A network do I always start with a /8 and then subnet from there?
  • VLSM then allowed for these subnetworks to be variable in length rather then all being the same size. Is my understanding correct?
  • One confusion I have is around RFC1918, the RFC states: - (10/8 prefix) - (172.16/12 prefix) - (192.168/16 prefix)

However, online there seems to be a mix of what the subnet mask should be. Some sites say it should be /8, /12, /16. But on this site, the examples are based on /8, /16, /24.


(Lazaros Agapides) #3

Hello Rick

You got most of it, but I hope this clarifies it a bit more.

CIDR is Classless Inter Domain Routing. This feature allows routing to occur not only between classful addresses but also between classless addresses. Classless addresses are those that allow a variable length subnet mask (VLSM), those that have a subnet mask other than the allowed classful address. So VLSM is the feature of IP addresses that allows CIDR to take place.

When subnetting, you always start with a larger address space and subnet into smaller address spaces. The large address space may be classful or it may be classless. For example, an ISP may provide you with a range of addresses of and you have to subnet them appropriately into your network. This range is a class B address, but its subnet mask is not class B. So when you subnet, you are usually given the address space that is available to you and you are to subnet it into subnets that suit your needs.

Here you have to understand the difference between the subnet mask of the classful addresses, and the prefix being used to describe the full range of private addresses.

In the case of, there is one possible class A private address using the classful subnet mask of /8. Both the subnet mask and the prefix defining the full range of private addresses is the same.

In the second case, the full range of private addresses is - which can be defined as But the subnet mask of class B addresses is /16. So: says that these are ALL of the private IP addresses that can be used, this essentially defines the range.
/16 says that the classful addresses of this range must have a subnet mask of /16. So the following are some classful class B private address subnets:

    all of which fall within the available range of private addresses.

For the third case, the full range of class C private IP addresses that can be used are defined by which is the same as saying - But because these are class C addresses, they must have a /24 subnet, so if you are using classful networks, then some possible private class C addresses are:


So 8/ 12/ 16/ are the prefixes that define the full range of private addresses while /8 /16 /24 are the classful subnet masks of the subnets for each type.

I hope this has been helpful!


(Rick D) #4

Thanks. What you have provided makes better sense. However when subnetting with the RFC1918 addresses Im still unclear,

When subnetting a block into small subnets do you calculate from the classful subnet mask or the prefix.
For example an 192.168.x.x. Do you subnet from /16 or 24. And this is the same for 172.16.x.x do you subnet from the /12 or /16.

(Lazaros Agapides) #5

Hello Rick

It all depends on what the requirements are. Remember that subnetting is something that you end up applying to a real world network so the network range you start off with can be anything. If you are given a network of and you are asked to further subnet it to segments of /26 then that is what you will do. There is no rule that says you must start with a /16 or /24. Now if you are told to specifically come up with classful result, then this means that the resulting subnets must be classful. So if you are originally given the range then the resulting subnets you create must have a /24 subnet mask.

I hope this has been helpful!


(Rick D) #6


Your responses have been really useful. And greatly appreciate your help.
So based on all of this would mean…

I have a Im right in thinking I can get a maximum of 254 networks from this as the prefix is /16. The mask is /24. Therefore I have 8 bits as subnet bits to play with.

Lets take another example:
How many subnets and hosts per subnet can you get from the network ? Its a class B so /12 bits are used for the network id. Therefore we have /16 subnet bits and 4 host bits. So this would give us… 65536 subnets with 14 hosts.


(Lazaros Agapides) #7

Hello Rick

Yes you’re right. Let me say it another way. The network defines a range of IP addresses from to This is a single subnet with a subnet mask of If you started off with a range of (which is the full range of private class C addresses), and you want to separate this range into /24 subnets, then this means that you can have up to 256 networks with 256 addresses (254 without network and broadcast) in each. In other words, the networks would be:

For this one, not quite. is the same as /28. If we do the same thing here we will have

This one is a little harder to see. Looking at the IP address in binary, like you described yourself, we start off with:


where the italics are the subnet and the bold are the host. The italics are 12 bits, so 2^12 = 4096. We have 4096 subnets each containing 16 (14 without network and broadcast) hosts.

I hope this has been helpful!


(Rick D) #9

Thanks. Sorry but Im still unclear. Your point of the 192.168 makes sense. We have a /24 but if we want to create more subnets we can use the class c range of /16 to obtain another 8 subnet bits.
However for the 172.30 address…
If wanted to create more subnets with the same amount of hosts in each, then wouldn’t we then again use the Class B range which is /12. Even if i go online it shows it being calculated the same was as you have shown. Also the binary you have shown is 172.3.x.x (?).


Thank you for all your help…

(Lazaros Agapides) #10

Hello Rick

My apologies, I made an error in my explanation. Let me clarify:

First of all, yes the binary I showed was incorrect. It should be


So going back to the original question, you are given an IP address of as your starting address and you want to create equal subnets with a subnet mask of Now what’s confusing here is that we have three different ways of describing the IP address ranges involved. We have:

  • The mask bits of the class B private IP address range which is /12
  • The classful mask of the private IP address range which is /16
  • The subnet size we want to obtain using the subnet mask we are given which is /28 (same as

The first of the three describes the full range of private Class B IP addresses. So is the same as saying - This describes the whole range. There is only one such range.

The second gives us the subnet mask to be used if CLASSFUL addressing will be used which is /16 or Here we can say that in the whole range of class B private addresses, there are multiple Classful subnets we can create. Namely:

The third is what we want to end up with, which is small subnets of /28 which is the same as a subnet mask of These were described in a previous post.

So, if you are originally given and you are told that this is a class B private range, and you want to separate this into subnets of /28 then:

You are starting with (class B) which means addresses from to Going to binary, we have:


where once again, the italics are the subnet and the bold are the host. The italics are 12 bits, so 2^12 = 4096. We have 4096 subnets each containing 16 (14 without network and broadcast) hosts.

Note that in your image of the IP subnet calculator above, you are using a subnet mask of rather than and this is why you get a value of 8192 and not 4096 for the maximum number of subnets.

I hope this has been helpful!


(Rick D) #11

Thanks - this is now clear.

1 Like