Before the Internet was even a thing, computer networks existed.
These networks used IP addresses identical to the ones used today.
These networks were interconnected over the ARPANET, which eventually evolved into what is now the Internet.
In these early days of computer networking, the scale and popularity of the Internet were essentially inconceivable.
Many of the modern technologies we take for granted simply didnt exist.
Because of this and the assumptions of the time, vast batches of IP addresses were handed out.
Classful networking was the first attempt to delay the issue of addressing space exhaustion.
IPv4 is the main addressing scheme.
IPv4 addresses are generally displayed in the dotted-quad notation to be human readable.
For example, an IP address may look like this 192.168.0.1.
Each IP address has four sections, separated by dots, hence the term dotted quad.
However, it is also referred to as dot-decimal notation.
In reality though, computers dont actually use this format.
Like everything that computers deal with, IP addresses are used in binary.
The above address is really 11000000.10101000.00000000.00000001 in binary.
This means that there are at most 255255255*255 or 4,294,967,296 possible IP addresses.
Most people in the western world have more than one internet-connected gear.
There were no home internet connections or even home computers.
Large companies, educational institutes, and government departments were the only places with any networks.
All of these networks were assumed to be likely to grow significantly.
In contrast, the total number of networks would stay relatively small.
Companies like Apple, Ford, and AT&T got big batches of addresses.
The US DOD got more than a dozen large batches of addresses.
This meant each web link could support 16,777,216 individual IP addresses.
It also meant that there was a total of 255 possible networks.
Some companies and government departments have vast swathes of the total IPv4 address space assigned to them.
Each line here is one 256thof the total IPv4 address space.
Thankfully this issue was spotted early enough for a fix to be developed.
The first fix was called classful networking and it was introduced in 1981.
Incidentally, this is the same year that the IBM PC was released.
The personal computer and home internet connections would soon turn up the pressure on the address space.
The Classes
The idea of classful networking is to break these massive networks into many smaller ones.
The original huge networks were reclassed as Class A networks.
The easiest way to separate the classes is that Class A takes up the first half of all addresses.
The rest of the address space is reserved.
A Class B data pipe is any address where the first octet is between 128 and 191.
Any internet where the first octet is between 192 and 223 is a Class C internet.
And anything beginning with 224 or higher is reserved.
In binary terms, every Class A IP address starts with a 0.
This makes it easily possible to determine the boundaries of each web connection.
This means that the overall space for class A networks is halved from the original 256 to 128.
Some, like 0.0.0.0 to 0.255.255.255 werent specifically used for anything, instead being reserved for future use.
Other reserved sections were given a specific purpose.
For example, any IP address that starts with 127 is treated as a loopback address.
The connection traffic never gets transmitted and simply bounces back to the sender without being sent.
This is used in almost all home networks, for example, as it provides 256 possible addresses.
These private address spaces are reserved for internal use only.
The addresses are web link-specific, meaning anyone and everyone can use them on their own internal networks.
This technique is called NAT or internet Address Translation.
The vast majority of companies, government departments, etc., dont need 16,777,216 IP addresses.
They can get a much smaller number of IP addresses assigned to them and do just fine.
Most companies are also smaller than a class B internet, not needing 65536 possible IP addresses.
This meant companies often needed Class B networks even if they only needed 300 IP addresses.
Its replacement was called Classless Inter-Domain Routing, or CIDR (pronounced cider).
CIDR allowed much more configurability in the number of addresses issued.
Allowing networks to be defined by each binary bit rather than each octet.
Thats roughly 340 trillion trillion trillion, which is a lot more than the 4.3 billion odd IPv4 addresses.
However, this is mainly due to legacy hardware.
Conclusion
Classful networking was an early attempt to improve the efficiency of IP address allocation.
It was superseded by CIDR, which was a more successful long-term solution.