Calculate the IPv4 /30 ending at 255.255.255.255

Follow a high-address CIDR through unsigned IPv4 arithmetic and verify its final address without signed 32-bit overflow.

Try these inputs

Worked calculation

  1. The input address equals 4,294,967,294 as an unsigned integer. The /30 block size is four.
  2. Round to the lower multiple of four, 4,294,967,292, for 255.255.255.252/30.
  3. Add three for 4,294,967,295, the top of IPv4 space. This example exercises address arithmetic on a special-use range.

Inputs

One name,hosts or name,/prefix per line. Leave blank for CIDR details only.
Optional. Separate blocks with commas or spaces.

Calculated in your browser

Results

Network CIDR
255.255.255.252/30
Usable in parent
2
Total in parent
4

IPv4 address-space map

IPv4 address-space mapBlock widths follow the share of the parent address space. The lower axis shows positions from the first to the last address.255.255.255.252/304 addressesParent space0%25%50%75%100%255.255.255.252255.255.255.255
  • Parent range
Block widths follow the share of the parent address space. The lower axis shows positions from the first to the last address.
Network
255.255.255.252
Broadcast
255.255.255.255
First usable
255.255.255.253
Last usable
255.255.255.254
Subnet mask
255.255.255.252
Wildcard
0.0.0.3
Input bits
11111111 11111111 11111111 11111110
Mask bits
11111111 11111111 11111111 11111100
Network bits
11111111 11111111 11111111 11111100

Questions

Why can JavaScript show a negative value for a high IPv4 address?

Many bitwise operators interpret the top bit as a sign bit. The range calculation uses unsigned-safe values for addresses.

What does the all-ones last IPv4 address signify?

255.255.255.255 is the limited broadcast address. Its presence in this arithmetic example does not make the range suitable for a host network.

References