Netmasks

A netmask is a 32 bit number, sometimes represented as 4 bytes, or octets, separated by dots. Valid netmasks, in binary, are a series of one's followed by zeros. I.e. You will never see a sequence of 101. Netmasks can also be represented in CIDR notation as a slash and the number of ones, out of 32, in the netmask. E.g. /24.

The number of available host addresses in a subnet is calculated by the following forumula:

hosts = 2 ^ 32 - CIDR

For example, a /24 subnet has 2 ^ 8 = 256 hosts.

CIDR Netmask Hex dotted quad Hosts Usable Comment
/32 1111111 11111111 11111111 11111111 FFFFFFFF 255.255.255.255 1 1 single host
/31 1111111 11111111 11111111 11111110 FFFFFFFE 255.255.255.254 2 2 ACL for 2 hosts
/30 1111111 11111111 11111111 11111100 FFFFFFFC 255.255.255.252 4 2 usually a WAN or PPP address
/29 1111111 11111111 11111111 11111000 FFFFFFF8 255.255.255.248 8 6 small static subnet
/28 1111111 11111111 11111111 11110000 FFFFFFF0 255.255.255.240 16 14 subnet
/27 1111111 11111111 11111111 11100000 FFFFFFE0 255.255.255.224 32 30 subnet
/26 1111111 11111111 11111111 11000000 FFFFFFC0 255.255.255.192 64 62 subnet
/25 1111111 11111111 11111111 10000000 FFFFFF80 255.255.255.128 128 126 subnet
/24 1111111 11111111 11111111 00000000 FFFFFF00 255.255.255.0 256 254 previously Class C
/23 1111111 11111111 11111110 00000000 FFFFFE00 255.255.254.0 512 510 supernet
/22 1111111 11111111 11111100 00000000 FFFFFC00 255.255.252.0 1024 1022 supernet
/21 1111111 11111111 11111000 00000000 FFFFF800 255.255.248.0 2048 2046 supernet
/20 1111111 11111111 11110000 00000000 FFFFF000 255.255.240.0 4096 4094 supernet
/19 1111111 11111111 11100000 00000000 FFFFE000 255.255.224.0 8192 4090 supernet
/18 1111111 11111111 11000000 00000000 FFFFC000 255.255.192.0 16384 16382 supernet
/17 1111111 11111111 10000000 00000000 FFFF8000 255.255.128.0 32768 32766 supernet
/16 1111111 11111111 00000000 00000000 FFFF0000 255.255.0.0 65536 65534 previously Class B