jpnap

Internet Fundamentals

Fundamental Terms Underpinning the Internet

09 What is Network Latency?
A Detailed Explanation of Measurement and Improvement Methods

Have you ever experienced slow web services? One of the reasons could be network latency. This article explains the concept of latency in networking, including measurement and improvement methods, in a way that's easy for beginners to understand.

Deepen your understanding of this crucial network metric and use this knowledge to create a more comfortable internet environment.

What is Latency?

Latency is a key metric in data transfer, referring to the delay time experienced when data is transmitted. Specifically, it is the time taken for data to travel from the sender to the receiver, i.e., the time it takes for data to move from one point to another.

Shorter delay times and faster responses indicate low latency, while longer delays and slower responses indicate high latency.
Latency is measured in milliseconds (ms). The smaller the latency, the higher the performance in data access, meaning a better state of internet communication.

Minimizing latency is crucial for providing a comfortable communication environment.

Difference from Throughput and Bandwidth

Along with latency, understanding throughput and bandwidth is essential for assessing network communication performance.
Throughput refers to the amount of data a network can process in a certain time, representing the actual data transmission speed. On the other hand, bandwidth is the maximum data transmission capacity of a communication channel, indicating the theoretical maximum transmission speed.
All are important metrics for measuring communication quality, each playing a different role. Throughput represents effective communication speed, bandwidth represents the maximum possible communication volume, and latency shows the time delay for data to reach its destination. To ensure fast and stable communication, these three elements need to be optimally balanced.

How to Measure Latency

There are several methods to measure latency, but the ping command is the most commonly used.
The ping command is a basic command in the TCP/IP world, sending a specific data format called ICMP*1 packets from the sending device to the receiving device and measuring the time until a response is received.

*1 ICMP (Internet Control Message Protocol): A protocol for controlling messages on the internet.

The round-trip time taken is displayed to understand latency. However, latency measured by the ping command is only a rough estimate and may differ from the actual data transmission speed. For more accurate measurements, specialized tools or protocols should be used.

Main Causes of Latency

The factors causing latency are diverse, affecting servers, network equipment, applications, and overall infrastructure. Identifying these potential causes and implementing corresponding measures can reduce latency.

Transmission Delay in Networks

Transmission delays occur when a packet is transmitted, measured as the time from the first bit being sent until the last bit is transferred. Managing this delay requires appropriate allocation of network bandwidth and effective queuing strategies.

Network Congestion Delay

Congestion delays occur when network data traffic exceeds a certain bandwidth, leading to packet delays or losses and, consequently, increased latency. Network traffic monitoring and proper traffic management can mitigate congestion delays.

Propagation Delay in Networks

Propagation delays occur due to the physical time taken for packet transmission over long distances between sites. It is proportional to distance, so shortening physical distances or using faster transmission media improves it. Thus, connecting to domestic servers closer to the user tends to result in shorter data transfer times than connecting to overseas servers.

Application or Program Settings

Improper design or implementation of applications and programs can affect overall system performance and increase latency. This issue is observed in cases of insufficient database optimization, unnecessary middleware layers, or unoptimized network requests.

Low Server Processing Performance

If a server's processing performance is low, response times to requests will be longer. This often results from insufficient CPU or memory resources or unoptimized application code. Servers with low processing power, especially under high traffic conditions, can cause increased delays and potentially service outages.

Methods to Improve Latency

There are several approaches to improving latency. Here, we'll explain some of the most common methods in an understandable way.

Switching to Fast Domestic Servers

As mentioned earlier, propagation delays increase with the physical distance between the user and the server. Thus, minimizing this distance is desirable. Domestic servers are physically closer than overseas servers, resulting in faster data transmission.

Enhancing Server Performance

Improving the processing performance of servers and network devices can also reduce latency. Specifically, this includes hardware upgrades and optimization of network devices.

Hardware upgrades enhance data processing speed by improving CPU and RAM performance.

Optimizing network devices, such as revising the settings and configurations of routers or switches, can make data transmission more efficient and reduce latency.

Optimizing Applications and Files

Improving the processing of applications and files can shorten latency. This includes application optimization and file compression.

Application optimization involves refactoring code and revising algorithms to increase processing speed.

File compression reduces data size, decreasing the amount of data sent and received over the network and improving latency.

Using CDNs (Content Delivery Network)

A CDN (Content Delivery Network) is a distributed server network spread over the internet. This network uses caching to deliver web content on behalf of the original server. By enabling fast responses through caching and delivering content from the nearest CDN server to the user, delays are minimized, and content can be delivered rapidly.

Conclusion

Reducing latency directly correlates with enhancing user experience and improving system responsiveness. However, the effectiveness of countermeasures varies depending on the situation. Choosing the optimal latency improvement strategy from the various approaches is crucial.