The great thing about working with Linux is the constant, serendipitous, discovery of the "best" command line tool ever. This happened to me the other day when I discovered, possibly the best ever, command line utility for network diagnostics.
"mtr" a network diagnostic tool
The mtr utility investigates the network connection between the host that mtr runs on and a target machine. Essentially it is a dynamic traceroute that constantly updates, and shows, at which router your great bandwidth pipe, gets squeezed to a trickle with a calculated mean and standard deviation.
Running "mtr [target]" such as "mtr www.linuxcertification.co.za" "will write output to the screen and continue to output network performance stats until cancelled by the user.
If you want to get the stats to put in a report to management, who want to know why their expensive internet connection still means they can't get fast access to mail while in China you can tell mtr to produce the output as a report for example
"mtr -c 20 --report --no-dns www.linuxcertification.co.za" gives the following output:
HOST: mark-desktop Loss% Snt Last Avg Best Wrst StDev 1. ??? 100.0 20 0.0 0.0 0.0 0.0 0.0 2. ??? 100.0 20 0.0 0.0 0.0 0.0 0.0 3. 41.174.0.1 0.0% 20 109.3 128.7 92.8 205.8 27.5 4. 41.160.0.242 0.0% 20 249.1 131.3 93.0 249.1 34.2 5. 198.32.142.10 0.0% 20 176.8 127.4 82.5 176.8 20.6 6. 168.209.1.172 0.0% 20 118.8 132.3 101.8 237.9 28.4 7. ??? 100.0 20 0.0 0.0 0.0 0.0 0.0 8. 196.33.141.109 0.0% 20 116.6 135.2 96.8 262.6 36.2 9. 41.66.150.122 0.0% 20 118.5 131.6 85.8 192.5 23.0 10. 41.66.153.132 5.0% 20 139.6 133.1 92.3 270.0 37.7
As can be seen there is packet loss at the target server and the average performance of the packet round trip time (RTT) between routers or hops. The mtr command's advantage over traceroute is that it also give you statistical information on the performance of the packet RTTs.
The entries with ??? are where the router did not response to the packets being sent, it either discarded them or it took too long to respond. This depends on how the router has been configured and its default behaviour when it comes to sending icpm time out packets.
You will also find, as with traceroute, some earlier hops have higher latency/RTT times than later hops. This could be due to how the router prioritizes ICMP packets its sends as opposed to ones it jut forwards.
Anyway, now you can impress your friends with this cool util! Don't tell your network admin you running it. She will probably blame you for the poor network performance.