Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sending IMIX traffic pattern #1576

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

danobi
Copy link

@danobi danobi commented Sep 14, 2023

  • 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
Copy link
Author

danobi commented Sep 14, 2023

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

@danobi
Copy link
Author

danobi commented Sep 14, 2023

Figured it out. Fix is in commit 1.

@danobi danobi force-pushed the imix branch 2 times, most recently from a060030 to ff08316 Compare September 14, 2023 10:54
* 576 4 33.333333%
* 1500 1 8.333333%
*/
r = random() % 1000;
Copy link

@mandarjog mandarjog Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the Random seed set explicitly?
I am wondering what is the behaviour we want ?

if we set a static seed (or give control of setting a seed), then successive runs are identical and conform to the packet size mixture distribution.

Without that every run is different, giving seed explicit control to the user will enable both behaviors.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seed is set lower in file (srandom(0xDEADF00D);). Would prefer to avoid another config flag (already quite a few) but don't mind adding if necessary

read() guarantees atomic delivery of a UDP datagram if the buffer
supplied is big enough. It is not correct to read in a loop if the
buffer is bigger than the actual datagram. This occurs often for --imix
mode.
Will be used to switch on imix traffic pattern.
This provides a somewhat more realistic workload for middleware
performance testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants