The different notations tripped us up big time a while ago at my company. A class of our devices used to get their machine name set from the serial number in the BIOS. On the older models these started with letters. Then we got a new model and the serial numbers on these were just long numbers. So far so good.<p>After a while we noticed that a lot of them (around 30%) didn't work on the network. It took a while to figure out that some of the serial numbers got interpreted as octal IP addresses so pinging them didn't resolve through DNS but instead went straight to the (wrong) IP.<p>In hindsight this could have been predicted but it just shows that often a design that made sense when it was created can cause huge headaches later on. Now we prefix all serial numbers with some letters to make sure they don't get misinterpreted.
I did telephone tech support in an Austin boiler room for awhile and used the decimal IP notation I'd learned from my ISP days a lot. Sometimes accessing a customer's router home page is a must and there is no connectivity for name lookups. Elderly people have trouble with dots and numbers, or they add spaces, or any number of things.<p>Instead of directing them to 192.168.0.1 I'd tell them to enter 3232235521 and it would get the same place. My supervisor called me into the office because someone heard me doing it while snooping a call and it freaked them out.
I discovered the hard way that a library I was using would parse an IP address in a URL like 192.168.000.077 as 192.168.0.63. Yeah... it treated leading zeros as octal in individual components of the IP. Lots of fun to track down.
I like the hex version better than the traditional version, although the traditional one is easily recognised as an IP address, even without context, so its probably best to stick with that ;)
I believe you can also represent an ipv4 address in base 10, by doing something like<p>a.b.c.d, (a * 2^24) + (b * 2^16) + (c * 2^8) + (d * 2^0)<p>(the first time i did this was the first time I understood raising a constant to zero was one, so I left it there for myself)<p>The resultant number should be somewhere between 0 and (2^32)-1. It's a neat toy. I'm not sure what value it has in practice.<p>192 x 2^24 + 168 x 2^16 + 0 x 2^8 + 1 x 2^0 == 3232235521<p>ping 3232235521
PING 3232235521 (192.168.0.1): 56 data bytes
Request timeout for icmp_seq 0
^C
There’s even more ways to skin this cat. Octal notation works (prefixed with a 0), and each octet can be represented differently (0x7F.1 == 0x7F.0.0.1 == 127.0.0.1).
The bit with `ping 0` is sadly unexplored, as the nature of "any host in network" and "any host in any network" addresses are sadly unmentioned these days.<p>Then come the joys of debugging someone's configuration because a tutorial told them to "connect to 0.0.0.0" instead of localhost...
This was quite interesting thanks!<p>On a related note, does anyone have a good recommendations/blog post that explains how IP addressing, ports, subnetting, etc.
all work?<p>This is one of these things where I know that I'm just working off of empirical knowledge without knowing the fundamentals.
As documented in the man pages...<p><a href="https://www.freebsd.org/cgi/man.cgi?query=inet_pton" rel="nofollow">https://www.freebsd.org/cgi/man.cgi?query=inet_pton</a>