Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropped RX packets - RPi 1, 2, and 3 #1954

Open
stamster opened this issue Apr 8, 2017 · 72 comments
Open

Dropped RX packets - RPi 1, 2, and 3 #1954

stamster opened this issue Apr 8, 2017 · 72 comments
Assignees
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.

Comments

@stamster
Copy link

stamster commented Apr 8, 2017

Hello,
I have multiple RPi's running on two locations. I noticed that each of them report dropped packets, but only in RX direction.

RPi 3:

eth0      Link encap:Ethernet  HWaddr b8:27:eb:xx:xx:xx  
          inet addr:192.168.100.20  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::906e:f3:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:275242 errors:0 dropped:15336 overruns:0 frame:0
          TX packets:71301 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:38165404 (36.3 MiB)  TX bytes:23844353 (22.7 MiB)

RPi 2:
Just rebooted after latest rpi-firmware patch, and only 4 mins of uptime getting: RX packets:689 errors:0 dropped:5 overruns:0 frame:0

RPi 1 model B:
RX packets:647 errors:0 dropped:28 overruns:0 frame:0

RPi 1:
RX packets:209844 errors:0 dropped:14892 overruns:0 frame:0

The only single RPi which does not seem to be affected by this issue is another RPi 1 model B, where I didn't upgraded firmware.
So if it's a firmware related issue, the last known good firmware/kernel w/o RX drops is this one:

4.1.19+ #858 Tue Mar 15 15:52:03 GMT 2016 armv6l GNU/Linux

Mar 15 2016 14:48:20 
Copyright (c) 2012 Broadcom
version 1bf9a9a77026af9128a339c82d72e331d3532ee4 (clean) (release)

10 days uptime, and not a single drop:

eth0      Link encap:Ethernet  HWaddr b8:27:eb:xx:xx:xx  
          inet addr:192.168.100.30  Bcast:192.168.100.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1335268 errors:0 dropped:0 overruns:0 frame:0
          TX packets:721742 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:81649608 (77.8 MiB)  TX bytes:185224562 (176.6 MiB)

RPi's behave exactly the same on other networks, so it's not LAN related, since other PC's and devices do not have any drops with uptime of 250 days.

@JamesH65
Copy link
Contributor

JamesH65 commented May 18, 2017

Any relevant messages in syslog? Also, any ideas when this problems started to occur?

@JamesH65 JamesH65 added Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. Assigned for implementation/action labels May 18, 2017
@JamesH65 JamesH65 self-assigned this May 19, 2017
@JamesH65 JamesH65 removed the Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. label May 19, 2017
@JamesH65
Copy link
Contributor

A quick glance and some minor debugging at the driver level seems to indicate that it is not the driver itself that is dropping the packet - the code that increments the rx_dropped counter is not called. So presumably somewhere else in the stack is deciding to drop the packet. I'm not sure how to find out where in the stack though! Will investigate further.

@JamesH65
Copy link
Contributor

