Sunday, January 14, 2018

IP addresses, when started a few decades ago, used the concept of classes. This architecture is called classful addressing.

In classful addressing, the IP address space is divided into five classes: A, B, C, D, and E. Each class occupies some part of the whole address space.

Recognizing Classes
We can find the class of an address when the address is given either in binary or dotted-decimal notation. In the binary notation, the first few bits can immediately tell us the class of the address; in the dotted-decimal notation, the value of the first byte can give the class of an address

Netid and Hostid
In classful addressing, an IP address in classes A, B, and C is divided into netid and hostid. These parts are of varying lengths, depending on the class of the address. The classes D and E are not divided into netid and hostid.

In class A, 1 byte defines the netid and 3 bytes define the hostid. In class B, 2 bytes define the netid and 2 bytes define the hostid. In class C, 3 bytes define the netid and 1 byte defines the hostid.

Class A
Since only 1 byte in class A defines the netid and the leftmost bit should be 0, the next 7 bits can be changed to find the number of blocks in this class. Therefore, class A is divided into 27 = 128 blocks that can be assigned to 128 organizations. Each organisation can have 224= 16,777,216 addresses, which means the organization should be a really large one to use all these addresses.

Class B
Since 2 bytes in class B define the class and the two leftmost bit should be 10 (fixed), the next 14 bits can be changed to find the number of blocks in this class. Therefore, class B is divided into 214= 16,384 blocks that can be assigned to 16,384 organizations, each block in this class contains 216= 65,536 addresses.

Class C
Since 3 bytes in class C define the class and the three leftmost bits should be 110 (fixed), the next 21 bits can be changed to find the number of blocks in this class. Therefore, class C is divided into 221= 2,097,152 blocks, in which each block contains 256 addresses, that can be assigned to 2,097,152 organizations. Each block contains 28=256 addresses.

Class D
There is just one block of class D addresses. It is designed for multicasting.
Each address in this class is used to define one group of hosts on the Internet. When a group is assigned an address in this class, every host that is a member