This topic is to discuss the following lesson:
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.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (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.
Thanks,
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 147.52.0.0/22 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 10.0.0.0/8, 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 172.16.0.0 -172.31.255.255 which can be defined as 172.16.0.0/12. But the subnet mask of class B addresses is /16. So:
172.16.0.0/12 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:
- 172.16.0.0/16
- 172.17.0.0/16
- 172.18.0.0/16
- 172.19.0.0/16
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 192.168.0.0/16 which is the same as saying 192.168.0.0 - 192.168.255.255. 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:
- 192.168.10.0/24
- 192.168.11.0/24
- 192.168.12.0/24
- 192.168.13.0/24
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!
Laz
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.
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 192.168.0.0/23 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 192.168.0.0/23 range then the resulting subnets you create must have a /24 subnet mask.
I hope this has been helpful!
Laz
Hi,
Your responses have been really useful. And greatly appreciate your help.
So based on all of this would mean…
I have a 192.168.0.0/24. 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 172.30.0.0 255.255.255.240 ? 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.
Thanks
Hello Rick
Yes you’re right. Let me say it another way. The 192.168.0.0/24 network defines a range of IP addresses from 192.168.0.0 to 192.168.0.255. This is a single subnet with a subnet mask of 255.255.255.0. If you started off with a range of 192.168.0.0/16 (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:
192.168.0.0/24
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
192.168.4.0/24
192.168.5.0/24
192.168.6.0/24
…
…
192.168.254.0/24
192.168.255.0/24
For this one, not quite. 255.255.255.240 is the same as /28. If we do the same thing here we will have
172.30.0.0/28
172.30.0.16/28
172.30.0.32/28
172.30.0.48/28
…
…
172.30.255.224/28
172.30.255.240/28
This one is a little harder to see. Looking at the IP address in binary, like you described yourself, we start off with:
10101100.00000011.00000000.00000000
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!
Laz
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…
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
10101100.00011110.00000000.00000000
So going back to the original question, you are given an IP address of 172.30.0.0 as your starting address and you want to create equal subnets with a subnet mask of 255.255.255.240. 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 255.255.255.240)
The first of the three describes the full range of private Class B IP addresses. So 172.16.0.0/12 is the same as saying 172.16.0.0 - 172.31.255.255. 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 255.255.0.0. Here we can say that in the whole range of class B private addresses, there are multiple Classful subnets we can create. Namely:
172.16.0.0/16
172.17.0.0/16
172.18.0.0/16
172.19.0.0/16
…
172.30.0.0/16
172.31.0.0/16
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 255.255.255.240. These were described in a previous post.
So, if you are originally given 172.30.0.0 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 172.30.0.0/16 (class B) which means addresses from 172.30.0.0 to 172.30.255.255. Going to binary, we have:
10101100.00011110.00000000.00000000
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 255.255.255.248 rather than 255.255.255.240 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!
Laz
Thanks - this is now clear.
I have a question that I find confusing. How do I determine the number of /24 subnets can be derived from a /23 subnet? Thanks for the help.
MIke
Hey @mooremike602,
I’m not positive where you are at in your studies so I’ll try to not make assumptions. However, as prescribed in mathematics binary is a base-2 numerical system, which uses only two symbols: typically “0” and “1”.
To start off, 192.168.0.0 /24 gives you the range of: 192.168.0.0 - 192.168.0.255. However, 192.168.0.0 /25 is half of that, or comprised of two subnet values: 192.168.0.0 - 192.168.0.127 and 192.168.0.128 - 192.168.0.255.
This means that you can fit two /25’s into a single /24. This holds true across the board - one could derive from that notion that as you shrink your prefix length (going from a /25 to a /24, or from a /24 to a /23) you will need two subnets to fill that gap.
So, if we carry that same logic over, we know that the network 192.168.0.0 /24 is from 192.168.0.0 - 192.168.0.255; the second subnet is from 192.168.1.0 - 192.168.1.255; the third subnet is 192.168.2.0 - 192.168.2.255; and so on and so forth.
In comparison, you can find the block size, or subnet range from determining what the bit value is left of your slash notation. If you are given a 192.168.0000000|0.00000000 /23, we know that left of that slash or hyphen is a bit value of 2; the bit values being 128 - 64 - 32 - 16 - 8 - 4 - 2 - 1 respectively. The hyphen is in-between the 2, and 1 bit value, and we know left of it is 2 which is our block size. We also know that our prefix length determines what octet we operate within, and because we are “borrowing” 23 bits (192.168.1111111|0.00000000) we work in that octet as such.
That said, this means that our first subnet range is 192.168.0.0 - 192.168.1.255 /23. This shows us that as we decreased, or shrunk our prefix length value by 1, the next largest value will require 2 subnets to fill it’s place. 192.168.0.0 - 192.168.0.255, and 192.168.1.0 - 192.168.1.255 is two different subnets that match exactly to our single /23.
In short, two /25’s can fit into a single /24; two /24’s can fit into a single /23; two /23’s can fit into a single /22; etc.
If there is anything I didn’t explain well enough, or you would like further clarification feel free to @ me, and I’ll do my best. Thanks!
Thank you vey much for your help!
MIke
Anytime!
If you ever run into future questions along your studies feel free to give me a shout out. I passed my CCNA R&S back in May, and now I’m hitting the grindstone to achieve my CCNP R&S before the last date to test on February 23, 2020.
-Austin
Hello,
The article - https://networklessons.com/cisco/ccna-200-301/what-is-subnetting
There is a mistake in the following statement of the mentioned lesson.
It should be 30 usable IP addresses, not 32.
The VLANs behind R4 will have 20 servers, the smallest subnet we can use is a /27 which allows 32 usable IP addresses.
Hello Vadim
Going into the lesson I see that the statement is now correct. It seems that @ReneMolenaar has already corrected it.
Thanks for pointing that out!
Laz
“There’s a limited amount of class C (private) networks. We can choose between 192.168.0.0/24 and 192.168.255.0/24. What if we have more than 256 sites? There’s not enough space so you will have to pick another network range.”
I’m a bit confused about what subnet mask you would use for a class C private network. In the quote from the lesson it says /24 but elsewhere I read that the range is 192.168.0.0 - 192.168.255.255 with a subnetmask of 255.255.0.0 which is /16? So, is the /16 address a consequence of classless routing?
Hello Marit
When talking about classful IP addressing, there are two things involved. The first is the actual range of the addresses that exist in that class, and the second is the subnet mask used to define the specific network in question.
When talking the private class C addresses, we can define the full range by saying that these addresses fall within the following address space: 192.168.0.0 255.255.0.0. This does not define a single network, but the range of private class C addresses. The default subnet mask for particular private class C addresses is 255.255.255.0. The confusion here is due to the fact that a subnet mask is used to define both the range as well as the default size of a class C network. You must determine the context in each case.
So if we say that the full range of private class C addresses is 192.168.0.0 255.255.0.0, we are simply saying that the address space used for class C addresses is from 192.168.0.0 to 192.168.255.255. However, each individual network within this address space must have a subnet mask of 255.255.255.0.
So within this address space, you can have the following class C networks:
192.168.0.0 255.255.255.0
192.168.1.0 255.255.255.0
192.168.2.0 255.255.255.0
…
…
192.168.254.0 255.255.255.0
192.168.255.0 255.255.255.0
The total number of class C networks within the class C network range is 256, and each class C network has 256 addresses.
Similarly, the class B private address range is 172.168.16.0 255.240.0.0 but the default subnet mask is actually 255.255.0.0 for each class B private network within that range.
For class A private network addresses, it turns out that the range, as well as the size of each class A network is the same, so there is only a single class A network within that range. The class A private address range is 10.0.0.0 255.0.0.0 and the default subnet mask for such a classful network is 255.0.0.0. So in this case, the full range is just a single network.
I hope this has been helpful!
Laz
Yes, it makes sense now, thanks a lot!!
Hi
Can you give me any advice or do you know best practise to planning an ip addressing.
Thanks