written 2.7 years ago by |
In classful addressing, an IP address of class A, B, and C are divided into netid and hostid. The netid determines the network address while the hostid determines the host connected to that network.
Blocks and Hosts Each class is divided into blocks. The number of blocks in a class can be calculated by the number of bits in the netid.
CLASS A
Class A has 1 byte (8 bits) netid and from the binary notation, we see that the Class A address starts with 0 so there is a total of 7 bits that can be changed out of 8.
Therefore total number of blocks in Class A = 27 = 128
There are 3 bytes (24 bits) for hostid in Class A so the total number of hosts in each block = 224 = 16,777,216
So total number of addresses in Class A = No. of Blocks in Class A x No. of Hosts in each block of Class A
= 128 x 16,777,216
= 2,147,483,648
This is 50% of the total addresses in IPv4.
1st block of Class A has the netid 0
And the host id is between
0.0.0.0
…
0.255.255.255
Similarly, 2nd block of Class A has the netid 1
And the host id is between
1.0.0.0
1.255.255.255
CLASS B
Class B has 2 bytes (16 bits) netid and from the binary notation, we see that the Class B address starts with 10, so there are total of 14 bits that can be changed out of 16.
Therefore total number of blocks in Class B = 214 = 16,384
There are 2 bytes (16 bits) for hostid in Class B so the total number of hosts in each block = 216 = 65,536
So total number of addresses in Class B = No. of Blocks in Class B x No. of Hosts in each block of Class B
= 16,384 x 65,536
= 1,073,741,824
This is 25% of the total addresses in IPv4.
1st block of Class B has the netid 128.0
And the host id is between
128.0.0.0
…
128.0.255.255
Similarly, 2nd block of Class B has the netid 128.1
And the host id is between
128.1.0.0
128.1.255.255
CLASS C
Class C has 3 bytes (24 bits) netid and from the binary notation, we see that the Class C address starts with 110, so there are total of 21 bits that can be changed out of 24.
Therefore total number of blocks in Class C = 221 = 2,097,152
There is 1 byte (8 bits) for hostid in Class C so the total number of hosts in each block = 28 = 256
So total number of addresses in Class C = No. of Blocks in Class C x No. of Hosts in each block of Class C
= 2,097,152 x 256
= 536,870,912
This is 12.5% of the total addresses in IPv4.
1st block of Class C has the netid 192.0.0
And the host id is between
192.0.0.0
…
192.0.0.255
Similarly, 2nd block of Class B has the netid 192.0.1
And the host id is between
192.0.1.0
192.0.1.255
CLASS D
It consists of a single block. It is designed for multicasting. | Class D | 224.0.0.0 to 239.255.255.255 | |---|---| | | Single block of 268,435,456 addresses |
CLASS E
It also consists of a single block. It is reserved for future use.
Class E | 240.0.0.0 to 255.255.255.255 |
---|---|
Single block of 268,435,456 addresses |
There are 128 blocks in Class A so only 128 organizations can be assigned Class A address, but each block has 2,147,483,648 hosts which mean the organization needs to be really huge to consume all the addresses in the block.
There are 16,384 blocks in Class B so total of 16,384 organizations can be assigned Class B address and there are 65,536 hosts in each block which mean each organization must be quite large to consume all the addresses in the block.
There are 2,097,152 blocks in Class C so a total of 2,097,152 organizations can be assigned Class C address but there are only 256 hosts in each block which mean the organization must be quite small to use this class.
This is the reason why a lot of addresses are wasted because of classful addressing.
Class A address can be allocated to only 128 organizations which sounds quite ok but each of these organizations must have 16,777,216 machines (host) which is not impossible. While Class C address can be assigned to a lot of organizations (2,097,152 to be precise) but if an organization gets Class C then it cannot have more than 256 computers (host).