Ping response

:confused:Hi,

In linux if ping to a system from a linux server it shows ping time=0.120ms

how we can achive this in aix. i need this for a latency check.

Thanks in advance.

AIX's ping already shows it, "time=x ms" at the end of each line. It also shows the min/average/max at the end. Is that what you are looking for?

localhost:/:# oslevel -s
6100-05-01-1016
localhost:/:# ping -c3 remotehost
PING remotehost: (10.2.1.2): 56 data bytes
64 bytes from 10.2.1.2: icmp_seq=0 ttl=255 time=0 ms
64 bytes from 10.2.1.2: icmp_seq=1 ttl=255 time=0 ms
64 bytes from 10.2.1.2: icmp_seq=2 ttl=255 time=0 ms

----remotehost PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0/0/0 ms
localhost:/:#

Obviously vjm is looking for a time resolution of less than 1ms to be displayed to check for network latency but unfortunately AIX cannot do that and just rounds to the nearest ms, 0ms in your example.

Sorry vjm, for AIX you will either need to try the linux ping or some open source ping or find another way.

Thanks for your reply...

You can combine ping with tcpdump which returns fine timestamps. Example:

(0)aserver:/home/root 6# tcpdump -i en0 ip proto \\icmp and host 192.168.100.>
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on en0, link-type 1, capture size 96 bytes
13:02:52.362347 IP aserver > remotebox: icmp 64: echo request seq 229
13:02:52.362575 IP remotebox > aserver: icmp 64: echo reply seq 229
13:02:53.362751 IP aserver > remotebox: icmp 64: echo request seq 230
13:02:53.362981 IP remotebox > aserver: icmp 64: echo reply seq 230
13:02:54.363136 IP aserver > remotebox: icmp 64: echo request seq 231
13:02:54.363449 IP remotebox > aserver: icmp 64: echo reply seq 231
13:02:55.364265 IP aserver > remotebox: icmp 64: echo request seq 232
13:02:55.364501 IP remotebox > aserver: icmp 64: echo reply seq 232

45 packets received by filter
0 packets dropped by kernel
(0)aserver:/home/root 7#

Use the two timestamps of the packets that share same sequence number to calculate round trip time. A granularity of six digits behind the full second should be good enough (as long as you do not work with HPC stock trading apps :wink: )

1 Like

Do work with stock trading apps and thanks for reply