Failing to receive UDP packets with zperf in OpenThread network

Hi all,

I'm trying to characterize the UDP throughput of a Thread network consisting of nRF5340 DK devices. I saw that Espressif made a test report and they seemed to use iPerf to measure UDP throughput. I am trying to do something similar, but with Zephyr's zperf and nRF5340 DK devices instead. However, I am having some troubles with successfully receiving UDP packets. Specifically, I am setting up one nRF5340 DK to be a zperf server and a second nRF5340 DK to be a zperf client. I am running the OpenThread CLI sample firmware on both DKs with additional configuration options taken from the Zephyr's zperf sample. I am running these two DKs under a working Thread network setup (RPi + RCP).

Here are some relevant logs: 

nRF5340 DK acting as a server:

uart:~$ zperf udp download 4343
UDP server started on port 4343
[02:03:23.218,078] <inf> net_zperf: Binding to 192.0.2.1
[02:03:23.218,231] <wrn> net_l2_openthread: No address info provided with event, please enable CONFIG_NET_MGMT_EVENT_INFO
[02:03:23.218,292] <inf> net_zperf: Binding to 2001:db8::1

nRF5340 DK acting as a client:

rtt:~$ zperf udp upload fdbf:fbde:6c4c:1:xxxx:xxxx:xxxx:xxxx 4343 
Remote port is 4343
Connecting to fdbf:fbde:6c4c:1:xxxx:xxxx:xxxx:xxxx
Duration:	1.00 s
Packet size:	256 bytes
Rate:		10 kbps
Starting...
Rate:		10 Kbps
Packet duration 200 ms
UDP upload failed (-1)
rtt:~$ [00:02:41.084,991] <err> net_zperf: Failed to receive packet (11)
rtt:~$ rtt:~$ [00:02:43.039,093] <err> net_zperf: Failed to receive packet (11)

Additional context:

  • I have tried 192.0.2.1, 2001:db8::1, and other ip addresses from `ot ipaddr` to no avail.
  • I also tried the communication between zperf (on a nRF5340 DK) and iPerf (on a Raspberry Pi). This didn't seem to work either. 

Does anyone happen to know how to approach this problem with UDP packets failing to receive? Any help would be greatly appreciated, and please let me know if I can provide any additional details. Thank you for reading!