It's quite possible this is harmless. The dropped packet count is not only used for errors, but also flagging up packets that are dropped because the linux stack doesn't handle them (some IPv6 stuff if you don't have IPv6 enabled for example). This might be one of those messages. I will try and find out which it is.

@stamster
Copy link
Author

stamster commented May 21, 2017 via email

@JamesH65
Copy link
Contributor

OK, not IPv6, but that was only given as an example of some packets that are simply discarded by the network stack. Dropped packets are not, necessarily, an error. If the stack gets a correctly formatted packet it doesn't implement, then it is dropped. It's not an error as such. So it is perfectly reasonable to be getting dropped packets and not worry about them. However, in this case I would like to know whether this is the case here.

@JamesH65
Copy link
Contributor

JamesH65 commented May 22, 2017

Here is some (probably quite old) text on why a packet may be dropped.

Also worth noting that even if IPv6 is disable on the Pi, it could still receive IPv6 packets from other devices on the network, which will cause dropped packets

Softnet backlog full -- (Measured from /proc/net/softnet_stat)

Bad / Unintended VLAN tags

Unknown / Unregistered protocols

IPv6 frames when the server is not configured for IPv6

If any frames meet those conditions, they are dropped before the protocol stack and the rx_dropped counter is incremented.

@JamesH65
Copy link
Contributor

After much faffing, I have build a utility I found called dropwatch, rebuilt the kernel to turn on a particular form of net logging and now have a list of addresses where packets are being dropped. However, cross references those addresses to the kernel isn't giving valid results, so i suspect all the drops are in modules.

What is worth noting is that the ifconfig dropped packets counter is a small subset of the actual number of packets dropped. I can see which address in my list is causing the ifconfigs drops, just need to figure out what code corresponds to that location.

@JamesH65
Copy link
Contributor

OK, thanks to a timely intervention from @pelwell I do have some idea of the code that is dropping the packets. The ifconfig dropped packet counter appears to be incremented in the __netif_receive_skb_core function, approx line 4214. Still some effort required in backtracking from there to determine the reason for the dropped packets.

@network-shark
Copy link

network-shark commented May 25, 2017

I also see these these drops on my pi3

pi@raspberrypi:~ $ uname -a Linux raspberrypi 4.9.13-v7+ #974 SMP Wed Mar 1 20:09:48 GMT 2017 armv7l GNU/Linux

pi@raspberrypi:~ $ ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:05:2e:7f inet addr:192.168.10.11 Bcast:192.168.10.255 Mask:255.255.255.0 inet6 addr: fe80::xxxxxxx/64 Scope:Link inet6 addr: 2003:xxxxxx/64 Scope:Global UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14465964 errors:0 dropped:276326 overruns:0 frame:0

If you need more infos feel free to ask !

@stamster
Copy link
Author

stamster commented May 26, 2017

@JamesH65 so we can conclude issue is located in the kernel core? On some cloud providers I also experience dropped packets in RX line.

@JamesH65
Copy link
Contributor

I don't think any conclusion can be made since I don't yet know the cause of the dropped packets - it could be entirely benign.

I think everyone sees the dropped packets on the Pi, I certainly have been seeing them for years, but ignored then.

@stamster
Copy link
Author

stamster commented May 26, 2017

Well, it started to happen only after kernel/firmware update year ago or so.

On this version I have zero dropped packets:

4.1.19+ #858 Tue Mar 15 15:52:03 GMT 2016 armv6l GNU/Linux

Mar 15 2016 14:48:20 
Copyright (c) 2012 Broadcom
version 1bf9a9a77026af9128a339c82d72e331d3532ee4 (clean) (release)

Heh, it might be that this old version has a bug of not incrementing counter 😆

@JamesH65
Copy link
Contributor

Or newer version added more places where the counter could be incremented...

@popcornmix
Copy link
Collaborator

stamster, can you identify the exact update which caused this. See:
https://github.com/Hexxeh/rpi-firmware/commits/master

If you click on each commit the end of the url contains a git hash. Run
sudo rpi-update <hash>
to revert back to that version. Report the first version with the packets dropped error.

(I suspect it will be one of the major bumps - e.g. the first 4.4 kernel)

@stamster
Copy link
Author

I've been super busy recently - I'll try to experiment with down-grades this weekend.

@JamesH65
Copy link
Contributor

I was doing some testing today with the latest Raspbian release, 5GB of data transferred with no dropped packets. This was on ethernet. If doing testing check the latest release first.

@stamster
Copy link
Author

Well, I got that kernel 5 days ago and still there were dropped packets.
Now I've fetched:

*** Updating kernel modules
 *** depmod 4.9.37-v7+
 *** depmod 4.9.37+

Let's see...

@koppenho
Copy link

Let me add my stats: RX drop was about 4% with unpatched rasbian-jessie.
After updating Jessie to 4.9.37-v7+ the drop count "dropped" to 0.005%.
I think this is an improvement.

@stamster
Copy link
Author

stamster commented Jul 17, 2017

I still have drops, even with latest kernel.

4.9.37+ #1017 Thu Jul 13 11:14:43 BST 2017 armv6l GNU/Linux
RX packets:62278 errors:0 dropped:4203 overruns:0 frame:0

@JamesH65
Copy link
Contributor

JamesH65 commented Jul 20, 2017

Hmm, just been doing some testing on this, not seeing dropped packets on the ethernet at all. It is possible that this is environmental?

Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

RX packets:828974 errors:0 dropped:0 overruns:0 frame:0
TX packets:503029 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:1142250236 (1.0 GiB)  TX bytes:43037541 (41.0 MiB)

@JamesH65
Copy link
Contributor

A similar issue has just come up on the linux networking list, unrelated to Pi. Suggestion is RX queueing problem. I'm not sure how to go further here, since I cannot see any dropped packets on the ethernet connection at all. This is a continuation of the previous stats, after leaving it over the weekend, not though with anything hammering the connection.

RX packets:1685234 errors:0 dropped:0 overruns:0 frame:0
TX packets:515057 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:1242494098 (1.1 GiB)  TX bytes:44171593 (42.1 MiB)

@JamesH65
Copy link
Contributor

@stamster Could you give me some idea of how your network is set up? Since I (nd others) am seeing no errors on the onboard Ethernet at all, it would be interesting to know if you have some odd setup that might be causing an issue.

@JamesH65 JamesH65 added the Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. label Jul 27, 2017
@JamesH65
Copy link
Contributor

ping @stamster Are you still seeing this? If so are there any strange things on your network that might have some effect.

Also, I'm currently using Stretch with a 4.13 kernel and seeing no drops. It would be interesting, if you have the ability to build your own kernel and install it, to see if you still see errors with the latest kernel code.

@JamesH65
Copy link
Contributor

I tested with over 10GB of data sent back and forth with no dropped packets at all. This is on Stretch with a 4.13 kernel (admittedly not yet a release kernel, but will be released eventually). I'm inclined, unless I hear otherwise to close this issue.

@JamesH65
Copy link
Contributor

Ah, forgot was using Jessie.

sudo apt dist-upgrade instead?

@pelwell
Copy link
Contributor

pelwell commented Mar 13, 2018

Go straight to 4.14 with sudo rpi-update - I'm not aware of any issues, and as James says it will be the new standard (and best supported) kernel very soon.

@MrLonko
Copy link

MrLonko commented Mar 13, 2018

Is there a way to setup a local rpi-update repository as i need to update units inside a very restricted network?
So we are in consesus :) rpi update ? I tried both and both work for me, both have now 0-tomax5 dropped count which is amazing coming down from 2/3 of all received packages...

