N-01 · Subnet · /21
/21 subnet
A /21 network keeps 21 of the 32 address bits for the network and leaves 11 for hosts. Its mask, host count, the blocks it fits in and example networks, all worked out below.
Short answer
- Subnet mask
- 255.255.248.0Wildcard 0.0.7.255
- Usable hosts
- 2,0462,048 addresses in total
2^11 = 2,048 addresses. The first is the network address and the last the broadcast, so 2,046 can go to devices.
The /21 mask in binary and hex
21 one bits, then 11 zero bits. The wildcard is the mask inverted.
| Mask | Dotted | Hex |
|---|---|---|
| Subnet mask | 255.255.248.0 | FF.FF.F8.00 |
| Wildcard | 0.0.7.255 | 00.00.07.FF |
The mask ends inside the third octet, at 248 (11111000). That leaves 3 host bits in the octet, so /21 networks start every 8 in it: 0, 8, 16, 24 and so on. Cisco access lists take the wildcard form, 0.0.7.255, where a 1 bit means “any value” (Cisco document 23602).
RFC 1878's table lists /21 as FF.FF.F8.00 hex, 2 K addresses, equal to 8 C in the old class terms. Its Table 1-1 counts a /21 as 32 subnets of a class B network with 2,046 hosts each. Erratum 3147 corrects that table's last row for each size: the all-ones subnet ends at N.N.255.255.
How many /21 subnets fit
The three private ranges (RFC 1918) and one /24.
| Block | /21 subnets in it |
|---|---|
| 10.0.0.0/8 | 8,192 |
| 172.16.0.0/12 | 512 |
| 192.168.0.0/16 | 32 |
| 192.168.181.0/24 | none: one /21 holds 8 |
10.0.0.0/8 holds 8,192, 172.16.0.0/12 holds 512 and 192.168.0.0/16 holds 32 /21 subnets. One /21 spans 8 /24s.
Splitting a /21
Each extra prefix bit halves the block.
| Into | Subnets | Usable each |
|---|---|---|
| /22 | 2 | 1,022 |
| /23 | 4 | 510 |
| /24 | 8 | 254 |
Two /22 subnets hold 2,044 usable addresses between them, 2 fewer than one /21: each half gives up its own network and broadcast address.
/21 subnets of 192.168.0.0/16
192.168.0.0/16 holds 32 of them. The row in bold holds 192.168.181.150.
| Subnet | First usable | Last usable | |
|---|---|---|---|
| 192.168.0.0/21 | 192.168.0.1 | 192.168.7.254 | |
| 192.168.8.0/21 | 192.168.8.1 | 192.168.15.254 | |
| 192.168.16.0/21 | 192.168.16.1 | 192.168.23.254 | |
| … 19 more subnets | |||
| 192.168.176.0/21 | 192.168.176.1 | 192.168.183.254 | |
| … 8 more subnets | |||
| 192.168.248.0/21 | 192.168.248.1 | 192.168.255.254 | |
Check an address
Pre-filled with 192.168.181.150/21. Change the address or the prefix.
Result
192.168.176.0/21
2,046 usable hosts
- Network
- 192.168.176.0
- First usable
- 192.168.176.1
- Last usable
- 192.168.183.254
- Broadcast
- 192.168.183.255
- Subnet mask
- 255.255.248.0
- Wildcard mask
- 0.0.7.255
- Total addresses
- 2,048
Inside 192.168.0.0/16, a private range (RFC 1918). Not routable on the public internet.
Binary view
- Address · 192.168.181.150
- 11000000.10101000.10110101.10010110
- Mask · 255.255.248.0
- 11111111.11111111.11111000.00000000
- Network · 192.168.176.0
- 11000000.10101000.10110000.00000000
Bold bits are fixed for the network; orange bits number the hosts.
192.168.0.0/16 split into /21 · 32 blocks
- … 19 before
- 192.168.176.0/21.176.1–.183.254 ◂
- … 5 more
/21 next to /20 and /22
One bit shorter, a /20 (255.255.240.0) has 4,096 addresses and 4,094 usable, 2,048 more than a /21. One bit longer, /22 (255.255.252.0) has 1,024 addresses and 1,022 usable. /20 subnet · /22 subnet
Ask the calculator for a host count and it answers /21 for 1,023 to 2,046 hosts: typing "192.168.176.0 2,046 hosts" gives this size, one more host gives a /20.
Worked example
Take 192.168.181.150/21. The mask ends in the third octet. There the address is 181 = 10110101 and the mask 248 = 11111000; AND keeps the first 5 bits: 10110000 = 176. The octets after it become 0, so the network is 192.168.176.0. OR the wildcard 0.0.7.255 onto it to set every host bit: 192.168.183.255, the broadcast.
Devices use 192.168.176.1 through 192.168.183.254: 2,046 addresses. 192.168.181.150 is number 1,430 of them. In 192.168.0.0/16 this is subnet 23 of 32.
References
- RFC 4632, Classless Inter-domain Routing (CIDR), §3.1: prefix lengths and block sizes.
- RFC 950, Internet Standard Subnetting Procedure: subnet masks.
- RFC 1878, Variable Length Subnet Table For IPv4, Table 1-1, with erratum 3147 (all-ones subnet rows).
- RFC 1918, Address Allocation for Private Internets: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
Other prefixes
Related tools
- Subnet calculatorNetwork, broadcast, host range, masks and a binary view from any IPv4 or IPv6 address and prefix.
- CIDR calculatorTurn IPv4 or IPv6 ranges into the fewest CIDR blocks, merge a list, and check it for overlaps.
- VLAN plannerCarve a parent block into right-sized subnets with VLAN IDs, then export CSV or Markdown.