I have two IP Addresses. To decide whether or not two IP addresses are on the same network, we use a subnet mask. This is used to mask the network portion of the IP Address. The network portion of the IP address has a 1 in the corresponding bit of the subnet mask. The host portion of the IP has a 0 in the corresponding bit of the subnet mask.
Lets take a look at the subnet mask in binary form.
Class A addressing. Both of the above IP's are on the same network. Subnetting The choice to go to a 32 bit number was poor as it did not offer enough IP addresses. This along with some poor decisions in handing out IP addresses based on want and not on need left us running short on addresses. In 1985 a RFC was put out which introduced us to subnetting.