Timestampline is not yet implemented. Need to find out how to do
ICMP timestamping first. :-)
+
+Someone suggested to put the following text here. As to context: Some
+people are wondering why mtr sometimes reports hosts beyond the
+destination host.
+
+
+The FINAL host will occasionally be mentioned at position n, n+1, n+2
+etc.
+
+You know traceroute, right? It sends a packet, waits for the reply to
+come back and when it comes back, it sends the next packet.
+
+If say hosts 5-8 do not send "time exceeded" packets, you'll wait a
+4*3 = twelve seconds extra before you get any results on hosts 9 and
+further. MTR doesn't work like that.
+
+In theory we could send out a probe for host 1-40 all at once. But
+this would pose an unnecessary burden on the network. So what we do,
+is we send out probes for a max of 5 hosts beyond where we've seen a
+reply. So in the example above, we'd see a reply from router at
+position 4, then we'd send out 5-9 (and because the max-host is now at
+9, we'll send them out at 1s/9 = 111ms intervals). When the reply from
+host 9 comes back, we'll start probing for host 10-15 (at about 60ms
+intervals). But suppose the network delay upto host 9 is already 200ms
+and suppose our destination host is at position 11. Then by the time
+the packet from host 11 comes back, we'll already have sent probe
+packets for position 12, 13, and 14! Those will come back as
+"destination reached" and be reported by the "raw" mode.
+
+Curses mode will stop showing hosts with position numbers beyond the
+first reply of the destination host. It could gather the information
+about replies to packets sent as probes FURTHER than it actually is
+into the line displayed at its true position, but it doesn't (yet).
+
+In fact the above example is almost completely true:
+
+% mtr -r -n -c 2 152.179.99.218 | tail -5
+ 13.|-- 144.232.18.238 0.0% 2 94.8 95.4 94.8 96.0 0.8
+ 14.|-- 152.63.16.182 0.0% 2 95.1 95.5 95.1 95.8 0.5
+ 15.|-- 152.63.64.106 0.0% 2 163.9 163.9 163.9 164.0 0.1
+ 16.|-- 152.63.50.89 50.0% 2 163.7 163.7 163.7 163.7 0.0
+ 17.|-- 152.179.99.218 50.0% 2 168.2 168.2 168.2 168.2 0.0
+% mtr -l -c 2 152.179.99.218 | grep -v "^[dp]" |tail -7
+h 10 144.232.1.41
+h 11 144.232.4.96
+h 16 152.179.99.218
+h 17 152.179.99.218
+h 18 152.179.99.218
+h 12 144.232.18.238
+h 13 152.63.16.182
+
+As you can see we get the reply from the destination host at position
+16 AFTER we've sent probes for position 17 and 18. When those come
+back, they are reported. That's what raw mode does. It reports the raw
+information.
+
+If you write a backend for the raw mode, it's up to you to
+filter/display the results.
+
+h 10 144.232.1.41
+h 11 144.232.4.96
+h 12 144.232.18.238
+h 13 152.63.16.182
+h 14 152.63.64.106
+h 15 152.63.50.89
+h 16 152.179.99.218
+h 17 152.179.99.218
+h 18 152.179.99.218
+
if (tolower(c) == '?'|| tolower(c) == 'h') {
mvprintw(2, 0, "Command:\n" );
printw(" ?|h help\n" );
+ printw(" p pause (SPACE to resume)\n" );
printw(" d switching display mode\n" );
printw(" e toggle MPLS information on/off\n" );
printw(" n toggle DNS on/off\n" );
+ printw(" r reset all counters\n" );
printw(" o str set the columns to display, default str='LRS N BAWV'\n" );
printw(" j toggle latency(LS NABWV)/jitter(DR AGJMXI) stats\n" );
printw(" c <n> report cycle n, default n=infinite\n" );
.B mtr
runs on and
.BR HOSTNAME .
-by sending packets with purposly low TTLs. It continues to send
+by sending packets with purposely low TTLs. It continues to send
packets with low TTL, noting the response time of the intervening
routers. This allows
.B mtr
to print the response percentage and response times of the internet
route to
.BR HOSTNAME .
-A sudden increase in packetloss or response time is often an indication
+A sudden increase in packet loss or response time is often an indication
of a bad (or simply overloaded) link.
+.PP
+The results are usually reported as round-trip-response times in miliseconds
+and the percentage of packetloss.
+
.SH OPTIONS
.TP
.B \-\-psize\ BYTES
.TP
.B PACKETSIZE
-These options or a trailing PACKETSIZE on the commandline sets
+These options or a trailing PACKETSIZE on the command line sets
the packet size used for probing.
It is in bytes inclusive IP and ICMP headers
If set to a negative number, every iteration will use a different, random
-packetsize upto that number.
+packet size upto that number.
.TP
.B \-t
.TP
.br
Use this option to specify the fields and their order when loading mtr.
.br
+Available fields:
+.TS
+center allbox tab(%);
+ll.
+L%Loss ratio
+D%Dropped packets
+R%Received packets
+S%Sent Packets
+N%Newest RTT(ms)
+B%Min/Best RTT(ms)
+A%Average RTT(ms)
+W%Max/Worst RTT(ms)
+V%Standard Deviation
+G%Geometric Mean
+J%Current Jitter
+M%Jitter Mean/Avg.
+X%Worst Jitter
+I%Interarrival Jitter
+.TE
+.br
+
Example:
-o "LSD NBAW"
-
.TP
.B \-g
.TP
GTK+ must have been available on the system when
.B mtr
was built for this to work. See the GTK+ web page at
-.B http://www.gimp.org/gtk/
+.B http://www.gtk.org/
for more information about GTK+.
.TP
.BR http://www.bitwizard.nl/mtr/ .
.PP
-Subscribe to the mtr mailing list. All mtr related announcements
-are posted to the mtr mailing list. To subscribe, send email to
-.B majordomo@lists.xmission.com
-with
-.B subscribe\ mtr
-in the body of the message. To send a message to the mailing list, mail to
-.BR mtr@lists.xmission.com .
+The mtr mailinglist was little used and is no longer active.
.PP
-Bug reports and feature requests should be sent to the mtr
-mailing list.
-
+Bug reports and feature requests should be submitted to the
+launchpad mtr bugtracker.
.SH "SEE ALSO"
traceroute(8),
-ping(8).
+ping(8)
+TCP/IP Illustrated (Stevens, ISBN 0201633469).
fprintf (stderr, "mtr: wait time must be positive\n");
exit (1);
}
- if (getuid() != 0 && WaitTime < 1.0)
- WaitTime = 1.0;
+ if (getuid() != 0 && WaitTime < 1.0) {
+ fprintf (stderr, "non-root users cannot request an interval < 1.0 seconds\r\n");
+ exit (1);
+ }
break;
case 'f':
fstTTL = atoi (optarg);
/* begin addByMin do more stats */
oldavg = host[index].avg;
host[index].avg += (totusec - oldavg +.0) / host[index].returned;
- host[index].var += (totusec - oldavg +.0) * (totusec - host[index].avg);
+ host[index].var += (totusec - oldavg +.0) * (totusec - host[index].avg) / 1000000;
oldjavg = host[index].javg;
host[index].javg += (host[index].jitter - oldjavg) / host[index].returned;
int net_stdev(int at)
{
if( host[at].returned > 1 ) {
- return ( sqrt( host[at].var/(host[at].returned -1.0) ) );
+ return ( 1000.0 * sqrt( host[at].var/(host[at].returned -1.0) ) );
} else {
return( 0 );
}
#include <sys/socket.h>
#include <string.h>
#include <strings.h>
+#include <time.h>
#include "mtr.h"
#include "report.h"
extern int reportwide;
-void report_open(void)
+char *get_time_string (void)
{
+ time_t now;
+ char *t;
+ now = time (NULL);
+ t = ctime (&now);
+ t [ strlen (t) -1] = 0; // remove the trailing newline
+ return t;
+}
+
+void report_open(void)
+{
+ printf ("Start: %s\n", get_time_string ());
}
static size_t snprint_addr(char *dst, size_t dst_len, ip_t *addr)