Understanding IPv4 Subnetting & CIDR Notation
1. The Bitwise Logic of Subnet Masks
An IPv4 address is an unsigned 32-bit integer formatted as 4 octets separated by dots. The subnet mask divides these 32 bits into two segments:
Any two devices whose IP addresses produce the exact same Network ID can communicate directly over layer-2 Ethernet switches without routing.
2. Special CIDR Prefixes: /31 and /32
Under RFC 3021, point-to-point links between two routers use /31 subnets (2 total IPs), with neither reserved for network or broadcast.
A /32 prefix denotes a single host loopback address or specific firewall rule with exactly 1 usable IP.