A subnet mask tells a computer or a router how to divide a range of IP addresses into the network part and the host part.
Given:
Address = 131.108.2.160
Subnet Mask = 255.255.255.0
Subnet = 131.108.2.0
In this example, without a subnet mask the address would be treated as class B and the network number would be 131.108. But because someone supplied a subnet mask of 255.255.255.0, the network number is actually 131.108.2.
These days, routers and computers always use subnet masks if they are supplied. If there is no subnet mask for an address, then the class A, B, C scheme is used.
Remember that a network mask determines which portion of an IP address identifies the network and which portion identifies the host, while a subnet mask describes which portion of an address refers to the subnet and which part refers to the host.