2

Can iperf3 report measurements also in terms of packets per second, when generating UDP traffic?

A typical output with the verbose mode is the following:

Test Complete. Summary Results:
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  4]   0.00-10.00  sec  1.64 GBytes  1.41 Gbits/sec  0.010 ms  804029/1208925 (67%)  
[  4] Sent 1208925 datagrams
CPU Utilization: local/sender 99.6% (16.4%u/83.3%s), remote/receiver 0.1% (0.0%u/0.1%s)

iperf Done.

I see that in iperf2 one could specify the input rate in pps, but there is no mentioning of the measured received rate (I don't see this feature in iperf3 anyway)

Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185

1 Answers1

3

I don't see an option for pps in iperf3, however the link below details a way to get what you are looking for.

https://discuss.aerospike.com/t/benchmarking-throughput-and-packet-count-with-iperf3/2791

Run your iperf3 test as you normally would. On the server create a script containing the following:

#!/bin/bash

INTERVAL="1"  # update interval in seconds

if [ -z "$1" ]; then
        echo
        echo usage: $0 [network-interface]
        echo
        echo e.g. $0 eth0
        echo
        echo shows packets-per-second
        exit
fi

IF=$1

while true
do
        R1=`cat /sys/class/net/$1/statistics/rx_packets`
        T1=`cat /sys/class/net/$1/statistics/tx_packets`
        sleep $INTERVAL
        R2=`cat /sys/class/net/$1/statistics/rx_packets`
        T2=`cat /sys/class/net/$1/statistics/tx_packets`
        TXPPS=`expr $T2 - $T1`
        RXPPS=`expr $R2 - $R1`
        echo "TX $1: $TXPPS pkts/s RX $1: $RXPPS pkts/s"
 done

This will give you an output in terms of packets per second.

Jeff
  • 688
  • 1
  • 13
  • 30