iperf icon indicating copy to clipboard operation
iperf copied to clipboard

Support sending IMIX traffic pattern

Open danobi opened this issue 2 years ago • 2 comments

  • Version of iperf3 (or development branch, such as master or 3.1-STABLE) to which this pull request applies:

master

  • Issues fixed (if any):

Added support for sending IMIX traffic pattern

  • Brief description of code changes (suitable for use as a commit message):

One piece of criticism that iperf3 usually gets is that it is not very realistic. IMIX traffic is fairly standard for load testing middleware and is an important benchmark for various middleware vendors / projects. Since iperf3 is very popular and this change is fairly simple, I thought it'd be a nice addition.

I tested this change by running a server and client locally. And I also attached a bpftrace probe to check that the kernel actually saw the intended distribution of packets.

Regular mode:

$ ./src/iperf3 -c localhost -u -b 0 -4
Connecting to host localhost, port 5201
[  5] local 127.0.0.1 port 45844 connected to 127.0.0.1 port 5201
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec  4.81 GBytes  41.3 Gbits/sec  157690
[  5]   1.00-2.00   sec  4.90 GBytes  42.1 Gbits/sec  160510
[  5]   2.00-3.00   sec  4.89 GBytes  42.0 Gbits/sec  160170
[  5]   3.00-4.00   sec  4.89 GBytes  42.0 Gbits/sec  160130
[  5]   4.00-5.00   sec  4.96 GBytes  42.6 Gbits/sec  162520
[  5]   5.00-6.00   sec  4.95 GBytes  42.5 Gbits/sec  162270
[  5]   6.00-7.00   sec  4.95 GBytes  42.5 Gbits/sec  162130
[  5]   7.00-8.00   sec  4.95 GBytes  42.5 Gbits/sec  162170
[  5]   8.00-9.00   sec  4.95 GBytes  42.5 Gbits/sec  162180
[  5]   9.00-10.00  sec  4.95 GBytes  42.5 Gbits/sec  162120
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  49.2 GBytes  42.3 Gbits/sec  0.000 ms  0/1611890 (0%)  sender
[  5]   0.00-10.00  sec  49.2 GBytes  42.2 Gbits/sec  0.002 ms  1237/1611890 (0.077%)  receiver

iperf Done.

bpftrace output for regular mode:

$ sudo bpftrace -e 'kfunc:udp_rcv { @ = hist(args->skb->len) }'
Attaching 1 probe...
^C

@:
[8, 16)                2 |                                                    |
[16, 32)               0 |                                                    |
[32, 64)               3 |                                                    |
[64, 128)              9 |                                                    |
[128, 256)             9 |                                                    |
[256, 512)             2 |                                                    |
[512, 1K)              0 |                                                    |
[1K, 2K)               0 |                                                    |
[2K, 4K)               0 |                                                    |
[4K, 8K)               0 |                                                    |
[8K, 16K)              0 |                                                    |
[16K, 32K)             0 |                                                    |
[32K, 64K)       1611890 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|

IMIX mode:

$ ./src/iperf3 -c localhost -u -4 -b 0 --imix
Connecting to host localhost, port 5201
[  5] local 127.0.0.1 port 37311 connected to 127.0.0.1 port 5201
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec   134 MBytes  1.13 Gbits/sec  445960
[  5]   1.00-2.00   sec   140 MBytes  1.17 Gbits/sec  461650
[  5]   2.00-3.00   sec   139 MBytes  1.16 Gbits/sec  458190
[  5]   3.00-4.00   sec   134 MBytes  1.13 Gbits/sec  441670
[  5]   4.00-5.00   sec   135 MBytes  1.13 Gbits/sec  443280
[  5]   5.00-6.00   sec   136 MBytes  1.14 Gbits/sec  446980
[  5]   6.00-7.00   sec   138 MBytes  1.16 Gbits/sec  454790
[  5]   7.00-8.00   sec   138 MBytes  1.16 Gbits/sec  454580
[  5]   8.00-9.00   sec   135 MBytes  1.13 Gbits/sec  444610
[  5]   9.00-10.00  sec   141 MBytes  1.18 Gbits/sec  465790
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  1.34 GBytes  1.15 Gbits/sec  0.000 ms  0/4517500 (0%)  sender
[  5]   0.00-10.00  sec  1.34 GBytes  1.15 Gbits/sec  0.001 ms  830/4517500 (0.018%)  receiver

iperf Done.

bpftrace output for IMIX mode:

$ sudo bpftrace -e 'kfunc:udp_rcv { @ = hist(args->skb->len) }'
[sudo] password for dxu:
Attaching 1 probe...
^C

@:
[16, 32)         2354059 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[32, 64)              36 |                                                    |
[64, 128)             34 |                                                    |
[128, 256)             0 |                                                    |
[256, 512)             3 |                                                    |
[512, 1K)        1353134 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                       |
[1K, 2K)          354144 |@@@@@@@                                             |

danobi avatar Sep 14 '23 06:09 danobi

I think there is a bug resulting in packet drops even over loopback. Still debugging. Will update when I figure it out

danobi avatar Sep 14 '23 10:09 danobi

Figured it out. Fix is in commit 1.

danobi avatar Sep 14 '23 10:09 danobi