Blog

How To Check Packet Loss On A Router

jkirkwood's picture

This is part two of a three-part series on that ever-so frustrating issue of packet loss. Please click here for part one and part three will be published soon.  

How to check packet loss? 

Packet loss is a problem that can affect any given network, slowing transfers to a halt and making real time streams such as VoIP or video streams unusable. Packet loss is something that should be avoided wherever possible and is a symptom of network issues such as lack of capacity or failing devices. 

Our broken local network

In the diagram below, I have a small segment of a larger network where we suspect packet loss. The two computers are connected through a switch on the same subnet. No routers are involved.

How to do a packet capture

How to do a packet capture? 

Ask an engineer what the first step to solving any problem and the answer you’ll probably hear back is ‘replicate it’ because if you can’t measure it, you can’t identify if you have fixed the issue or not. 

The tool we are going to use for this is ping, which is on most Windows or Linux computers as a command line tool. 

From 192.168.0.2, we will ping 192.168.0.3 ten times with the following command: 

Mac:~ $ ping 192.168.0.3 -c 10 PING 192.168.0.3 (192.168.0.3): 56 data bytes 64 bytes from 192.168.0.3: icmp_seq=0 ttl=255 time=4.841 ms 64 bytes from 192.168.0.3: icmp_seq=1 ttl=255 time=1.980 ms 64 bytes from 192.168.0.3: icmp_seq=2 ttl=255 time=10.877 ms 64 bytes from 192.168.0.3: icmp_seq=3 ttl=255 time=14.607 ms Request timeout for icmp_seq 4 64 bytes from 192.168.0.3: icmp_seq=5 ttl=255 time=1.729 ms 64 bytes from 192.168.0.3: icmp_seq=6 ttl=255 time=1.766 ms Request timeout for icmp_seq 7 64 bytes from 192.168.0.3: icmp_seq=8 ttl=255 time=31.202 ms 64 bytes from 192.168.0.3: icmp_seq=9 ttl=255 time=3.034 ms

--- 192.168.0.3 ping statistics --- 10 packets transmitted, 8 packets received, 20.0% packet loss round-trip min/avg/max/stddev = 1.475/7.605/31.202/8.901 ms

Looks like we are having a bad time on our network with 20% packet loss spotted. Best send someone to look at it! 

Our broken routed network

How to do a packet capture

Now let’s look at this in a larger network. We are going to go from computer to computer via two routers. 

How to identify and monitor packet loss

Let’s try the ping again from 10.0.0.2 to 10.2.0.2: 

Mac:~ $ ping 10.2.0.2 -c 10 PING 10.2.0.2 (10.2.0.2): 56 data bytes 64 bytes from 10.2.0.2: icmp_seq=0 ttl=255 time=4.841 ms 64 bytes from 10.2.0.2: icmp_seq=1 ttl=255 time=1.980 ms 64 bytes from 10.2.0.2: icmp_seq=2 ttl=255 time=10.877 ms 64 bytes from 10.2.0.2: icmp_seq=3 ttl=255 time=14.607 ms Request timeout for icmp_seq 4 64 bytes from 10.2.0.2: icmp_seq=5 ttl=255 time=1.729 ms 64 bytes from 10.2.0.2: icmp_seq=6 ttl=255 time=1.766 ms Request timeout for icmp_seq 7 64 bytes from 10.2.0.2: icmp_seq=8 ttl=255 time=31.202 ms 64 bytes from 10.2.0.2: icmp_seq=9 ttl=255 time=3.034 ms 
--- 10.2.0.2 ping statistics --- 10 packets transmitted, 8 packets received, 20.0% packet loss round-trip min/avg/max/stddev = 1.475/7.605/31.202/8.901 ms

As you can see, there is 20% loss once again. But this time, the different issues that could go wrong warrant the use of another tool to see if we can receive more information. To do this, we can utilize a tool called mtr and run it against 10.2.0.2 to get these results: 

$ mtr --report 10.2.0.2 HOST: example                  Loss%   Snt   Last   Avg  Best  Wrst StDev   1. 10.0.0.1                    0.0%    10    2.8   2.1   1.9   2.8   0.3   2. 10.1.0.2                    0.0%    10    3.2   2.6   2.4   3.2   0.3   3. 10.2.0.2                    20.0%    10    9.8  12.2   8.7  18.2   

This response creates an important finding. The loss is happening after hop 2, so we need to send the engineer to look at the link between the second router and 10.2.0.2 as its probably broken/congested. That link should be the first place you look. 

What’s next

Now that we know how to spot the problem and narrow it down to the relevant network segment, we can start talking about how to make packet loss go away. In part three, we will show you how to best fix and prevent packet loss.