Inconsistent ping in lan

Hello :slight_smile:

I have a home LAN cabled with cat6 with the following devices: PC<-->Switch<-->Router.
The PC is running Linux; the router is Gl-inet B1300 running OpenWrt; the switch is TP-Link TL-SG105E. All devices support Gigabit network.

When pinging from my PC to the Router running OpenWrt, I see somewhat inconsistent times (see below). I wonder about two things:

  1. 2ms looks too much for a cabled connection (~10 meters of cable)
  2. having pings taking of more than double the time of other pings does not seem right.

Am I wrong about these points? If there's a problem, do you have some idea about how do I go about troubleshooting and pinpointing the issue?

PC$ ping 192.168.47.1
PING 192.168.47.1 (192.168.47.1) 56(84) bytes of data.
64 bytes from 192.168.47.1: icmp_seq=1 ttl=64 time=2.11 ms
64 bytes from 192.168.47.1: icmp_seq=2 ttl=64 time=0.305 ms
64 bytes from 192.168.47.1: icmp_seq=3 ttl=64 time=0.259 ms
64 bytes from 192.168.47.1: icmp_seq=4 ttl=64 time=1.65 ms
64 bytes from 192.168.47.1: icmp_seq=5 ttl=64 time=0.577 ms
64 bytes from 192.168.47.1: icmp_seq=6 ttl=64 time=0.467 ms
64 bytes from 192.168.47.1: icmp_seq=7 ttl=64 time=0.563 ms
64 bytes from 192.168.47.1: icmp_seq=8 ttl=64 time=1.60 ms
64 bytes from 192.168.47.1: icmp_seq=9 ttl=64 time=1.58 ms
64 bytes from 192.168.47.1: icmp_seq=10 ttl=64 time=0.692 ms
64 bytes from 192.168.47.1: icmp_seq=11 ttl=64 time=0.283 ms
64 bytes from 192.168.47.1: icmp_seq=12 ttl=64 time=1.73 ms
64 bytes from 192.168.47.1: icmp_seq=13 ttl=64 time=1.72 ms
64 bytes from 192.168.47.1: icmp_seq=14 ttl=64 time=0.289 ms
64 bytes from 192.168.47.1: icmp_seq=15 ttl=64 time=1.40 ms
64 bytes from 192.168.47.1: icmp_seq=16 ttl=64 time=0.274 ms
64 bytes from 192.168.47.1: icmp_seq=17 ttl=64 time=0.447 ms
64 bytes from 192.168.47.1: icmp_seq=18 ttl=64 time=1.36 ms
64 bytes from 192.168.47.1: icmp_seq=19 ttl=64 time=1.75 ms
64 bytes from 192.168.47.1: icmp_seq=20 ttl=64 time=1.45 ms
^C
--- 192.168.47.1 ping statistics ---
20 packets transmitted, 20 received, 0% packet loss, time 19179ms
rtt min/avg/max/mdev = 0.259/1.025/2.105/0.635 ms

Are you taking in consideration what was the router doing at the moments that you see spikes?
2ms are indeed too much network wise, however there are other factors to consider.

  1. Try without an intermediate switch.
  2. Ping another PC on the switch
  3. Ping another PC on the router.
1 Like

there's no load on the router, as far as I (and top) are aware.

pinging another PC on the switch lowers the response time, but there are still fluctuations of one ping taking double the time of another. IDK if at this scale (10^-4 s) this is normal or not...
unfortunatelly I cannot eliminate the switch as I cannot move the router and I don't have enougth cable to bypass it.

Thanks for the help !

PC$ ping 192.168.47.13
PING 192.168.47.13 (192.168.47.13) 56(84) bytes of data.
64 bytes from 192.168.47.13: icmp_seq=1 ttl=64 time=0.422 ms
64 bytes from 192.168.47.13: icmp_seq=2 ttl=64 time=0.738 ms
64 bytes from 192.168.47.13: icmp_seq=3 ttl=64 time=0.381 ms
64 bytes from 192.168.47.13: icmp_seq=4 ttl=64 time=0.363 ms
64 bytes from 192.168.47.13: icmp_seq=5 ttl=64 time=0.347 ms
64 bytes from 192.168.47.13: icmp_seq=6 ttl=64 time=0.491 ms
64 bytes from 192.168.47.13: icmp_seq=7 ttl=64 time=0.437 ms
64 bytes from 192.168.47.13: icmp_seq=8 ttl=64 time=0.400 ms
64 bytes from 192.168.47.13: icmp_seq=9 ttl=64 time=0.717 ms
64 bytes from 192.168.47.13: icmp_seq=10 ttl=64 time=0.425 ms
64 bytes from 192.168.47.13: icmp_seq=11 ttl=64 time=0.728 ms
64 bytes from 192.168.47.13: icmp_seq=12 ttl=64 time=0.568 ms
64 bytes from 192.168.47.13: icmp_seq=13 ttl=64 time=0.555 ms
64 bytes from 192.168.47.13: icmp_seq=14 ttl=64 time=0.719 ms
64 bytes from 192.168.47.13: icmp_seq=15 ttl=64 time=0.597 ms
64 bytes from 192.168.47.13: icmp_seq=16 ttl=64 time=0.633 ms
64 bytes from 192.168.47.13: icmp_seq=17 ttl=64 time=0.718 ms
64 bytes from 192.168.47.13: icmp_seq=18 ttl=64 time=0.614 ms
64 bytes from 192.168.47.13: icmp_seq=19 ttl=64 time=0.555 ms
64 bytes from 192.168.47.13: icmp_seq=20 ttl=64 time=0.371 ms
^C
--- 192.168.47.13 ping statistics ---
20 packets transmitted, 20 received, 0% packet loss, time 19262ms
rtt min/avg/max/mdev = 0.347/0.538/0.738/0.136 ms

