Hosts are connected to networks via interfaces . Some hosts are connected to more than one network. Some of those hosts forward packets from one network to another, and are therefore called routers . Every interface has both a link-layer address and an IP address . So when we talk about the IP address of a host, that's shorthand for the address of some interface belonging to that host.
Every network has an address prefix .
Every interface on that network has an address beginning with that prefix, and every interface whose address begins with that prefix is on that network. Therefore, every network has a mask, often called a netmask , that can be used to extract the prefix from any address on the network. Hosts must know the netmasks of the networks they are attached to, in order to determine whether a given destination address is on any of those networks. If it is, packets can be sent to it directly, otherwise they must be sent to a router. But now the original boundaries between the network and host fields of the address are ignored.