ktrilaksono.dev
Cloud & InfrastructureFebruary 28, 2021·4 views

Subnetting Tutorial (Part 1)

networkingfundamentals

Subnetting divides a network into multiple separate networks and is a common topic in SRE and DevOps interviews.

Key Terms

  • IP Address (IPv4): A unique 32-bit address for hosts on TCP/IP networks
  • CIDR / Classless Inter-Domain Routing: A format specifying subnet masks for classless network design
  • Network bits (b): Bits forming the subnet's network portion (represented as 1s)
  • Host bits (h): Bits for host addresses (represented as 0s)
  • Subnet mask: Required component for TCP/IP operation
  • Network address: First assigned address in a subnet
  • Broadcast address: Last assigned address in a subnet
  • Number of hosts: 2^h − 2
  • Number of subnets: 2^b

How to Answer Subnetting Questions

Using the example 192.168.1.168/24:

  1. Understand the question clearly.
  2. Convert the IP to binary and identify the variables (b, h, number of hosts, number of subnets).
  3. AND the IP address bits with the subnet mask bits to find the network and broadcast addresses.
  4. Verify your answers.

For this example: network address = 192.168.1.0, broadcast address = 192.168.1.255.

Commonly Used Subnet Classes

ClassFirst octetSubnet maskCIDR
A0–127255.0.0.0/8
B128–191255.255.0.0/16
C192–223255.255.255.0/24

© 2026 Kurnianto Trilaksono Sutjipto. Built with Next.js.