Did you know? All Video & Audio API plans include a $100 free usage credit each month so you can build and test risk-free. View Plans ->

Packet Loss

When users complain about call drops or inconsistent performance, packet loss is often to blame. Understanding how and why packets go missing is critical to building resilient, real-time applications and debugging network performance effectively.

What Is Packet Loss?

Packet loss occurs when one or more data packets traveling across a network fail to reach their destination, often due to network issues.

A packet is a basic unit of data, each containing several bytes that traverse the network, allowing systems to communicate effectively. While most packets are transmitted successfully, some might get dropped in the process.

This failure degrades application performance, particularly in systems requiring fast, continuous data delivery.

The exact effects manifest differently from one application to another. In a video conferencing app, it may result in frozen screens or distorted audio. In a file transfer system, it can lead to failed or corrupted downloads.

Additionally, network transport protocols handle packet loss differently. For example, let's compare the two most common protocols:

  • Transmission Control Protocol (TCP) retransmits lost packets, which improves the network connection but increases latency.

  • User Datagram Protocol (UDP) does not recover lost packets, leading to partially distorted communication but lower latency than TCP.

How Does Packet Loss Occur?

Below are some of the top causes:

Network Congestion

When traffic exceeds a network's capacity, congestion occurs, resulting in data packet drops. Routers with limited bandwidth drop incoming packets because their buffers are full. This bottleneck contributes to loss rates that increase with the severity of the congestion.

Wireless-Specific Problems 

Wireless networks like Wi-Fi are prone to interference from physical barriers like walls, electronic devices (such as microwaves), or long distances from access points. This interference corrupts signals, forcing packet retransmissions at the MAC layer or leading to immediate drops.

Software Bugs 

It can also occur due to software bugs. Flaws in the firmware, network drivers, or OS stack can cause packets to be dropped. For example, a bad router could start dropping packets after running for some time, or a misbehaving firewall might discard legitimate traffic.

Bugs in your applications, especially those using custom protocols or low-level sockets, lead to packets dropping from buffers.

Security Attacks

Security threats like distributed denial of service attacks (DDoS) cause a sudden spike in lost packets by flooding the network with an overwhelming amount of traffic. This high volume consumes bandwidth and overwhelms device resources, which results in the dropping of legitimate packets.

Hardware Faults and Physical Errors

Faulty or aging network devices are another avenue through which packets may be lost, such as a failing network interface card on a server, a flapping switch port, or an overheating router. Outdated network hardware often lacks the capacity to handle high throughput, so they drop packets once traffic exceeds their limits.

Network Misconfigurations

Configuration mistakes in network switches and routers can create network loops that result in system instability and packet loss. For example, when a router's entry table is incorrect, the packets are sent to a nonexistent path.

Misconfigured VLAN or ACL rules on switches or routers can discard traffic incorrectly, including packets. Overly strict firewall configurations or errors inadvertently block legitimate data flow.

Devices with incorrect IP addresses, subnet masks, or default gateways will fail to communicate on the network, and packets sent to and from them will be dropped. 

Impact of Packet Loss

Losing packets impacts application performance in various ways:

Streaming and Calling Problems

Delays in receiving data packets cause jitter, a variation in arrival time that degrades call and stream quality.

After losing packets, audio or video streaming applications may buffer, freeze, or lower their quality to re-fetch or compensate for missing data. Similarly, losing packets in live streaming or real-time video chat can make video playback glitchy for users. It's also a reason why VoIP calls can have choppy or robotic audio.

Lag in Gaming

Gaming apps are highly sensitive to this problem. Gamers will notice lag, such as delayed inputs, causing the characters to move back to a previous position. Opponents might appear to teleport, or some actions may not register. This makes the experience highly unpredictable, and the game may become unplayable.

Slowed File Transfers 

File transfer protocols like FTP and SFTP ensure data is fully received, so this issue doesn't corrupt files. However, it significantly slows down the transfer process. Each lost packet initiates a resend, lengthening the total download time.

Slow HTTP Requests 

Since web browsers fetch many resources like HTML, CSS, images, and scripts, packet loss delays the loading of web page elements. Lost packets cause retransmissions, which add latency.

Methods for Testing Packet Loss

There are several tools and methods for testing it in applications, including:

Running a Ping Test

The ping command tests packet loss by sending messages to the destination system and asking for a reply. It sends ICMP echo request packets to a target IP, then measures the response.

By sending a large number of messages, you can detect the extent of the loss.

To run this test, open your terminal and enter the ping command, followed by relevant flags, number of packets, and destination IP address as shown below:

ping -n 100 8.8.8.8 on Windows

ping -c 100 8.8.8.8 on Linux/Mac

These commands will send 100 packets to Google's DNS. The test returns network statistics, including the percentage of packet loss.

The response appears as follows, indicating a loss of 2%.

64 bytes from 8.8.8.8: icmp_seq=98 ttl=119 time=9.65 ms

64 bytes from 8.8.8.8: icmp_seq=99 ttl=119 time=15.9 ms

