I'm studying IPv4 addresses and came across this whole thing about classful addressing. I get the idea behind it, bit there is something I find confusing:
There are two "ABC" ranges:
First one:
A: 1.0.0.0 to 126.0.0.0 with /8
B: 128.0.0.0 to 191.255.0.0 with /16
C: 192.0.0.0 to 223.255.255.0 with /24
Second one:
A: 10.0.0.0 to 10.255.255.255 with /8
B: 172.16.0.0 to 172.31.255.255 with /12
C: 192.168.0.0 to 192.168.255.255 with /16
Why are both of these using the names A, B and C? They are not even using the same sets of subnet-masks! Is the first one only for public addresses? Because the second one is only private addresses.
Help appreciated!
Best Answer
It's likely that the subnet masks are throwing you off. As long as you keep in mind that the below rules no longer apply, you should be fine.
Ultimately classful addressing came down to the most significant (or "leading") bits in the address. Nothing more, nothing less.
0
10
110
The "classes" came from the way they split up the address space for use between "host" and "network". Keep in mind that back then (way way back, from the days of ARPANET), subnet masks did not exist, and the network was intended to be inferred from the address itself. So, with the above in mind, this is what they came up with (this is intended to be binary representation - each
N
orH
represents a single bit in the 32-bit address):NNNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
(less networks, more hosts)NNNNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
(more networks, less hosts)NNNNNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH
(even more networks, even less hosts)Here the
N
is representative of the network portion of the address, and theH
is representative of the host portion of the address, or as they called it back in the day, the "rest field."Combining that with what was said earlier about the most-significant bits, we have the following:
Converting those ranges to binary may make this more clear:
Class A
Class B
Class C
Every single address within those ranges will share a common leading bit(s). The moral of the story is, if you can remember what the leading bits are supposed to be (0 for class A, 10 for class B, 110 for class C) it's extremely simple to determine what "class" an address would have otherwise belonged in. Or, if decimal is easier:
The easiest way to mess someone up on "classful addressing" either on a test, or exam, or whatever, is to use misdirection by way of a subnet mask. Again, remember that the subnet mask does not apply for determining the class of an address. This is easy to forget because as others have said, classless addressing and routing have been around for over two decades now, and the subnet mask and CIDR notation have become ubiquitous in the industry.