4 min
We live in a world where user experience (UX) is paramount. For instance, almost a quarter of all users will tell ten people (or more) when they’ve had a good experience.
Thus, mitigating the pitfalls of network latency – the duration required for data packets to reach one location to another – is pivotal. After all, users expect speed and latency issues that slow things down will hamper their experience.
What Is Network Latency?
Network latency is a “delay.” It’s how long it takes packets of information or data to reach the destination node from their initial source node.
For instance, imagine a Connecticut server sends a data packet to a server in Istanbul. The packet gets sent from the source node at 05:25:00.000 GMT, and the destination node receives it at 5:25:00.145 GMT. In this instance, the path’s latency is 145 milliseconds (0.145 seconds), the difference between the two times.
Despite the lightning quickness with which data travels online, distance, delays, and the immutable obstacles of internet infrastructures make latency a fact of life. You can’t eliminate it, but you can minimize it.
What Causes Network Latency?
The distance between the client/requesting devices and the responding servers is a primary culprit of excessive network latency.
Users making requests from the same state as a website’s data host’s center won’t experience as much latency as if the host center is out of state or out of the country.
In-state requests will take within 5 to 10 milliseconds, whereas out-of-state or out-of-country requests will veer toward 40 to 50 milliseconds and beyond.
While these infinitesimal disparities come across as negligible, you must consider the following issues compounding them:
- Back-and-forth communication to establish connections.
- The total load time and size of the page.
- Network equipment problems.
- The number of networks through which data must travel (it’s usually more than one, and the more networks HTTP must go through, the more chances for delays there will be).
For instance, data packets crossing networks traverse Internet Exchange Points (IXPs). Routers must process and route data packets and might need to divide them into smaller packets, adding extra milliseconds to the process.
How To Monitor And Measure Latency
Most often, latency is measured in milliseconds. The lower the milliseconds, the better it is for performance.
However, on average, most networks should seek 100 milliseconds, although some video games require 50 milliseconds of latency for optimal performance.
Microseconds (μs) can also measure latency for specific use cases (e.g., high-volume trading, cloud and edge computing, IoT and analytics, and interactive apps) that require super speed.
Another term worth considering is round-trip time (RTT), which is how long it takes for client devices to receive a response after a request. This amount is double the latency because it involves the data traveling there and back again.
If you’re actively measuring and monitoring latency, run what’s known as a ping.
As network diagnostic tools, pings test the connectivity between two devices or services.
Pinging a destination server requires sending an Internet Control Message Protocol (ICMP) echo request to the server. The destination node replies with an echo, so long as there’s an available connection.
A ping will calculate a data packet’s route RTT from origin to destination and back, deciphering if packets were lost on the trip.
The Latency Formula
Another measuring component worth considering is the latency formula: Propagation Delay + Transmission Delay + Processing Delay + Queueing Delay.
Here’s a quick breakdown of each facet:
- Propagation Delay refers to the duration of the source traveling to the destination.
- Transmission Delay involves the time it takes to push bits onto a network.
- Processing Delay is the time network devices require to process and forward data.
- Queueing Delay refers to how long a packet idles in a queue before transmission.
Depending on the networks and devices, the latency values will vary.
Other Types Of Latency
Other forms of latency you might hear about include (but aren’t limited to):
- Interrupt latency is the duration of a computer’s response to a signal the host OS to stop until it decides its response.
- Fiber optic latency refers to the duration of light traveling a specific distance through a fiber optic cable (4.0 μs occur for every kilometer)
- Internet latency relies on how long a packet travels across a global WAN. The longer the distance, the more the latency.
- WAN latency depends on how busy it is. The more traffic, the more delays.
- Computer and OS latency involves the delay between input and output, often caused by underperforming data buffers and mismatched data speeds between input/output devices and the microprocessor.
Reducing Network Latency
A content delivery network (CDN) can dramatically reduce latency by caching (storing data for future requests) static content to serve users.
CDN distribution occurs across multiple locations, storing content closer to end users, reducing travel times, ensuring webpage loading takes less time, and enhancing speed and performance.
Network monitoring and troubleshooting tools are also crucial in mitigating network latency.
Furthermore, consider setting network standard latency expectations, which send alerts once it crosses a baseline threshold.
Consider using specific monitoring technology to compare different data metrics, helping flag performance issues (e.g., app performance or errors).
Mapping tools can detect where latency occurs within a network experiencing issues, enabling more streamlined troubleshooting.
Additionally, available traceroute tools monitor how packets traverse an IP network (i.e., the number of “hops” it takes, RTT, and best time) and how many IP addresses and countries it goes through.
Network Latency And Bandwidth
Bandwidth is the maximum capacity of an internet connection or network. An excess of bandwidth typically means less latency, whereas a bandwidth shortage sends latency rates soaring.
A good analogy for bandwidth’s role in latency is viewing it as a throughput or pipe that carries water over a specific distance. The latency encapsulates the time it takes the water to reach from ‘a’ to ‘b.’
A smaller pipe means the water takes longer to get where it needs to go, while a larger pipe means a quicker process. Such is the cause-and-effect relationship between bandwidth and latency.
Further reading: