What Is Packet Loss | How to Test And Fix Packet Loss

This Comprehensive Tutorial Explains What is Packet Loss, What Are the Causes, How to Check for it, How to Conduct Packet Loss Test and How to Fix it:

In this tutorial, we will explore the basic definition of packet loss in terms of computer networking systems. We will see the basic reasons behind the loss in any network.

We will also look into the various tools used to test packet loss and other network performance parameters like jitter, packet delay, distortion, network speed, and network congestion with the help of various examples and screenshots. Then we also go for checking various methods available to fix it.

How to Test and Fix Packet loss

What Is Packet Loss?

When we access the Internet for sending emails, downloading any data or image file, or looking for any information, the tiny entities of data are sent and received over the Internet these are known as packets. The flow of data packets takes place between source and destination nodes in any network and reaches its destination by passing through various transit nodes.

Now, whenever these data packets fail to reach the desired final destination then the condition is called a packet loss. It impacts the overall network throughput and QoS as due to the unsuccessful delivery of packets to the destination node the network speed slows down and real-time applications such as streaming videos, gaming also get affected.

Packet Loss Causes

The reason behind the loss can be explained with below-mentioned points:

#1) Network Congestion: During peak hours or network busy hour, when the traffic in the network reaches its maximum limits and network bandwidth is highly utilized, the condition of network congestion occurs. Now, during this condition, the packets at each intermediate node have to wait for its chance to get forwarded till the congestion clears.

But if the nodes fail apart to store and forward these packets, then they will discard them to cope up with the speed of the network. This is how the packet loss occurs in the case of network congestion. But there are many algorithms and software applications through which these lost packets can be re-transmitted to reach the destination.

#2) Software Bugs: This is one of the most usual causes of lost data packets which is introduced in the system during software updates and will result in the abnormal behavior of the network because of the introduced bugs. This can be minimized by rebooting the system and by introducing software patching.

#3) The issue with Network Hardware: Growing your network infrastructure by using old and outdated network elements such as routers, switches, hubs, firewalls, and the computer will result in packet loss as by using old devices the overall network will slow down which result in poor throughput and also loss in network connectivity. These can be improved by using updated network devices.

#4) Security threats: If you experience a sudden drop in the data packets and slowdown in the network speed then the possible cause behind this could be a malicious virus attack on your network. This means that someone is getting unauthorized access to your network and is executing the denial of service so that load on the router is increasing and as a result asking your router to drop the data packets so that network will fail.

Such kind of unwanted attacks on your network causes packet loss due to the overload of traffic and poor network speed. This can be minimized by using updated network security software and firewall which detect such network threats and eliminate them.

#5) Overloaded device and inadequate infrastructure for handling network: If your system is running out of memory and reaches its capacity then it will start discarding the data packets due to overutilization of the resources.

In this situation, the packets will not be able to reach the destination despite queuing and buffers because then they will sustain up to a certain limit and after that, they will start dropping data packets.

Similarly, if the administrator of the network is not smart enough to handle the overload condition of the system the network performance will degrade and packet loss will occur repeatedly.

Recommended Reading => BEST Packet Sniffer Tools

Effects Of Lost Data Packets

It affects different applications in various ways. For example, if we are searching and downloading any file from the Internet and there is a packet loss then it will slow down the speed of download.

But if the latency is very low meaning the loss is less than 10%, then the user will not notice the latency and the lost packet will be re-transmitted and it will be received by the user at the desired time interval.

But if the loss is greater than 20%, then the system will take more time to download the data than its usual speed, and thus delay will be noticeable. In this case, the user has to wait for the packet to be re-transmitted by the source and then receive it.

On the other hand, for real-time applications, even a 3% packet loss is not acceptable as it will be noticeable and it might change the meaning of one’s ongoing conversation and real-time data if one of the packet string is altered or goes missing.

TCP protocol has the model for re-transmission of lost packets and when TCP protocol is used for delivery of data packets, it identifies the lost packets and re-transmits the packets that are not acknowledged by the receiver. But the UDP protocol doesn’t have any acknowledgment based scenario for re-transmission of data packets therefore the lost packets will not be recovered.

