The 5 best tools to measure network latency

The goal of this article is to summarize classical ways used to measure network latency through synthetic testing, that is by injecting traffic on the network. We will highlight the pros and cons of each tool to make sure you pick the right one for your needs. 

These 5 tools are:

  • Ping
  • Traceroute
  • OWAMP
  • TWAMP
  • iPerf

Simple tests using your PC

Let’s start with the ones whose implementation is straightforward.

1. Measure network latency with PING 

Let’s begin with the simplest way you may think about when trying to measure network latency: using your PC.

How it works

Ping is a standard tool available on all types of OS platforms that measures the round trip time between your PC and the target you specify (domain or IP address).

Just open your console and type pingdomain. If you provide a domain name, the first step the ping will perform is resolving it to the corresponding IP address. As an alternative you can provide the IP address directly.

The following example shows that the minimum, maximum and average round trip times are respectively 20ms, 24ms and 21ms.

ping measure network latency

By default, a ping command sends four ICMP Echo Request packets to the destination. This latter responds  back with ICMP Echo Reply packets. 

Advantages

The main advantage of this method is its simplicity. You do not need anything installed on your PC (except that ping tool) and can directly target any domain or corresponding IP address without additional configuration or software component.

Limitations

Unfortunately, simplicity often comes with limitations.

  • First, for security reasons, ICMP packets may be blocked by intermediate firewalls. In this case, the target will  never respond to your ICMP Echo Request and you will not be able to measure the network latency.
  • Secondly, the ICMP protocol may be handled with low priority by intermediate routers, distorting the accuracy of the measurements.
  • Last but certainly not least, as ping measures a round trip delay, you cannot differentiate the network latency in both directions. So it is not possible to detect network problem that would occur in a specific traffic direction.

2. Measure network performance with TRACEROUTE 

As alternative to ping, you can make use of traceroute:

  • tracert command on Windows machines
  • traceroute command on Linux machines

How it works

Traceroute uses the TTL (Time To Live) field of IP packets to discover intermediate routers between a source and a destination.

The principle is quite simple. Each time a router routes a packet, its corresponding TTL field value is decremented by 1. When this value reaches 1, the router drops the packet and sends an ICMP Error message “TTL exceeded in transit” back to the source. This mechanism is used to prevent packets from looping indefinitely, which may cause the whole network to crash.

Receiving ICMP packets back from intermediate routers allows the source to discover all of them as well as measure the network latency to reach them.

traceroute to measure network latency

In its simplest form, traceroute uses ICMP protocol for sending packets (Echo Request). And as you know now, some routers may not respond to ICMP packets for security reasons. This phenomenon is shown hereunder.

example of a traceroute command that measure network latency

On this figure, you can also see that traceroute sends four packets per hop by default on a Windows platform.

More advanced implementations also use UDP or TCP transport protocols and propose more options (size of the packets, probes interval, number of probes per hop, …). This ensures a better alignment with real network traffic and the way it is routed. Nevertheless, all traceroute implementations still rely on the ICMP Echo Reply messages that can be handled with much lower priorities as explained previously.

Furthermore, the reported value corresponds to the round trip delay. So again, it is not possible to detect asymmetric network problems.

Advantages

The main pros of traceroute are:

  • Easy to use and implement
  • Gives a representation of the network path

Limitations

On the other hand, Traceroute also comes with some limitations:

  • If traceroute uses ICMP, all the limitations listed for Ping are also valid.
  • Round trip delay only.

More advanced tests to measure network latency

More advanced synthetic test techniques can help getting around the problem of handling ICMP packets with low priority as well as the limitation of round trip measurement. 

Let’s introduce the most well known.

3. Using OWAMP for one-way and two-way network response times

How it works

OWAMP stands for One-Way Active Measurement Protocol.

It is standardized under RFC 4656.

Compared to its counterpart ping/traceroute, OWAMP measures the network latency in one direction and does not rely on the ICMP protocol to calculate it.

In conclusion, OWAMP provides more precise data, as it uses UDP packets in one direction to measure the latency. You can fine tune your tests to better align with your specific requirements and use case. For example, you can define the size of each packet, the interval between two consecutive packets in a test, as well as the number of packets to send per test.

And of course, it is easy to detect any network problem related to a specific traffic direction by performing the same test in both directions separately.

