17

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!

6
  • 17
    The real world stopped using classful addressing at least 15 years ago. I suggest you put effort into learning CIDR (classless inter domain routing).
    – Teun Vink
    Feb 25, 2014 at 15:32
  • @TeunVink That won't help much for certification testing, though... Classful addressing is still a pretty integral part of the CCNA curriculum.
    – Ryan Foley
    Feb 25, 2014 at 15:43
  • 6
    Wow really? That's... sad.
    – Teun Vink
    Feb 25, 2014 at 15:50
  • 2
    @TeunVink It's not really any different that having to learn about Token Rings and BNC connectors for Comptia Networking+. Old OLD technology, but still a chance to run across it.
    – WernerCD
    Feb 26, 2014 at 1:42
  • 3
    Not a real answer, but much more a rant: why in 2014 there is still people teaching about A B and C classes? The whole making up is just confusing, when used today with 1s-to-the-left-up-to-32-ones bit masks. I understand the historical value, but it is the time to update books and courses! One should learn the CIDR first and then be taught about the old days. Do you start by study Latin to learn French? Mar 18, 2014 at 13:34

4 Answers 4

33

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.

  • Class A: Most significant bits starts with 0
  • Class B: Most significant bits start with 10
  • Class C: Most significant bits start with 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 or H represents a single bit in the 32-bit address):

  • Class A: NNNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH (less networks, more hosts)
  • Class B: NNNNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH (more networks, less hosts)
  • Class C: NNNNNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH (even more networks, even less hosts)

Here the N is representative of the network portion of the address, and the H 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:

  • Class A: 0.0.0.0 - 127.255.255.255
  • Class B: 128.0.0.0 - 191.255.255.255
  • Class C: 192.0.0.0 - 223.255.255.255

Converting those ranges to binary may make this more clear:

Class A

0.0.0.0
-----------
[0]0000000.00000000.00000000.00000000

127.255.255.255
-----------
[0]1111111.11111111.11111111.11111111
 ^
 most significant bit = 0

Class B

128.0.0.0
-----------
[10]000000.00000000.00000000.00000000

191.255.255.255
-----------
[10]111111.11111111.11111111.11111111
 ^
 most significant bits = 10

Class C

192.0.0.0
-----------
[110]00000.00000000.00000000.00000000

223.255.255.255
-----------
[110]11111.11111111.11111111.11111111
 ^
 most significant bits = 110

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:

  • Class A: First octet in address is between 0 and 127, inclusive
  • Class B: First octet in address is between 128 and 191, inclusive
  • Class C: First octet in address is between 192 and 223, inclusive

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.

7
  • 1
    Just to expand on this from a historical perspective, to say that subnets did not apply in classful networks is not quite accurate. The idea of subnetting did not originate with CIDR. For example RFC 950, published back in 1985 talked about subnetting in classful networks a decade before CIDR became the norm. faqs.org/rfcs/rfc950.html. Feb 25, 2014 at 20:13
  • 1
    @RussellHeilling I simply said CIDR notation and the concept of a subnet mask going along with an IP address has become ubiquitous - I'll rephrase the statement "does not apply" to be more clear - it does not apply in determining the class that an address belongs in. Feb 25, 2014 at 20:24
  • +1 I never realized A/B/C followed 0/1/11. Why didn't you tell me this years ago?
    – WernerCD
    Feb 26, 2014 at 1:45
  • 4
    @WernerCD it's 0 / 10 / 110 - completely different than 0/1/11 :-) trailing zeroes are significant in binary. Leading ones are not. Feb 26, 2014 at 22:30
  • @JohnJensen Brilliant explaination! Thank you so much :D Feb 28, 2014 at 15:10
18

While the idea behind classful addressing is now obsolete as classless interdomain routing (CIDR) has been in use for decades(the original RFC1519 was published in 1993), your first answer is the historically correct one.

The second set of networks you list are from RFC1918, and define private use address ranges. There is a single /8 network within the former class A space (giving a single class A network), a /12 within the former class B space (giving 16 class B networks), and a /16 within the former class C space (giving 256 class C networks).

There is no contradiction.

4
  • I don't understand why it is 16 class B networks. If the network portion is /12 wouldn't it be remaining lower 4 bits in the second octet + 2 lower octets be host addresses?
    – Eladian
    Aug 13, 2018 at 4:48
  • In modern classless routing terms, yes. Traditional classfull routing didn't have the concept of supernets, and only limited support for subnetting. The natural mask of addresses in this range is /16, in classful routing the /12 would not be usable as a single network, only as 16 discrete class B networks. Aug 13, 2018 at 9:15
  • Thanks for answering this was confusing the hell out of me until now it sort of all is starting to make sense. So now a days we cannot say that a class B network (beginning with prefix 10) definitely has 16 networks without knowing the subnet mask - if I am understanding correctly. But if we are told it has the mask /16, then we can.
    – Eladian
    Aug 13, 2018 at 10:43
  • When thinking classfully, a class B nework (binary prefix 10) is always a /16. There is no concept of a /12 in classful routing, so the way to think about the /12 allocated in RFC1918 is 16 individual class B networks. Of course this is all academic - you will not need to know any of this to configure a modern network, and can freely subnet the 1918 space. Aug 13, 2018 at 15:01
3

Alex, you asked the question back in 2014, and I didn't see a clear, succinct answer to your question, so here goes: The "First One" are public IP addresses, which can be used on the internet. The "Second one" are private IP addresses which cannot be used on the internet as they are not routable. There are, however, benefits to private IP addresses. Firstly, cost. An organization can lease one public IP address from an ISP which internal nodes can use when communicating externally. Secondly, security. Internal IP addresses will remain unknown. A NAT or PAT server can be used for translating private IP to public and vise versa.

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

Hope this helps.

/Joanne

1

The class, "A", "B" and "C", tells you the size of the network mask. (e.g., a class "C" has a 24 bit network mask.) The class is not a proper name specifying a specific network.

5
  • 1
    While it is true that the natural mask of a class C network is equivalent to a /24 prefix length, the reverse is not true. 10.1.1.0/24 is not a class C network for example - it is a classless /24 subnet within the former class A space. Please try not to draw parallels between classful terminology and CIDR notation. Feb 25, 2014 at 15:58
  • 1
    Actually, it is by modern terminology; "class" is simply the size of the subnet.
    – Ricky
    Feb 25, 2014 at 19:33
  • I was trying to provide a simple answer to point out his confusing the idea of 'a particular network' in "A" with netmasks and network ranges. In hindsight, I think Jensen's explanation is more useful than my attempt at brevity. Feb 25, 2014 at 19:35
  • 1
    @RickyBeam Not sure what you mean by modern terminology. I know that in my experience (in the ISP industry) the common term for a /24 is a 'slash-24'. Anyone caught calling it a class C generally gets a lecture on the history of CIDR... :) Feb 25, 2014 at 20:04
  • 1
    Nobody does "classful" anymore, so class foo has devolved into just the subnet size.
    – Ricky
    Feb 25, 2014 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.