How To Fix Packet Loss?

There is no way to achieve a zero percent packet loss as the reasons behind the loss like system overload, too many users, network issues, etc. constantly pop up all the time. So we can take measures to minimize the packet loss to achieve a good quality network.

The following daily practice methods can minimize the general packet loss to a great extent.

  • Check the physical connections: Please make sure that the connections between all the devices are properly done. All the ports are properly connected with the required cable to the devices. If the connection is loose and cables are wrongly connected then packet loss will occur.
  • Restart the system: If you haven’t restarted your system for long then give it a quick restart, this will clear all the bugs and also can fix the loss issue.
  • Update the software: Using updated software and the latest operating system will automatically lower the chances of having packet loss.
  • Using reliable cable connection instead of Wi-Fi: If we use the fiber optic cable and ethernet cable for network connections instead of Wi-Fi network then the network quality can be improved and there is less chance of packet loss, as Wi-Fi network is more prone to it.
  • Replace out-of-date hardware: Replacing the outdated hardware like old routers and switches which have a limited capacity with new updated high capacity network devices will minimize packet loss. As the outdated hardware is more prone to malfunctioning which in turn will drop packets and increase packet loss.
  • Detecting error types and fixing accordingly: If the interface alignment packet loss occurs with the FCS errors then there is a duplex mode mismatch between the two ends of the interface of the router. Thus, in this case, match the interface to rectify the loss. If only the FCS loss occurs, then there is an issue with cable connections thus check the connections to rectify the losses.
  • Link balance: If the bandwidth of the link between source and destination is chocked due to high and overutilization of the capacity of the link, then it will start dropping the packets unless the traffic becomes normal. In this case, we can shift half of the traffic to the protection link or the redundant link which is in idle condition to overcome the situation of high packet loss and delivering good quality of service. This is known as link Balance.

Packet Loss Test

Why do we perform the test for packet loss? The packet loss is responsible for many of the network issues especially in the WAN connectivity and Wi-Fi networks. The packet loss test results conclude the reasons behind it like the issue is due to the network connectivity or the quality of the network degrades due to TCP or UDP packet loss.

For testing the loss various tools are used, one such tool is PRTG network monitor tool which assists to confirm the lost packets, locate the UDP and TCP packet loss issues and also scrutinize the network utilization by calculating the network bandwidth, availability of nodes, and by checking the IP addresses of the network devices for better network performance.

PRTG Architecture:

PRTG architecture

[image source]

#1) PRTG Packet Loss Test

Quality of Service (QoS) one way Sensor: This tool is used to determine various parameters that are linked with the quality of a network between two nodes also known as probes.

This is used to monitor the packet loss in Voice over IP (VoIP) connections.

To run this test it is necessary to install the PRTG remote probe on a windows operating system at one end which should be connected to the PRTG server probe.

Now once the connection is established between the remote and server end probe, the sensor will transmit a bunch of UDP packets from the origin probe to the remote end and will evaluate these below factors:

  1. Noise or jitter in milliseconds (min, max, and average)
  2. Deviation in packet delay in milliseconds (min, max, and average)
  3. Replica packets (%)
  4. Distorted packets (%)
  5. Lost packets (%)
  6. Out of order packets (%)
  7. The last packet delivered ( in milliseconds)

QoS one way sensor

Go to the sensor settings and then choose the server area probe as the destination end and remote end probe as host then, the PRTG will automatically start forwarding the data packets to and fro among the two selected probes. Thus it will monitor the performance of network connection.

In this way, we will be able to locate the lost data along with the other parameters which are essential for good network performance. We just need to choose and select the host and remote device among which we want to test the packet loss.

PRTG QoS Reflector: The best thing about using this reflector is that it can also run on any of the Linux operating systems so there is no compulsion of using windows system and remote probe for output.

