Score:-2

Identifying subnet bits of network addresses with same CIDR

cn flag

Say we have network addresses 10.10.10.252/30 and 10.10.255.252/30 and 10.255.255.252/30. They all have CIDR of 30.

I realize all three subnets have two usable hosts.

All three addresses have subnet mask 255.255.255.252 but different number of possible subnets. 10.255.255.252/30 has 30-8=22 bits reserved for subnets (class A). 10.10.255.252/30 has 30-16=14 bits reserved for subnets (class B). 10.10.10.252/30 has 30-24=6 bits reserved for subnets (class C). But this is not apparent from looking at their CIDR.

So how do I identify the number of subnet bits from looking at their subnet masks or CIDR?

https://www.omnisecu.com/tcpip/internet-layer-ip-subnetting-part6.php

Bravo avatar
us flag
I think you may misunderstand subnets ... none of those have that many bits for subnet - if you have a /30 ip address, that IS the subnet
Logan Lee avatar
cn flag
@Bravo i edited the question to make it clearer.
Daniel avatar
in flag
/30 always has 30 bits reserved for subnets. Why are you subtracting multiples of 8 for each? Because the value is 10?
Logan Lee avatar
cn flag
@Daniel because of the class.
Daniel avatar
in flag
Class A = /8, Class B = /16, Class C = /24
Logan Lee avatar
cn flag
please have a look at the table in https://www.omnisecu.com/tcpip/internet-layer-ip-subnetting-part6.php
Bravo avatar
us flag
all your addresses are /30 ... therefore all your subnet bits are 22 (according to the table in the page **you linked** ... there is no difference between *10.10.10.252/30 and 10.10.255.252/30 and 10.255.255.252/30* ... they're all /30, therefore they're all 22 subnet bits as per the last table in the document you linked - a `255` in the second or second and third octet of a /30 address has no special meaning
Logan Lee avatar
cn flag
@Bravo how about the page https://www.omnisecu.com/tcpip/internet-layer-ip-subnetting-part4.php
Bravo avatar
us flag
what's class B got to do with class A subnetting?
Daniel avatar
in flag
The table about Class A is trying to explain how given a class A block of IP, you can decide to assign from the remaining number of bits a certain number of them for subnets and the remainder for hosts. So in the example it is saying that you can use 4 bits for subnets which would give you 16 subnets (1111 = 15) with 1048576 hosts per subnet. You can split this up whatever way you want by changing the number of bits you decide to assign to subnets
Logan Lee avatar
cn flag
@Bravo i thought 10.255.255.252/30 is class A, 10.10.255.252/30 is class B and 10.10.10.252 is class C. is this wrong?
Bravo avatar
us flag
@LoganLee -why? they are /30 - they are not class A, class B or class C .. .class A = /8, class B = /16, class C = /24 as Daniel already told you ... /30 is none of those - see https://www.n-able.com/blog/overview-of-subnet-classes
Logan Lee avatar
cn flag
@Bravo if you look at my two links they are different classes but there is an entry for /30 for both.
Logan Lee avatar
cn flag
@Bravo ok i will have a look at your link.
Bravo avatar
us flag
there's much misinformation on the internet - but a /30 is not class A, B or C - your links describe subnetting A, B, or C - but a /30 netmask can not be subnetted - there's no room for subnetting a /30
Logan Lee avatar
cn flag
@Bravo now i know why those are class A. its because the first byte is in range 0-127. thx!
Bravo avatar
us flag
"class" is irrelevant though ... the ranges **you** defined were `/30` - class A,B,C is irrelevant to "subnetting" a /30 range
us flag
Classful subnetting and CIDR are separate concepts and you must not mix them in any way.
Michael Hampton avatar
cz flag
You should ignore this tutorial entirely, as it refers to historical IP classes which are no longer used.
Score:3
ru flag

Classful networking was obsoleted in 1993 by RFC 1518/1519. Please leave network classes in the history drawer where they belong, they are irrelevant.

They all have CIDR of 30.

There is no such a thing. You likely mean prefix length.

So how do I identify the number of subnet bits from looking at their subnet masks or CIDR?

The number of network bits is the number indicated by e.g. /30. Only when you subnet a network with m bits to n bits*, the number of subnet bits is n - m: the number of host bits you repurpose as network bits.

You can subnet each /30 network in two /31 subnets, for point-to-point links only.

Score:-4
cn flag

All three ip's are class A because the first byte is in range 1-126.

10.10.10.252/30 belongs to the subnet 10.10.10.252-10.10.10.255.

10.10.255.252/30 belongs to the subnet 10.10.255.252-10.10.255.255.

10.255.255.252/30 belongs to the subnet 10.255.255.252-10.255.255.255.

They all have 22 subnet bits.

If it was a class B or class C IP for that matter, then the bits reserved for subnets (subnet bits) would be different even with the same 30 mask bits.

For class B, there are 14 subnet bits for /30. For class C, there are 6 subnet bits for /30.

My confusion was originating from me not knowing how to differentiate different classes. I didn't know it depended on the value of the first byte.

jcaron avatar
co flag
Classes no longer exist. Forget about them. They have been replaced by CIDR over 20 years ago. In CIDR, you have a prefix-length (the part after the `/`) which defines how many bits are the network address, and the rest is the host part. Any subnet can be further subnetted at any point, and this is actually very frequent.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.