We have studied in the previous post about “IP Addresses” of all hosts connected to the Internet are divided into two parts:-
1) The network ID (net ID).
2) The Host Id (host ID).
The number of octets or bits allocated to the net ID and the host ID parts depended on the class or the rang to which the IP address belongs. For example, id an IP address belongs to class C, then the first 8 bit are allocated to the net ID part and the remaining 24 bits to the host ID. With the introduction of subnet addressing, however, a new division is introduced that divides an IP address into three parts:
The network ID (net ID)
The host ID (host ID)
The subnet ID (subnet ID)
The use of subnet addressing not only hides the organizational structure of the internal network but also prevents the waste of IP Addresses. For example, consider a typical class B IP address., Which is divided in the following manner
First 16 bits: network ID
Last 16 bits: host Id
Such a division requires 216-2hosts to attached to that particular network—far more than are typically attached to a single network (thereby causing the waste of the IP addresses).
You subtract the 2 because a host ID value of 0 or 255 cannot be all0cated to a system because both are reserved for special usage. For example, a host ID value of 0 is usually used for routers and 255 is usually the broadcast address for the subnet.