90

Earlier today I thought I had a URL in my clipboard, but I actually had four 9 digit integers copied from a spreadsheet, which were identification numbers from a proprietary system. Completely unrelated to the task at hand. I pasted it into Firefox and was surprised to find that it actually loaded a page. I've seen dotless decimal notations of IPv4 addresses before, but this long number is something much, much larger.

714687644714805209715128610715964400 (stick a HTTP:// in front)

How does this work? All of the decimal -> IPv4 converters that I've found on the Internet all consider it an invalid input. If I take the IPv4 address that it actually loads, and perform the same calculations to convert it to dotless decimal, I get a vastly smaller number.

I've read that ping can accept dwords and do some conversion, but it cannot convert this number to an IP address. IPv6 is out of the question as this host does not have IPv6 connectivity.

What kind of madness is this? It's stumped myself and my coworkers.

Edit: It's back online now.

beeks
  • 1,082
  • 8
  • 13

1 Answers1

93

This is quite an interesting question, and took me a little while to figure out. The short answer is the last 32-bits of the number are 3660944368 (in decimal, which can be found by 714687644714805209715128610715964400 mod 2^32)

This is the decimal value of the IPv4 address 218.53.147.240, which can be found by converting it to base-256 3660944368 = 218*(256^3)+53*(256^2)+147*(256)+240 analogous to writing out a number in decimal (base-10). For example 234 = 2*10^2+ 3*10 + 4.

As @chritohnide points out, each section of dotted IPv4 addresses is called an octet as it represents 8 binary digits. It is also worth noting that the various formats of IPv4 addresses (such as the dotted decimal, or the pure decimal) are just different ways of representing the 32-bit binary number for out benefit.

Since IPv4 addresses are 32-bit numbers, so only last 32-bits of the number are used to resolve the address. Why this is true is not as obvious. As others have pointed out, the full number looks strikingly similar an IPv6 address in decimal, but is not a valid address.

Looking at the Teredo specification (see 4. Teredo Addresses), the Client IPv4 occupies the last 32-bits of the IPv6 address, but the prefix of the number does not match the Teredo specification (Also see wikipedia).