BPI-R2 slow ethernet speed


(Thomas Linke) #12

I did:

mount -t cifs -o username=linke,password=******* //supernane/Data /mnt

rsync /mnt/BPI-Images/2017-09-13-debian-9-stretch-mate-desktop-preview-bpi-r2-sd-emmc.img.zip . --progress

1,072,890,047 100% 84.99MB/s 0:00:12 (xfr#1, to-chk=0/1)

Using scp I get only 18 MB/sec. Well it is an ARM - not an i7. The target system is an Intel-Atom powered Zotac Zbox … not THAT fast too :wink:


#13

Hi, I’ve encountered a similar problem as sunarowicz, the gigabit ethernet speed when transfering data to the Pi is fine, 900-ish Mbps, but speeds in the other direction are under 1Mbps…

I’m using Frank W.'s debian image with 4.14 kernel. Downgrading to 4.9 solved the problem, but 4.9 doesn’t have GPIO support and I’m also unable to create more than one routing table.

Any idea what might be causing this? It isn’t a duplex mismatch problem, nor is it anything other than the network, I used iperf to test the speed. If you want I can provide screenshots of the tests, but they won’t tell you anything more than I have already.


(Frank W.) #14

Which kernel do you use (uname -r) exactly?


#15

If I remember correctly, it was 4.14.62, the precompiled version from august 2018. I’ve been running 4.9 for two months now. The strange thing is that if I set the NIC to 100Mbps (or used a 100Mbps switch), it worked fine both ways, the problem was only with gigabit.


(Frank W.) #16

Have you tried a version of 4.14 prior to 4.14.52?

4.9 is not affected? You use my 4.9? How about 4.19?


(Frank W.) #17

with ssh/scp i got ~13MB/s if i download a file from PI…same in opposite direction…looks more like 100Mbit/s…

cat /sys/class/net/lan0/speed
1000
cat /sys/class/net/eth0/speed                                                                                    
1000

maybe it’s internally (wrong) handled as 100Mbit/s??

looking at top shows that ssh-process is running with 100% cpu (1core used)…so the Problem is the encryption. maybe this can be increased with hardware-encryption-acceleration, but i don’t know how set this up

traffic through http is slower (~7MB/s) and much more cpu-intensive (200%)

currently have no idea why this happens.

gigabit should reach ~115 MByte/s if not limited by CPU

@Ryder.Lee / @moore / @linkerosa / @Jackzeng can you test it with your boards?

same with my test-board and kernel 4.19.1 (without gmac#2)…both directions 12-13 MB/s (ssh with 100% cpu), but ftp is 9MB/s get and 20MB/s put


(moore liu) #18

openssh uses openssl library to implament ssh command and openssl linrary use cryptodev to enable hw accererator feature. maybe you can refer to below thread and use openssl command to check performance first, thanks.

http://forum.banana-pi.org/t/is-it-possible-to-have-the-crypto-extensions-working/4034/2


(Frank W.) #19

ssh/scp is fastest…

Without encyption it’s the same problem…

i tested for dropped/corrupt packets, after transferring, but there no relevant error-count

frank@frank-N56VZ:~
[09:48:59]$ scp /media/data_ntfs/backup/system_backup_20181023.tar.gz root@192.168.0.42:/tmp
root@192.168.0.42's password: 
system_backup_20181023.tar.gz                                                                 100%  395MB  13.5MB/s   00:29    
frank@frank-N56VZ:~
[09:49:44]$ scp root@192.168.0.42:/tmp/system_backup_20181023.tar.gz /tmp
root@192.168.0.42's password: 
system_backup_20181023.tar.gz                                                                 100%  395MB  12.6MB/s   00:31 

eth_stats.txt (1,3 KB)


(Alex R.) #20

Please note, that scp copying speed may depend on emmc/SD/SSD/etc speed. Not bad way to test network speed is to use iperf - no disk IO, just network.

Here is my wifi example

-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 10.0.1.64, port 54066
[  5] local 10.0.1.1 port 5201 connected to 10.0.1.64 port 54067
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  20.0 MBytes   168 Mbits/sec
[  5]   1.00-2.00   sec  23.6 MBytes   198 Mbits/sec
[  5]   2.00-3.00   sec  22.7 MBytes   190 Mbits/sec
[  5]   3.00-4.00   sec  23.0 MBytes   193 Mbits/sec
[  5]   4.00-5.00   sec  22.5 MBytes   189 Mbits/sec
[  5]   5.00-6.00   sec  22.1 MBytes   186 Mbits/sec
[  5]   6.00-7.00   sec  22.1 MBytes   186 Mbits/sec
[  5]   7.00-8.00   sec  22.2 MBytes   186 Mbits/sec
[  5]   8.00-9.00   sec  21.0 MBytes   176 Mbits/sec
[  5]   9.00-10.00  sec  20.8 MBytes   175 Mbits/sec
[  5]  10.00-10.04  sec   838 KBytes   164 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.04  sec   221 MBytes   184 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

scp on same setup gives only ~5MiB/s which is about 50Mbit/s

P.S. Note that i use wifi


(Frank W.) #21

Can you explain how you setup iperf (server config) and your client command?


(Frank W.) #22
root@bpi-r2:~# iperf -s                                                         
------------------------------------------------------------                    
Server listening on TCP port 5001                                               
TCP window size: 85.3 KByte (default)                                           
------------------------------------------------------------                    
[  4] local 192.168.0.42 port 5001 connected with 192.168.0.21 port 50830       
[ ID] Interval       Transfer     Bandwidth                                     
[  4]  0.0-10.0 sec  1.08 GBytes   931 Mbits/sec

running on client:

frank@frank-N56VZ:~
[19:05:12]$ iperf -c 192.168.0.42
------------------------------------------------------------
Client connecting to 192.168.0.42, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.21 port 50830 connected with 192.168.0.42 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.08 GBytes   931 Mbits/sec

info on r2 (kernel+ip-address)

root@bpi-r2:~# uname -r                                                         
4.19.4-bpi-r2-testing
root@bpi-r2:~# ip addr show wan                                                 
5: wan@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 0
    link/ether 8a:dc:3b:8b:15:ed brd ff:ff:ff:ff:ff:ff                          
    inet 192.168.0.42/24 brd 192.168.0.255 scope global wan                     
       valid_lft forever preferred_lft forever                                  
    inet6 fe80::88dc:3bff:fe8b:15ed/64 scope link                               
       valid_lft forever preferred_lft forever

(Alex R.) #23

Looks like you’ve done everything right :slight_smile:

But i’m not sure that both directions are tested, anyway you can wsitch client and server side if there are no options for choosing traffic direction.


(Frank W.) #24

have done it the opposite direction and also over lan0, speed is comparable to the above results


#25

I never did find a solution to this issue other than to use some external USB-NICs not ideal by any stretch and sorta obviates the reason for choosing the R2 in the fist place.

I have the same issue you throw packets at the pi, but if the pi is generating packets even if its a simple script or something to just kick out zeros its terribly slow and the error rate is very high.

Myshob, sunarowicz, malvcr, Have you guys capture packets on both the pi side and client side? Do you see a lot of re-transmission?


(Thomas) #26

I do also have an issue with BPi-R2 and network speed.

If I make tests with iperf, everything is fine. If I connect the R2 behind my providers router and do measures with https://fast.com I reach around 200 Mbit/s (should be 400Mbit/s which I do get when connecting directly to my providers router, but okay). If I connect more devices to all four ports of the R2 the speed measured with https://fast.com drops below 1Mbit/s. If I do exactly the same with a BPi-R1 I do reach arround 200Mbit/s on https://fast.com, also if the other devices are connected. During the tests with R1 and R2; the other devices were an Odroid-C2 and a Raspberry PI Zero, both running shairport-sync playing multiroom audio from a MacBook Pro.

Kernel used:

  • R2: 4.14.88-bpi-r2-main (frank-w)
  • R1: 4.14.55-1-ARCH

both running archlinux and using arno-iptables-firewall and dnsmasq. All LAN Ports are in one bridge.

@frank-w do you use the R2 as router or are you only doing some tests with it?


(Frank W.) #27

I use r2 (1 of 2) as router but i have only a adsl2+ with 12mbit/s


(Frank W.) #28

tested again with 4.19 and my gmac-patches

from r2 speed is ~940Mbit/s, to r2 i have only ~700Mbit/s

now i tested with iperf3 from r2 (first normal, second with -R, output from my laptop/client):

wan (eth1):

[18:46:48]$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.0.19, port 49282
[  5] local 192.168.0.21 port 5201 connected to 192.168.0.19 port 49284
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec   107 MBytes   895 Mbits/sec                  
[  5]   1.00-2.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   2.00-3.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   3.00-4.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   4.00-5.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   5.00-6.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   6.00-7.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   7.00-8.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   8.00-9.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   9.00-10.00  sec   112 MBytes   939 Mbits/sec                  
[  5]  10.00-10.05  sec  5.32 MBytes   939 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.05  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.05  sec  1.09 GBytes   935 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.0.19, port 49286
[  5] local 192.168.0.21 port 5201 connected to 192.168.0.19 port 49288
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  5]   0.00-1.00   sec   102 MBytes   851 Mbits/sec    0    576 KBytes       
[  5]   1.00-2.00   sec   111 MBytes   934 Mbits/sec    0    576 KBytes       
[  5]   2.00-3.00   sec   111 MBytes   933 Mbits/sec    0    576 KBytes       
[  5]   3.00-4.00   sec  80.3 MBytes   674 Mbits/sec    0    771 KBytes       
[  5]   4.00-5.00   sec  73.0 MBytes   613 Mbits/sec    0    771 KBytes       
[  5]   5.00-6.00   sec  73.5 MBytes   617 Mbits/sec    0    771 KBytes       
[  5]   6.00-7.00   sec  73.5 MBytes   617 Mbits/sec    0    771 KBytes       
[  5]   7.00-8.00   sec  73.5 MBytes   617 Mbits/sec    0    771 KBytes       
[  5]   8.00-9.00   sec  73.5 MBytes   617 Mbits/sec    0    771 KBytes       
[  5]   9.00-10.00  sec  73.5 MBytes   616 Mbits/sec    0    771 KBytes       
[  5]  10.00-10.04  sec  2.49 MBytes   523 Mbits/sec    0    771 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-10.04  sec   847 MBytes   708 Mbits/sec    0             sender
[  5]   0.00-10.04  sec  0.00 Bytes  0.00 bits/sec                  receiver

lan0 (eth0):

Accepted connection from 192.168.0.19, port 49290
[  5] local 192.168.0.21 port 5201 connected to 192.168.0.19 port 49292
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec   107 MBytes   894 Mbits/sec                  
[  5]   1.00-2.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   2.00-3.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   3.00-4.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   4.00-5.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   5.00-6.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   6.00-7.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   7.00-8.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   8.00-9.00   sec   112 MBytes   939 Mbits/sec                  
[  5]   9.00-10.00  sec   112 MBytes   939 Mbits/sec                  
[  5]  10.00-10.05  sec  5.27 MBytes   935 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.05  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.05  sec  1.09 GBytes   935 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.0.19, port 49294
[  5] local 192.168.0.21 port 5201 connected to 192.168.0.19 port 49296
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  5]   0.00-1.00   sec   106 MBytes   887 Mbits/sec    0    143 KBytes       
[  5]   1.00-2.00   sec  85.0 MBytes   713 Mbits/sec    0    583 KBytes       
[  5]   2.00-3.00   sec  73.5 MBytes   617 Mbits/sec    0    583 KBytes       
[  5]   3.00-4.00   sec  73.5 MBytes   617 Mbits/sec    0    583 KBytes       
[  5]   4.00-5.00   sec  73.5 MBytes   617 Mbits/sec    0    583 KBytes       
[  5]   5.00-6.00   sec  74.0 MBytes   621 Mbits/sec    0    583 KBytes       
[  5]   6.00-7.00   sec  73.3 MBytes   614 Mbits/sec    0    583 KBytes       
[  5]   7.00-8.00   sec  73.5 MBytes   617 Mbits/sec    0    583 KBytes       
[  5]   8.00-9.00   sec  73.4 MBytes   616 Mbits/sec    0    583 KBytes       
[  5]   9.00-10.00  sec  73.4 MBytes   615 Mbits/sec    0    583 KBytes       
[  5]  10.00-10.05  sec  3.01 MBytes   537 Mbits/sec    0    583 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-10.05  sec   782 MBytes   653 Mbits/sec    0             sender
[  5]   0.00-10.05  sec  0.00 Bytes  0.00 bits/sec                  receiver

