IP addresses serve the purpose of identification in networking.IPv4 addresses consist of 32 bits divided into 4 segments.The 32 bits are divided into the Network portion and the Host portion.Subnet mask is used to define the Network and Host portions of an IP address.