Blame FORMATS

Packit b802ec
Packit b802ec
The "split" format is for a separating the gui from the main program.
Packit b802ec
The main program can be installed setuid, and you don't want to link a
Packit b802ec
gui-library with a setuid program.
Packit b802ec
Packit b802ec
Packit b802ec
The split format is:
Packit b802ec
Packit b802ec
<pos> <host> <loss%> <rcvd pckts> <sent pckts> <best> <avg> <worst> 
Packit b802ec
Packit b802ec
Packit b802ec
The "raw" format is:
Packit b802ec
Packit b802ec
hostline|xmitline|pingline|dnsline|timestampline
Packit b802ec
Packit b802ec
hostline:
Packit b802ec
h <pos> <host IP>
Packit b802ec
Packit b802ec
xmitline:
Packit b802ec
x <pos> <seqnum>
Packit b802ec
Packit b802ec
pingline:
Packit b802ec
p <pos> <pingtime (ms)> <seqnum>
Packit b802ec
Packit b802ec
dnsline: 
Packit b802ec
d <pos> <hostname>
Packit b802ec
Packit b802ec
timestampline:
Packit b802ec
t <pos> <pingtime> <timestamp>
Packit b802ec
Packit b802ec
Packit b802ec
Timestampline is not  yet implemented. Need to find out how to do
Packit b802ec
ICMP timestamping first. :-)
Packit b802ec
Packit b802ec
Packit b802ec
Someone suggested to put the following text here. As to context: Some
Packit b802ec
people are wondering why mtr sometimes reports hosts beyond the
Packit b802ec
destination host. 
Packit b802ec
Packit b802ec
Packit b802ec
The FINAL host will occasionally be mentioned at position n, n+1, n+2
Packit b802ec
etc.
Packit b802ec
Packit b802ec
You know traceroute, right? It sends a packet, waits for the reply to
Packit b802ec
come back and when it comes back, it sends the next packet.
Packit b802ec
Packit b802ec
If say hosts 5-8 do not send "time exceeded" packets, you'll wait a
Packit b802ec
4*3 = twelve seconds extra before you get any results on hosts 9 and
Packit b802ec
further. MTR doesn't work like that.
Packit b802ec
Packit b802ec
In theory we could send out a probe for host 1-40 all at once. But
Packit b802ec
this would pose an unnecessary burden on the network. So what we do,
Packit b802ec
is we send out probes for a max of 5 hosts beyond where we've seen a
Packit b802ec
reply. So in the example above, we'd see a reply from router at
Packit b802ec
position 4, then we'd send out 5-9 (and because the max-host is now at
Packit b802ec
9, we'll send them out at 1s/9 = 111ms intervals). When the reply from
Packit b802ec
host 9 comes back, we'll start probing for host 10-15 (at about 60ms
Packit b802ec
intervals). But suppose the network delay up to host 9 is already 200ms
Packit b802ec
and suppose our destination host is at position 11. Then by the time
Packit b802ec
the packet from host 11 comes back, we'll already have sent probe
Packit b802ec
packets for position 12, 13, and 14! Those will come back as
Packit b802ec
"destination reached" and be reported by the "raw" mode.
Packit b802ec
Packit b802ec
Curses mode will stop showing hosts with position numbers beyond the
Packit b802ec
first reply of the destination host. It could gather the information
Packit b802ec
about replies to packets sent as probes FURTHER than it actually is
Packit b802ec
into the line displayed at its true position, but it doesn't (yet).
Packit b802ec
Packit b802ec
In fact the above example is almost completely true:
Packit b802ec
Packit b802ec
% mtr -r -n -c 2 152.179.99.218 | tail -5
Packit b802ec
 13.|-- 144.232.18.238 0.0% 2 94.8 95.4 94.8 96.0 0.8
Packit b802ec
 14.|-- 152.63.16.182 0.0% 2 95.1 95.5 95.1 95.8 0.5
Packit b802ec
 15.|-- 152.63.64.106 0.0% 2 163.9 163.9 163.9 164.0 0.1
Packit b802ec
 16.|-- 152.63.50.89 50.0% 2 163.7 163.7 163.7 163.7 0.0
Packit b802ec
 17.|-- 152.179.99.218 50.0% 2 168.2 168.2 168.2 168.2 0.0
Packit b802ec
% mtr -l -c 2 152.179.99.218 | grep -v "^[dp]" |tail -7
Packit b802ec
h 10 144.232.1.41
Packit b802ec
h 11 144.232.4.96
Packit b802ec
h 16 152.179.99.218
Packit b802ec
h 17 152.179.99.218
Packit b802ec
h 18 152.179.99.218
Packit b802ec
h 12 144.232.18.238
Packit b802ec
h 13 152.63.16.182
Packit b802ec
Packit b802ec
As you can see we get the reply from the destination host at position
Packit b802ec
16 AFTER we've sent probes for position 17 and 18. When those come
Packit b802ec
back, they are reported. That's what raw mode does. It reports the raw
Packit b802ec
information.
Packit b802ec
Packit b802ec
If you write a backend for the raw mode, it's up to you to
Packit b802ec
filter/display the results.
Packit b802ec
Packit b802ec
h 10 144.232.1.41
Packit b802ec
h 11 144.232.4.96
Packit b802ec
h 12 144.232.18.238
Packit b802ec
h 13 152.63.16.182
Packit b802ec
h 14 152.63.64.106
Packit b802ec
h 15 152.63.50.89
Packit b802ec
h 16 152.179.99.218
Packit b802ec
h 17 152.179.99.218
Packit b802ec
h 18 152.179.99.218
Packit b802ec