tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Packet loss on eth0 [Raspberry Pi 4 Model B]

Wed Oct 02, 2019 8:42 am

Hi Forum,

just recieved my new RPi4 with the official power supply. I installed Raspbian Buster 10.1 and updated all packages.

Everything works as expected but the eth0 interface looses about 15% of all packets (measured by router).
When using eth0 the ssh connection keeps disconnecting and if I ping from Windows 10 cmd I get constantly 6 replies and then 2 timeouts.

It is currently running on the wlan0 interface because the wifi connection is stable and got 0% packet loss.
The configuration for wlan0 and eth0 is the same. Problem persists when disabling wifi.

Code: Select all

$ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255
        ether dc:a6:32:21:81:af  txqueuelen 1000  (Ethernet)
        RX packets 8926  bytes 3129771 (2.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10888  bytes 5324045 (5.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Also no RX- or TX-Errors when using

Code: Select all

$ netstat -i 
Kernel-Schnittstellentabelle
Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0      1500     8926      0      0 0         10888      0      0      0 BMU
lo       65536      187      0      0 0           187      0      0      0 LRU
wlan0     1500   186028      0      0 0        251652      0      0      0 BMRU
I changed cables from cat6 to cat5e but no difference. Both cables are just 0.5m long.
Tried to manually configure /etc/network/interfaces but also no difference. Reversed to default config and reconfigured via desktop.

The whole reason for me to upgrade from RPi2 to RPi4 is the gigabit network port.
I hope you guys can give me a few more hints on solving this or confirm a broken unit.


User avatar
neilgl
Posts: 2177
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Thu Oct 03, 2019 10:58 pm

What router / switch are you using?

ejolson
Posts: 5366
Joined: Tue Mar 18, 2014 11:47 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Thu Oct 03, 2019 11:02 pm

tfuchs1987 wrote:
Thu Oct 03, 2019 10:47 pm
push :mrgreen:
It's possible you have defective hardware--either the Pi or the switch.

I thought my 4B was defective because it wouldn't connect with a particular gigabit switch that appeared to work for other computers. I finally tried a different switch and everything is now fine. More details are in the thread

https://www.raspberrypi.org/forums/view ... 6&t=249861

Have you tried measuring the bandwidth between the Pi 4B and a PC on the same subnet using iperf3? If things are working correctly, one should get more than 900 Mbps in either direction.

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 8:40 am

thank you guys for your replies!
I'm using the default router of my isp called "Unitymedia ConnectBox". I got a NAS, 2 Desktops and a RPi2 just running fine on my network. But I'll test it with another switch as I come home today. If I measure my connection speed I got the full duplex 1000mbps

Code: Select all

# iperf -c 192.168.1.4
------------------------------------------------------------
Client connecting to 192.168.1.4, TCP port 5001
TCP window size:  127 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.2 port 60858 connected with 192.168.1.4 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.03 GBytes  985 Mbits/sec
Image
Last edited by tfuchs1987 on Fri Oct 04, 2019 9:10 am, edited 1 time in total.

User avatar
DougieLawson
Posts: 39092
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 8:59 am

It might be worth posting the same question on https://community.unitymedia.de/ in case it's a problem with your router/ap/dhcp server's firmware.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 6:32 pm

Replacement Raspberry was in my mail today! I immediately inserted the sd-card and booted up.

No packet loss detected! :D

I put the new raspberry into my case and gently reapplied the passiv heatsinks. Booted again and was shocked to watch the requests timing out again. :o

Booted up the old raspberry without any heatsinks and the problem on this unit is now even worse. There is no visual damage! Never had any similar issues with my RPi1 and 2. Even successfully installed 2 RPi4s for my company. But we used not the offical case and other heatsinks were delivered. I guess the "GeeekPi 8PCS Hatsink for Raspberry Pi 4 Modell B" are the issue! https://www.amazon.de/gp/product/B07VMM ... UTF8&psc=1

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 6:57 pm

tfuchs1987 wrote:
Fri Oct 04, 2019 6:32 pm
Replacement Raspberry was in my mail today! I immediately inserted the sd-card and booted up.

No packet loss detected! :D

I put the new raspberry into my case and gently reapplied the passiv heatsinks. Booted again and was shocked to watch the requests timing out again. :o

Booted up the old raspberry without any heatsinks and the problem on this unit is now even worse. There is no visual damage! Never had any similar issues with my RPi1 and 2.

GeeekPi 8PCS Hatsink for Raspberry Pi 4 Modell B
https://www.amazon.de/gp/product/B07VMM ... UTF8&psc=1
It will be very helpful when you tell us what you are testing, how you are testing and that you provide information on how you determine that there is a problem.

Please provide the output of

Code: Select all

ifconfig eth0
The road to insanity is paved with static ip addresses

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 7:00 pm

Code: Select all

root@raspberrypi:~# ifconfig eth0                                                                                                                                               
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500                                                                                                                      
        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255                                                                                                        
        inet6 fe80::554b:adc4:f8bc:fcb5  prefixlen 64  scopeid 0x20<link>                                                                                                       
        ether dc:a6:32:21:81:af  txqueuelen 1000  (Ethernet)                                                                                                                    
        RX packets 2112  bytes 187768 (183.3 KiB)                                                                                                                               
        RX errors 0  dropped 0  overruns 0  frame 0                                                                                                                             
        TX packets 2168  bytes 201983 (197.2 KiB)                                                                                                                               
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0       
This is my Windows cmd

Code: Select all

C:\Users\trist>ping 192.168.1.2 -t
Reply from 192.168.1.2: bytes=32 time<1ms TTL=64
Reply from 192.168.1.2: bytes=32 time<1ms TTL=64
Reply from 192.168.1.2: bytes=32 time<1ms TTL=64
Reply from 192.168.1.2: bytes=32 time<1ms TTL=64
Reply from 192.168.1.2: bytes=32 time<1ms TTL=64
Reply from 192.168.1.2: bytes=32 time<1ms TTL=64
Request timed out.
Request timed out.
Reply from 192.168.1.2: bytes=32 time<1ms TTL=64
Request timed out.
Request timed out.
Reply from 192.168.1.2: bytes=32 time<1ms TTL=64
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.1.2: bytes=32 time<1ms TTL=64
Request timed out.
Request timed out.

ejolson
Posts: 5366
Joined: Tue Mar 18, 2014 11:47 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 7:07 pm

tfuchs1987 wrote:
Fri Oct 04, 2019 6:32 pm
Replacement Raspberry was in my mail today! I immediately inserted the sd-card and booted up.

No packet loss detected! :D

I put the new raspberry into my case and gently reapplied the passiv heatsinks. Booted again and was shocked to watch the requests timing out again. :o

Booted up the old raspberry without any heatsinks and the problem on this unit is now even worse. There is no visual damage! Never had any similar issues with my RPi1 and 2. Even successfully installed 2 RPi4s for my company. But we used not the offical case and other heatsinks were delivered. I guess the "GeeekPi 8PCS Hatsink for Raspberry Pi 4 Modell B" are the issue! https://www.amazon.de/gp/product/B07VMM ... UTF8&psc=1
Are you aware that Linux ignores packets for protocols and services which aren't enabled and counts those as dropped packets in the network metrics?

Please try iperf3 (not the original iperf) and check for dropped packets as reported by the output of that program. I would suggest running

$ iperf3 -s

on the Pi and then

$ iperf3 -c ip.number.of.the.pi

from a Linux PC on the same subnet.

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 7:09 pm

When using Putty the connection is so bad that typing is really hard and after a few minutes the connection is lost entirely. I will provide iperf3 data in a minute! Thank you so much to address my issue!

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 7:14 pm

Session1

Code: Select all

root@raspberrypi:~# iperf3 -c 192.168.1.2
Connecting to host 192.168.1.2, port 5201
[  5] local 192.168.1.2 port 47930 connected to 192.168.1.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   695 MBytes  5.83 Gbits/sec    0   1023 KBytes
[  5]   1.00-2.00   sec   690 MBytes  5.79 Gbits/sec    0   1023 KBytes
[  5]   2.00-3.00   sec   691 MBytes  5.80 Gbits/sec    0   1023 KBytes
[  5]   3.00-4.00   sec   688 MBytes  5.77 Gbits/sec    0   1023 KBytes
[  5]   4.00-5.00   sec   686 MBytes  5.75 Gbits/sec    0   1023 KBytes
[  5]   5.00-6.00   sec   676 MBytes  5.67 Gbits/sec    0   1023 KBytes
[  5]   6.00-7.00   sec   680 MBytes  5.71 Gbits/sec    0   1023 KBytes
[  5]   7.00-8.00   sec   686 MBytes  5.76 Gbits/sec    0   1023 KBytes
[  5]   8.00-9.00   sec   685 MBytes  5.75 Gbits/sec    0   1023 KBytes
[  5]   9.00-10.00  sec   688 MBytes  5.76 Gbits/sec    0   1023 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  6.70 GBytes  5.76 Gbits/sec    0             sender
[  5]   0.00-10.04  sec  6.70 GBytes  5.73 Gbits/sec                  receiver

iperf Done.
Session2

Code: Select all

root@raspberrypi:~# iperf3 -s                                                                                                                                                   
-----------------------------------------------------------                                                                                                                     
Server listening on 5201                                                                                                                                                        
-----------------------------------------------------------                                                                                                                     
Accepted connection from 192.168.1.2, port 47928                                                                                                                                
[  5] local 192.168.1.2 port 5201 connected to 192.168.1.2 port 47930                                                                                                           
[ ID] Interval           Transfer     Bitrate                                                                                                                                   
[  5]   0.00-1.00   sec   662 MBytes  5.55 Gbits/sec                                                                                                                            
[  5]   1.00-2.00   sec   690 MBytes  5.79 Gbits/sec                                                                                                                            
[  5]   2.00-3.00   sec   691 MBytes  5.79 Gbits/sec                                                                                                                            
[  5]   3.00-4.00   sec   689 MBytes  5.78 Gbits/sec                                                                                                                            
[  5]   4.00-5.00   sec   685 MBytes  5.75 Gbits/sec                                                                                                                            
[  5]   5.00-6.00   sec   676 MBytes  5.67 Gbits/sec                                                                                                                            
[  5]   6.00-7.00   sec   680 MBytes  5.71 Gbits/sec                                                                                                                            
[  5]   7.00-8.00   sec   686 MBytes  5.75 Gbits/sec                                                                                                                            
[  5]   8.00-9.00   sec   685 MBytes  5.75 Gbits/sec                                                                                                                            
[  5]   9.00-10.00  sec   686 MBytes  5.76 Gbits/sec                                                                                                                            
[  5]  10.00-10.04  sec  25.8 MBytes  5.87 Gbits/sec                                                                                                                            
- - - - - - - - - - - - - - - - - - - - - - - - -                                                                                                                               
[ ID] Interval           Transfer     Bitrate                                                                                                                                   
[  5]   0.00-10.04  sec  6.70 GBytes  5.73 Gbits/sec                  receiver                                                                                                  
-----------------------------------------------------------                                                                                                                     
Server listening on 5201                                                                                                                                                        
-----------------------------------------------------------   

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 7:17 pm

tfuchs1987 wrote:
Fri Oct 04, 2019 7:00 pm

Code: Select all

root@raspberrypi:~# ifconfig eth0                                                                                                                                               
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500                                                                                                                      
        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255                                                                                                        
        inet6 fe80::554b:adc4:f8bc:fcb5  prefixlen 64  scopeid 0x20<link>                                                                                                       
        ether dc:a6:32:21:81:af  txqueuelen 1000  (Ethernet)                                                                                                                    
        RX packets 2112  bytes 187768 (183.3 KiB)                                                                                                                               
        RX errors 0  dropped 0  overruns 0  frame 0                                                                                                                             
        TX packets 2168  bytes 201983 (197.2 KiB)                                                                                                                               
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      
Did you see the error counters above ? Looks perfect to me.
That means that you should look at your switch/router,your PC and the cabling.
The road to insanity is paved with static ip addresses

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 7:20 pm

tfuchs1987 wrote:
Fri Oct 04, 2019 7:14 pm
Session1

Code: Select all

root@raspberrypi:~# iperf3 -c 192.168.1.2
Connecting to host 192.168.1.2, port 5201
What are you testing, according to previous information provided your Pi 4 has the name raspberrypi with the ip address 192.168.1.2, which could be the same system where you entered "iperf3 -c 192.168.1.2".
The road to insanity is paved with static ip addresses

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 8:15 pm

I'm not quite sure how to use iperf3 properly. I executed the following command on Host: Raspberrypi IP: 192.168.1.2

Code: Select all

iperf3 -s
opened another shell with putty on the same host and entered

Code: Select all

ipferf3 -c 192.168.1.2
So the RPi executed the command on itself. iperf is working with my NAS but not with iperf3 and I don't have another linux system available right now.

Just set my router back to default settings and the problem still persists. The weired thing is that everything is fine when using my routers WiFi!

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 8:17 pm

I linked my RPi4 directly into my macbook and there is no packet loss :?

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 8:25 pm

tfuchs1987 wrote:
Fri Oct 04, 2019 8:17 pm
I linked my RPi4 directly into my macbook and there is no packet loss :?
Please explain what you mean with "directly"
Please explain what you mean with "packet loss". How do you check for packet loss ?
The road to insanity is paved with static ip addresses

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 8:56 pm

I plugged a cat5e patch cable on one side into my RPi and other side into my Macbook. Both devices are on the same subnet so I could ping each other with no timeouts when executing "ping 192.168.1.2" on the Macs terminal.

With packet loss i mean the timeouts i receive on the Mac and the Windows machine when the RPi is linked back to my router. Logging into my router I can do a ping test as well which provides additional information.

Executed following commands on Host: ConnectBox IP 192.168.1.1 (router)

Code: Select all

PING 192.168.1.2 (192.168.1.2) from EXTERNAL-IP (censored): 64 data bytes 
72 bytes from 192.168.1.2: seq=15 ttl=64 time=0.000 ms 
72 bytes from 192.168.1.2: seq=19 ttl=64 time=0.000 ms 
[…]
--- 192.168.1.2 ping statistics --- 
20 packets transmitted, 17 packets received, 15% packet loss 
round-trip min/avg/max = 0.000/1.176/20.000 ms 

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 9:17 pm

tfuchs1987 wrote:
Fri Oct 04, 2019 8:56 pm
I plugged a cat5e patch cable on one side into my RPi and other side into my Macbook. Both devices are on the same subnet so I could ping each other with no timeouts when executing "ping 192.168.1.2" on the Macs terminal.

With packet loss i mean the timeouts i receive on the Mac and the Windows machine when the RPi is linked back to my router. Logging into my router I can do a ping test as well which provides additional information.

Executed following commands on Host: ConnectBox IP 192.168.1.1 (router)

Code: Select all

PING 192.168.1.2 (192.168.1.2) from EXTERNAL-IP (censored): 64 data bytes 
72 bytes from 192.168.1.2: seq=15 ttl=64 time=0.000 ms 
72 bytes from 192.168.1.2: seq=19 ttl=64 time=0.000 ms 
[…]
--- 192.168.1.2 ping statistics --- 
20 packets transmitted, 17 packets received, 15% packet loss 
round-trip min/avg/max = 0.000/1.176/20.000 ms 
Ping is a connectivity test and not a performance test but it can report missing response (packet loss).
This does NOT mean that the client is the problem because ALL components, including the ConnectBox / cables, have to be taken into account.

From your ping I can assume that one possible problem is in the ConnectBox, it is not correctly reporting the time,
and the round-trip min/avg are suspect, to much variation for a local ping. What you could do is to reboot your ConnectBox, use a different ethernet port and replace the cable. If that does not help you must contact your provider.

Btw: https://lmgtfy.com/?q=connect+box+ping+packet+loss
The road to insanity is paved with static ip addresses

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 9:21 pm

I moved the IP on eth0 from 192.168.1.2 to 192.168.1.222
The wlan0 interface remained still on 192.168.1.2

Pinged both interfaces simultaneously and recieved packet loss on eth0 and wlan0
Removed network cable from RPi and got 0% packet loss on wlan0

:shock: wtf

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 9:23 pm

What you could do is to reboot your ConnectBox, use a different ethernet port and replace the cable. If that does not help you must contact your provider.
done that even set it to default settings and reconfigured.

I am testing to put a switch in between.

tfuchs1987
Posts: 13
Joined: Wed Oct 02, 2019 8:13 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Fri Oct 04, 2019 9:35 pm

I cannot believe this, it worked :D :D :D :D :D :D :D :D :D
My netgear switch can route the information without any packet loss
Sorry for not believing it could be a issue with the router itself

The problem sits most of the time in front of the screen :mrgreen:

andrum99
Posts: 1219
Joined: Fri Jul 20, 2012 2:41 pm

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Thu Oct 17, 2019 1:35 pm

You will occasionally see these kind of interop issues with ethernet devices, although it should be much less common than it once was. It could be a bug in your router, or a bug in the Pi. Either way you now have a solution 👍

ejolson
Posts: 5366
Joined: Tue Mar 18, 2014 11:47 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Thu Oct 17, 2019 3:09 pm

andrum99 wrote:
Thu Oct 17, 2019 1:35 pm
You will occasionally see these kind of interop issues with ethernet devices, although it should be much less common than it once was. It could be a bug in your router, or a bug in the Pi. Either way you now have a solution 👍
I had a similar problem which I described earlier in this thread.

https://www.raspberrypi.org/forums/view ... 7#p1546645

My experience with networking is that gigabit has more compatibility problems than I ever had with 100 Mbit or even 10 Mbit over twisted pair. As speeds move to 10 Gbit--maybe not for a while with Pi hardware--I expect even more trouble.

klesk
Posts: 18
Joined: Tue Aug 08, 2017 7:16 am

Re: Packet loss on eth0 [Raspberry Pi 4 Model B]

Wed Feb 12, 2020 3:48 pm

Sorry about bumping this up but I also run into a similar problem with a Raspberry PI 4.

384 packets transmitted, 363 received, 5% packet loss, time 383992ms
rtt min/avg/max/mdev = 1.443/4.406/93.588/6.613 ms


Just did a full upgrade on the latest Raspbian which upgraded the kernel:


Linux linux 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux
to
Linux linux 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux

No difference.

I have the rpi, my laptop and an ip phone all connected to a non manageable gigabit cisco switch.
From my laptop I can ping the phone for hours with 0 packet loss, with the PI there is a packet loss even after couple of minutes.

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether dc:a6:32:1d:a2:11 txqueuelen 1000 (Ethernet)
RX packets 850849 bytes 920529130 (877.8 MiB)
RX errors 0 dropped 16 overruns 0 frame 0
TX packets 849384 bytes 880092173 (839.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: negotiated 1000baseT-FD flow-control, link ok

The problem is definitely with the pi not the switch or the cable because from the pi if I ping the phone for example I get about the same amount of packet loss.

Return to “Troubleshooting”