Classful addressing is a concept that divides the available address space of IPv4 into five classes namely A, B, C, D & E. Nowadays, this concept has become obsolete and has been replaced with classless addressing. IP addresses, before 1993 use the classful addressing where classes have a fixed number of blocks and each block has a fixed number of hosts. In this section, we will deeply study the classful addressing, its disadvantages & solution to its flaws.
Content: Classful Addressing
- What is Classful Addressing?
- Classes in Classful Addressing
- Disadvantages of Classful Addressing
- Subnetting & Supernetting
- Key Takeaways
What is Classful Addressing?
In its initial days, IP addresses use the concept of classful addressing which splits the available address space into five classes A, B, C, D & E. IPv4 addresses are represented using 32-bit addresses. The 32-bit IPv4 address is also referred to as the 4-byte address or 4-octet address. So, we can conclude that the address space of IPv4 is 232 which is equal to 4,294,967,296.
Generally, the IPv4 addresses are expressed using the binary notation or dotted decimal notation or hexadecimal notation. The first few bits of binary notation of IPv4 addresses recognizes the class of the address whereas, in dotted-decimal notation of IPv4 address the value of the first byte recognizes the class of the address. As you can see the image below, the first byte of each class denotes the range of addresses in each class.
The classful addressing concepts divide the address space into a fixed number of blocks and each block has a fixed number of hosts. In IPv4 addresses of class A, B & C the first part of the address is considered as net-id (Network id) and the second part of the address is called host-id. The size of these parts varies with the classes.
Net-id: The net-id denotes the address of the network.
Host-id: The hoist-id denotes the address of the host attached to the corresponding network.
In Class A, the net-id is defined by the first byte of the address. And the rest 3 bytes defines the host-id.
In Class B, the first two bytes of the address defines the network address and the rest two bytes defines the host-id.
In Class C the first three bytes defines the network address and the last byte defines the host-id.
Classes of Classful address
Class A
The network id of class A is defined by the first byte of the 32-bit IPv4 address. In class A, the first bit of the net-id stays ‘0′ to define that the IPv4 address belongs to the class A and the other 7 bits of the net-id can be changed to defines different blocks in class A. As the first bit is preserved the remaining seven bits calculate the number of blocks in the class A i.e. 27= 128 blocks. There are 128 blocks in class A, as the addressing would start from 0 the range of blocks will be from 0-127.
The host-id in class A is defined by the remaining three bytes of the IPv4 address which is equal to 24 bits. So, we can calculate the number of hosts for each block as 224=16,777,216. So, we conclude that we can assign 128 blocks from class A to 128 organizations where each organization can have 16,777,216 hosts connected to the network.
Now, as we have calculated the number of blocks and the number of addresses in each block of class A. Let us count the total number of addresses in class A which can be calculated as follow:
As we have seen above the first bit of the entire 32-bit addresses of class A stays ‘0’. The remaining 31 bits of 32-bit addresses can be changed to define the address space of class A i.e. 231= 2,147,483,648.
Class B
The network id or the net-id of class B is defined using the first two bytes of the IPv4 address. The first two bits of net-id stays ‘10’ to define that the IPv4 address belongs to the class B and the remaining 14 bits of net-id can be changed to calculate the number of blocks in class B i.e. 214= 16,384.
The next two bytes to of IPv4 address denotes the host id in class B which is 16 bits. The number of hosts can be calculated as 216= 65,536. So, we conclude that we can assign 16,384 blocks from class B to 16,384 organizations where each organization can have 65,536 hosts connected to the network.
Now, as we have calculated the number of blocks and the number of addresses in each block of class B. Let us count the total number of addresses in class B which can be calculated as follow:
As we have seen above the first two bits of the entire 32-bit addresses of class B stays ‘10’ to define the class. The remaining 30 bits of entire 32-bit addresses can be changed to define the address space of class B i.e. 230= 1,073,741,824.
Class C
In class C the network id is defined by the first 3 bytes of the IPv4 address. The first 3 bits in network id stay ‘110’ to define the class and the remaining 21 bits defines the number of blocks in class B. The number of blocks can be calculated as 221= 2,097,152.
The last byte of the IPv4 address in class C defines the host-id. The number of hosts can be calculated as 28 = 256. So, we conclude that we can assign 2,097,152 blocks from class C to 2,097,152 organizations where each organization can have 256 hosts connected to the network.
Now, as we have calculated the number of blocks and the number of addresses in each block of class C. Let us count the total number of addresses in class C which can be calculated as follow:
As we have seen above the first three bits of the entire 32-bit addresses of class C stays ‘110’ to define the class. The remaining 29 bits of entire 32-bit addresses can be changed to define the address space of class C i.e. 229= 536,870,912.
Class D
Like class A, B & C, class D does not divide IPv4 into net-id and host-id. All the addresses of class D are of one single block. The class D addresses are designed for multicasting. The first four-bit of entire 32-bit addresses of class D stays ‘1110’ to define the class.
The remaining 28 bits from the 32-bit addresses of class D can be changed to define the address space of class D. So, the number of addresses in class D is 228=2,68,435,456.
Class E
Like class D, Class E addresses are one block addresses. The addresses in class E are not split into net-id and host-id. The addresses in class E are reserved for future use. The first four bits of entire 32-bit IPv4 addresses of class E stays ‘1111’. The remaining 28-bit changes to define the number of addresses in class E i.e. 228=2,68,435,456.
Disadvantages of Classful Addressing
- If we consider class A, the number of addresses in each block is more than enough for almost any organization. So, it results in wastage of addresses.
- Same is the case with class B, probably an organization receiving block from class B would not require that much of addresses. So, it also results in wastage of addresses.
- A block in class C may be too small to fulfil the addresses requirement of an organization.
- Each address in class D defines a group of hosts. Hosts need to multicast the address. So, the addresses are wasted here too.
- Addresses of class E are reserved for the future purpose which is also wastage of addresses.
- The main issue here is; we are not assigning addresses according to user requirements. We directly assign a block of a fixed size which has a fixed number of addresses which leads to wastage of address.
Subnetting and Supernetting
To overcome the flaws of classful addressing, these two solutions were introduced to compensate for the wastage of addresses. Let us discuss them one by one.
Subnetting
As class blocks of A & B are too large for any organization. So, they can divide their large network in the smaller subnetwork and share them with other organizations. This whole concept is subnetting.
Supernetting
As the blocks in class A and B were almost consumed so, new organizations consider class C. But, the block of class C is too small then the requirement of the organization. In this case, the solution which came out is supernetting which grants to join the blocks of class C to form a larger block which satisfies the address requirement of the organization.
Key Takeaways:
- The IPv4 has 32-bit addresses. The total address space of IPv4is 232=4,294,967,296.
- IPv4 divides the address space into 5 classes A, B, C, D, & E.
- The IPv4 addresses of class A, B and C are divide net id and host id.
- The total addresses in class A are 2,147,483,648 which are divided into 128 blocks and each block has 16,777,216 addresses.
- The total addresses in class B are 1,073,741,824 which are divided into 16,384 blocks and each block has 65,536 addresses.
- The total addresses in class C are 536,870,912 which are divided into 2,097,152 blocks and each block has 256 addresses.
- The total addresses in class D, are 268,435,456 where each address defines a group of hosts. Here, the host has to multicast the address.
- The total addresses in class E are 268,435,456 and they are preserved for future purposes.
- The main flaw of classful addressing is the wastage of addresses due to the fixed size of blocks having a fixed number of addresses in it.
- Subnetting and supernetting were a solution to the flaws of classful addressing.
So, this was all about the classful addressing, this addressing leads to wastage of addresses. Subnetting and supernetting also failed in resolving the problem as they make the routing of packets more difficult. So, classless addressing was introduced to cope up with the failure of classful addressing.
Dawood Abuswai says
Thank you, this article is wwaayy better than my lecture
Getachew says
Nice