Given a Mininet network, I want to simulate flows, e.g. using iperf. To do this, I can run the following:
h5 iperf3 -s -p 1337 &
h6 iperf3 -s -p 1338 &
h1 iperf3 -c h5 -n 10G -b 11M -p 1337 &
h2 iperf3 -c h6 -n 10G -b 11M -p 1338 &
Within the Mininet CLI, h1
, h2
... represent hosts on the Mininet topology. If a Mininet commands begins by a host ID, the command will be run as if on that host. Any later occurrences of the IDs will be replaced by their IP addresses, for convenience.
These commands work, but I haven't found a way to automate them. I can run a python script which can call bash commands, but the above commands break because the context cannot make sense of the mininet IDs. Inputting all of these by hand is annoying, even if it's a copy-paste job.
Is there a way to send a batch of commands to the mininet CLI?