# IPv4 CIDR, Subnet Masks, and VPC Subnetting Explained for Developers

> **TL;DR**: Learn IPv4 CIDR notation, subnet masks, VPC subnetting, and security group configuration with runnable examples. Avoid common pitfalls and use our subnet calculator.
> **Source**: https://ai.yevrix.com/articles/ipv4-cidr-subnet-mask-explained-for-developers

## Why CIDR?

Classful addressing (A/B/C) wasted IPs. CIDR (Classless Inter-Domain Routing) uses a suffix `/n` to denote the network prefix length. For example, `192.168.1.0/24` means the first 24 bits are the network, and the last 8 bits are hosts.

## Subnet Mask and Calculations

A subnet mask is a series of 1s followed by 0s. For `/24`, the mask is `255.255.255.0`. Network address = IP & mask; broadcast address = network | ~mask.

...

> Full engineering guide unlocked at https://ai.yevrix.com/articles/ipv4-cidr-subnet-mask-explained-for-developers
