What is classful addressing in IPv4?

Classful addressing divides the available IP address into five classes: A, B, C, D, and E. This architecture divides the address into classes based on the fixed number of blocks assigned to the host IDPart of the IP address that uniquely classifies a host on a specified network. and network IDPart of the IP address which identifies the network for a given host.. The most significant bits of the address (starting from the left) represent the network ID, and the remaining part represents the host ID.

The IP addresses in classful addressing are written in dotted decimal notation. The IP address' first few bits describe the class of the address.

Classes of classful address

The following describes the structure of different classes of IP addresses:

Class A

In this class, the first byte of the 32-bit IP address represents the network ID. The first bit of the net ID remains '0', and the remaining seven bits can be arranged to generate different class A addresses. Therefore, it can generate 27 (128 blocks) different blocks of addresses ranging from 0–127.

The remaining three bytes represent the host ID, resulting in 224 (1677216) hosts for each block and 231 different addresses.

The following diagram illustrates the structure of class A IP addresses:

Class A IP addresses

Class B

In this class, the first two bytes of the 32-bit IP address represent the network ID. The first two bits of the net ID remain '10', and the remaining 14 bits are used to generate different class B addresses, such as 214 (16384) different blocks of addresses.

The remaining two bytes of the IP address denote the host ID, providing 216 different hosts and 230 different addresses.

The following diagram illustrates the structure of class B IP addresses:

Class B IP addresses

Class C

In this class, the first three bytes of the 32-bit address represent the network ID. The first three bits of the net Id remain '110', and the remaining 21 bits define the number of blocks for class C, such as 221 = 2097152 blocks.

The last remaining byte represents the host ID, such as 28 = 256 and the total number of class C addresses that can be generated are 229 = 536870912—the first three bits are fixed—therefore, the remaining 29 bits make different arrangements).

The following diagram shows the structure of class C IP address:

Class C IP addresses

Class D

Class D does not divide the IP address into a fixed-size network ID and host ID, unlike the above-mentioned classes. Class D addresses are designed for multicastingIt is a method of group communication where the sender sends data to multiple receivers or nodes present in the network simultaneously.. The first four bits remain '1110' (representing class D), and the remaining 28 bits can be altered to define the address space of class D. This makes a total of 228 addresses for class D.

The following diagram shows the structure of class D IP address:

Class D IP addresses

Class E

Class E addresses are also one-block addresses (like class D). This class is reserved for future use (for research purposes, and so on). The first four bits of the IP address remain '1111'. The remaining 28 bits generate different permutations of class E addresses, such as 228 addresses.

The following diagram shows the structure of class E IP address:

Class E IP addresses

This is how classes are defined by changing the number of bits assigned to the host ID and network ID in the IP address.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved