Skip to content

Commit

Permalink
IperfFlowMeasurement.py: Add mptcp options to iperf
Browse files Browse the repository at this point in the history
Added code to support setting the `--multipath` flag in iperf3 on both client and server

Note: This requires a special build of iperf:
esnet/iperf#1166
  • Loading branch information
pgagne authored and olichtne committed Sep 15, 2021
1 parent 32e4784 commit 1f19e3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ def _prepare_server(self, flow):

self._set_cpupin_params(server_params, flow.cpupin)

if flow.type == "mptcp_stream":
server_params["mptcp"] = True

if flow.receiver_port is not None:
server_params["port"] = flow.receiver_port

Expand All @@ -139,6 +142,8 @@ def _prepare_client(self, flow):
client_params["udp"] = True
elif flow.type == "sctp_stream":
client_params["sctp"] = True
elif flow.type == "mptcp_stream":
client_params["mptcp"] = True
else:
raise RecipeError("Unsupported flow type '{}'".format(flow.type))

Expand Down
10 changes: 8 additions & 2 deletions lnst/Tests/Iperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from lnst.Tests.BaseTestModule import BaseTestModule, TestModuleError

class IperfBase(BaseTestModule):
mptcp = BoolParam(default=False)

def run(self):
self._res_data = {}
if not is_installed("iperf3"):
Expand Down Expand Up @@ -105,8 +107,10 @@ def _compose_cmd(self):
if "oneoff" in self.params and self.params.oneoff:
oneoff = "-1"

cmd = "iperf3 -s {bind} -J {port} {cpu} {oneoff} {opts}".format(
bind=bind, port=port, cpu=cpu, oneoff=oneoff,
mptcp = "--multipath" if self.params.mptcp else ""

cmd = "iperf3 -s {bind} -J {port} {cpu} {oneoff} {mptcp} {opts}".format(
bind=bind, port=port, cpu=cpu, oneoff=oneoff, mptcp=mptcp,
opts=self.params.opts if "opts" in self.params else "")

return cmd
Expand Down Expand Up @@ -166,6 +170,8 @@ def _compose_cmd(self):
test = "--udp"
elif self.params.sctp:
test = "--sctp"
elif self.params.mptcp:
test = "--multipath"
else:
test = ""

Expand Down

0 comments on commit 1f19e3b

Please sign in to comment.