Parents
  • Hi,

     

    I would recommend that you take away the static IP configurations, and rather let the instance bind to all interfaces.

    ie. append these to your cli project:

    CONFIG_NETWORKING=y
    CONFIG_NET_ZPERF=y
    # CONFIG_NET_ZPERF_SERVER=y
    CONFIG_NET_LOG=y
    CONFIG_NET_IPV6=y
    CONFIG_NET_IPV4=y
    CONFIG_NET_DHCPV4=n
    CONFIG_NET_UDP=y
    CONFIG_NET_TCP=y
    CONFIG_NET_TCP_IPV6_ND_REACHABILITY_HINT=y
    CONFIG_NET_STATISTICS=y
    
    CONFIG_NET_PKT_RX_COUNT=40
    CONFIG_NET_PKT_TX_COUNT=40
    CONFIG_NET_BUF_RX_COUNT=160
    CONFIG_NET_BUF_TX_COUNT=160
    CONFIG_NET_BUF_DATA_SIZE=256
    CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=4
    CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=5
    CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
    CONFIG_NET_MAX_CONTEXTS=5
    CONFIG_NET_TC_TX_COUNT=1
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_SERVICE_THREAD_PRIO=-1
    CONFIG_ZVFS_POLL_MAX=9
    CONFIG_ZVFS_OPEN_MAX=12
    CONFIG_POSIX_API=y
    
    CONFIG_INIT_STACKS=y
    CONFIG_TEST_RANDOM_GENERATOR=y
    
    CONFIG_NET_L2_ETHERNET=y
    CONFIG_NET_SHELL=y
    
    #CONFIG_NET_CONFIG_SETTINGS=y
    #CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2"
    #CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::1"
    #CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.2"
    #CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.1"
    
    CONFIG_LOG=y
    CONFIG_SHELL_CMDS_RESIZE=n
    
    CONFIG_CACHE_MANAGEMENT=y
    CONFIG_SPEED_OPTIMIZATIONS=y
    

     

    Follow the sequence on how to connect the two kits, as shown in the CLI docs:

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/openthread/cli/README.html#testing

    Copy its IPv6 addr:

    ~ ot ipaddr
    fdde:ad00:beef:0:0:ff:fe00:7401
    fdde:ad00:beef:0:981d:33d9:fcfb:c28 <- this is the one I'll connect to
    fe80:0:0:0:c0f2:c293:42bd:a7e4
    Done

    Then setup one device as the zperf server:

    zperf udp download

    Which should output:

    UDP server started on port 5001
    [00:07:02.072,479] <inf> net_zperf: Binding to 0.0.0.0
    [00:07:02.072,570] <inf> net_zperf: Binding to ::
    [00:07:02.072,631] <inf> net_zperf: Listening on port 5001
    

     

    On your other device:

    zperf udp upload fdde:ad00:beef:0:REST:OF:IP 5001 10 1K 1M

     

    The client seems to print loads of errors (buffering etc), so I used the server side logs to see the output:

    uart:~$ zperf udp download
    UDP server started on port 5001
    [00:07:02.072,479] <inf> net_zperf: Binding to 0.0.0.0
    [00:07:02.072,570] <inf> net_zperf: Binding to ::
    [00:07:02.072,631] <inf> net_zperf: Listening on port 5001
    New session started.
    End of session!
     duration:              12.00 s
     received packets:      123
     nb packets lost:       1154
     nb packets outorder:   0
     jitter:                        2.89 ms
     rate:                  81 Kbps
    [00:08:36.301,727] <inf> net_l2_openthread: State changed! Flags: 0x00000064 Current role: router

     

    Kind regards,

    Håkon

  • Hi Håkon,

    Thank you for the response!

    I tried running building the firmware after appending the lines you mentioned above into my prj.conf file, but I came across the following Kconfig errors:

    warning: CACHE_MANAGEMENT (defined at soc/snps/nsim/Kconfig.defconfig.em:33,
    soc/snps/nsim/Kconfig.defconfig.em11d:33, soc/snps/nsim/Kconfig.defconfig.em7d_v22:33,
    soc/snps/nsim/Kconfig.defconfig.hs:30, soc/snps/nsim/Kconfig.defconfig.hs5x:20,
    soc/snps/nsim/Kconfig.defconfig.hs5x_smp:20, soc/snps/nsim/Kconfig.defconfig.hs6x:20,
    soc/snps/nsim/Kconfig.defconfig.hs6x_smp:21, soc/snps/nsim/Kconfig.defconfig.hs_mpuv6:36,
    soc/snps/nsim/Kconfig.defconfig.hs_smp:28, soc/snps/nsim/Kconfig.defconfig.sem:33,
    soc/snps/nsim/Kconfig.defconfig.vpx5:30, soc/snps/emsk/Kconfig.defconfig.em11d:29,
    soc/snps/emsk/Kconfig.defconfig.em7d:38, soc/snps/emsdp/Kconfig.defconfig.em11d:24,
    soc/snps/emsdp/Kconfig.defconfig.em4:24, soc/snps/emsdp/Kconfig.defconfig.em5d:24,
    soc/snps/emsdp/Kconfig.defconfig.em6:24, soc/snps/emsdp/Kconfig.defconfig.em7d:24,
    soc/snps/emsdp/Kconfig.defconfig.em7d_esp:24, soc/snps/emsdp/Kconfig.defconfig.em9d:24,
    soc/nxp/s32/s32k3/Kconfig.defconfig:35, soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig:113,
    soc/nxp/imxrt/Kconfig.defconfig:116, soc/nxp/imx/imx8/Kconfig.defconfig:20,
    soc/nxp/imx/imx8m/Kconfig.defconfig.mimx8ml8_adsp:20, soc/nxp/imx/imx8ulp/Kconfig.defconfig:20,
    soc/nxp/imx/imx8x/Kconfig.defconfig:20, soc/intel/intel_adsp/Kconfig.defconfig:44, arch/Kconfig:960)
    was assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies:
    ((SOC_NSIM_EM && SOC_NSIM) || (SOC_NSIM_EM11D && SOC_NSIM) || (SOC_NSIM_EM7D_V22 && SOC_NSIM) ||
    (SOC_NSIM_HS && SOC_NSIM) || (SOC_NSIM_HS5X && SOC_NSIM) || (SOC_NSIM_HS5X_SMP && SOC_NSIM) ||
    (SOC_NSIM_HS6X && SOC_NSIM) || (SOC_NSIM_HS6X_SMP && SOC_NSIM) || (SOC_NSIM_HS_MPUV6 && SOC_NSIM) ||
    (SOC_NSIM_HS_SMP && SOC_NSIM) || (SOC_NSIM_SEM && SOC_NSIM) || (SOC_NSIM_VPX5 && SOC_NSIM) ||
    (SOC_EMSK_EM11D && SOC_EMSK) || (SOC_EMSK_EM7D && SOC_EMSK) || (SOC_EMSDP_EM11D && SOC_ARC_EMSDP) ||
    (SOC_EMSDP_EM4 && SOC_ARC_EMSDP) || (SOC_EMSDP_EM5D && SOC_ARC_EMSDP) || (SOC_EMSDP_EM6 &&
    SOC_ARC_EMSDP) || (SOC_EMSDP_EM7D && SOC_ARC_EMSDP) || (SOC_EMSDP_EM7D_ESP && SOC_ARC_EMSDP) ||
    (SOC_EMSDP_EM9D && SOC_ARC_EMSDP) || (SOC_SERIES_S32K3 && SOC_FAMILY_NXP_S32) || (SOC_MIMXRT595S_F1
    && SOC_FAMILY_NXP_IMXRT) || ((SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX) && SOC_FAMILY_NXP_IMXRT)
    || (SOC_MIMX8QM6_ADSP && SOC_SERIES_IMX8 && SOC_FAMILY_NXP_IMX) || (SOC_MIMX8ML8_ADSP &&
    SOC_SERIES_IMX8M && SOC_SERIES_IMX8M && SOC_FAMILY_NXP_IMX) || (SOC_MIMX8UD7_ADSP &&
    SOC_SERIES_IMX8ULP && SOC_FAMILY_NXP_IMX) || (SOC_MIMX8QX6_ADSP && SOC_SERIES_IMX8X &&
    SOC_FAMILY_NXP_IMX) || SOC_FAMILY_INTEL_ADSP || DCACHE || ICACHE) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_CACHE_MANAGEMENT and/or look up
    CACHE_MANAGEMENT in the menuconfig/guiconfig interface. The Application Development Primer, Setting
    Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
    too.
    
    
    warning: Experimental symbol NET_SOCKETS_SERVICE is enabled.
    
    Parsing /home/aaron/ncs_v2.7.0/zephyr/samples/net/zperf_ot_cli/Kconfig
    Loaded configuration '/home/aaron/ncs_v2.7.0/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/aaron/ncs_v2.7.0/zephyr/samples/net/zperf_ot_cli/prj.conf'
    Merged configuration '/home/aaron/ncs_v2.7.0/zephyr/samples/net/zperf_ot_cli/build/zperf_ot_cli/zephyr/.config.sysbuild'
    
    /home/aaron/ncs_v2.7.0/zephyr/samples/net/zperf_ot_cli/prj.conf:25: warning: attempt to assign the value '9' to the undefined symbol ZVFS_POLL_MAX
    
    /home/aaron/ncs_v2.7.0/zephyr/samples/net/zperf_ot_cli/prj.conf:26: warning: attempt to assign the value '12' to the undefined symbol ZVFS_OPEN_MAX
    
    error: Aborting due to Kconfig warnings

    It seems like my setup is not identifying CONFIG_ZVFS_POLL_MAX=9 and CONFIG_ZVFS_OPEN_MAX=12. I tried two ncs versions (ncs_v2.7.0 and ncs_v2.9.0) and I ran into the same issue both times. I attempted to proceed after commenting out these lines, but it failed to start the UDP server.

    uart:~$ zperf udp download
    Failed to start UDP server!
    [00:21:22.071,014] <inf> net_zperf: Binding to 0.0.0.0
    [00:21:22.071,136] <inf> net_zperf: Binding to ::
    [00:21:22.071,166] <inf> net_zperf: Listening on port 5001
    [00:21:22.071,197] <err> net_zperf: Cannot register socket service handler (-5)
    

     

    A few more details that may or may not be relevant: 

    OS: Linux Manjaro 25.0.5 (virtual machine)

    CMake version: 3.20.0

    Zephyr version: 3.6.99

    Do you have any suggestions on how to go about this?

    Best,

    Aaron

  • Hi Aaron,

     

    My test was performed on ncs v3.0.2 (zephyr 4.0-based), where the syntax for socket configuration was changed.

    Try either one of these, but remember to comment out the static IP stuff:

    https://github.com/nrfconnect/sdk-zephyr/blob/v3.6.99-ncs2/samples/net/zperf/prj.conf

    https://github.com/nrfconnect/sdk-zephyr/blob/v3.7.99-ncs3/samples/net/zperf/prj.conf

     

    Kind regards,

    Håkon

Reply Children
No Data
Related