Skip to content
Tape and Square

N-01 · Subnet · /22

/22 subnet

A /22 network keeps 22 of the 32 address bits for the network and leaves 10 for hosts. Its mask, host count, the blocks it fits in and example networks, all worked out below.

Short answer

Subnet mask
255.255.252.0Wildcard 0.0.3.255
Usable hosts
1,0221,024 addresses in total

2^10 = 1,024 addresses. The first is the network address and the last the broadcast, so 1,022 can go to devices.

The /22 mask in binary and hex

22 one bits, then 10 zero bits. The wildcard is the mask inverted.

MaskDottedHex
Subnet mask255.255.252.0FF.FF.FC.00
Wildcard0.0.3.25500.00.03.FF

The mask ends inside the third octet, at 252 (11111100). That leaves 2 host bits in the octet, so /22 networks start every 4 in it: 0, 4, 8, 12 and so on. Cisco access lists take the wildcard form, 0.0.3.255, where a 1 bit means “any value” (Cisco document 23602).

RFC 1878's table lists /22 as FF.FF.FC.00 hex, 1 K addresses, equal to 4 C in the old class terms. Its Table 1-1 counts a /22 as 64 subnets of a class B network with 1,022 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 /22 subnets fit

The three private ranges (RFC 1918) and one /24.

Block/22 subnets in it
10.0.0.0/816,384
172.16.0.0/121,024
192.168.0.0/1664
192.168.181.0/24none: one /22 holds 4

10.0.0.0/8 holds 16,384, 172.16.0.0/12 holds 1,024 and 192.168.0.0/16 holds 64 /22 subnets. One /22 spans 4 /24s.

Splitting a /22

Each extra prefix bit halves the block.

IntoSubnetsUsable each
/232510
/244254
/258126

Two /23 subnets hold 1,020 usable addresses between them, 2 fewer than one /22: each half gives up its own network and broadcast address.

/22 subnets of 192.168.0.0/16

192.168.0.0/16 holds 64 of them. The row in bold holds 192.168.181.150.

SubnetFirst usableLast usable
192.168.0.0/22192.168.0.1192.168.3.254
192.168.4.0/22192.168.4.1192.168.7.254
192.168.8.0/22192.168.8.1192.168.11.254
… 42 more subnets
192.168.180.0/22192.168.180.1192.168.183.254
… 17 more subnets
192.168.252.0/22192.168.252.1192.168.255.254

Check an address

Pre-filled with 192.168.181.150/22. Change the address or the prefix.

/22

Also accepts 192.168.1.130 255.255.255.192, 192.168.1.0 60 hosts or IPv6 like 2001:db8::/48.

Result

192.168.180.0/22

1,022 usable hosts

Network
192.168.180.0
First usable
192.168.180.1
Last usable
192.168.183.254
Broadcast
192.168.183.255
Subnet mask
255.255.252.0
Wildcard mask
0.0.3.255
Total addresses
1,024
PRIVATE

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.252.0
11111111.11111111.11111100.00000000
Network · 192.168.180.0
11000000.10101000.10110100.00000000

Bold bits are fixed for the network; orange bits number the hosts.

192.168.0.0/16 split into /22 · 64 blocks

  1. … 42 before
  2. 192.168.180.0/22.180.1–.183.254 ◂
  3. … 14 more

/22 next to /21 and /23

One bit shorter, a /21 (255.255.248.0) has 2,048 addresses and 2,046 usable, 1,024 more than a /22. One bit longer, /23 (255.255.254.0) has 512 addresses and 510 usable. /21 subnet · /23 subnet

Ask the calculator for a host count and it answers /22 for 511 to 1,022 hosts: typing "192.168.180.0 1,022 hosts" gives this size, one more host gives a /21.

Worked example

Take 192.168.181.150/22. The mask ends in the third octet. There the address is 181 = 10110101 and the mask 252 = 11111100; AND keeps the first 6 bits: 10110100 = 180. The octets after it become 0, so the network is 192.168.180.0. OR the wildcard 0.0.3.255 onto it to set every host bit: 192.168.183.255, the broadcast.

Devices use 192.168.180.1 through 192.168.183.254: 1,022 addresses. 192.168.181.150 is number 406 of them. In 192.168.0.0/16 this is subnet 46 of 64.

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