Suppose we are given that a subnet mask is /28. How do we convert this to 255.255.255.240?
The number after the "/" represents the number of ones, starting from the left, in the binary representation of the IP address. (Recall that all IP address have 32 digits.)
Thus, in binary notation, a /28 subnet mask is written as:
1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 0 0 0 0
If we convert each octet into decimal notation, we get the following:
255.255.255.240
Suppose we are given that a subnet mask is /20. Then in binary notation, the IP address of the subnet mask is written as:
1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 0 0 0 0 . 0 0 0 0 0 0 0 0
Converting each octet into decimal notation, we get the following IP address for the subnet mask:
255.255.240.0