A simple explanation:
/<number> is how a computer can quickly calculate what is part of its network and what is not. It represents the bit length of the subnet mask, as indicated above. The subnet mask is like masking when painting. You place a mask over what you DO NOT want to paint on. The subnet mask is a way to calculate the network portion of the address space and the host address space. The network address space is assigned to you, the host address space you define which device receives what address in the host space.
A computer performs binary math of ANDing the IP address and the network mask.
IP Address 10.10.15.10/16
Step 1) Translate the IP address 4 octets into binary: 00001010.00001010.00001111.00001010
Step 2) Translate the Subnet mask 4 octets into binary, which is easy using CIDR: 11111111.11111111.00000000.00000000
Step 3) Perform the ANDing operation on the two addresses. This will give you the Network Address for the subnet.
ANDing rules are as follows:
- 1 AND 1 = 1
- 0 AND 1 = 0
- 0 AND 0 = 0
- 1 AND 0 = 0
00001010.00001010.00001111.00001010 AND 11111111.11111111.00000000.00000000 ——————————————————————————————————— 00001010.00001010.00000000.00000000
Step 4) Convert it back to decimal: 10.10.0.0
So now a computer knows that any address from 10.10.0.0 to 10.10.255.255 is part of its network and any other address is not.
It's like a binary network gang thing, you are in or you are not.
The slash and the number following it is just a shorthand way to write a subnet mask. It's called CIDR (Classless Inter-Domain Routing) notation. It's also commonly referred to as the prefix length.
The number after the slash represents the number of consecutive 1's in the subnet mask. For example,
192.168.10.0/24 is equal to the network
192.168.10.0 with a
255.255.255.0 subnet mask. If you convert
255.255.255.0 to binary, you end up with 24 consecutive
Another example could be
10.0.0.0/8. 8 consecutive
1's in the subnet mask gives you
For more information, see RFC 4632, Section 3.1.