SCHIZOSCHIZOSCHIZO
  • WORK
  • ABOUT
  • BRAIN DUMP
  • TOOLS
  • CONTACT
2026-06-27

Subnetting Reference

networksubnettingCIDRCCNAIP addressing

Subnetting is the process of dividing a larger network into smaller, more manageable sub-networks, i.e. subnets.

Why subnet?

  1. >Efficient IP address management: helps manage IP addresses more efficiently by dividing large networks into smaller segments.
  2. >Improved performance: reduces network traffic and congestion by limiting the broadcast domains.
  3. >Enhanced security: isolates different segments of a network, improving security and management.

IP address

A unique identifier for a device on a network, e.g. 192.168.1.1.

Subnet mask

A mask used to determine the subnet an IP address belongs to, e.g. 255.255.255.0.

CIDR

Classless Inter-Domain Routing notation is a way to specify IP addresses and their associated routing prefix. It is written as an IP address, followed by a forward slash, and then a number (e.g. 192.168.1.0/24).

  • >The number after the slash (e.g. 24 in /24) represents the number of bits in the network prefix.
  • >The remaining bits (32 minus the prefix length) represent the host portion.

Some common CIDR notations

  • >/24: 255.255.255.0
  • >/20: 255.255.240.0
  • >/16: 255.255.0.0
  • >/8: 255.0.0.0
  • >/32: 255.255.255.255 (single IP address)
  • >/12: 255.240.0.0

Calculating subnets and hosts

  1. >Subnets: divide the available host addresses into smaller groups.
  2. >Hosts: determine the number of available IP addresses in each subnet.

Formula for number of hosts

code
Number of hosts = 2^(32 - prefix length) - 2

The subtraction of 2 accounts for the network and broadcast addresses, which are not assignable to hosts.

Examples

  • >/24 (255.255.255.0):
    • >Hosts: 2^(32-24) - 2 = 2^8 - 2 = 254
    • >Subnets: 1 subnet (since /24 is the default subnet mask for Class C)
  • >/20 (255.255.240.0):
    • >Hosts: 2^(32-20) - 2 = 2^12 - 2 = 4094
    • >Subnets: 2^(24-20) = 2^4 = 16 subnets if starting from a /24 block
  • >/16 (255.255.0.0):
    • >Hosts: 2^(32-16) - 2 = 2^16 - 2 = 65,534
    • >Subnets: 2^(24-16) = 2^8 = 256 subnets if starting from a /24 block
  • >/8 (255.0.0.0):
    • >Hosts: 2^(32-8) - 2 = 2^24 - 2 = 16,777,214
    • >Subnets: 2^(24-8) = 2^16 = 65,536 subnets if starting from a /24 block
  • >/32 (255.255.255.255):
    • >Hosts: 2^(32-32) - 2 = 2^0 - 2 = 0
    • >Subnets: N/A (single IP address)
  • >/12 (255.240.0.0):
    • >Hosts: 2^(32-12) - 2 = 2^20 - 2 = 1,048,574
    • >Subnets: 2^(24-12) = 2^12 = 4,096 subnets if starting from a /24 block

How to remember it

  1. >Power of two rule: remember the powers of two (2^8 = 256, 2^10 = 1024, 2^12 = 4096).
  2. >Subnet mask patterns:
    • >/24: 255.255.255.0 (256 addresses, 254 usable hosts)
    • >/20: 255.255.240.0 (4096 addresses, 4094 usable hosts)
    • >/16: 255.255.0.0 (65,536 addresses, 65,534 usable hosts)
  3. >Bit counting: every bit in the subnet mask reduces the number of host bits by one, and each host bit remaining represents 2 potential addresses.
  4. >Shortcut for host counts:
    • >/24: 254 hosts
    • >/23: 512 hosts (minus 2)
    • >/22: 1024 hosts (minus 2)
    • >Continue doubling hosts as we decrease the prefix by 1.

Subnetting reference table

CIDRSubnet Mask# of Subnets# of Hosts per SubnetNetwork AddressBroadcast AddressUsable IP Range
/8255.0.0.0116,777,21410.0.0.010.255.255.25510.0.0.1 - 10.255.255.254
/12255.240.0.0161,048,57410.0.0.010.15.255.25510.0.0.1 - 10.15.255.254
/16255.255.0.025665,534192.168.0.0192.168.255.255192.168.0.1 - 192.168.255.254
/20255.255.240.040964,094192.168.0.0192.168.15.255192.168.0.1 - 192.168.15.254
/24255.255.255.01254192.168.1.0192.168.1.255192.168.1.1 - 192.168.1.254
/26255.255.255.192462192.168.1.0192.168.1.63192.168.1.1 - 192.168.1.62
/28255.255.255.2401614192.168.1.0192.168.1.15192.168.1.1 - 192.168.1.14
/30255.255.255.252642192.168.1.0192.168.1.3192.168.1.1 - 192.168.1.2
/32255.255.255.255N/A1192.168.1.1192.168.1.1192.168.1.1
Host maths4 blanks

Usable hosts = 2^(32 - prefix) minus , for the network and addresses. A /26 mask is 255.255.255. and leaves usable hosts.

try it before revealing

Read next

  • 2026-06-12 · CheatsheetsIP Headers and Address Classes
  • 2024-07-09 · Deep DivesDividing a Broadcast Domain
  • 2026-06-14 · Byte-SizedVirtual LANs (VLANs)
  • 2024-12-03 · Deep DivesCisco Packet Tracer Basics

← All PostsSCHIZO Brain Dump
SCHIZO

Suhesh Kasti — AppSec & Offensive Security

Navigate

  • ▸ Projects
  • ▸ Brain Dump
  • ▸ Cyber Tools
  • ▸ About
  • ▸ Contact
  • Download CV

Connect

  • ◆ GitHub
  • ◆ LinkedIn
  • ◆ Twitter
  • ◆ YouTube
  • ◆ Telegram
© 2026 SCHIZO

Press / to search