|
4 | 4 | # Iperf Example |
5 | 5 |
|
6 | 6 | ## Note about iperf version |
7 | | -The iperf example doesn't support all features in standard iperf. It's compitable with iperf version 2.x. |
| 7 | +The iperf example doesn't support all features in standard iperf. It's compatible with iperf version 2.x. |
8 | 8 |
|
9 | | -## Note about 80MHz flash frequency |
| 9 | +- Refer to the components registry iperf-cmd page for more information: https://components.espressif.com/components/espressif/iperf-cmd |
| 10 | + |
| 11 | +## Note about 80MHz flash frequency (ESP32) |
10 | 12 | The iperf can get better throughput if the SPI flash frequency is set to 80MHz, but the system may crash in 80MHz mode for ESP-WROVER-KIT. |
11 | 13 | Removing R140~R145 from the board can fix this issue. Currently the default SPI frequency is set to 40MHz, if you want to change the SPI flash |
12 | 14 | frequency to 80MHz, please make sure R140~R145 are removed from ESP-WROVER-KIT or use ESP32 DevKitC. |
13 | 15 |
|
14 | 16 | ## Introduction |
15 | 17 | This example implements the protocol used by the common performance measurement tool [iPerf](https://iperf.fr/). |
16 | | -Performance can be measured between two ESP32s running this example, or between a single ESP32 and a computer running the iPerf tool |
| 18 | +Performance can be measured between two ESP targets running this example, or between a single ESP target and a computer running the iPerf tool |
17 | 19 |
|
18 | 20 | Demo steps to test station TCP Tx performance: |
19 | | -1. Configure in `menuconfig` which serial output you are using. Execute `idf.py menuconfig` and go to `Component config/ESP System Settings/Channel for console output`, then select the appropiate interface. By default the UART0 interface is used, this means that for example in the ESP32-S3-DevKitC-1 or ESP32-C6-DevKitC-1 you should connect to the micro-usb connector labeled as UART and not to the one labeled as USB. To use the one labeled as USB you should change the aforementioned setting to `USB Serial/JTAG Controller`. |
20 | 21 |
|
21 | | -2. Build the iperf example with sdkconfig.defaults, which contains performance test specific configurations |
| 22 | +- Configure in `menuconfig` which serial output you are using. Execute `idf.py menuconfig` and go to `Component config/ESP System Settings/Channel for console output`, then select the appropriate interface. By default the UART0 interface is used, this means that for example in the ESP32-S3-DevKitC-1 or ESP32-C6-DevKitC-1 you should connect to the micro-usb connector labeled as UART and not to the one labeled as USB. To use the one labeled as USB you should change the aforementioned setting to `USB Serial/JTAG Controller`. |
22 | 23 |
|
23 | | -3. Run the demo as station mode and join the target AP |
24 | | - sta ssid password |
| 24 | +- Build and flash the iperf example with `sdkconfig.defaults`, which contains performance test specific configurations |
| 25 | + - Use `help` for detailed command usage information. |
25 | 26 |
|
26 | | -4. Run iperf as server on AP side |
27 | | - iperf -s -i 3 |
| 27 | +- Run the demo as station mode and join the target AP |
| 28 | + - `sta_connect <ssid> <password>` |
| 29 | + - NOTE: the dut is started in station mode by default. If you want to use the dut as softap, please set wifi mode first: |
| 30 | + - `wifi_mode ap` |
| 31 | + - `ap_set <dut_ap_ssid> <dut_ap_password>` |
28 | 32 |
|
29 | | -5. Run iperf as client on ESP32 side |
30 | | - iperf -c 192.168.10.42 -i 3 -t 60 |
| 33 | +- Run iperf as server on AP side |
| 34 | + - `iperf -s -i 3` |
31 | 35 |
|
32 | | -The console output, which is printed by station TCP RX throughput test, looks like: |
| 36 | +- Run iperf as client on ESP side |
| 37 | + - `iperf -c 192.168.10.42 -i 3 -t 60` |
33 | 38 |
|
34 | | ->iperf> sta aptest |
35 | | -> |
36 | | ->I (5325) iperf: sta connecting to 'aptest' |
37 | | -> |
38 | | ->iperf> I (6017) event: ip: 192.168.10.248, mask: 255.255.255.0, gw: 192.168.10.1 |
39 | | -> |
40 | | ->iperf> iperf -s -i 3 -t 1000 |
41 | | -> |
42 | | ->I (14958) iperf: mode=tcp-server sip=192.168.10.248:5001, dip=0.0.0.0:5001, interval=3, time=1000 |
43 | | -> |
44 | | ->Interval Bandwidth |
45 | | -> |
46 | | ->iperf> accept: 192.168.10.42,62958 |
47 | | -> |
48 | | ->0- 3 sec 8.43 Mbits/sec |
49 | | -> |
50 | | ->3- 6 sec 36.16 Mbits/sec |
51 | | -> |
52 | | ->6- 9 sec 36.22 Mbits/sec |
53 | | -> |
54 | | ->9- 12 sec 36.44 Mbits/sec |
55 | | -> |
56 | | ->12- 15 sec 36.25 Mbits/sec |
57 | | -> |
58 | | ->15- 18 sec 24.36 Mbits/sec |
59 | | -> |
60 | | ->18- 21 sec 27.79 Mbits/sec |
| 39 | +The console output, which is printed by station TCP RX throughput test, looks like: |
61 | 40 |
|
| 41 | + ``` |
| 42 | + iperf> sta_connect testap-11 ******** |
| 43 | + I (36836) WIFI: Connecting to testap-11... |
| 44 | + I (36839) WIFI: DONE.WIFI_CONNECT_START,OK. |
| 45 | + iperf> I (39248) WIFI: WIFI_EVENT_STA_DISCONNECTED! reason: 201 |
| 46 | + I (39249) WIFI: trying to reconnect... |
| 47 | + I (41811) wifi:new:<11,2>, old:<1,0>, ap:<255,255>, sta:<11,2>, prof:1, snd_ch_cfg:0x0 |
| 48 | + I (41813) wifi:state: init -> auth (0xb0) |
| 49 | + I (41816) wifi:state: auth -> assoc (0x0) |
| 50 | + I (41840) wifi:state: assoc -> run (0x10) |
| 51 | + I (41847) wifi:<ba-add>idx:0 (ifx:0, 30:5a:3a:74:90:f0), tid:0, ssn:0, winSize:64 |
| 52 | + I (41914) wifi:connected with testap-11, aid = 1, channel 11, 40D, bssid = 30:5a:3a:74:90:f0 |
| 53 | + I (41915) wifi:security: WPA2-PSK, phy: bgn, rssi: -34 |
| 54 | + I (41926) wifi:pm start, type: 0 |
| 55 | + |
| 56 | + I (41927) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us |
| 57 | + I (41929) WIFI: WIFI_EVENT_STA_CONNECTED! |
| 58 | + I (41983) wifi:AP's beacon interval = 102400 us, DTIM period = 3 |
| 59 | + I (42929) esp_netif_handlers: sta ip: 192.168.1.79, mask: 255.255.255.0, gw: 192.168.1.1 |
| 60 | + I (42930) WIFI: IP_EVENT_STA_GOT_IP: Interface "sta" address: 192.168.1.79 |
| 61 | + I (42942) WIFI: - IPv4 address: 192.168.1.79, |
| 62 | + iperf> |
| 63 | + iperf> iperf -s -i 2 |
| 64 | + I (84810) IPERF: mode=tcp-server sip=0.0.0.0:5001, dip=0.0.0.0:5001, interval=2, time=30 |
| 65 | + I (84812) iperf: Socket created |
| 66 | + iperf> I (87967) iperf: accept: 192.168.1.2,43726 |
| 67 | + |
| 68 | + Interval Bandwidth |
| 69 | + 0.0- 2.0 sec 24.36 Mbits/sec |
| 70 | + 2.0- 4.0 sec 23.38 Mbits/sec |
| 71 | + 4.0- 6.0 sec 24.02 Mbits/sec |
| 72 | + 6.0- 8.0 sec 25.27 Mbits/sec |
| 73 | + 8.0-10.0 sec 23.84 Mbits/sec |
| 74 | + ``` |
62 | 75 |
|
63 | 76 | Steps to test station/soft-AP TCP/UDP RX/TX throughput are similar as test steps in station TCP TX. |
64 | 77 |
|
|
0 commit comments