HTTPfy

/4 subnet mask (240.0.0.0)

A /4 network has 28 host bits, 268,435,456 addresses and 268,435,454 usable hosts. It is 1,048,576 /24 networks.

/4 at a glance

Netmask
240.0.0.0
Wildcard mask
15.255.255.255
Hex mask
0xF0000000
Binary mask
11110000.00000000.00000000.00000000
Host bits
28
Total addresses
268,435,456
Usable hosts
268,435,454 (minus network and broadcast)
Compared with a /24
1,048,576 /24 networks

Typical uses of a /4

A /4 is the size of the multicast block 224.0.0.0/4 (old Class D) and the reserved 240.0.0.0/4 (old Class E). It is also the shortest mask Google Cloud accepts for a subnet primary range, though you would never need one that large.

Well-known /4 blocks

  • 224.0.0.0/4: Multicast (RFC 5771), old Class D
  • 240.0.0.0/4: Reserved, old Class E (RFC 1112)

Example /4 ranges

NetworkNetwork addressFirst usableLast usableBroadcastNext /4
0.0.0.0/4 0.0.0.0 0.0.0.1 15.255.255.254 15.255.255.255 16.0.0.0/4 calculate

The /4 boundary falls in the first octet, so /4 networks start every 16 in that octet (16 per address space): 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240.

What a /4 contains

Smaller blockHow many
/164,096
/241,048,576
/264,194,304
/2816,777,216
/2933,554,432
/3067,108,864
/32268,435,456

Splitting a /4

IntoSubnetsUsable hosts each
/52134,217,726
/6467,108,862
/7833,554,430
/81616,777,214

/4 in AWS, Azure and Google Cloud

PlatformAllowed subnet sizes/4 allowed?Usable after reservation
AWS VPC/16 to /28 No -
Azure VNet/2 to /29 Yes 268,435,451 (5 reserved)
Google Cloud VPC/4 to /29 Yes 268,435,452 (4 reserved)

Cloud providers reserve addresses in every subnet (first four and the last address (network, VPC router, DNS, future use, broadcast) on AWS), so the usable count there differs from the classic 2^n - 2.