zperf: Network Traffic Generator

Browse source code on GitHub

Description

The zperf sample demonstrates the zperf shell utility, which allows to evaluate network bandwidth.

Features

Supported Boards

zperf is board-agnostic. However, to run the zperf sample application, the target platform must provide a network interface supported by Zephyr.

This sample application has been tested on the following platforms:

  • Freedom Board (FRDM K64F)

  • QEMU x86

  • Arm FVP BaseR AEMv8-R

  • ARM BASE RevC AEMv8A Fixed Virtual Platforms

For best performance, the sample configures a lot of network packets and buffers. Because of this, the sample’s RAM requirements are quite large. In case the sample does not fit into target platform RAM, reduce the following configs:

CONFIG_NET_PKT_RX_COUNT=40
CONFIG_NET_PKT_TX_COUNT=40
CONFIG_NET_BUF_RX_COUNT=160
CONFIG_NET_BUF_TX_COUNT=160

Requirements

  • iPerf 2.0.10 or newer installed on the host machine, or iperf3 for a build with overlay-iperf3.conf

  • Supported board

Depending on the network technology chosen, extra steps may be required to setup the network environment.

Usage

See zperf library documentation for more information about the library usage.

iperf3

To measure against iperf3 rather than iperf2, build with the iperf3 overlay. The zperf commands are the same, and the default port becomes 5201:

# From the root of the zephyr repository
west build -b <board> samples/net/zperf -- -DEXTRA_CONF_FILE=overlay-iperf3.conf
west flash

Then zperf tcp download and zperf udp download answer iperf3 -c <device address> on the host, and zperf tcp upload <host address> runs a test against iperf3 -s.

Deterministic throughput regression testing

For a hardware-agnostic, host-speed-independent way to detect network throughput regressions (using qemu_x86 with QEMU icount mode over the in-guest loopback interface), see zperf deterministic loopback throughput (qemu_x86 + icount).

Wi-Fi

The IPv4 Wi-Fi support can be enabled in the sample with Wi-Fi snippet.

See also

Network Configuration Library