4

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 Sep 30 '16 at 14:56
  • 2
    @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 Sep 30 '16 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 Sep 30 '16 at 15:45
  • 1
    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 Jun 2 '18 at 17:32
3

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 Sep 30 '16 at 17:26
  • Do you have access to the routers? If not, then no. – Ron Trunk Sep 30 '16 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 Oct 2 '16 at 9:19
  • I only have access to my home wi-fi router. – defalt Oct 2 '16 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 Jun 2 '18 at 17:37
2

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 Sep 30 '16 at 17:03
  • @PatrickMcManus on an IO bound server latency would be a significant factor. – AJP Jun 2 '18 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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