Subnet mask

A subnet mask is used in the IP addressing system which divides the IP address in two parts: the network part and the host part. A subnet mask (also shortened to netmask) is usually expressed like an IP address in dotted decimal notation. The subnet mask works by masking out the network part from the full IP address:

The logical operation AND is performed with the IP address and netmask. 192.168.3.45 AND 255.255.255.0 = 192.168.3.0 This tells us that the computer with an address of 192.168.3.45 belongs to a subnet called 192.168.3.0.

Notation
A subnet mask can also be given in this notation:

192.168.0.1/24

where /24 means "with the first 24 bits set", so, it is the same as 255.255.255.0. See CIDR_notation.