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.
...