IP Addressing & Subnetting

💤0
Lv 10 XP
← 🧱 Foundations · Networking Basics

IP Addressing & Subnetting

Intermediate ⭐ 80 XP ⏱ 22 min #networking#ip#subnetting#cidr

Read IP addresses and CIDR notation, and split networks into subnets.

📖Theory

An IPv4 address is 32 bits, written as four octets (192.168.1.10). A subnet mask or CIDR suffix splits it into a network portion and a host portion. /24 means the first 24 bits identify the network, leaving 8 bits — 256 addresses (254 usable; the first is the network address and the last is broadcast).

Smaller suffix = bigger network: /16 is 65,536 addresses, /24 is 256, /32 is a single host. Private ranges (RFC 1918) — 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — are not routable on the public internet and are what you use inside VPCs and home networks.

🌍Real-World Example
192.168.1.0/24
  Network:    192.168.1.0
  Usable:     192.168.1.1 – 192.168.1.254
  Broadcast:  192.168.1.255
  Hosts:      254

Split /24 into two /25 subnets:
  192.168.1.0/25   → .1 – .126   (126 hosts)
  192.168.1.128/25 → .129 – .254 (126 hosts)
✍️Hands-On Exercise
  1. How many usable hosts are in a /28 subnet?
  2. Identify the network and broadcast address of 10.0.5.0/24.
  3. Which RFC 1918 range would you pick for a large cloud VPC, and why?
  4. Split 192.168.10.0/24 into four equal subnets and list their ranges.
🧾Cheat Sheet
CIDRHosts (usable)Mask
/816,777,214255.0.0.0
/1665,534255.255.0.0
/24254255.255.255.0
/2662255.255.255.192
/2814255.255.255.240
/321 (host)255.255.255.255
💬Common Interview Questions
What does /24 mean in CIDR notation?

The first 24 bits are the network portion, leaving 8 bits for hosts — 256 addresses total, 254 usable after removing network and broadcast addresses.

Why use private IP ranges?

RFC 1918 ranges are not routable on the public internet, so they let you build large internal networks without consuming scarce public IPs; NAT handles outbound.

How many usable hosts does a /30 provide?

2^(32−30) − 2 = 2 usable hosts — commonly used for point-to-point links.

📚Official Documentation

📝 My notes on this topic

Auto-saves as you type