The /20 prefix means the first 20 bits of the address identify the network and the remaining 12 identify the host. Written out, the mask is 255.255.240.0, in binary 11111111.11111111.11110000.00000000, and its Cisco wildcard or inverse form is 0.0.15.255. It covers 4,096 addresses, of which 4,094 can be given to hosts.
| CIDR prefix | /20 |
|---|---|
| Subnet mask | 255.255.240.0 |
| Mask in binary | 11111111.11111111.11110000.00000000 |
| Wildcard (inverse) mask | 0.0.15.255 |
| Host bits | 12 |
| Total addresses | 4,096 |
| Usable hosts | 4,094 |
| Block size (magic number) | 16 in octet 3 |
A 172.16.0.0/16 contains 16 subnets of /20. Here are the first 8, which is enough to see the pattern: each one starts 16 after the last in octet 3.
| Network | First host | Last host | Broadcast |
|---|---|---|---|
| 172.16.0.0/20 | 172.16.0.1 | 172.16.15.254 | 172.16.15.255 |
| 172.16.16.0/20 | 172.16.16.1 | 172.16.31.254 | 172.16.31.255 |
| 172.16.32.0/20 | 172.16.32.1 | 172.16.47.254 | 172.16.47.255 |
| 172.16.48.0/20 | 172.16.48.1 | 172.16.63.254 | 172.16.63.255 |
| 172.16.64.0/20 | 172.16.64.1 | 172.16.79.254 | 172.16.79.255 |
| 172.16.80.0/20 | 172.16.80.1 | 172.16.95.254 | 172.16.95.255 |
| 172.16.96.0/20 | 172.16.96.1 | 172.16.111.254 | 172.16.111.255 |
| 172.16.112.0/20 | 172.16.112.1 | 172.16.127.254 | 172.16.127.255 |
Take the interesting octet of the mask, the one that is neither 255 nor 0. For /20 that is 240 in octet 3. Subtract it from 256:
256 - 240 = 16
That is the block size. Every /20 network address is a multiple of 16 in octet 3, so you can list them by counting: 0, 16, 32, 48, and so on. No binary needed once you know the number.
The /20 is the default size of an AWS VPC, and a sensible default anywhere in the cloud: 4,094 usable addresses, room for a lot of subnets, small enough that you can fit many VPCs inside one enterprise range without collisions.
A /20 holds 4,096 addresses in total. After reserving the network and broadcast addresses, 4,094 are usable by hosts.
The /20 subnet mask is 255.255.240.0 in dotted-decimal notation.
The wildcard mask, also called the inverse mask, is 0.0.15.255. It is the bitwise inverse of 255.255.240.0 and is what Cisco access lists and OSPF network statements expect.
The /20 mask written out bit by bit is 11111111.11111111.11110000.00000000: 20 ones followed by 12 zeros.