← IP Addressing & Subnetting learning path
IP Addressing & Subnetting · Module 4 of 10

Subnet masks and CIDR

Use subnet masks and prefix notation.

📖 Key ideas

  1. A subnet mask separates network and host bits: 255.255.255.0.
  2. CIDR notation writes the mask as a prefix: /24.
  3. /24 means 24 network bits and 8 host bits.
  4. Common masks: /8 = 255.0.0.0, /16 = 255.255.0.0, /24 = 255.255.255.0.
  5. 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