Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sbin/ping



On Jan 2, 10:55am, gdt%ir.bbn.com@localhost (Greg Troxel) wrote:
-- Subject: Re: CVS commit: src/sbin/ping

| christos%zoulas.com@localhost (Christos Zoulas) writes:
| 
| > ping -s 1 localhost
| >
| > linux:
| > PING localhost (127.0.0.1) 1(29) bytes of data.
| > 9 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64
| 
| so linux sends n bytes more than the header.
| > macosx
| > PING localhost (127.0.0.1): 1 data bytes
| > 9 bytes from 127.0.0.1: icmp_seq=0 ttl=64
| 
| as does macosx
| 
| > netbsd-current
| > PING localhost (127.0.0.1): 1 data bytes
| > 8 bytes from 127.0.0.1: icmp_seq=0 ttl=255
| 
| The man page says:
| 
|      -s packetsize
|              Specifies the number of data bytes to be sent.  The default is
|              56, which translates into 64 ICMP data bytes when combined with
|              the 8 bytes of ICMP header data.  The maximum allowed value is
|              65467 bytes.
| 
| so clearly -s 0 should lead to 8-byte packets, and -s 56 to 64-byte
| packets.  Then we would match the man page, NetBSD 5_STABLE, Linux and
| mac.

It is a bit more complicated than that:

    [10:57am] 2276>ping -C quasar
    PING quasar.astron.com (192.168.2.4): 56 data bytes
    64 bytes from 192.168.2.4: icmp_seq=0 ttl=255 time=0.037 ms
    64 bytes from 192.168.2.4: icmp_seq=1 ttl=255 time=0.084 ms
    64 bytes from 192.168.2.4: icmp_seq=2 ttl=255 time=0.102 ms
    ^C
    ----quasar.astron.com PING Statistics----
    3 packets transmitted, 3 packets received, 0.0% packet loss
    round-trip min/avg/max/stddev = 0.037/0.074/0.102/0.034 ms
    [10:58am] 2277>ping  quasar
    PING quasar.astron.com (192.168.2.4): 48 data bytes
    64 bytes from 192.168.2.4: icmp_seq=0 ttl=255 time=0.027 ms
    64 bytes from 192.168.2.4: icmp_seq=1 ttl=255 time=0.043 ms
    64 bytes from 192.168.2.4: icmp_seq=2 ttl=255 time=0.037 ms
    ^C
    ----quasar.astron.com PING Statistics----
    3 packets transmitted, 3 packets received, 0.0% packet loss
    round-trip min/avg/max/stddev = 0.027/0.036/0.043/0.008 ms

but yes, we should update the man page and make the behavior what
we want. Note that before 8 bytes matched the timestamp size, now
it does not.

christos


Home | Main Index | Thread Index | Old Index