From owner-freebsd-net@FreeBSD.ORG Sat May 17 10:55:33 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 91DF837B401 for ; Sat, 17 May 2003 10:55:33 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id A0CC043F85 for ; Sat, 17 May 2003 10:55:32 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9/8.12.9) with ESMTP id h4HHtOM7063475; Sat, 17 May 2003 10:55:28 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200305171755.h4HHtOM7063475@gw.catspoiler.org> Date: Sat, 17 May 2003 10:55:24 -0700 (PDT) From: Don Lewis To: brett@lariat.org In-Reply-To: <200305171558.JAA16811@lariat.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: net@FreeBSD.org Subject: Re: Ping results are sometimes wrong X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2003 17:55:33 -0000 On 17 May, Brett Glass wrote: > Just noticed that FreeBSD's ping program was giving me inaccurate stats when > pinging hosts on the local subnet (but not on remote subnets). Some > investigation has revealed why: the delay for the very first ping includes the > time (if any) it takes to use ARP to discover the MAC address of the target. > This introduces an outlying data point that messes up the stats; it makes them > look as if there are extra delays or congestion on the network. > > Perhaps the program should make sure that the MAC address of the target (if > it's on the local network) has been resolved before starting to ping? You could have the same problem when pinging through a router that doesn't have the MAC address of the target, and ping doesn't have a way to check that. It would be simpler to just ignore the first sample when calculating the statistics.