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

Orange Pi 4 TCP checksum offload malfunction #86

Open
wjy50 opened this issue Jun 26, 2020 · 0 comments
Open

Orange Pi 4 TCP checksum offload malfunction #86

wjy50 opened this issue Jun 26, 2020 · 0 comments

Comments

@wjy50
Copy link

wjy50 commented Jun 26, 2020

I have an Orange Pi 4 running official ubuntu_bionic_desktop_linux4.4.179_v1.3 system. Recently I connected it to wired ethernet, it turns out that a server on it, which is implemented by myself with Java, fails to transmit data over HTTPS. I've tried different Java packages like SSLServerSocket, SSLEngine and HttpsServer, only to find none of them works. So I did some other tests and packet captures, it seems that the TCP checksum offload of the wired ethernet interface doesn't work correctly under certain circumstance.

Here are some infomation if necessary

  • The server runs on the Orange Pi 4 4GB with official ubuntu_bionic_desktop_linux4.4.179_v1.3 system image
  • Orange Pi 4 is connected to a LAN port of my router Asus RT-AC86U

I start packet capturing with WireShark and request the server, soon a packet with incorrect checksum 0xec39 (No. 2405) is sent from Orange Pi 4 (192.168.50.176).
image
Then a large number (up to 88) of duplicate ACKs are sent from the client device (192.168.50.106).
image
However all retransmission packets (like No. 2543) from Pi 4 still have the same incorrect checksum 0xec39, making the communication unable to continue.
image
More interestingly, if I do more tests, no matter what client device I use, the incorrect checksum will always be 0xec39, so I also capture packets with tcpdump on Orange Pi 4, the outputs are
image
We can easily figure out that the checksums are 0xe685 plus the length of packet, e.g. 0xe6df - 0xe685 == 90 and 0xec39 - 0xe685 == 1460. Because of TCP checksum offload, these checksums should be replaced with the actual checksums calculated by NIC before being sent. So obviously the packets with incorrect checksum 0xec39 received by client devices are transmitted by Orange Pi 4 without replacing checksum. Since retransmission packets are simply cached in the send window, they still have the incorrect checksum.

Now I have to turn off checksum offload with ethtool -K eth0 tx off. However this may increase CPU usage and temperature.

This will only happen to wired ethernet. If Orange Pi 4 is connected to WiFi instead of wired ethernet, everything works fine. And it is even stranger because if I turn off HTTPS, everything will work well too (and the transmission will be much faster). Probably it has something to do with CPU load.

I haven't seen any similar issuse, I wonder if it is a system or driver bug or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant