[[searchwing-pi-datarate]]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
searchwing-pi-datarate [2019/11/27 13:12]
beckmanf [Data transfer via Wifi / USB] usb
searchwing-pi-datarate [2021/11/18 15:08] (current)
wf68spef [pi4 config]
Line 1: Line 1:
-===== Raspberry Pi data transfer rate test =====+===== Raspberry Pi Zero data transfer rate test =====
  
 The Raspberry Pi stores the images which are collected during flight. After the plane landed, the images are retrieved from the Pi. The least impact with respect to water sealing would be a wireless transfer via Wifi or Bluetooth. For completeness I also test the transfer rate via USB configured as RNDIS network device. As a seperate topic I look into the transfer rate of the SD Card. The Raspberry Pi stores the images which are collected during flight. After the plane landed, the images are retrieved from the Pi. The least impact with respect to water sealing would be a wireless transfer via Wifi or Bluetooth. For completeness I also test the transfer rate via USB configured as RNDIS network device. As a seperate topic I look into the transfer rate of the SD Card.
Line 131: Line 131:
 </​code>​ </​code>​
  
-=== iperf data transfer rate measurement via USB ===+==== iperf data transfer rate measurement via USB ====
  
 The iperf datastream goes from the client to the server. For our scenario the relevant direction is Pi to Mac. Therefore I run the iperf server on the Mac and the client on the Pi. iperf opens a tcp connection from the client to the server. The iperf datastream goes from the client to the server. For our scenario the relevant direction is Pi to Mac. Therefore I run the iperf server on the Mac and the client on the Pi. iperf opens a tcp connection from the client to the server.
Line 217: Line 217:
 The transfer rate from the Mac to the Pi is 109 Mbit/s over the USB Interface. The transfer rate from the Mac to the Pi is 109 Mbit/s over the USB Interface.
  
 +=== CPU Load during iperf transfer ===
  
 +I measured the cpu load with the top tool. I login to the pi via the wifi interface and run "​top"​ there. The idle sitation is shown here:
  