(Thomas) #29

Today I did more tests.

As long as I do only connect 1 device to the lan ports (no matter which one) I do get ~200MBit/s with https://fast.com

If I connect more devices to the other lan ports, even if these device do not do any network communication, the more devices I do connect; the data-rate goes down to 3 MBit/s or even only some kbit/s.

  1. So I tried to not use arno-iptables-firewall, but did only activate forward and a masquerade rule, nothing else: Same result

  2. Then I thought maybe the bridge is the problem, so I removed the bridge and configured every lan port with it’s own subnet: same result

Then I thought maybe the MAC Addresses cause an issue, so I tried 2 different things:

  1. Give the same mac address to eth1 and wan, like it is the default: Same result
  2. Give every interface (eth0,eth1,lan0-lan3,wan) a different MAC address: Same result

So I have no idea what is causing this. BPI-R2 is not usable as router for my personal setup.

EDIT: tested with kernel 4.14.92_main selfcompiled and from frank’s github releases


(Frank W.) #30

Important info that this issue only appears only if more than 1 lanport is connected as my tests are only over one lan/wan-port or from lan to wan.

On my main-router i also have only 1 lan connected because this lan is a trunk to managed switch there my other devices are connected


(Frank W.) #31

@Ryder.Lee / @moore / @linkerosa / @Jackzeng can bpi-r2 operate without dsa-driver in 4.14+ like it works in 4.4 (eth1 fixed to wan,eth0 to lan-ports)