-2

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

Logan Lee
  • 149
  • 1
  • 6
  • 4
    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 – Bravo Aug 28 '21 at 03:40
  • @Bravo i edited the question to make it clearer. – Logan Lee Aug 28 '21 at 03:48
  • /30 always has 30 bits reserved for subnets. Why are you subtracting multiples of 8 for each? Because the value is 10? – Daniel Aug 28 '21 at 03:54
  • @Daniel because of the class. – Logan Lee Aug 28 '21 at 03:56
  • 1
    Class A = /8, Class B = /16, Class C = /24 – Daniel Aug 28 '21 at 03:57
  • please have a look at the table in https://www.omnisecu.com/tcpip/internet-layer-ip-subnetting-part6.php – Logan Lee Aug 28 '21 at 03:59
  • 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 – Bravo Aug 28 '21 at 04:03
  • @Bravo how about the page https://www.omnisecu.com/tcpip/internet-layer-ip-subnetting-part4.php – Logan Lee Aug 28 '21 at 04:05
  • what's class B got to do with class A subnetting? – Bravo Aug 28 '21 at 04:05
  • 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 – Daniel Aug 28 '21 at 04:06
  • @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? – Logan Lee Aug 28 '21 at 04:08
  • @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 – Bravo Aug 28 '21 at 04:10
  • @Bravo if you look at my two links they are different classes but there is an entry for /30 for both. – Logan Lee Aug 28 '21 at 04:11
  • @Bravo ok i will have a look at your link. – Logan Lee Aug 28 '21 at 04:13
  • 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 – Bravo Aug 28 '21 at 04:13
  • @Bravo now i know why those are class A. its because the first byte is in range 0-127. thx! – Logan Lee Aug 28 '21 at 05:48
  • "class" is irrelevant though ... the ranges **you** defined were `/30` - class A,B,C is irrelevant to "subnetting" a /30 range – Bravo Aug 28 '21 at 05:54
  • Classful subnetting and CIDR are separate concepts and you must not mix them in any way. – Tero Kilkanen Aug 28 '21 at 09:22
  • You should ignore this tutorial entirely, as it refers to historical IP classes which are no longer used. – Michael Hampton Aug 28 '21 at 19:27

2 Answers2

3

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.

Zac67
  • 10,320
  • 2
  • 12
  • 32
-4

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.

Logan Lee
  • 149
  • 1
  • 6
  • 3
    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. – jcaron Aug 28 '21 at 11:33