Classful and Classless Addressing
Classful and Classless Addressing
Every device in a network has an IP address. The address helps to identify each device in the
network and allows communicating with other devices in the network. An IP address consists of
32 bits. Every 8 bits is an octet, and they are separated by a dot. The address consists of two
sections as network ID and host ID. The network ID represents the network while the host ID
represents the host. There are two IP addressing types as classful and classless addressing.
Classful addressing categorizes the IP addresses into five major classes: class A, B, C, D, and E.
Class A addresses allocate first 8 bits for the network and the remaining bits for the host.
Class B addresses allocate first 16 bits for the network and the remaining bits for the host.
Class C addresses allocate first 24 bits for the network and the remaining bits for the host.
Class D addresses do not have the network ID and host ID. These addresses are used for
multicasting.
Class E addresses also do not have network ID and host ID. These addresses are reserved for
future and for experiments.
Figure 1: IP Address
1
By reading the first octet, we can determine the class of address to which it belongs.
Furthermore, the IP address 0.0.0.0 is used for broadcasting while 127.0.0.1 is used as a
loopback address.
Classless addressing is also called Classless Inter-Domain Routing (CIDR). This addressing
type helps to allocate IP addresses more efficiently. When the user requires a particular number
of IP addresses, this method assigns a block of IP addresses concerning certain rules. And, this
block is called a CIDR block and has the required number of IP addresses.
Classless addressing uses the following three rules when assigning a block.
Rule 2 – The block size should be presentable as a power of 2. Moreover, the number of IP
addresses in the block is equivalent to the size.
Rule 3 – First IP address of the block must be dividable by the block size.
The number of bits for the network portion is 27, and the number of bits for the host is 5. (32-
27)
2
The highlighted bits represent the host bits.
192.168.1.32
192.168.1.63
Another difference is that in classful addressing, the network ID and host ID change depending
on the classes. However, in classless addressing, there is no boundary on network ID and host
ID.
Classless addressing allows allocating IP addresses more efficiently than classful addressing.
Classless addressing avoids running out of IP addresses that can occur in classful addressing.