@stamster
Copy link
Author

You mean only for kernel? What about core packages (apt)?
IMHO your best shot for restricted networks is using HTTP proxy. So let them open you one channel only and use that as a HTTP proxy during updates. That's how I do it with Debian/GNU systems for years in the enterprise.

@MrLonko
Copy link

MrLonko commented Mar 14, 2018

Thank you! We got a limited time window with open network ;)

@JamesH65
Copy link
Contributor

Are people still seeing overly high dropped packet counts with the latest Raspbian? Or even with rpi-update kernel (4.14.50) if you fancy trying it out?

@stamster
Copy link
Author

stamster commented Jul 2, 2018

+1 getting drops on 4.14.50+ #1122 Tue Jun 19 12:21:21 BST 2018

RX packets:116923 errors:0 dropped:7986 overruns:0 frame:0

up 5 days, 13:07

@JamesH65
Copy link
Contributor

JamesH65 commented Jul 2, 2018

Hmm. No idea what this is. Out of 4M packets sent in a currently running test, I see 7 dropped packets. I can only think its environmental. Bad cable somewhere? Bad router? Interference?

@stamster
Copy link
Author

stamster commented Jul 2, 2018

In the same room I have another RPi mentioned earlier, which is unaffected. Same switch used. The only difference I see is the kernel / firmware version (latest vs. older kernel) - e.g. software layer brings this issue.

As a matter of fact, SSH connections are stable 100%, but it's TCP layer to polish things behind the scenes I guess. So no issues I can think of - only that RX dropped counter is increasing constantly.

@MrLonko
Copy link

MrLonko commented Jul 2, 2018 via email

@JamesH65
Copy link
Contributor

JamesH65 commented Jul 3, 2018

Would it be possible to measure throughput on the two Pi's? It would be interesting to know if the one showing dropped packets is actually slower.

