Classful vs Classless addressing
IPV4 Addresses, Classful Addressing, Classless Addressing, and the difference between Classful and Classless addressing are discussed in this article.
Let's first discuss about IPV4 addresses
The IP address, often known as the Internet address, is the unique identifier used in the IP layer of the TCP/IP protocol suite to identify each device's connection to the Internet. A host's or router's connection to the Internet is defined by its 32-bit IPv4 address, which is unique and used worldwide. The IP address, not the host or router, is what identifies the connection because it could change if the device is relocated to a different network.
Since each address specifies a single and exclusive connection to the Internet, IPv4 addresses are distinctive. A device has two IPv4 addresses if it has two networks connecting to the Internet through it. Because every host that wishes to connect to the Internet must use the IPv4 addressing scheme, IPv4 addresses are considered universal.
Hierarchy in Addressing
The addressing system is hierarchical in every type of communication network that requires delivery, including phone and postal networks.
Although it is separated into two parts, a 32-bit IPv4 address is also hierarchical. The network is defined by the first component of the address, known as the prefix, and the node is defined by the second component, known as the suffix (connection of a device to the Internet). A 32-bit IPv4 address's prefix and suffix are shown in the given figure. The lengths of the prefix and suffix are n bits and (32 - n) bits, respectively.
Prefixes can have variable or fixed lengths. The IPv4 network identification was initially intended to be a fixed-length prefix. Classful addressing is the term used to describe this outmoded system. The brand-new addressing method, known as classless addressing, makes use of a variable-length network prefix. Prior to focusing on classless addressing, we briefly explore classful addressing.
1. CLASSFUL ADDRESSING
An IPv4 address originally had a fixed-length prefix, but three fixed-length prefixes (n = 8, n = 16, and n = 24) were created in order to support both small and big networks. As shown in the figure below, the entire address space was partitioned into five classes (classes A, B, C, D, and E). Classful addressing is the term used to describe this system. Despite being a thing of the past, classful addressing aids in the comprehension of classless addressing, which is covered in the later section.
CLASS A - Despite the fact that the network length is 8 bits, we can only use seven bits for the network identifier since the first bit, which is 0 and determines the class, is part of the length. This indicates that only 27 = 128 networks can have a class A address globally.
CLASS B - Despite the fact that the first two bits of class B's network, which are 10 in binary or we can write it as (10)2, determine the class, we can only use 14 bits as the network identification, as class B's network length is 16 bits. As a result, only 214 = 16,384 networks in the entire world are capable of using a class B address.
CLASS C - All addresses that begin with the number (110)2 fall under class C. Class C networks are 24 bits long, but since the class is defined by three bits, the network identifier can only be 21 bits long. As a result, 221 = 2, 097, 152 networks worldwide are capable of using a class C address.
Quick Quiz - The maximum number of networks that can use Class C addresses in the IPv4 addressing format is __________
CLASS D - Prefix and suffix categories do not exist for Class D. It is employed for multicast addresses.
CLASS E - All binary addresses with the prefix 1111 fall under class E. Class E, like Class D, does not have a prefix or a suffix and is used as a reserve.
2. CLASSLESS ADDRESSING
The address depletion issue was not fully resolved by classful addressing's subnetting and supernetting techniques. As the Internet expanded, it became obvious that a bigger address space was required as a long-term fix. However, the expanded address space necessitates that IP addresses should be longer as well, necessitating a change in IP packet syntax. The short-term solution, which uses the same address space but modifies the distribution of addresses to deliver a fair amount to each business, was developed despite the fact that the long-term solution, known as IPv6, has already been developed. Classless addressing is the temporary fix, which nevertheless makes use of IPv4 addresses. In order to make up for address depletion, the class privilege was taken out of the distribution.
The entire address space is partitioned into blocks of varying lengths with classless addressing. An address's prefix designates the block (network); its suffix designates the node (device). We are capable of having a block of 20, 21, 22 ,..., 232 addresses, theoretically. One of the limitations is that a block of addresses must have a power of two addresses. One address block may be given to an organization. The given figure demonstrates the non-overlapping block segmentation of the entire address space.
In contrast to classful addressing, classless addressing allows for varying prefix lengths. Prefix lengths that vary from 0 to 32 are possible. The length of the prefix has an inverse relationship with network size. A smaller network has a large prefix; a larger one has a small prefix.
We must stress that classful addressing is just as easily adaptable to the concept of classless addressing. Consider an address in class A as a classless address with a prefix length of 8. Class B addresses can be viewed as classless addresses with the prefix 16 and so on. Putting it another way, classless addressing is a specific instance of classful addressing.
Prefix Length - Slash Notation
In classless addressing, the first issue that needs to be resolved is how to determine the prefix length if an address is provided. We must individually provide the prefix length because it is not a property of the address. The address is inserted in this scenario, followed by a slash, and the prefix length, n. Slash notation is the colloquial name for the notation, while classless interdomain routing, or CIDR (pronounced cider) method, is the official name. An address in classless addressing can thus be expressed as illustrated in the figure below.
To put it another way, we must also provide the prefix length in classless addressing because an address does not automatically define the block or network to which it belongs.
Extracting Information from an Address
With respect to any given address in the block, we typically like to know three things: the number of addresses in the block, the start address in the block, and the last address. These three pieces of information, which are depicted in the picture below, are simple to locate because the prefix length, n, is known.
For Example - The address 184.108.40.206/27 is a classless address. The following is where we can find the aforementioned three pieces of data. In the network, there are 232-n = 25 = 32 addresses in all.
The first 27 bits are kept while the remaining bits are converted to 0s to determine the first address.
Keeping the first 27 bits and turning the remaining bits to 1s will allow you to determine the last address.
Quick Quiz - In the network 220.127.116.11/27, the fourth octet (in decimal) of the last IP address of the network, which can be assigned to a host is _____ (GATE 2015, 2 Marks)
Here, the maximum possible value of the last octet is 159 in decimal. Hence, the fourth octet of the last IP address, which can be assigned to a host is 10011110 in binary or 158 in decimal. Hence, the answer to the question is 158.
Difference Between Classful and Classless Addressing
IP addressing includes two types: classful and classless. Classless addressing offers a more effective method of allocating IP addresses than classful addressing, which is the main difference between the two. To put it briefly, classless addressing prevents the issue of IP address exhaustion that can occur with classful addressing.