- What is a subnet mask?
- A subnet mask divides IP address into network and host portions. It's a 32-bit number where network bits are 1, host bits are 0. Example: 255.255.255.0 = 11111111.11111111.11111111.00000000 = /24 CIDR. Common masks: 255.255.255.0 (/24) = 256 IPs, 255.255.0.0 (/16) = 65536 IPs, 255.0.0.0 (/8) = 16 million IPs. Used for network segmentation, IP allocation, and routing.
- What are network and broadcast addresses?
- Network address: First IP of subnet (all host bits = 0). Identifies the subnet itself. Example: 192.168.1.0/24 network = 192.168.1.0. Broadcast address: Last IP of subnet (all host bits = 1). Sends messages to all hosts. Example: 192.168.1.0/24 broadcast = 192.168.1.255. Usable hosts: IPs between network and broadcast (256 IPs - 2 = 254 usable).
- How to read CIDR notation?
- CIDR format: IP/prefix length. Example: 192.168.1.0/24. Prefix (/24) is number of network bits. /24 = 24-bit network, 8-bit host = 2^8 = 256 IPs. Calculation: Total IPs = 2^(32-prefix). /24 = 2^8 = 256, /16 = 2^16 = 65536. Larger prefix = smaller network: /32 = 1 IP, /24 = 256 IPs, /8 = 16 million IPs.
- How to calculate usable hosts?
- Usable hosts = Total IPs - 2 (network and broadcast addresses). Example: /24 = 256 IPs - 2 = 254 usable. /16 = 65536 - 2 = 65534 usable. /32 = 1 IP - 2 = -1 (no hosts, single IP). /31 = 2 IPs - 2 = 0 (special case, RFC 3021 allows for point-to-point links). This calculator computes automatically.
- Why use a subnet calculator?
- Use cases: Network planning (plan IP allocation), Subnet design (divide network into subnets), Routing configuration (set network routes), IP address validation (verify IP belongs to subnet), Firewall rules (define network ranges), Troubleshooting (debug network issues). Quickly calculate IP ranges, usable hosts, and mask conversions.