Bug 360881 - Inconsistant behavior with ping, timeouts, and local/remote IP segments
Summary: Inconsistant behavior with ping, timeouts, and local/remote IP segments
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: iputils
Version: 7
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Martin Nagy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-31 20:00 UTC by Alan Narup
Modified: 2016-07-26 23:46 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-25 14:18:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch for ping (1.06 KB, patch)
2008-02-26 13:28 UTC, Martin Nagy
no flags Details | Diff

Description Alan Narup 2007-10-31 20:00:36 UTC
Ping output and duration of timeouts (-w or -W) is affected depending on if the
target is on the local IP segment or not.

If the target host is on the same IP segment and is not online:

1. Timeout options (-w or -W) of 3 or greater seconds generate output errors.

2. Timeout options (-w or -W) of 4 and greater are ignored and results in a 3
second timeout.

This does not occur when using IP's not on the local IP segment or using
timeouts of less than 3 on the local segment.

While it can be worked around via a wrapper script or filter (i.e. grep) it
should be corrected for consistancy sake and hopefully correct a possible bug
that will improve ping.


Version-Release number of selected component (if applicable):
ping from s20070202 and earlier versions.


How reproducible:
Have been able to reproduce on different hardware and networks with various
distros (Fedora 6, Fedora 7, PCLinuxOS 2007, Knoppix 5.1).

Have also been able to confirm with other users via IRC and forums.

Steps to Reproduce:

Choose a target IP address on your local IP segment that is not online.
Choose a target IP address on your local IP segment of a host that is online.
Choose a target IP address on a remote IP segment that is not online.

For these examples:
172.29.212.253 - Local IP segment with no host online
172.29.212.254 - Local IP segment with host online
192.168.11.3 - Remote IP segment with no host online

1. Local IP of host not online and errors generated with -w and a timeout 3 or
greater.

$ ping -c1 -w10 172.29.212.253
PING 172.29.212.253 (172.29.212.253) 56(84) bytes of data.
From 172.29.212.113 icmp_seq=1 Destination Host Unreachable
From 172.29.212.113 icmp_seq=2 Destination Host Unreachable
From 172.29.212.113 icmp_seq=3 Destination Host Unreachable

--- 172.29.212.253 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2010ms
, pipe 3

Note: Timeout of 10 is ignored and results in a 3 second run.
The ", pipe 3" shows up after the summary line.


2. Local IP of host not online and and error generated with -W option.

$ ping -c1 -W10 172.29.212.253
PING 172.29.212.253 (172.29.212.253) 56(84) bytes of data.
From 172.29.212.113 icmp_seq=1 Destination Host Unreachable

--- 172.29.212.253 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

Note: Timeout of 10 is ignored and results in a 3 second run.


3. Local IP of host not online and -w or -W set to 2 seconds   

$ ping -c1 -w2 172.29.212.253
PING 172.29.212.253 (172.29.212.253) 56(84) bytes of data.

--- 172.29.212.253 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1010ms

ping -c1 -W2 172.29.212.253
PING 172.29.212.253 (172.29.212.253) 56(84) bytes of data.

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


4. Local IP of host online.

$ ping -c1 -w10 172.29.212.254
PING 172.29.212.254 (172.29.212.254) 56(84) bytes of data.
64 bytes from 172.29.212.254: icmp_seq=1 ttl=255 time=1.71 ms

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


5. Remote IP of host not online and timeout set greater than 3.

$ ping -c1 -w10 192.168.11.3
PING 192.168.11.3 (192.168.11.3) 56(84) bytes of data.

--- 192.168.11.3 ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 10002ms

$ ping -c1 -W10 192.168.11.3
PING 192.168.11.3 (192.168.11.3) 56(84) bytes of data.

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

Note: A timeout of 10 in either case is working.

Expected results:
"Destination Host Unreachable" errors and error counts should not be generated.
The specified timeout of greater than 3 should work on the local segment.
The ", pipe 3" should not be appearing in example #1.

ping should be operating the same regardless if local IP segment or not.

And again, while this can be worked around via a wrapper script or filter (i.e.
grep) it should be corrected for consistancy sake and hopefully correct a
possible bug that will improve ping.

Comment 1 Martin Bacovsky 2007-10-31 21:12:54 UTC
I have been meeting the same behavior from time to time. Thanks for your
investigation. I'll keep you informed about the progress.

Comment 2 Martin Nagy 2008-02-26 13:06:47 UTC
The ", pipe 3" looks ugly, and will be fixed. Also, it seems the time is wrong.
Otherwise, I don't see any other problems.

1. Ignoring the -w10 is okay in this case, according to the manual page, with
the -w flag, ping will send echo request until the deadline or some error
notifications from the network (that means, host unreachable).

2. The timeout is not ignored, but since the host unreachable message was sent,
it isn't possible to receive an echo reply.

3. Everything seems fine to me here..

4. Same here.

5. Same here.

Comment 3 Martin Nagy 2008-02-26 13:28:23 UTC
Created attachment 295901 [details]
Patch for ping

This patch will fix the ", pipe" issue and the timing.

Comment 4 Martin Nagy 2008-03-25 14:18:04 UTC
Fixed in iputils-20071127-2.fc9


Note You need to log in before you can comment on or make changes to this bug.