This is a kind of Python script that transmits the data packets between nodes known as endpoints and the PRTG. Thus by sending the data packets between two endpoints, it will measure all the QoS parameters of the network. Thus by extracting these data and by doing analysis and comparison, we can find out the jitter, deviation in packet delay, lost packets, distorted packets, etc.

Ping Sensor: This sensor transmits an Internet Control Message Protocol (ICMP) echo message request data packets between two nodes of the network onto which we have to check for network parameters and packet loss and if the receiver is available it will revert the ICMP echo reply packets as a response to the request.

The parameters it shows are:

  1. Ping time
  2. Ping time is  minimum if using greater than one ping per interval
  3. Ping time is maximum if using greater than one ping per interval
  4. Packet loss (%) for using more than one ping per interval
  5. Average round trip time in milliseconds.

The default setting for ping is four pings per scanning interval of time for the windows operating system and the Unix based OS, the ping will continue to run until we press some keywords to stop it.

Now, let’s test the packet loss between the laptop and the Wi-Fi network.

Follow the below steps:

  1. Go to the command prompt by selecting the start menu and then type “cmd”.
  2. Now the command window will open, then use ping 192.168.29.1 and press enter.
  3. This will ping the given IP address and give us the output which is shown below.

Output:

ping success

Now, as per the above summary, we can see that there is no packet loss and ping is successful.

Consider the case when the loss is there then the ping result will be like below screenshot where there is 100% packet loss as the user is not able to reach the Wi-Fi network.

ping packet loss

ping sensor

#2) MTR Tool For Packet Loss Test

We have already studied in brief about the ping and traceroute tool in one of the previous articles. The link is given below-

Must Read=> Basic Network Troubleshooting Steps And Tools

So let’s move to the MTR tool which combines the features of both pings and traceroute and used to troubleshoot and monitor the network performance and packet loss parameters.

We can run the MTR command from the command prompt by using MTR followed by the destination host IP address. Once we run the command it will keep tracking the destination by following the various routes. To stop it to perform the investigation we can enter the q key and CTRL+C key.

Let’s see how we can analyze various parameters of the network connectivity by using this tool from the below example and the output of one of the network:

MTR test

[image source]

  • Connectivity with the destination node: Here, MTR trace shows in the output that it is reaching the final hop of the destination without any fail, as we can see from the above image it is clear that there is no issue between source and destination end connectivity.
  • Packet loss: This field indicates the % of the packet loss at each intermediate hop while we are moving from source to destination end. The 0% packet loss as shown in the above image indicated there is no issue but if it shows some loss then we need to check that particular hop.
  • Round Trip Time (RTT): This represents the total time taken by the packets to reach the destination from the source. It is calculated in milliseconds and if this is very large it means that the distance between the two hops is very big. As we can see that the RTT time difference between hop 6 and hop 7 in the above screenshot is huge which is because both hops are situated in different countries.
  • Standard deviation: This parameter reflects the deviation in the packet delay which is calculated in milliseconds.
  • Jitter: This is the distortion that is usually observed during the voice communication in the network. The MTR tool can also evaluate the amount of jitter at each hop level between source and destination by just adding the field in the default settings and run the show jitter command.

Let’s take another example in which we run the MTR command with some different settings then the default one. Here we will send packets at every successive second means, speed will be very fast to notice the packet loss, and also we will send 50 data packets in each hop.

Now in the below screenshot we can see that by increasing the speed of packet transmission and sending more packets per hop there is packet failure in hop 1, hop 2, and hop 3 with 100% packet failure at hop 2. Thus it means that there is network congestion at these hops. We need to take steps to rectify them.

MTR test example

Conclusion

In this article, we have learned the fundamentals of the packet loss with the reason and the methods to fix it in any network.

The packet loss is a very common network problem that occurs due to the basic issues like a system software issue, cable fault, etc. We have also learned the fact that it can’t be neutralized completely, it can only be minimized by taking precautions and using various tools for monitoring and testing the network.

We also looked at ways to evaluate the packet loss by studying various test methods with the help of screenshots and images.