@stamster
Copy link
Author

stamster commented Jul 4, 2018

@MrLonko Those are RPi's 1st generation (revisions B and B+). So no WiFi there, only good old ethernet jack.

@JamesH65 sure I can run iperf or something.

@rrobinett
Copy link

I have recently discovered that Raspbian Stretch has a bug which very, very infrequently causes ethernet packets to be dropped. By running 'sudo rpi-update' on my Pi 3b, which upgraded the kernel from 4.7 to 4.14, I have completely eliminated the 2-5 per day kiwirecorder.py restarts from which I was previously suffering. Running 4.14, my WSPR decoding script 'kiwiwspr.sh' can simultaneously record 17 uncompressed audio streams (3.5 Mbps = 750 receive packets per second ) from 3 Kiwis on one Pi without a single restart in 24 hours.

@alvaroslm
Copy link

alvaroslm commented Jun 16, 2019

I'm running the latest kernel (4.19.42-v7+) on a 3B and I see 7-15% packets dropped on ping. Transfer speeds are affected by this, too. In my particular case it's on AP mode and wlan0 bridged with eth0. There are no losses when pinging the ethernet side.
RX packets 667550 bytes 89343147 (85.2 MiB)
RX errors 0 dropped 4182 overruns 0 frame 0

@cyayon
Copy link

cyayon commented Feb 25, 2021

Samie issue here with RPI3 and RPI4.
kernel is 5.10.17-v7+ on both RPIs (last stable buster 10.8 with fresh apt-get upgrade).
tried rpi-update but no luck, always the same issue.

@tonygunter
Copy link

I have seen discussions elsewhere that seemed to indicate that the ethernet connection is the most power hungry, and low power or inconsistent power to the RPi results in RX errors as the most obvious symptom. You may want to verify that the correct power is being supplied.

@raspberrypi raspberrypi deleted a comment from alvaroslm Oct 27, 2021
@raspberrypi raspberrypi deleted a comment from JamesH65 Oct 28, 2021
@raspberrypi raspberrypi deleted a comment from alvaroslm Oct 28, 2021
@raspberrypi raspberrypi deleted a comment from alvaroslm Oct 28, 2021
@raspberrypi raspberrypi deleted a comment from JamesH65 Oct 28, 2021
@raspberrypi raspberrypi deleted a comment from alvaroslm Oct 28, 2021
@raspberrypi raspberrypi deleted a comment from alvaroslm Oct 28, 2021
@raspberrypi raspberrypi deleted a comment from JamesH65 Oct 28, 2021
@pelwell
Copy link
Contributor

pelwell commented Oct 28, 2021

[ Unconstructive diversion deleted - I don't want to lock this thread ]

@alvaroslm
Copy link

You may as well lock it since you're not addressing the issue anyway. That's how things work around here...

@JamesH65
Copy link
Contributor

No, it really isn't how things work around here. If we close the issue, we no longer have it visible, so it gets forgotten and will never get fixed. Right now, it's visible, and when time allows someone will look at it. However, we are a tiny team, with a lot to do, and since this only reduces bandwidth, rather than killing anything completely, it's lower priority than many other issues.

@6by9
Copy link
Contributor

6by9 commented Oct 28, 2021

Not having a reliable way to reproduce an issue also makes it incredibly hard to work on.

Reports of it being seen on a Pi4 make it even stranger as Pi3B+ and Pi4 have a totally different ethernet interfaces to Pi1/2/3B, which makes it seem more systemic than just the ethernet chip driver. Pi4 is over a totally different interface too (inbuilt as opposed to USB).

@stamster
Copy link
Author

@6by9
But there seems to be a reliable way to reproduce it - just install newer kernel than this one:

#1954 (comment)

@hostingnuggets
Copy link

I have this issue with RX dropped packets on all of my Ubuntu 20.04 LTS Server on Raspberry Pi 4 8GB model as you can see below:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether e4:5f:01:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast   
    227473191  501667   0       8487    0       2842    
    TX: bytes  packets  errors  dropped carrier collsns 
    705780728  743859   0       0       0       0       

Are there any workarounds or fixes planned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.
Projects
None yet
Development

No branches or pull requests