perfsonar / bwctl

A scheduling and policy framework for measurement tools
Apache License 2.0
16 stars 6 forks source link

Ability to set MSS size of an iperf3 test via BWCTL #23

Closed JWZurawski closed 8 years ago

JWZurawski commented 9 years ago

iperf3 has an option to adjust MSS of a test:

-M, --set-mss # set TCP maximum segment size (MTU - 40 bytes)

Having this as an available item in BWCTL would be helpful.

mfeit-internet2 commented 9 years ago

(This is for the 1.0 branch.)

This looks doable but would require a change to the protocol.

The bandwidth test request has four unused bytes at offset 104, two of which could be used to hold this value. (The largest MSS is 1220 for IPv6.)

Required code changes as far as I can see them (all in bwlib):

bwctl.c: Modify handle_throughput_test_arg()(line ~1910) to accept a -m switch. (Note that -M is already used for TTL in traceroutes.) Add code to ginormous main() (line ~2650) to copy MSS from app options into test options.

bwctld.c: Add MSS to output generated by BWLDExecPostHookScript()

bwlib.h: Add mss field to the BWLTestSpec structure, define a value to be used for the default if not specified (0 seems to make sense).

iperf3.c: Adjust Iperf3PreRunTest() to add the -M switch to the arguments if merited. Need to do the same to iperf.c if older versions of iperf support it.

nuttcp.c: Adjust NuttcpPreRunTest() to add the -M switch to the arguments if merited. (Note that the manual page makes no mention of this switch, but it is in the sources.)

protocol.c: Tweak BWLGenericParseThroughputParameters() and BWLGenericUnparseThroughputParameters() to transfer the value between the message and structure. Also need to make sure that MSS is the default if we receive a request from an older version of the protocol that doesn't have it.

aaronmbr commented 9 years ago

You'll also need to make sure that it fails for older versions of bwctl, and older versions of iperf that don't support setting the MTU. As to the post hook nonsense, I'd ignore it as no one uses it, and it's woefully out of date anyway.

It'd probably also make sense to add the feature to bwctl2, though that should probably be a bit easier.

mfeit-internet2 commented 9 years ago

A set of RPMs for 1.0 that I've tested on a 3.5rc2 system is available: https://perfsonar-dev3.grnoc.iu.edu/jenkins/job/bwctl-issue-23/8/label=master/

mfeit-internet2 commented 8 years ago

Kathy Beninger (benninger@psc.edu) tried some tests with only one side upgraded and they failed because of a protocol mismatch. In theory, it should be just fine to require that the sending end of the test have the version of the protocol that supports MSS because the receiver doesn't actually care. In practice, the code doesn't make it easy to make this check without some major structural changes.

mfeit-internet2 commented 8 years ago

Merged changes; this will be in 3.5.1.