Using Ping, Traceroute and MTR

From vpsget wiki
Jump to: navigation, search

Traceroute is a diagnostic tool for displaying the route (path) and measuring transit delays of packets across an IP network.

A simplest example of traceroute command is:

traceroute domain.com

You can also set a parameters:

traceroute -w 3 -q 1 -m 16 domain.com

-w 3 wait for three seconds (instead of five)
-q 1 send out only one query to each hop (instead of three)
-m 16 limit the maximum number of hops to 16 before giving up (instead of 30)

Ping is an utility to test the reachability and the time of response of a host on an IP network. Sample ping command:

ping domain.com

or:

ping 1.2.3.4

You can also set a parameters (Linux):

ping -c 5 -s 1450 domain.com

-c 5 5 cycles instead of infinite.
-s 1450 packet size is 1450 bytes (instead of 56).

You can also set a parameters (Windows):

ping domain.com -l 1450 -n 5

-l 1450 packet size is 1450 bytes (instead of 32).
-n 5 5 cycles (instead of 4).

mtr is a program which combines the functionality of the traceroute and ping programs in a single network diagnostic tool.

Install mtr on Centos:

yum install mtr

Install mtr on Debian, Ubuntu:

apt-get install mtr-tiny

mtr for Windows:

http://winmtr.net/download-winmtr/

Also on Windows (since Vosta,7) you can use built in tool named pathping. It's work similar to mtr. just type:

pathping <IP_ADDR>

Generating mtr report (Linux):

mtr --report --report-cycles 200 domain.com

This will take some time (200 cycles). The result will look like this:

[root@vps /]# mtr --report --report-cycles 200 google.com
HOST:    vps.vpsget.com           Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 2a02:748:d000:8::10           0.0%   200    0.6   0.6   0.4   1.3   0.1
 2. core1.ams.net.google.com      0.0%   200    1.7   6.0   1.4  54.8  54.6
 3. 2001:4860::1:0:8              0.5%   200   13.0   6.3   1.6  57.7   9.1
 4. 2001:4860::8:0:51a0           0.5%   200   14.1   4.4   1.4  42.8   7.1
 5. 2001:4860::8:0:519e           0.0%   200    5.5   6.4   4.6  48.6   6.1
 6. 2001:4860::2:0:66f            0.5%   200    5.5   6.6   5.0  57.4   5.0
 7. ea-in-x64.1e100.net           0.5%   200    5.2   5.6   5.1  10.3   0.4

Generating mtr report (Windows):

Just start the application, enter the domain name or the IP address in a "Host" field and press "Start".