64 bytes from 8.8.8.8: icmp_seq=100 ttl=119 time=14.8 ms

--- 8.8.8.8 ping statistics ---

100 packets transmitted, 98 received, 2% packet loss, time 99238ms

rtt min/avg/max/mdev = 9.021/46.381/1038.902/145.160 ms, pipe 2

Using Traceroute

Traceroute is a network diagnostics tool that uses ICMP messages to test network connectivity. It reveals the path that the data takes and the latency at each hop. It identifies the links and network nodes with packet loss issues.

To use traceroute in Linux, use the following commands on your terminal, replacing (website) with your target site:

sudo apt install traceroute\
traceroute (website)

These commands return a response like this:

traceroute to getstream.io (52.84.102.66), 30 hops max, 60 byte packets

1  DESKTOP-R7T0DC8.mshome.net (172.21.240.1)  1.381 ms  1.355 ms  1.337 ms

2  my.meraki.net (192.168.0.1)  10.210 ms  10.184 ms  10.157 ms

3  197.254.50.241.acesskenya.net (197.254.50.241)  9.985 ms  9.741 ms  9.686 ms

4  197.254.110.241.acesskenya.net (197.254.110.241)  9.668 ms * *

5  99.83.68.106 (99.83.68.106)  9.492 ms  48.791 ms  48.714 ms

6  150.222.29.132 (150.222.29.132)  48.730 ms 150.222.29.100 (150.222.29.100)  45.190 ms server-52-84-102-66.nbo50.r.cloudfront.net (52.84.102.66)  12.347 ms

This response indicates that data successfully reached getstream.io in 6 hops, with all intermediate routers responding except hop 4, which dropped two probes. Packet loss in traceroute typically appears as repeated asterisks (* * *) at one or more hops, indicating no response from those routers.

MTR, a more advanced tool, combines ping and traceroute in a continuous measurement, pinging each hop and showing the loss percentage.

Using Network Monitoring Tools

When running a large production environment, dedicated monitoring tools can help identify and mitigate packet loss continuously. They use protocols like ICMP and SNMP to pinpoint the source and the extent, enabling proactive troubleshooting. Some tools ping important nodes, while others deploy agents to simulate traffic between locations.

Best Practices for Mitigating Packet Loss

Once you have identified the issue, follow these best practices to mitigate it:

Monitor and Troubleshoot Continuously

Use continuous monitoring tools to track packet loss and network performance. These tools provide end-to-end visibility to aid in maintaining application health. They also alert you about any real-time anomalies, enabling immediate troubleshooting.

Increase Network Bandwidth

If packet loss originates within your network, increase bandwidth or capacity to handle higher loads. This can involve upgrading links, adding new ones, or implementing link aggregation.

You should also implement quality of service (QoS) policies to prioritize critical traffic. Techniques like traffic priority and traffic shaping make sure that important packets get delivered first, helping to avoid drops during periods of heavy network usage.

Check for Software Bugs 

Fix bugs and software inefficiencies through patches. Identify applications that reduce bandwidth or have memory leaks that lead to packet drops.

Also, you can use built-in strategies to handle packet loss where appropriate, such as error correction or retransmission mechanisms. If you're building video conferencing solutions, you can use WebRTC debugging tools to understand the system more deeply.

Upgrade Outdated Hardware

Upgrade old or faulty hardware devices that cause intermittent packet loss. Newer Ethernet cables, routers, and switches have better traffic management and can handle a higher capacity. For example, modern switches might have larger packet buffers and smarter queuing than older ones.

Rebooting Routers

Restarting a router can clear cached states or memory leaks and reset network connections, which can temporarily resolve packet loss.

Frequently Asked Questions

Is 1% Packet Loss Bad for Gaming?

Even a 1% packet loss can be detrimental to online gaming, as it may lead to noticeable lag spikes or stuttering. While it may not break the game, it’s noticeable and can put some players at a disadvantage in fast-paced games. For competitive online gaming apps, you should aim for 0% loss.

Can a CPU Cause Packet Loss?

A CPU can directly cause packet loss if it's the bottleneck for processing network interrupts or forwarding. Packet handling requires CPU time, either on the user’s PC or on a router’s processor. If the CPU has high usage or is overutilized, it may result in slow processing and possible packet drops.

What’s the Difference Between Frame Loss and Packet Loss?

Frame loss refers to the percentage of video frames dropped and not displayed to the viewer versus the number sent, which is often the result of dropped packets. In contrast, packet loss occurs when data packets are dropped at the network or transport level.

What Is an Acceptable Amount of Packet Loss?

The acceptable amount of packet loss depends on the nature of the application, but generally, 1% is considered acceptable. Sensitive apps like online gaming can have noticeable issues at higher percentages. Losses higher than 5% will likely cause lagging in video calls or slow loading pages.

What Are the Chances of Losing a UDP Packet?

The likelihood of losing UDP packets on healthy networks is low, typically under 1%. However, UDP does not retransmit lost packets, so loss becomes visible at the application layer.