[TUHS] conventions around zero padding in ip4

ron minnich rminnich at gmail.com
Sun May 8 05:50:44 AEST 2022


here's a simple example:
rminnich at a300:~/tamago/t9$ ping 127.1
PING 127.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.056 ms

telnet 127.1 22
Trying 127.0.0.1...
Connected to 127.1.

All plan 9 programs I try parse 127.1 as 127.0.0.1

I first learned to use this convention in a BSD world, later on sunos.

Interesting, the things you think are a standard, and are actually
just a convention!

On Sat, May 7, 2022 at 12:15 PM Warner Losh <imp at bsdimp.com> wrote:
>
>
>
> On Sat, May 7, 2022 at 10:23 AM ron minnich <rminnich at gmail.com> wrote:
>>
>> IP4 padding came up recently: the ip command interprets 10.2 as
>> 10.2.0.0, whereas most things (golang libraries, ping, ...) interpret
>> it as 10.0.0.2. The latter interpretation accords with what I learned
>> 40y ago.
>
>
> 10.2 is ambiguous. In a network context, it means, typically, 10.2.0.0/16 (though your mileage may vary).
> In a host context, it means 10.0.0.2. It's this confusion that has lead to many efforts
> to outright kill this notation.
>
>>
>> But, I find myself wondering: where was the first use of the IP4 zero
>> padding convention?
>
>
> I know that it was around in the late 80s on TOPS-20 TCP/IP at Stanford, and in 4.2BSD (4.1c?). It may have also been in use at MIT. It's usage pre-dates my 1984 joining of the internet...
>
> Warner


More information about the TUHS mailing list