1

I would like to estimate what is the latency in sending a packet between two IP addresses.

Let's assume that I have two IP addresses: ip1 and ip2. I can easily ping both ip1 and ip2, and the ping command gives me the round trip time for a packet to reach given IP address and for the response to come back to me. However, given the knowledge of the time it takes to ping ip1 and ip2 respectively from my IP address, can I somehow estimate the round time for a ping from ip1 to ip2?

In general, my goal is to find a way to estimate the packet latency between two IP addresses, and I thought I can do it using ping. But maybe there are other ways to do that?

2
  • 1
    Ping uses ICMP, a low-priority protocol. ICMP latency has no relationship to the latency you may have for TCP or UDP, which are probably what your applications use.
    – Ron Maupin
    Jan 16, 2020 at 11:34
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Dec 17, 2020 at 14:45

3 Answers 3

3

In addition to infra's remarks on the reliability of ping:

You can't figure out the latency between to end points by measuring this from a third point, unless they all share the exact same network, then you may be able to draw some conclusions.

If A and B are two IP addresses in random networks on the internet, you can't draw any conclusions on the latency you <--> A and you <--> B, simply because A <--> B may take yet another shorter or much longer path, because other networks may be involved in getting from A to B than for getting from you to A and B.

1

There are many ways of finding network Latency and one method is Ping Command. But Ping command has limitations and therefore you Can use Network Performance Tools such as Solarwinds, NPM...etc

In addition to that you can do packet analysis with Wire-shark and You need to proper TCP or UDP Protocols.

1

Here's a cool MacOS CLI command which shows round-trip-time per process per destination per socket: nettop! Make sure to scroll to the right to see the data.

In the example I'm giving I'm only looking at 4 categories of output for process 40893. But "nettop" by itself shows a ton of data, but you have to expand your terminal window to the right to see all the columns. There is a rtt_avg field in the full output.

I believe this is displaying data used by MacOS' "happy eyeballs" implementation to choose optimal IPv4 versus IPv6 transport.

nettop -m tcp -J rtt_min,rtt_var,bytes_in,bytes_out -p 40893
                                                                                                  bytes_in       bytes_out   rtt_min   rtt_var
    com.apple.WebKi.40893                                                                           99 KiB         209 KiB
       tcp4 192.168.0.10:49492<->lb-192-30-253-124-iad.github.com:443                             3628 B          1009 B    72.56 ms  16.12 ms
       tcp4 192.168.0.10:49479<->104.244.42.66:443                                                5091 B          1648 B    17.72 ms   7.69 ms
       tcp4 192.168.0.10:49467<->lb-140-82-114-25-iad.github.com:443                              3783 B          1184 B    81.22 ms   6.75 ms
       tcp4 192.168.0.10:49448<->stackoverflow.com:443                                            3951 B          1035 B    83.03 ms  22.56 ms
       tcp4 192.168.0.10:49441<->151.101.129.69:443                                                 64 KiB          50 KiB   9.94 ms   0.62 ms
       tcp4 192.168.0.10:49269<->ec2-34-192-92-205.compute-1.amazonaws.com:443                      13 KiB         151 KiB  77.75 ms   7.94 ms
       tcp4 192.168.0.10:49245<->lb-140-82-113-25-iad.github.com:443                              4651 B          2196 B    79.12 ms   0.62 ms

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.