-=== Results ===+<​code>​ 
 +top - 13:29:01 up 33 min,  2 users, ​ load average: 0.03, 0.04, 0.00 
 +Tasks: ​ 77 total, ​  1 running, ​ 76 sleeping, ​  0 stopped, ​  0 zombie 
 +%Cpu(s): ​ 0.7 us,  1.0 sy,  0.0 ni, 98.4 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st 
 +MiB Mem :    432.7 total, ​   327.0 free,     36.6 used,     69.1 buff/​cache 
 +MiB Swap:    100.0 total, ​   100.0 free,      0.0 used.    345.0 avail Mem 
  
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​  
 +  578 pi        20   ​0 ​  ​10172 ​  ​2952 ​  2520 R   ​1.0 ​  ​0.7 ​  ​0:​01.11 top       
 +  556 root      20   ​0 ​      ​0 ​     0      0 I   ​0.3 ​  ​0.0 ​  ​0:​00.02 kworker/u+
 +    1 root      20   ​0 ​  ​32532 ​  ​7876 ​  6384 S   ​0.0 ​  ​1.8 ​  ​0:​04.33 systemd ​  
 +    2 root      20   ​0 ​      ​0 ​     0      0 S   ​0.0 ​  ​0.0 ​  ​0:​00.00 kthreadd  ​
 +    5 root      20   ​0 ​      ​0 ​     0      0 I   ​0.0 ​  ​0.0 ​  ​0:​00.04 kworker/u+
 +    6 root       0 -20       ​0 ​     0      0 I   ​0.0 ​  ​0.0 ​  ​0:​00.00 mm_percpu+
 +    7 root      20   ​0 ​      ​0 ​     0      0 S   ​0.0 ​  ​0.0 ​  ​0:​00.31 ksoftirqd+
 +    8 root      20   ​0 ​      ​0 ​     0      0 S   ​0.0 ​  ​0.0 ​  ​0:​00.01 kdevtmpfs ​
 +    9 root       0 -20       ​0 ​     0      0 I   ​0.0 ​  ​0.0 ​  ​0:​00.00 netns     
 +   10 root      20   ​0 ​      ​0 ​     0      0 I   ​0.0 ​  ​0.0 ​  ​0:​00.10 kworker/0+
 +   11 root      20   ​0 ​      ​0 ​     0      0 S   ​0.0 ​  ​0.0 ​  ​0:​00.00 khungtaskd
 +</​code>​
  
 +Then I start the iperf client and transfer the data to the iperf server on the Mac. The cpu load on the Pi looks like this:
  
 +<​code>​
 +top - 13:30:54 up 35 min,  2 users, ​ load average: 0.61, 0.17, 0.05
 +Tasks: ​ 77 total, ​  2 running, ​ 75 sleeping, ​  0 stopped, ​  0 zombie
 +%Cpu(s): ​ 0.7 us, 46.7 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi, 52.6 si,  0.0 st
 +MiB Mem :    432.7 total, ​   326.0 free,     37.5 used,     69.2 buff/cache
 +MiB Swap:    100.0 total, ​   100.0 free,      0.0 used.    344.0 avail Mem 
  
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​  
 +  580 pi        20   ​0 ​  ​26708 ​  ​2944 ​  2252 S  80.7   ​0.7 ​  ​0:​20.34 iperf     
 +    7 root      20   ​0 ​      ​0 ​     0      0 R  14.1   ​0.0 ​  ​0:​03.64 ksoftirqd+
 +  299 root      20   ​0 ​  ​27640 ​  ​1368 ​  1240 S   ​3.6 ​  ​0.3 ​  ​0:​01.11 rngd      ​
 +  578 pi        20   ​0 ​  ​10172 ​  ​2952 ​  2520 R   ​0.7 ​  ​0.7 ​  ​0:​01.97 top       
 +   91 root      20   ​0 ​      ​0 ​     0      0 I   ​0.3 ​  ​0.0 ​  ​0:​00.51 kworker/u+
 +  562 pi        20   ​0 ​  ​12172 ​  ​4056 ​  3248 S   ​0.3 ​  ​0.9 ​  ​0:​00.37 sshd      ​
 +  579 root      20   ​0 ​      ​0 ​     0      0 I   ​0.3 ​  ​0.0 ​  ​0:​00.18 kworker/0+
 +    1 root      20   ​0 ​  ​32532 ​  ​7876 ​  6384 S   ​0.0 ​  ​1.8 ​  ​0:​04.33 systemd ​  
 +    2 root      20   ​0 ​      ​0 ​     0      0 S   ​0.0 ​  ​0.0 ​  ​0:​00.00 kthreadd  ​
 +    5 root      20   ​0 ​      ​0 ​     0      0 I   ​0.0 ​  ​0.0 ​  ​0:​00.04 kworker/u+
 +    6 root       0 -20       ​0 ​     0      0 I   ​0.0 ​  ​0.0 ​  ​0:​00.00 mm_percpu+
 +</​code>​
  
 +The CPU is fully loaded with the iperf process (80%) and the interrupt service (14%). The transfer rate is again 150 MBit/s.
  
 +==== ssh transfer via usb ===
  
 +I created 3 files with different size
  
 +  * tf1mb - 1 MB
 +  * tf3mb - 3 MB
 +  * tf100mb - 100Mb
  
 +The following example creates the file "​tf3mb"​ with random content and a size of 3000000 bytes (3 MB). 
  
 +<​code>​
 +pi@raspberrypi:​~ $ dd if=/​dev/​urandom of=tf3mb bs=1000 count=3000
 +3000+0 records in
 +3000+0 records out
 +3000000 bytes (3.0 MB, 2.9 MiB) copied, 0.272827 s, 11.0 MB/s
 +pi@raspberrypi:​
 +</​code>​
 +
 +The I copied the file from the Pi to the Mac via scp.
 +
 +<​code>​
 +Fredo:~ fritz$ scp pi@192.168.2.2:​~/​tf1mb .
 +pi@192.168.2.2'​s password: ​
 +tf1mb                                         ​100% ​ 977KB   ​4.8MB/​s ​  ​00:​00 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.2.2:​~/​tf3mb .
 +pi@192.168.2.2'​s password: ​
 +tf3mb                                         100% 2930KB ​  ​5.1MB/​s ​  ​00:​00 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.2.2:​~/​tf100mb .
 +pi@192.168.2.2'​s password: ​
 +tf100mb ​                                      ​100% ​  ​95MB ​  ​5.2MB/​s ​  ​00:​18 ​   ​
 +Fredo:~ fritz$ ​
 +</​code>​
 +
 +The reported rate is 5.2 MB/s. The transfer time as reported by scp -v is shown in the following table together with the effective rate. 
 +
 +^File     ^ Size             ^ Time         ^ Rate       ^
 +|tf1mb ​   | 1000000 Bytes    | 0.6 s        | 13 MBit/​s ​ |
 +|tf3mb ​   | 3000000 Bytes    | 0.9 s        | 27 MBit/​s ​ |
 +|tf100mb ​ | 100000000 Bytes  | 18.8 s       | 42 MBit/​s ​ |
 +
 +The transfer rate depends on the file size. Compared to the rate of 150 MBit/s as reported by iperf, there is substantial mismatch. The CPU load during the transfer as shown by top is
 +
 +<​code>​
 +top - 14:55:32 up  2:00,  3 users, ​ load average: 0.52, 0.15, 0.13
 +Tasks: ​ 82 total, ​  3 running, ​ 79 sleeping, ​  0 stopped, ​  0 zombie
 +%Cpu(s): 53.3 us, 35.9 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi, 10.8 si,  0.0 st
 +MiB Mem :    432.7 total, ​   217.3 free,     41.1 used,    174.3 buff/cache
 +MiB Swap:    100.0 total, ​   100.0 free,      0.0 used.    339.5 avail Mem 
 +
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​            
 +  948 pi        20   ​0 ​  ​12320 ​  ​4244 ​  3320 R  89.2   ​1.0 ​  ​0:​13.13 sshd                ​
 +  950 pi        20   ​0 ​   6648   ​1828 ​  1724 S   ​7.5 ​  ​0.4 ​  ​0:​01.12 scp                 
 +  299 root      20   ​0 ​  ​27640 ​  ​1380 ​  1240 S   ​1.3 ​  ​0.3 ​  ​0:​19.77 rngd                ​
 +    7 root      20   ​0 ​      ​0 ​     0      0 R   ​1.0 ​  ​0.0 ​  ​2:​32.59 ksoftirqd/​0 ​        
 +  918 pi        20   ​0 ​  ​10168 ​  ​2848 ​  2428 R   ​1.0 ​  ​0.6 ​  ​0:​00.71 top                 
 +   43 root     ​-51 ​  ​0 ​      ​0 ​     0      0 S   ​0.3 ​  ​0.0 ​  ​1:​25.49 irq/​86-mmc1 ​        
 +    1 root      20   ​0 ​  ​32532 ​  ​7884 ​  6384 S   ​0.0 ​  ​1.8 ​  ​0:​05.07 systemd  ​
 +</​code>​
 +
 +The CPU is fully loaded. 90% of the time is spent in the ssh daemon. This is probably due to the encryption of ssh. The rate is limited by CPU load. For short files the initial transactions probably limit the rate.
 +
 +==== http transfer via USB ====
 +
 +I installed the lighttpd web server on the Raspberry Pi and tested the file transfer via wget.
 +
 +<​code>​
 +Fredo:~ fritz$ wget 192.168.2.2/​tf100mb
 +--2019-11-27 16:​52:​57-- ​ http://​192.168.2.2/​tf100mb
 +Verbindungsaufbau zu 192.168.2.2:​80 … verbunden.
 +HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
 +Länge: 100000000 (95M) [application/​octet-stream]
 +Wird in »tf100mb.2« gespeichert.
 +
 +tf100mb.2 ​                       100%[========================================================>​] ​ 95,​37M ​ 18,​6MB/​s ​   in 5,2s    ​
 +
 +2019-11-27 16:53:02 (18,5 MB/s) - »tf100mb.2« gespeichert [100000000/​100000000]
 +
 +Fredo:~ fritz$ ​
 +</​code>​
 +
 +It takes 5.2s to transfer the 100MB file. That corresponds to a speed of 153 Mbit/s. The full usb speed according to iperf is used. The transfer times for the 1MB file are 0.06s and for the 3MB file 0.2s. 
 +
 +==== iperf measurements via WLAN ====
 +
 +In my setup the Pi and Macbook both connect to a Fritzbox and both receive their IP address via DHCP. The IP address of the Pi is 192.168.178.84 and the IP Address of the Macbook is 192.168.178.34. The iperf server is started on the Macbook and the client on the Pi. The FritzBox access point is operates on 2.4 GHz channel 1. The fritzbox reports 8 others stations on that band. The distance between the Fritzbox and the Pi is approximately 2m. The Fritzbox reports that the wifi rate of the Pi is 65 Mbit/s for upstream and downstream.
 +
 +<​code>​
 +pi@raspberrypi:​~ $ iperf -i 10 -t 300 -c 192.168.178.34
 +------------------------------------------------------------
 +Client connecting to 192.168.178.34,​ TCP port 5001
 +TCP window size: 74.4 KByte (default)
 +------------------------------------------------------------
 +[  3] local 192.168.178.84 port 53842 connected with 192.168.178.34 port 5001
 +[ ID] Interval ​      ​Transfer ​    ​Bandwidth
 +[  3]  0.0-10.0 sec  46.9 MBytes ​ 39.3 Mbits/sec
 +[  3] 10.0-20.0 sec  48.9 MBytes ​ 41.0 Mbits/sec
 +[  3] 20.0-30.0 sec  49.2 MBytes ​ 41.3 Mbits/sec
 +[  3] 30.0-40.0 sec  47.1 MBytes ​ 39.5 Mbits/sec
 +[  3] 40.0-50.0 sec  45.6 MBytes ​ 38.3 Mbits/sec
 +[  3] 50.0-60.0 sec  48.5 MBytes ​ 40.7 Mbits/sec
 +[  3] 60.0-70.0 sec  48.9 MBytes ​ 41.0 Mbits/sec
 +[  3] 70.0-80.0 sec  48.8 MBytes ​ 40.9 Mbits/sec
 +[  3] 80.0-90.0 sec  48.5 MBytes ​ 40.7 Mbits/sec
 +[  3] 90.0-100.0 sec  48.2 MBytes ​ 40.5 Mbits/sec
 +[  3] 100.0-110.0 sec  48.6 MBytes ​ 40.8 Mbits/sec
 +[  3] 110.0-120.0 sec  47.2 MBytes ​ 39.6 Mbits/sec
 +[  3] 120.0-130.0 sec  48.5 MBytes ​ 40.7 Mbits/sec
 +[  3] 130.0-140.0 sec  48.2 MBytes ​ 40.5 Mbits/sec
 +[  3] 140.0-150.0 sec  47.9 MBytes ​ 40.2 Mbits/sec
 +[  3] 150.0-160.0 sec  47.9 MBytes ​ 40.2 Mbits/sec
 +[  3] 160.0-170.0 sec  49.6 MBytes ​ 41.6 Mbits/sec
 +[  3] 170.0-180.0 sec  47.0 MBytes ​ 39.4 Mbits/sec
 +[  3] 180.0-190.0 sec  45.4 MBytes ​ 38.1 Mbits/sec
 +[  3] 190.0-200.0 sec  44.5 MBytes ​ 37.3 Mbits/sec
 +[  3] 200.0-210.0 sec  47.1 MBytes ​ 39.5 Mbits/sec
 +[  3] 210.0-220.0 sec  44.0 MBytes ​ 36.9 Mbits/sec
 +[  3] 220.0-230.0 sec  45.5 MBytes ​ 38.2 Mbits/sec
 +[  3] 230.0-240.0 sec  48.4 MBytes ​ 40.6 Mbits/sec
 +[  3] 240.0-250.0 sec  48.5 MBytes ​ 40.7 Mbits/sec
 +[  3] 250.0-260.0 sec  48.6 MBytes ​ 40.8 Mbits/sec
 +[  3] 260.0-270.0 sec  48.4 MBytes ​ 40.6 Mbits/sec
 +[  3] 270.0-280.0 sec  48.0 MBytes ​ 40.3 Mbits/sec
 +[  3] 280.0-290.0 sec  46.5 MBytes ​ 39.0 Mbits/sec
 +[  3] 290.0-300.0 sec  47.5 MBytes ​ 39.8 Mbits/sec
 +[  3]  0.0-300.0 sec  1.39 GBytes ​ 39.9 Mbits/sec
 +pi@raspberrypi:​~ $ 
 +</​code>​
 +
 +The average data rate from the Pi to the Mac via 2.4 GHz Wifi measured with iperf is 39.9 MBit/s.
 +
 +=== CPU load during iperf wlan transfer ===
 +
 +** top results during iperf data transfer **
 +<​code>​
 +top - 13:59:35 up  1:04,  3 users, ​ load average: 1.29, 0.92, 0.53
 +Tasks: ​ 80 total, ​  1 running, ​ 79 sleeping, ​  0 stopped, ​  0 zombie
 +%Cpu(s): ​ 0.7 us, 22.2 sy,  0.0 ni, 44.7 id,  0.0 wa,  0.0 hi, 32.4 si,  0.0 st
 +MiB Mem :    432.7 total, ​   321.6 free,     41.0 used,     70.1 buff/cache
 +MiB Swap:    100.0 total, ​   100.0 free,      0.0 used.    340.5 avail Mem 
 +
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​                                          
 +  556 root      20   ​0 ​      ​0 ​     0      0 I  24.9   ​0.0 ​  ​0:​27.56 kworker/​u2:​1-brcmf_wq/​mmc1:​0001:​1 ​                
 +    7 root      20   ​0 ​      ​0 ​     0      0 S  14.2   ​0.0 ​  ​1:​33.28 ksoftirqd/​0 ​                                      
 +   43 root     ​-51 ​  ​0 ​      ​0 ​     0      0 S  11.7   ​0.0 ​  ​0:​34.95 irq/​86-mmc1 ​                                      
 +  662 pi        20   ​0 ​  ​26708 ​  ​3116 ​  2052 S   ​2.3 ​  ​0.7 ​  ​0:​04.38 iperf                                             
 +  665 pi        20   ​0 ​  ​10168 ​  ​3004 ​  2584 R   ​1.3 ​  ​0.7 ​  ​0:​00.57 top                                               
 +  657 root      20   ​0 ​      ​0 ​     0      0 I   ​0.6 ​  ​0.0 ​  ​0:​48.06 kworker/​u2:​0-brcmf_wq/​mmc1:​0001:​1 ​                
 +  299 root      20   ​0 ​  ​27640 ​  ​1380 ​  1240 S   ​0.3 ​  ​0.3 ​  ​0:​17.01 rngd                                              ​
 +  533 pi        20   ​0 ​  ​12172 ​  ​4016 ​  3208 S   ​0.3 ​  ​0.9 ​  ​0:​00.22 sshd                                              ​
 +    1 root      20   ​0 ​  ​32532 ​  ​7876 ​  6384 S   ​0.0 ​  ​1.8 ​  ​0:​04.41 systemd ​        
 +</​code>​
 +
 +The iperf client transfer results in a CPU load of 50%. The iperf process consumes only 3%, while most of the cpu power goes to the interrupt handling of the wlan driver.
 +
 +==== ssh transfer with wlan ====
 +
 +The ssh results for the wifi transfer are
 +
 +<​code>​
 +Fredo:~ fritz$ scp pi@192.168.178.84:​~/​tf1mb .
 +pi@192.168.178.84'​s password: ​
 +tf1mb                                              100%  977KB   ​2.1MB/​s ​  ​00:​00 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.178.84:​~/​tf3mb .
 +pi@192.168.178.84'​s password: ​
 +tf3mb                                              100% 2930KB ​  ​2.3MB/​s ​  ​00:​01 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.178.84:​~/​tf100mb .
 +pi@192.168.178.84'​s password: ​
 +tf100mb ​                                           100%   ​95MB ​  ​1.6MB/​s ​  ​00:​58 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.178.84:​~/​tf100mb .
 +pi@192.168.178.84'​s password: ​
 +tf100mb ​                                           100%   ​95MB ​  ​1.8MB/​s ​  ​00:​54 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.178.84:​~/​tf100mb .
 +pi@192.168.178.84'​s password: ​
 +tf100mb ​                                           100%   ​95MB ​  ​1.8MB/​s ​  ​00:​53 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.178.84:​~/​tf100mb .
 +pi@192.168.178.84'​s password: ​
 +tf100mb ​                                           100%   ​95MB ​  ​1.7MB/​s ​  ​00:​55 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.178.84:​~/​tf100mb .
 +pi@192.168.178.84'​s password: ​
 +tf100mb ​                                           100%   ​95MB ​  ​1.9MB/​s ​  ​00:​51 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.178.84:​~/​tf1mb .
 +pi@192.168.178.84'​s password: ​
 +tf1mb                                              100%  977KB   ​1.8MB/​s ​  ​00:​00 ​   ​
 +Fredo:~ fritz$ scp pi@192.168.178.84:​~/​tf3mb .
 +pi@192.168.178.84'​s password: ​
 +Permission denied, please try again.
 +pi@192.168.178.84'​s password: ​
 +tf3mb                                              100% 2930KB ​  ​2.0MB/​s ​  ​00:​01 ​   ​
 +Fredo:~ fritz$ ​
 +</​code>​
 +
 +During the transfer of the 100 MByte file, the cpu load according to top is
 +
 +<​code>​
 +top - 15:36:21 up 18 min,  1 user,  load average: 0.96, 0.86, 0.58
 +Tasks: ​ 76 total, ​  2 running, ​ 74 sleeping, ​  0 stopped, ​  0 zombie
 +%Cpu(s): 23.3 us, 39.5 sy,  0.0 ni,  3.9 id,  0.0 wa,  0.0 hi, 33.3 si,  0.0 st
 +MiB Mem :    432.7 total, ​   222.8 free,     40.1 used,    169.7 buff/cache
 +MiB Swap:    100.0 total, ​   100.0 free,      0.0 used.    341.3 avail Mem 
 +
 +  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND ​      
 +  906 pi        20   ​0 ​  ​15852 ​  ​7740 ​  3208 R  29.5   ​1.7 ​  ​0:​08.32 sshd          ​
 +  314 root      20   ​0 ​      ​0 ​     0      0 D  29.2   ​0.0 ​  ​0:​50.23 kworker/​u2:​3++
 +   43 root     ​-51 ​  ​0 ​      ​0 ​     0      0 D  28.8   ​0.0 ​  ​1:​20.66 irq/​86-mmc1 ​  
 +  908 pi        20   ​0 ​   6620   ​1760 ​  1656 S   ​3.2 ​  ​0.4 ​  ​0:​00.70 scp           
 +    7 root      20   ​0 ​      ​0 ​     0      0 S   ​2.6 ​  ​0.0 ​  ​0:​12.60 ksoftirqd/​0 ​  
 +  530 pi        20   ​0 ​  ​10172 ​  ​2856 ​  2432 R   ​1.0 ​  ​0.6 ​  ​0:​08.43 top           
 +  292 root      20   ​0 ​  ​27640 ​  ​1420 ​  1292 S   ​0.6 ​  ​0.3 ​  ​0:​01.62 rngd          ​
 +</​code>​
 +
 +The CPU is fully loaded and 30% are used for the ssh daemon and 60% are required for the wifi driver. It takes about 55s to transfer the 100 MB file. The rate is therefore around 14 MBit/s. The 1MB files take 0.8s (=10 MBit/s) and the 3MB file takes 2.5s (=10 MBit/s).
 +
 +==== http transfer time for wifi ====
 +
 +The results for the wget transfer time are 0.8s for the 1MB file, 1.1s for the 3MB file and 30s for teh 100MB file. However, these measurements were made at 19.00, i.e. there is quite some traffic on channel 1 now...
 +
 +The transfer times for the 100MB were 30s, 24s, 25s, 26s. This corresponds to a transfer rate of 30 MBit/s. Some times for the 1MB file were: 0.2 0.2 0.2 0.9 0.3 0.7 0.7 0.2 -> There is heavy congestion on channel 1.
 +
 +Based on the 0.2s for the 1 MB File, this translates to **5 MB/s = 40 MBit/s** rate for an undisturbed channel for a transfer via http. This is again exactly the achieved iperf rate as shown above.
 +
 +==== Julian tests ====
 +
 +  * WIFI Only datatransfer
 +  * Router: FritzBox 7430 AW
 +  * Placement: Pi Zero and Laptop placed 10cm above router.
 +  * data ammount: 540 MByte
 +  * ** Laptop and Raspberry Pi share the same Wifi channel => Each packet goes from Pi to AP and from AP to Laptop. => Congestion on the Wifi Channel. **
 +
 +=== wget ===
 +  * time=213sek
 +  * rate=2.53 Mbyte/sek
 +  * cpuusage=70%
 +
 +=== ftp ===
 +  * time=361sek
 +  * rate=1.495 Mbyte/sek
 +  * cpuusage=50-60%
 +
 +==== Results ====
 +
 +  * The Laptop and the Pi should not be connected via a single 2.4 GHz access point as laptop and Pi share the same Wifi channel. This results in 50% throughput reduction (see Julians 2.5 MB/s for wget).
 +  * The transfer rate via wget on an undisturbed 2.4 GHz wifi channel is **5 MB/s**. (Only Pi connected to AP, No other stations use this channel). This 40 MBit/s throughput on http level compares well to the maximum 65 MBit/s wifi data rate of the Pi Zero W.
 +  * ssh transfer is limited by CPU load on the Pi for encryption and results in 1.8 MB/s for Wifi.
 +  * Short Guard Interval setting could possibly increase the the raw wifi rate from 65 MBit/s to 72 MBit/​s. ​
 +
 +
 +
 +
 +
 +
 +
 +
 +===== Pi4/CM4 data transfer rate test =====
 +
 +  * Fritzbox 7520
 +  * CM4 5Ghz Wifi 
 +  * Laptop T14 via Gigabit Ethernet
 +
 +
 +
 +==== pi4 theoretical speed ====
 +
 +from https://​forums.raspberrypi.com/​viewtopic.php?​t=291824&​start=25#​p1768600
 +
 +//Fri Nov 27, 2020 2:03 pm
 +The WiFi chip is connected via a 4-bit SDIO link that typically runs at 41.7MHz giving an upper **limit on throughput of ~160Mbs**. In practise you won't get close to that because it is a simplex link (only one direction at a time) and there is overhead in each of the protocol and transport layers. Given that, 112Mbps sounds pretty good. Even though the throughput hasn't increased, being able to properly use the wide channels means that the channel (which is a shared medium) is occupied for a shorter time, leaving more time for other devices.
 +
 +//
 +
 +==== pi4 config ====
 +
 +
 +
 +<​code>​
 +pi@testi:~ $ iw dev
 +phy#0
 + Unnamed/​non-netdev interface
 + wdev 0x2
 + addr de:​a6:​32:​fe:​85:​b0
 + type P2P-device
 + txpower 31.00 dBm
 + Interface wlan0
 + ifindex 3
 + wdev 0x1
 + addr dc:​a6:​32:​fe:​85:​b0
 + ssid DrMartinRouterKing
 + type managed
 + channel 64 (5320 MHz), width: 80 MHz, center1: 5290 MHz
 + txpower 31.00 dBm
 +
 +pi@testi:~ $ iwconfig wlan0
 +wlan0     IEEE 802.11 ​ ESSID:"​XXXXXXXXXXXX"  ​
 +          Mode:​Managed ​ Frequency:​5.32 GHz  Access Point: 3C:​A6:​2F:​CB:​E0:​7E ​  
 +          Bit Rate=433.3 Mb/s   ​Tx-Power=31 dBm   
 +          Retry short limit:​7 ​  RTS thr:​off ​  ​Fragment thr:off
 +          Power Management:​on
 +          Link Quality=70/​70 ​ Signal level=-29 dBm  ​
 +          Rx invalid nwid:​0 ​ Rx invalid crypt:​0 ​ Rx invalid frag:0
 +          Tx excessive retries:​1 ​ Invalid misc:​0 ​  ​Missed beacon:0
 +
 +</​code>​
 +
 +==== iperf measurements via WLAN ====
 +
 +=== Datatransfer Pi4 -> Laptop ===
 +
 +<​code>​
 +➜  /tmp iperf3 -s
 +-----------------------------------------------------------
 +Server listening on 5201 (test #1)
 +-----------------------------------------------------------
 +Accepted connection from 192.168.178.29,​ port 54534
 +[  5] local 192.168.178.20 port 5201 connected to 192.168.178.29 port 54536
 +[ ID] Interval ​          ​Transfer ​    ​Bitrate
 +[  5]   ​0.00-1.00 ​  ​sec ​ 9.14 MBytes ​ 76.7 Mbits/​sec ​                 ​
 +[  5]   ​1.00-2.00 ​  ​sec ​ 10.8 MBytes ​ 90.9 Mbits/​sec ​                 ​
 +[  5]   ​2.00-3.00 ​  ​sec ​ 10.9 MBytes ​ 91.1 Mbits/​sec ​                 ​
 +[  5]   ​3.00-4.00 ​  ​sec ​ 10.8 MBytes ​ 90.9 Mbits/​sec ​                 ​
 +[  5]   ​4.00-5.00 ​  ​sec ​ 10.9 MBytes ​ 91.5 Mbits/​sec ​                 ​
 +[  5]   ​5.00-6.00 ​  ​sec ​ 10.3 MBytes ​ 86.2 Mbits/​sec ​                 ​
 +[  5]   ​6.00-7.00 ​  ​sec ​ 9.21 MBytes ​ 77.3 Mbits/​sec ​                 ​
 +[  5]   ​7.00-8.00 ​  ​sec ​ 10.9 MBytes ​ 91.1 Mbits/​sec ​                 ​
 +[  5]   ​8.00-9.00 ​  ​sec ​ 10.8 MBytes ​ 90.7 Mbits/​sec ​                 ​
 +[  5]   ​9.00-10.00 ​ sec  10.9 MBytes ​ 91.5 Mbits/​sec ​                 ​
 +[  5]  10.00-10.01 ​ sec   103 KBytes ​ 89.2 Mbits/​sec ​                 ​
 +- - - - - - - - - - - - - - - - - - - - - - - - -
 +[ ID] Interval ​          ​Transfer ​    ​Bitrate
 +[  5]   ​0.00-10.01 ​ sec   105 MBytes ​ 87.8 Mbits/​sec ​                 receiver
 +-----------------------------------------------------------
 +Server listening on 5201 (test #2)
 +-----------------------------------------------------------
 +^Ciperf3: interrupt - the server has terminated
 +</​code>​
 +
 +=== Datatransfer Pi4 <- Laptop ===
 +
 +<​code>​
 +➜  /tmp iperf3 -c 192.168.178.29
 +iperf3: error - unable to connect to server: Connection refused
 +➜  /tmp iperf3 -c 192.168.178.29
 +Connecting to host 192.168.178.29,​ port 5201
 +[  5] local 192.168.178.20 port 40318 connected to 192.168.178.29 port 5201
 +[ ID] Interval ​          ​Transfer ​    ​Bitrate ​        ​Retr ​ Cwnd
 +[  5]   ​0.00-1.00 ​  ​sec ​ 5.21 MBytes ​ 43.7 Mbits/​sec ​  ​24 ​  24.0 KBytes ​      
 +[  5]   ​1.00-2.00 ​  ​sec ​ 4.57 MBytes ​ 38.4 Mbits/​sec ​  ​32 ​  22.6 KBytes ​      
 +[  5]   ​2.00-3.00 ​  ​sec ​ 4.75 MBytes ​ 39.8 Mbits/​sec ​  ​35 ​  38.2 KBytes ​      
 +[  5]   ​3.00-4.00 ​  ​sec ​ 5.11 MBytes ​ 42.8 Mbits/​sec ​  ​36 ​  28.3 KBytes ​      
 +[  5]   ​4.00-5.00 ​  ​sec ​ 4.51 MBytes ​ 37.9 Mbits/​sec ​  ​24 ​  31.1 KBytes ​      
 +[  5]   ​5.00-6.00 ​  ​sec ​ 5.11 MBytes ​ 42.8 Mbits/​sec ​  ​31 ​  21.2 KBytes ​      
 +[  5]   ​6.00-7.00 ​  ​sec ​ 5.23 MBytes ​ 43.8 Mbits/​sec ​  ​23 ​  35.4 KBytes ​      
 +[  5]   ​7.00-8.00 ​  ​sec ​ 5.46 MBytes ​ 45.8 Mbits/​sec ​  ​27 ​  21.2 KBytes ​      
 +[  5]   ​8.00-9.00 ​  ​sec ​ 4.99 MBytes ​ 41.8 Mbits/​sec ​  ​20 ​  35.4 KBytes ​      
 +[  5]   ​9.00-10.00 ​ sec  4.63 MBytes ​ 38.9 Mbits/​sec ​  ​41 ​  19.8 KBytes ​      
 +- - - - - - - - - - - - - - - - - - - - - - - - -
 +[ ID] Interval ​          ​Transfer ​    ​Bitrate ​        Retr
 +[  5]   ​0.00-10.00 ​ sec  49.6 MBytes ​ 41.6 Mbits/​sec ​ 293             ​sender
 +[  5]   ​0.00-10.00 ​ sec  49.3 MBytes ​ 41.4 Mbits/​sec ​                 receiver
 +
 +iperf Done.
 +
 +</​code>​
  • searchwing-pi-datarate.1574856766.txt.gz
  • Last modified: 2019/11/27 13:12
  • by beckmanf