← IP Addressing & Subnetting learning pathIP Addressing & Subnetting · Module 4 of 10
Subnet masks and CIDR
Use subnet masks and prefix notation.
📖 Key ideas
- A subnet mask separates network and host bits: 255.255.255.0.
- CIDR notation writes the mask as a prefix: /24.
- /24 means 24 network bits and 8 host bits.
- Common masks: /8 = 255.0.0.0, /16 = 255.255.0.0, /24 = 255.255.255.0.
- Hosts per subnet = 2^(host bits) − 2.
💡 Real-life example: The subnet mask is a stencil: the covered part is the street name, the open part is house numbers.
Subnet maskMarks network vs host bits
CIDRClassless Inter-Domain Routing notation
Prefix lengthNumber of network bits
Usable hosts2^h − 2 addresses