Speedup ping and traceroute Responses in Linux

Speedup ping and traceroute Responses in Linux

speedup-ping-and-traceroute-responses-in-linux

Ping is used to test the reach ability of a host on an Internet Protocol (IP) network and to measure the round trip time for messages sent from the originating host to a destination computer.

Syntax.

ping -n -W VALUE -i VALUE host

n  – Disable DNS lookup to speed up queries

w – Time to wait for a response, in seconds. The option affects only timeout in absence of any responses, otherwise ping waits for two RTTs.

i - Wait interval seconds between sending each packet. The default is to wait for one second between each packet normally, or not to wait in flood mode. Only super-user may set interval to values less 0.2 seconds.

default ping result :

ping -c 6 www.thetechnicalstuff.com

PING thetechnicalstuff.com (118.139.174.210) 56(84) bytes of data.
64 bytes from ip-118-139-174-210.ip.secureserver.net (118.139.174.210): icmp_seq=1 ttl=57 time=279 ms
64 bytes from ip-118-139-174-210.ip.secureserver.net (118.139.174.210): icmp_seq=2 ttl=57 time=277 ms
64 bytes from ip-118-139-174-210.ip.secureserver.net (118.139.174.210): icmp_seq=3 ttl=57 time=276 ms
64 bytes from ip-118-139-174-210.ip.secureserver.net (118.139.174.210): icmp_seq=4 ttl=57 time=277 ms
64 bytes from ip-118-139-174-210.ip.secureserver.net (118.139.174.210): icmp_seq=5 ttl=57 time=277 ms
64 bytes from ip-118-139-174-210.ip.secureserver.net (118.139.174.210): icmp_seq=6 ttl=57 time=277 ms

— thetechnicalstuff.com ping statistics —
6 packets transmitted, 6 received, 0% packet loss, time 5280ms
rtt min/avg/max/mdev = 276.977/277.709/279.648/1.043 ms

After optimizing the ping command

ping -c 5 -n -i 0.2 -W1 www.thetechnicalstuff.com
PING thetechnicalstuff.com (118.139.174.210) 56(84) bytes of data.
64 bytes from 118.139.174.210: icmp_seq=1 ttl=57 time=277 ms
64 bytes from 118.139.174.210: icmp_seq=2 ttl=57 time=297 ms
64 bytes from 118.139.174.210: icmp_seq=3 ttl=57 time=279 ms
64 bytes from 118.139.174.210: icmp_seq=4 ttl=57 time=286 ms
64 bytes from 118.139.174.210: icmp_seq=5 ttl=57 time=277 ms

— thetechnicalstuff.com ping statistics —
5 packets transmitted, 5 received, 0% packet loss, time 1079ms
rtt min/avg/max/mdev = 277.105/283.507/297.536/7.794 ms, pipe 2

Trace route

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

syntax –

traceroute -n -w SECONDS -q NUMBER host

n  – Disable DNS lookup to speed up queries

w – set the time to wait for response

q – set the number of probe – default 3

The following example will wailt 3 seconds , only send out 1 query to each hop

.traceroute -n -w 3 -q 1 www.thetechnicalstuff.com

 




Leave a Reply

Your email address will not be published. Required fields are marked *