# Confusion in IPv4 addressing scheme and classfull addressing

I am relatively new to the field of computer networking. I am trying to understand the subject. I know that the question here might be outdated but I still need to understand "why", because I am just unable to put the pieces in place and get a complete picture of the thing.

Please note, all discussion here is in respect to IP v4.

CIDR is what is used nowadays and Class A, B, C etc. don't really make much sense in today's world, as I have learned so far. But for a minute lets say we still have this class-full addressing scheme in use.

So I would like to know this:

What exactly do we mean when we say Class A PUBLIC IP address ? Is it not that classes make sense only when we talk of private networks?

I mean a public IP is simply a unique 32 bit number right? The other thing is we say that, for eg., Class A private IP range is 10.x.x.x to 10.255.255.255 and that Class A IP range is from 0.0.0.0 to 127.255.255.255 (leaving apart the loop back and unusable address cases). So if the private range is the one that should ideally be used in private networks, while all the other addresses in the Class A IP range will be Class A public IPs (which makes no sense to me), then why can't we simply say that the Class A IP range is from 10.x.x.x to 10.255.255.255 itself, because the others in the Class A IP range will be Class A public IPs.

The questions might sound stupid, but I am really confused.

-
sure... will take care of it. –  geek_ji May 20 '13 at 4:40

## 2 Answers

Wikipedia gives you an overview of the classes in a classful network. Class A contains all addresses in which the most significant bit is zero, so all addresses from 0.0.0.0 up to 127.255.255.255. If you say "Class A IP address" you mean an IP address in the given range. If you say "Class A PUBLIC IP address" you mean an IP address in the given range which public.

Public IP addresses are globally routable unicast IP addresses. If you take a look at Wikpedia's IPv4 article or RFC5735, you can see that there are a few ranges in Class A that are not globally routable:

1. 0.0.0.0/8 (0.0.0.0-0.255.255.255): only valid as source address in special cases
2. Private network: According to RFC1918 the network 10.0.0.0/8 (10.0.0.0-10.255.255.255) is a private class A network.
3. Loopback address: 127.0.0.0/8 (127.0.0.0-127.255.255.255) is for local loopback.
4. Shared Address Space: 100.64.0.0/10 (100.64.0.0-100.127.255.255).

So if the private range is the one that should ideally be used in private networks, while all the other addresses in the Class A IP range will be Class A public IPs (which makes no sense to me),

But this is exactly what it is like. There are a few private network IP ranges. One of them is 10.0.0.0/8, which is a Class A network. Another one is 172.16.0.0./12, which is Class B. And private network range 192.168.0.0/16 is Class C. Any IP address (range) you are giving can be classified a Class A, B, C, D or E network. Classful network was first. So first all IP addresses where only put in these classes. But as things evolved there was a need for more granularity and new ranges. So CIDR was invented and someone took the unused range 10.0.0.0/7 in Class A and said that this range is not for public IP addresses anymore but for private network.

then why can't we simply say that the Class A IP range is from 10.x.x.x to 10.255.255.255 itself, because the others in the Class A IP range will be Class A public IPs.

Because this is wrong. You are mixing two stages of evolvement (Class A = classful Networking, public IPs = CIDR). According to Wikipedia IPv4 the first IP addresses had been divided up into 8 bits network and 24 bits host part. This was not flexible enough, only 256 networks maximum were too few, so someone invented classful networking with Class A, B, C, D and E. This second version of IP allocation replaced the first version. Again later someone invented classless inter-domain routing (CIDR). This third version of IP allocation replaced the second version. The classful network allocation scheme was not changed, noone changed Class A or any other class, the classful network scheme is just not used any more.

Class A range was defined to be the range 0.0.0.0-127.255.255.255. This was not changed and it will not change. There is no need to change it. Classful networking is not used nowadays, we are using CIDR now.

You might argue that the inventor of CIDR could have redefined Class A and introduced new classes. But this makes it unnecessarily complex when the same name "Class A" has different meanings depending on the IP allocation version used.

-
it would be really nice and helpful if you could explain the last line of your answer above, preferably with an example.... "If you have an IP address it falls into one of the classful network ranges, but it also falls into one of the CIDR ranges." –  geek_ji May 26 '13 at 14:05
@geek_ji: I changed my answer. I hope it is clearer now. –  Werner Henze May 27 '13 at 7:42

Private addresses "are characterized as private because they are not globally delegated, meaning they are not allocated to any specific organization, and IP packets addressed by them cannot be transmitted onto the public Internet. Anyone may use these addresses without approval from a regional Internet registry (RIR). If such a private network needs to connect to the Internet, it must use either a network address translator (NAT) gateway, or a proxy server." Private Network - Wikipedia

-
I totally understand the point you made above. But I guess you did not really understand what I was trying to ask here. "What exactly do we mean when we say Class A PUBLIC IP address ? Is it not that classes make sense only when we talk of private networks?" –  geek_ji May 21 '13 at 3:32
Apple's network, in classful conventions, is Class A network 17.0.0.0/8, MIT's is 18.0.0.0/8. 24.0.0.0/8 was set aside for cable modem users. Those networks are public class A networks. tools.ietf.org/html/rfc1918 has more details on private IP space. –  Nevin Williams May 21 '13 at 5:56
A: 0.0.0.0 - 127.255.255.255, B: 128.0.0.0 - 191.255.255.255, C: 192.0.0.0 - 223.255.255.255, Private addresses are specific and reside within each class... –  packets May 21 '13 at 10:11
A class A public IP address would be an address range comprising of 256x256x256 IPs (ie X.y.y.y) where X is fixed - and where that range can be routed on the Internet - unlike 10.x.x.x which can't. –  davidgo May 23 '13 at 6:39