Many people often suggest you to use ping command to find out your network latency. But it is false and a myth you often find in articles on Internet. ICMP ping was never designed to find out latency because it is given very low priority for routing and ICMP packets may be routed over completely different path from what your TCP/UDP packets are being sent. The routes which are chosen for sending ICMP packets can be longer and highly occupied with other traffic and thus they can never give you true result. ICMP ping was designed for checking connectivity with a server. I want to find the latency of TCP/UDP route. Is it possible?

  • Latency can very greatly from one test to another, depending on the continually changing network conditions at the time of the test. I don't think you actually understand what you are asking. There is no one answer to what the latency is. There are things like IP SLA to continuously monitor latency.
    – Ron Maupin
    Commented Sep 30, 2016 at 14:56
  • 3
    @RonMaupin I understand what I'm asking. Ping command cannot be used for testing TCP/UDP latency. I want a tool which can do that?
    – defalt
    Commented Sep 30, 2016 at 15:26
  • Unfortunately, product or resource recommendations are explicitly off-topic here. You could try to ask for that on Software Recommendations. What you are looking for is a single latency number, but what I'm telling you is that there is no such thing because the latency can vary greatly from one second to the next.
    – Ron Maupin
    Commented Sep 30, 2016 at 15:45
  • 2
    I think this is a perfectly reasonable question and fits "operating, maintaining, ... managing an enterprise ... network;", "tools used by network professionals;" and "production troubleshooting or problem resolution;" networkengineering.stackexchange.com/help/on-topic . Latency is a problem often encountered in production troubleshooting. I fail to see why a single statistical measure of latency is not possible, and as the answers below demonstrate, it clearly is possible to have a single number (though granted distributions are more useful).
    – AJP
    Commented Jun 2, 2018 at 17:32

2 Answers 2


If you're asking if you can measure latency using TCP or UDP packets, the answer is a qualified yes. There is software you can install on servers that will generate TCP/UDP flows, and you can measure the latency from that. If you have newer Cisco routers, you can use a feature called IP SLA where the routers will generate traffic.

All these assume you can install software on the target server, or you have access to the routers. The advantage of Ping is that no additional software is needed.

You can also capture live traffic with Wireshark or something similar and analyze the packet flows to calculate latency.

All the caveats that @ronmaupin mentions still hold true -- latency continuously varies as traffic conditions change. Unless the servers you use are dedicated for this purpose, their changing load can influence your results.

  • Is it possible to use IP SLA or similar utility on client side also?
    – defalt
    Commented Sep 30, 2016 at 17:26
  • Do you have access to the routers? If not, then no.
    – Ron Trunk
    Commented Sep 30, 2016 at 17:32
  • Most of the online gaming servers are able to calculate your ping rate and they don't have access to routers either. If your ping rate is too high you are kicked from the lobby. How they are doing it? Battlefield is one of them.
    – defalt
    Commented Oct 2, 2016 at 9:19
  • I only have access to my home wi-fi router.
    – defalt
    Commented Oct 2, 2016 at 9:26
  • @defalt I would imagine they measure the difference between the time they sent a message to your machine and the time they receive a response back from your machine. They may also perform other corrections for other factors like your machine responding slowly.
    – AJP
    Commented Jun 2, 2018 at 17:37

in practice your concerns are not generally a significant factor. but here's a way to confirm:

sudo nmap --packet-trace -p 80 hostname

SENT (0.4506s) [..] RCVD (0.4990s) [..]

that shows you 49ms of latency between the syn and the syn ack. Of course that includes CPU time on the client and server but that's rather unavoidable when doing active measurements.

  • You should indicate that your answer is OS dependent.
    – Ron Maupin
    Commented Sep 30, 2016 at 17:03
  • @PatrickMcManus on an IO bound server latency would be a significant factor.
    – AJP
    Commented Jun 2, 2018 at 17:39
  • @RonMaupin While "sudo" may indicate the use of Linux or Mac, the program "nmap" is available for many operating systems including Windows. "nmap" is a fairly known free application for network testing. Commented Jul 4, 2020 at 23:48
  • @Pozzo-Balbi, I understand that, but simply pasting in that command line on Windows simply will not work, and, apparently, the OP would not know that. Also, product or resource recommendations are explicitly off-topic here.
    – Ron Maupin
    Commented Jul 5, 2020 at 0:41

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