In: Computer Science
Explain with an example a scenario where both the class full and classless IP addressing scheme can be used to configure the IP address for the network.
IP Address:
An IP address is an identifier or label used to identify a machine on the internet or a particular network. Each of the devices on the internet must have an IP address for identification.
IPv4 is the first version of Internet Protocol that uses a 32-bit address and this protocol is most widely used.
Total number of IP address supported by IPv4 = 232
The netmask and subnet mask is used to divide the IP address as given below:
The netmask is a sequence of '1' followed by a sequence of '0' and it is used to divide an IP address into multiple subnets.
The subnet mask is a sequence of '1' followed by a sequence of '0' and it is used to separate a big network into smaller multiple networks.
The subnet mask is used to separate the IP address into a network address and host address.
It is made by setting '1' to all network bits and '0' to all host bits. In a network, the first and last IP addresses are used for the special purpose and the remaining addresses are used as a host address.
Classful Addressing:
In classful addressing, an IP address is related to a class and we need to purchase a class of the IP addresses as per the requirement.
Address class:
Class A:
The range of the first octet: 0 to 127
Subnet mask = 255.0.0.0
Class B:
First octet range: 128 to 191
Subnet mask = 255.255.0.0
Class C:
First octet range: 192 to 223
Subnet mask = 255.255.255.0
Class D:
First octet range: 224 to 239
This class is reserved for multicasting, so there is no need for the subnet mask.
Class E:
First octet range: 240 to 254
This class is reserved for experimental purposes, so there is no need for the subnet mask.
For example:
If we required to purchase 255 IP addresses, then we must purchase class C because in class C we can use 255 addresses for each of the network ids.
But if an organization needs 260 addresses, then he must go to class B and there is a lot of wastage of the IP addresses. This problem was resolve by a classless addressing scheme.
Classless addressing:
The previous system of allocating the IP address that was based on classes like class A, class B, etc. and classless addressing is based on variable-length subnet masking.
For example:
Let us suppose the given IP address is:
193.62.83.0/23
The netmask in binary representation will be:
11111111 11111111 11111110 00000000
The netmask in decimal representation will be:
255 255 254 0
Here, 23 bits are used for network id, and the last 9 bits are used for host id.
Total number of IP addresses will be = 29 = 512
In a network, the first and last IP addresses are used for the special purpose and the remaining addresses are used as a host address.
The total number of the host in this network will be = 512 - 2 = 510
So, there is less wastage of the IP addresses in the classless addressing scheme.