Another thing that I tried was checking speed with iperf3. and I see somethings which I also cannot explain, specially the asymmetry of running on one end or the other.

Why so much lower speeds when the router is acting as client than the other way around.

And maybe more important, why are there retries (Retr) when the PC is the client? And why are these retries not happening when the Router is the client?

from PC to Router:

PC$ iperf3 -c 192.168.47.1
Connecting to host 192.168.47.1, port 5201
[  5] local 192.168.47.12 port 48720 connected to 192.168.47.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   114 MBytes   955 Mbits/sec   15    256 KBytes       
[  5]   1.00-2.00   sec   110 MBytes   925 Mbits/sec   12    222 KBytes       
[  5]   2.00-3.00   sec   111 MBytes   933 Mbits/sec   12    174 KBytes       
[  5]   3.00-4.00   sec   112 MBytes   938 Mbits/sec   12    260 KBytes       
[  5]   4.00-5.00   sec   111 MBytes   933 Mbits/sec   15    242 KBytes       
[  5]   5.00-6.00   sec   110 MBytes   924 Mbits/sec   12    298 KBytes       
[  5]   6.00-7.00   sec   108 MBytes   907 Mbits/sec    6    310 KBytes       
[  5]   7.00-8.00   sec   112 MBytes   940 Mbits/sec   15    192 KBytes       
[  5]   8.00-9.00   sec   112 MBytes   938 Mbits/sec   12    269 KBytes       
[  5]   9.00-10.00  sec   112 MBytes   937 Mbits/sec   15    243 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   933 Mbits/sec  126             sender
[  5]   0.00-10.00  sec  1.08 GBytes   931 Mbits/sec                  receiver

from Router to PC:

Router# iperf3 -c 192.168.47.12
Connecting to host 192.168.47.12, port 5201
[  5] local 192.168.47.1 port 55318 connected to 192.168.47.12 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.01   sec  88.8 MBytes   736 Mbits/sec    0    199 KBytes       
[  5]   1.01-2.01   sec  87.5 MBytes   739 Mbits/sec    0    209 KBytes       
[  5]   2.01-3.01   sec  83.8 MBytes   698 Mbits/sec    0    235 KBytes       
[  5]   3.01-4.01   sec  85.0 MBytes   714 Mbits/sec    0    247 KBytes       
[  5]   4.01-5.01   sec  87.5 MBytes   734 Mbits/sec    0    247 KBytes       
[  5]   5.01-6.01   sec  97.4 MBytes   821 Mbits/sec    0    469 KBytes       
[  5]   6.01-7.01   sec   113 MBytes   941 Mbits/sec    0    561 KBytes       
[  5]   7.01-8.00   sec   111 MBytes   940 Mbits/sec    0    634 KBytes       
[  5]   8.00-9.01   sec   112 MBytes   938 Mbits/sec    0    634 KBytes       
[  5]   9.01-10.01  sec   112 MBytes   940 Mbits/sec    0    634 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec   978 MBytes   820 Mbits/sec    0             sender
[  5]   0.00-10.02  sec   977 MBytes   818 Mbits/sec                  receiver

Maybe this forum is not the ideal place to ask about this, as this is likely unrelated to OpenWrt. If so, feel free to point this out, and if possible I'd appreciate if there's a more appropriate forum.

For the ping, you can always try different cables and a different switch.

Running an iperf from the router is not accurate, as packet generation takes more cpu cycles from merely forwarding them.

1 Like

Are your actually seeing an issue when using the network normally?

I mean, I can't notice anything when browsing or watching videos, etc.

In that case I'd probably just stop worrying about the results from ping or iperf3. You can spend a lot of time chasing imaginary gremlins if you focus on diagnostics, especially when there's no real world usage problem.

2 Likes

in your case ping test is a test for a test, if you have no packet loss, or 100+ms spikes, do not worry, even for a gaming like CS:GO or dota your ping is not sufficient
(gaming is MOST depending to ping consistent thing you can do with your pc)

1 Like