Skip to content

Latency — Measuring and Troubleshooting Network Delays

Latency is the amount of time it takes for data to travel from a source to a destination and back again. It is one of the most important performance metrics in networking because high latency directly affects web applications, APIs, databases, cloud services, VoIP, gaming, Kubernetes clusters, and distributed systems. Low latency improves user experience, while excessive latency can lead to slow applications, timeouts, retransmissions, and poor system performance. Every Network Engineer, Linux Administrator, DevOps Engineer, SRE, Cloud Architect, and Kubernetes Administrator should understand latency and how to troubleshoot it.


Learning Path

Networking Mastery → Module 12: Network Troubleshooting → Lesson 8

Difficulty: Advanced

Reading Time: 220 Minutes

Course Progress

Course: Networking Mastery

Module: Network Troubleshooting

Lesson: 8 of 10


What You'll Learn

After completing this lesson, you'll be able to:

  • Understand network latency
  • Measure Round Trip Time (RTT)
  • Differentiate latency from bandwidth
  • Understand jitter
  • Identify latency bottlenecks
  • Troubleshoot latency in cloud and Kubernetes environments
  • Optimize network performance

Prerequisites

Complete:

Basic understanding of:

  • TCP/IP
  • Routing
  • Ethernet

Why Does Latency Matter?

Imagine users report:

Website

Feels

Slow

Possible causes:

  • High Network Latency
  • Congestion
  • Packet Loss
  • Long-Distance Routing
  • Server Processing Delay
  • DNS Delay

Latency directly impacts application responsiveness.


What is Latency?

Latency is:

The

Time

Taken

For

Data

To

Travel

Across

A

Network

Measured in:

Milliseconds

(ms)

Round Trip Time (RTT)

Most networking tools measure:

Round

Trip

Time

RTT represents:

Client


Server


Client

The total travel time for a request and its response.


One-Way Latency

One-way latency measures:

Client


Server

Unlike RTT, it requires synchronized clocks between systems.


Packet Journey

Client


Switch


Router


Internet


Server


Response

Every device contributes to total latency.


Sources of Latency

Latency comes from:

  • Propagation Delay
  • Transmission Delay
  • Processing Delay
  • Queuing Delay

Each component adds to the overall response time.


Propagation Delay

The time required for signals to travel through the medium.

Influenced by:

  • Distance
  • Fiber
  • Copper
  • Wireless

Longer distances increase propagation delay.


Transmission Delay

The time needed to place all bits onto the network link.

Depends on:

  • Packet Size
  • Link Speed

Larger packets require more transmission time.


Processing Delay

Routers and switches require time to:

  • Inspect Packets
  • Lookup Routes
  • Apply Firewall Rules
  • Perform Network Address Translation (NAT)

Modern hardware minimizes this delay.


Queuing Delay

Occurs when devices wait before forwarding packets.

Common causes:

  • Congestion
  • High Traffic
  • Buffering

This delay often fluctuates.


Jitter

Jitter is:

Variation

In

Latency

Example:

10 ms


15 ms


9 ms


35 ms

High jitter negatively affects:

  • Voice Calls
  • Video Conferencing
  • Online Gaming
  • Live Streaming

Bandwidth vs Latency

Bandwidth measures:

How

Much

Data

Latency measures:

How

Fast

The

First

Packet

Arrives

High bandwidth does not guarantee low latency.


Example

Connection A:

1 Gbps

Latency

100 ms

Connection B:

100 Mbps

Latency

5 ms

Interactive applications often perform better on Connection B.


Typical Latency Values

RTT Interpretation
<1 ms Local Host
1–5 ms Local Network
5–20 ms Same Data Center
20–50 ms Same Region
50–100 ms Different Region
100–200 ms Cross Continent
>200 ms High Latency

Measuring Latency

Use Ping.

ping google.com

Example:

time=15 ms

The reported time is the RTT.


Using traceroute

traceroute google.com

Identify:

  • Slow Routers
  • Long Paths
  • Congested Links

Each hop reports its own latency.


Measuring with curl

Measure HTTP response time.

curl -w "%{time_total}\n" https://example.com

Useful for application-level latency measurements.


tcpdump Analysis

Capture packets.

sudo tcpdump

Analyze:

  • Retransmissions
  • Delays
  • TCP Handshake Timing

Wireshark Analysis

Measure:

  • TCP RTT
  • DNS Response Time
  • HTTP Response Time
  • TLS Handshake Duration

Wireshark provides timestamp-based analysis for every packet.


DNS Latency

Slow DNS resolution increases overall response time.

Workflow:

Browser


DNS


Server


Response

Use:

dig

to measure DNS query times.


Cloud Latency

Common causes:

  • Cross-Region Traffic
  • Internet Routing
  • VPN Tunnels
  • Load Balancers
  • NAT Gateways

Keep services close to users whenever possible.


Kubernetes Latency

