So, I discovered a strange quirk of the Windows 10 ping utility. If you ping a whole number instead of an IP address, it will "convert" that number to an IPv4 address. The conversion is such that the first octet is your 256^3 spot, second octet is 256^2, third is 256^1, and the last octet being the "ones" place or 256^0.
For example "ping 200" will ping 0.0.0.200, but "ping 400" will ping 0.0.1.144, where the "1" in the third octet represents 256 (256 + 144 = 400).
A quick Google search (although I couldn't think of a great search term) didn't bring anything.
My only two theories are this:
- It may be the case that in an earlier iteration of the IP schema (i.e. the unused v1, v2, or v3), the plan was to just use single whole numbers. Microsoft, in its' obsession with backwards compatibility wrote a translation algorithm into the ping utility to handle this way way back when ping was first coded.
- It may be the case that due to the way the ping utility is coded, it normally takes a valid IPv4 address and translates it to a single whole number before doing something with that data. Thus, as a check in the code, if it sees that the user entered a single whole number, it just skips that initial translation step.
Any ideas? It definitely intrigued my co-workers, but they were just as clueless as I am.
EDIT: Just tested it on my Arch Linux machine, and I can confirm that the behavior exists there as well, so that likely discredits my first theory.