esnet / iperf

iperf3: A TCP, UDP, and SCTP network bandwidth measurement tool
Other
7k stars 1.28k forks source link

Make --nstreams and --xbind options bound to SCTP support #981

Open PatrikMosko opened 4 years ago

PatrikMosko commented 4 years ago

Context

Bug Report

Put the options tied-to SCTP functionality to the SCTP support. Options --nstreams and --xbind are present and can be invoked even when iperf3 is compiled without SCTP support, which may be missleading for someone. This is not exactly an issue or regression but I saw it, didn't liked it, so here we are.

bmah888 commented 4 years ago

Thanks for the patch! This looks like it'll do the right thing, although I haven't actually tried compiling or running it yet.

bmah888 commented 4 years ago

Now that I'm staring at this, I'm trying to figure out how to recreate your problem. If you compile iperf3 where there's no SCTP support, then the command-line options for SCTP aren't compiled in (see iperf_parse_arguments() at around line 838 in iperf_api.c). So assuming you run on the same system, it shouldn't allow the user to specify --sctp, --numstreams, or -X/--xbind. It's true that (in the current code) the code that handles those command-line arguments is there, but they cann't get called because those options weren't included in the getopt_long().

If you compile on an SCTP-aware machine, everything will be activated, but if you then take the executable to a non-SCTP machine (same OS and architecture), it should try to run but will probably barf when it goes to open the data sockets.

So I'm trying to understand how you got an instance of iperf3 that's behaving the way you described. More details to help me reproduce the problem would be greatly appreciated.

Also you mentioned --without-sctp, which would be a great configure-time parameter, except our configure script doesn't support that. (There probably should be a way to disable SCTP support explicitly, but we don't have one.)