Great resources are available to let the user understand the CIDR notation (let’s call it the modern way to specify a submask).
When you get the logic behind it, probably the best is this online calculator cidr.xyz.
To understand the meaning, use this tutorial.
For me worked having a visual comparative, like the following.
My way
Considering this notation:
s = significat digit
n = not significat digit
w = whatever
and this CIDR notation: 192.168.0.0/24
The evaluation to be conduct (and the result) is:
binary base IP 11000000.10101000.00000000.00000000 mask (i.e. /24) ssssssss.ssssssss.ssssssss.nnnnnnnn result (generic) 11000000.10101000.00000000.wwwwwwww cases result result (generic) 11000000.10101000.00000000.wwwwwwww 192.168.0.0 11000000.10101000.00000000.00000000 --> admitted 192.168.0.1 11000000.10101000.00000000.00000001 --> admitted 192.168.0.255 11000000.10101000.00000000.11111111 --> admitted 192.168.3.15 11000000.10101000.00000011.00001111 --> blocked
Consider now this other CIDR notation: 192.168.0.0/21
The evaluation to be conduct (and the result) is:
binary base IP 11000000.10101000.00000000.00000000 mask (i.e. /21) ssssssss.ssssssss.sssssnnn.nnnnnnnn result (generic) 11000000.10101000.00000www.wwwwwwww cases result result (generic) 11000000.10101000.00000www.wwwwwwww 192.168.0.0 11000000.10101000.00000000.00000000 --> admitted 192.168.0.1 11000000.10101000.00000000.00000001 --> admitted 192.168.0.255 11000000.10101000.00000000.11111111 --> admitted 192.168.3.15 11000000.10101000.00000011.00001111 --> admitted
Of course, I almost forgot to say that, formally, CIDR means classless inter domain routing.