[smokeping-users] Less smoke.

G.W. Haywood ged at jubileegroup.co.uk
Fri May 23 16:25:32 CEST 2008


Hi there,

It's very common for the RTT of the first ping in a series to be much
greater than those subsequent.  This is easily explained because there
may be much more work for the routers etc. along the way to do for the
first packet, they have to populate ARP caches for example.

However this can give very misleading statistics in some cases.  I've
modified my copy of FPing.pm to send one more ping than requested, and
then to discard the first returned RTT value.

8<----------------------------------------------------------------------
*** FPing.pm.original	2008-05-23 15:02:39.000000000 +0100
--- FPing.pm	2008-05-23 15:08:15.000000000 +0100
***************
*** 32,37 ****
--- 32,40 ----

  The (optional) B<packetsize> option lets you configure the packetsize for the pings sent.

+ This version of FPing sends one more ping than requested, and discards
+ the first RTT value returned as it's likely to be an outlier.
+
  The FPing manpage has the following to say on this topic:

  Number of bytes of ping data to send.  The minimum size (normally 12) allows
***************
*** 121,127 ****

      my @cmd = (
                      $self->binary,
!                     '-C', $self->pings, '-q','-B1','-r1',
  		    @params,
                      @{$self->addresses});
      $self->do_debug("Executing @cmd");
--- 124,130 ----

      my @cmd = (
                      $self->binary,
!                     '-C', ($self->pings)+1, '-q','-B1','-r1',						# Add an extra ping
  		    @params,
                      @{$self->addresses});
      $self->do_debug("Executing @cmd");
***************
*** 134,140 ****
          my @times = split /\s+/;
          my $ip = shift @times;
          next unless ':' eq shift @times; #drop the colon
!
          @times = map {sprintf "%.10e", $_ / $self->{pingfactor}} sort {$a <=> $b} grep /^\d/, @times;
          map { $self->{rtts}{$_} = [@times] } @{$self->{addrlookup}{$ip}} ;
      }
--- 137,143 ----
          my @times = split /\s+/;
          my $ip = shift @times;
          next unless ':' eq shift @times; #drop the colon
!         shift @times;											# Junk the first result.
          @times = map {sprintf "%.10e", $_ / $self->{pingfactor}} sort {$a <=> $b} grep /^\d/, @times;
          map { $self->{rtts}{$_} = [@times] } @{$self->{addrlookup}{$ip}} ;
      }

8<----------------------------------------------------------------------

In some circumstances, the results can be striking:

http://www.jubileegroup.co.uk/JOS/misc/less_smoke.png

--

73,
Ged.



More information about the smokeping-users mailing list