📚
Deep Dive: Decoding IPv4 Subnetting & Network Classifications
Subnetting is the practice of dividing a single large network into smaller, efficient sub-networks (subnets). A subnet calculator helps network engineers quickly calculate subnet masks, IP address ranges, broadcast addresses, and usable host counts.
🧮 How to Calculate (Step-by-Step Formula)
- Convert the CIDR prefix (e.g. /24) to a 32-bit binary subnet mask (e.g., 24 ones followed by 8 zeros).
- Perform a bitwise AND operation between the IP address and the subnet mask to calculate the Network Address.
- Set all host bits in the binary network address to 1s to calculate the Broadcast Address.
- Calculate usable host capacity using the host bits (h): Usable Hosts = 2^h - 2.
Key Concepts & Terminology Decoded
- CIDR Notation: Classless Inter-Domain Routing (e.g., /24), indicating the number of bits allocated to the network portion of an IP address.
- Subnet Mask: A 32-bit number (e.g., 255.255.255.0) used to separate the network ID from the host ID within an IP address.
- Usable Hosts: The range of valid IP addresses that can be assigned to devices on a subnet, excluding the network and broadcast addresses.
💡Always remember that the usable host count is calculated as 2^n - 2 (where n is the number of host bits), as the first address is reserved for the network ID and the last for the broadcast address.