As result, you get the minimum, median, and maximum value of the network latency between your source and the targeted destination (as well as other useful data like the one-way jitter and the packet loss).

example of an OWAMP test that measures network latency

In addition, OWAMP supports authentication mechanisms to ensure security.

OWAMP seems to be the way to go, right ?

The answer is “Yes”, but only if you manage both ends of the test. Indeed, OWAMP requires the implementation of a client/server architecture. A piece of software must be installed on both the source and the destination of the test. 

Furthermore, the accuracy of the data depends on their proper clock synchronization.

Last but not least, OWAMP does not properly support NAT (Network Address Translation) configurations. Certainly something to take into account…

Advantages

  • One way delay measurement
  • Accuracy

Limitations

  • Requirements:
    • Control of both ends
    • Proper clock synchronization
  • No support for NAT

4. TWAMP for 2-way latency measurement

How it works

TWAMP, which stands for Two-Way Active Measurement Protocol, is an alternative to OWAMP. It is standardized under RFC 5357.

Compared to OWAMP, TWAMP measures latency in both directions.

It first uses TCP to establish a connection between the source and destination, then uses UDP packets to measure the latency. It also uses a client/server architecture.

Advantages and limitations

TWAMP globally shares the same advantages and limitations as its counterpart OWAMP.

5. Measure network performance with iPerf3

You may think about iPerf (latest version is iPerf3) as an alternative to OWAMP or TWAMP.

How it works

This tool also uses a client/server model, where data can be analyzed from both ends.

Nevertheless, as the data collected are the throughput, jitter and packet loss, it is more used to measure the overall link quality between two endpoints, and not directly the network latency itself.

Advantages

  • Firstly, the main advantage of iPerf is that it supports a variety of parameters and can use UDP as well as TCP to send probe packets, which can better align with your specific use cases.
  • Secondly, iPerf also provides throughput information

Limitations

  • iPerf requires a client / server implementation (i.e. on both ends).
  • iPerf provides no network latency measurement.

Summary

Tool
Metrics
Implementation
Pros
Limitations / Drawbacks
Ping
  • Round trip delay
  • Packet Loss (approx.)
  • Simple test from any machine
  • Simple
  • ICMP accuracy
  • Round trip only
Traceroute
  • Round trip delay
  • Packet Loss (approx.)
  • Network path
  • Simple test from any machine
  • Simple
  • Network path
  • ICMP accuracy (if not using UDP/TCP)
  • Round trip only
OWAMP
  • One way and Round trip delay
  • Jitter
  • Packet loss
Minimum, mediam and max values
  • Client server model
  • Accurate
  • One way delay measurement
  • Deployment model
  • Be careful to clock synchronization
  • No support for NAT
TWAMP
  • One way and Round trip delay
  • Jitter
  • Packet loss
Minimum, mediam and max values
  • Client server model
  • Accurate
  • One way delay measurement
  • Deployment model
  • Be careful to clock synchronization
iPerf
  • Jitter
  • Packet loss
  • Throughput
  • Client server model
  • Accurate
  • Throughput information
  • No network latency measurement
  • Deployment model

Takeaways

Being able to correctly measure network latency is a key aspect for ensuring digital services performance.

On one hand, measuring it can be as simple as performing ping or traceroute commands from your PC. Just bear in mind that these techniques, although simple to implement, suffer from some significant limitations:

  • Prone to measure imprecision due to the nature of ICMP handling
  • Only report RTT value (no problem detection for a specific traffic direction)

On the other hand, if you manage both ends of the test, a better option would be to use OWAMP or TWAMP. The measurements will be more precise and you will be able to detect problems related to specific traffic direction. Nevertheless, one important question stays open: “How to orchestrate such tests in a distributed and complex production environment?”. This is where specialized solutions certainly come into play.

Finally, If you are interested in this topic you may also find worthwhile looking at these two other articles:

  • “Why network latency drives digital performance” explains why network latency is a critical driver for web applications performance. It is all the more true if you think about cloud-based services, where the network path may be complex. Nowadays, the network is definitely one of the major drivers of digital services performance.
  • What is network latency? How it works and how to reduce it”, we define network latency as being the delay for a packet to travel on a network from one point to another. We introduce some techniques used to measure this latency, like RTT (Round Trip Time) measurement.