Ping does not show roundtrip time (64bit issue)

Bug #1004350 reported by Sebastian Sjoholm
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
iputils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Update, 2012-06-11, Please see my updated description in the comment #1.

Issue with showing the round trip time in ping, it seems that for some reason the roundtrip time is not visible when the packet size is smaller than 16 bytes, still there should be all space needed to keep the time information in the packet.

Accordingt to the man page (ubuntu);

"If the data space is at least eight bytes large, ping uses the first eight bytes of this space to include a timestamp which it uses in the computation of round trip times. If less than eight bytes of pad are specified, no round trip times are given."

Below ping with 12 bytes packet size and 16 bytes packet size, with 12 bytes there is no roundtrip time printed out, but with the 16 bytes packet there is.

# ping 137.58.205.245 -s 12
PING 137.58.205.245 (137.58.205.245) 12(40) bytes of data.
20 bytes from 137.58.205.245: icmp_req=1 ttl=64
20 bytes from 137.58.205.245: icmp_req=2 ttl=64
^C
--- 137.58.205.245 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3996ms

# ping 137.58.205.245 -s 16
PING 137.58.205.245 (137.58.205.245) 16(44) bytes of data.
24 bytes from 137.58.205.245: icmp_req=1 ttl=64 time=0.139 ms
24 bytes from 137.58.205.245: icmp_req=2 ttl=64 time=0.120 ms
^C
--- 137.58.205.245 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3996ms
rtt min/avg/max/mdev = 0.119/0.123/0.139/0.012 ms
root@uetest:~#

System and Ping information

# ping -V
ping utility, iputils-sss20101006
# uname -a
Linux uetest 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
#

When checking the data with wireshark

12 Byte PING :

Internet Control Message Protocol
    Type: 0 (Echo (ping) reply)
    Code: 0
    Checksum: 0xcc5a [correct]
    Identifier (BE): 5504 (0x1580)
    Identifier (LE): 32789 (0x8015)
    Sequence number (BE): 1 (0x0001)
    Sequence number (LE): 256 (0x0100)
    [Response To: 1035]
    [Response Time: 0,131 ms]
    Data (12 bytes)

0000 00 01 02 03 04 05 06 07 08 09 0a 0b ............
        Data: 000102030405060708090a0b
        [Length: 12]

16 Byte PING :

Internet Control Message Protocol
    Type: 0 (Echo (ping) reply)
    Code: 0
    Checksum: 0x3bd6 [correct]
    Identifier (BE): 5506 (0x1582)
    Identifier (LE): 33301 (0x8215)
    Sequence number (BE): 1 (0x0001)
    Sequence number (LE): 256 (0x0100)
    [Response To: 2266]
    [Response Time: 0,112 ms]
    Data (16 bytes)

0000 83 2c bf 4f 00 00 00 00 6a 2a 02 00 00 00 00 00 .,.O....j*......
        Data: 832cbf4f000000006a2a020000000000
        [Length: 16]

As can be seen here is, that the roundtrip time exists in both cases, but for some reason the PING application in Ubuntu will not show it.

To compare with OpenSUSE distribution with an different version of ping, here we can see that the ping version is older, as well that we get roundtrip time when the packet size is 12 and 8 bytes, with 6 bytes we have no roundtrip time anymore.

$ ping www.ubuntu.com -s 12
PING www.ubuntu.com (91.189.90.41) 12(40) bytes of data.
20 bytes from jujube.canonical.com (91.189.90.41): icmp_seq=1 ttl=38 time=38.8 ms
20 bytes from jujube.canonical.com (91.189.90.41): icmp_seq=2 ttl=38 time=36.8 ms
^C
--- www.ubuntu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 36.821/37.837/38.853/1.016 ms
$ ping www.ubuntu.com -s 8
PING www.ubuntu.com (91.189.90.41) 8(36) bytes of data.
16 bytes from jujube.canonical.com (91.189.90.41): icmp_seq=1 ttl=38 time=35.7 ms
16 bytes from jujube.canonical.com (91.189.90.41): icmp_seq=2 ttl=38 time=36.3 ms
^C
--- www.ubuntu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 35.772/36.046/36.320/0.274 ms
$ ping www.ubuntu.com -s 6
PING www.ubuntu.com (91.189.90.41) 6(34) bytes of data.
14 bytes from jujube.canonical.com (91.189.90.41): icmp_seq=1 ttl=38
14 bytes from jujube.canonical.com (91.189.90.41): icmp_seq=2 ttl=38
^C
--- www.ubuntu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms

$ ping -V
ping utility, iputils-ss021109
$ uname -a
Linux ws7041 2.6.32.29-0.3-pae #1 SMP 2011-02-25 13:36:59 +0100 i686 i686 i386 GNU/Linux
$ lsb_release -a
LSB Version: core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-ia32:core-3.2-ia32:core-4.0-ia32:desktop-4.0-ia32:desktop-4.0-noarch:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.2-ia32:graphics-3.2-noarch:graphics-4.0-ia32:graphics-4.0-noarch
Distributor ID: SUSE LINUX
Description: SUSE Linux Enterprise Desktop 11 (i586)
Release: 11
Codename: n/a
$

Tags: iputils ping
description: updated
description: updated
summary: - Ping does not show roundtrip time
+ Ping does not show roundtrip time (64bit issue)
Revision history for this message
Sebastian Sjoholm (sebastian-sjoholm) wrote :

I have now confirmed that the issue with the ping/iputils is due to the 64bit version of the Ubuntu (the same fault appears as well in the 64bit version of OpenSUSE).

TEST in 32bit;

$:/# ping -V
ping utility, iputils-sss20101006
$:/# uname -a
Linux ueserver2 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux
$:/# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
$:/# ping localhost -c 1 -s 8
PING localhost (127.0.0.1) 8(36) bytes of data.
16 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.024 ms

--- localhost ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.024/0.024/0.024/0.000 ms
$:/#

The packet size is 8 bytes and the time is properly printed out (time=0.024 ms).

TEST in 64bit;

$:/# ping -V
ping utility, iputils-sss20101006
$:/# uname -a
Linux uetest 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$:/# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
$:/# ping localhost -c 1 -s 8
PING localhost (127.0.0.1) 8(36) bytes of data.
16 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64

--- localhost ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms

$:/#

Same ping arguments but no time stamp.

The only difference is the 32bit versus 64bit, for some reason the 8 byte is not enough for the 64 bit version to get the time stamp (would it need 16 bytes??).

Below is ping with packet size 16 bytes (RTT Time OK) and 15 bytes (RTT Time missing).

$:/# ping localhost -c 1 -s 16
PING localhost (127.0.0.1) 16(44) bytes of data.
24 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.025 ms

--- localhost ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.025/0.025/0.025/0.000 ms

$:/# ping localhost -c 1 -s 15
PING localhost (127.0.0.1) 15(43) bytes of data.
23 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64

--- localhost ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms

$:/#

Workaround is to have 32bit installed if the ping RTT value is needed for packet size smaller than 16 bytes.

description: updated
Revision history for this message
YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= (yoshfuji) wrote :

It is documented. ping(8) (3:20101006-1ubuntu1 from 12.04LTS) says:
| If the data space is at least of size of struct timeval ping uses the
| beginning bytes of this space to include a timestamp which it uses in
| the computation of round trip times. If the data space is shorter, no
| round trip times are given.

Changed in iputils (Ubuntu):
status: New → Invalid
Revision history for this message
Sebastian Sjoholm (sebastian-sjoholm) wrote :

According to the TCP/IP trace the roundtrip time exists also on ping that is made with 12 bytes;

   [Response Time: 0,131 ms]
    Data (12 bytes)

But the command will not show this. This would mean that the information exists, but for some reason not printed out.

This is also more than the 8 bytes that is the limit if the RTT data will be included or not, according to the documentation, if this is not different when it is 64bit?

Please review the case one more time.

Changed in iputils (Ubuntu):
status: Invalid → New
Revision history for this message
YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= (yoshfuji) wrote :

Timeval is 16bytes long on x86-64 and 8 bytes long on x86.

|12 Byte PING :
|
|Internet Control Message Protocol
:
| Data (12 bytes)
|
|0000 00 01 02 03 04 05 06 07 08 09 0a 0b ............
| Data: 000102030405060708090a0b
| [Length: 12]

This does NOT contain timeval information.

|16 Byte PING :
|
|Internet Control Message Protocol
:
| Data (16 bytes)
|
|0000 83 2c bf 4f 00 00 00 00 6a 2a 02 00 00 00 00 00 .,.O....j*......
| Data: 832cbf4f000000006a2a020000000000
| [Length: 16]

This does contain timeval (sec+usec): Fri May 25 06:53:55 2012 (UTC) + 141930usec

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in iputils (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.