Potential causes:

  • CoreDNS
  • Service Mesh
  • Overlay Networks
  • kube-proxy
  • eBPF Configuration
  • Cross-Node Communication

Monitor Pod-to-Pod communication carefully.


Enterprise Latency Workflow

Client


Gateway


ISP


Internet


Cloud


Application


Database

Measure latency at every layer.


Monitoring Latency

Common monitoring tools:

  • Prometheus
  • Grafana
  • Ping Exporter
  • Blackbox Exporter
  • Cloud Monitoring
  • Datadog

Track latency trends over time.


CLI Examples

Measure RTT.

ping google.com

Trace the route.

traceroute google.com

Measure HTTP response time.

curl -w "%{time_total}\n" https://example.com

Capture traffic.

sudo tcpdump

Hands-on Lab

Task 1

Measure latency to:

ping google.com

Record the RTT.


Task 2

Run:

traceroute google.com

Identify the slowest hop.


Task 3

Measure application latency.

curl -w "%{time_total}\n" https://example.com

Task 4

Capture packets.

sudo tcpdump

Observe packet timing.


Task 5

Analyze the capture in Wireshark.

Measure:

  • TCP Handshake
  • DNS Lookup
  • HTTP Response

Task 6

Compare latency between:

  • Local Server
  • Cloud VM
  • Kubernetes Service

Document your findings.


Task 7

Deploy an application in two cloud regions and compare response times from different geographic locations.


Task 8

Draw the complete latency path:

Browser


DNS


Load Balancer


Application


Database


Response

Estimate where the highest latency is likely to occur.


Production Troubleshooting

Problem:

Application

Is

Slow

Check:

  • DNS
  • RTT
  • Routing
  • Packet Loss
  • TCP Retransmissions
  • Server CPU
  • Database Response
  • Cloud Region

Workflow:

Ping


Traceroute


tcpdump


Wireshark


Application Logs


Root Cause

Latency vs Bandwidth

Latency Bandwidth
Time Delay Data Capacity
Milliseconds Mbps / Gbps
Response Speed Transfer Rate
Affects User Experience Affects Download Speed
Lower is Better Higher is Better

Latency vs Jitter

Latency Jitter
Average Delay Delay Variation
Measured in ms Measured in ms
Consistent Value Fluctuating Value
Impacts All Applications Especially Affects Real-Time Applications
Lower is Better Lower is Better

Common Mistakes

❌ Confusing bandwidth with latency.

✅ Measure both independently.


❌ Blaming the network without checking the application.

✅ Correlate network metrics with application performance.


❌ Ignoring DNS resolution time.

✅ Include DNS latency in end-to-end analysis.


❌ Measuring latency from only one location.

✅ Test from multiple regions or networks.


❌ Focusing only on Ping.

✅ Measure application response times as well.


Best Practices

  • Monitor latency continuously.
  • Measure latency from multiple locations.
  • Keep applications close to users.
  • Reduce unnecessary network hops.
  • Use Content Delivery Networks (CDNs) for global content.
  • Monitor DNS response times.
  • Analyze TCP retransmissions.
  • Benchmark latency after infrastructure changes.

Interview Questions

Beginner

  1. What is network latency?
  2. What is RTT?
  3. What is jitter?
  4. How is latency measured?

Intermediate

  1. Compare latency and bandwidth.
  2. Explain propagation delay.
  3. What causes high latency?
  4. How do you measure application latency?

Architect Level

  1. Design a latency monitoring strategy for a global application.
  2. Explain how to troubleshoot high latency in Kubernetes.
  3. How would you reduce latency across multiple cloud regions?

Summary

In this lesson, you learned:

  • Network Latency
  • Round Trip Time (RTT)
  • One-Way Latency
  • Jitter
  • Bandwidth vs Latency
  • DNS Latency
  • Cloud Latency
  • Kubernetes Latency
  • Production Performance Troubleshooting

Latency is one of the most important indicators of network and application performance. High latency can originate from network distance, congestion, routing, DNS, or application processing. By measuring latency at multiple layers and combining tools such as Ping, traceroute, tcpdump, Wireshark, and application monitoring, engineers can accurately identify performance bottlenecks and optimize user experience.


Key Takeaways

  • Latency measures how long data takes to travel across a network.
  • RTT is the most common latency metric.
  • Jitter measures variation in latency and is critical for real-time applications.
  • High bandwidth does not guarantee low latency.
  • Measure latency at the network, transport, and application layers.
  • Combine multiple troubleshooting tools to identify the true source of delays.

What's Next?

Packet Loss

In the next lesson, you'll learn about Packet Loss.

You'll explore:

  • What Packet Loss is
  • Common Causes
  • Packet Drops
  • TCP Retransmissions
  • Network Congestion
  • Packet Loss Detection
  • Production Network Troubleshooting

By the end of the lesson, you'll understand how to identify, measure, and resolve packet loss issues across enterprise networks, cloud infrastructures, and Kubernetes environments.