IP address classification refers to the categorization of IP addresses into different classes based on their network structure and address range. This classification was relevant mainly in the context of IPv4 (Internet Protocol version 4), as it used a fixed-length 32-bit address space. With the introduction of IPv6 (Internet Protocol version 6), which has a much larger address space, the concept of IP address classification became less significant.
In IPv4, the IP address is divided into two parts: the network part and the host part. The division between the network and host parts is determined by the subnet mask. The subnet mask is a 32-bit value that consists of consecutive 1 (binary) in the network part followed by consecutive 0 (binary) in the host part.
There are five IPv4 address classes (Class A to Class E) designated as follows:
- Class A (1.0.0.0 to 126.255.255.255):
Class A addresses have the first bit of the IP address set to 0 (MSB), and the network part occupies the first octet (8 bits). The remaining three octets (24 bits) represent the host part. Class A addresses were originally intended for large networks and have a vast number of host addresses.
- Class B (128.0.0.0 to 191.255.255.255):
Class B addresses have the first two bits of the IP address set to 10 (MSB), and the network part occupies the first two octets (16 bits). The remaining two octets (16 bits) represent the host part. Class B addresses were designed for medium-sized networks.
- Class C (192.0.0.0 to 223.255.255.255):
Class C addresses have the first three bits of the IP address set to 110 (MSB), and the network part occupies the first three octets (24 bits). The remaining octet (8 bits) represents the host part. Class C addresses were intended for small networks.
- Class D (224.0.0.0 to 239.255.255.255):
Class D addresses have the first four bits of the IP address set to 1110 (MSB). These addresses are used for multicast purposes, where data can be sent to multiple hosts at a time.
- Class E (240.0.0.0 to 255.255.255.255):
Class E addresses have the first four bits of the IP address set to 1111 (MSB). Class E addresses were reserved for experimental purposes and were not meant for general use.
It's important to note that IP address classification based on classes is mostly a historical concept. In modern networking, subnetting and Classless Inter-Domain Routing (CIDR) are commonly used techniques to allocate IP addresses more efficiently and flexibly, regardless of the traditional class boundaries. CIDR allows for the allocation of IP addresses in variable-sized blocks, which enables better address utilization and more efficient routing of the network traffic.