John Sommerville writes: > Similar to the --netperf-control-port parameter, it would be nice if we could specify --netperf-data-port during runtime also. This would change the data-port that the netperf tests are being passed through to, IE: > > ``` > root@99be1c32d2fa:/home# netperf -H 10.11.12.195 -p 12865 -t TCP_STREAM > MIGRATED TCP STREAM TEST from 0.0.0.0 () port 0 AF_INET to 10.11.12.195 () port 0 AF_INET : demo > netperf: send_omni: connect_data_socket failed: Connection refused > > > root@99be1c32d2fa:/home# netperf -H 10.11.12.195 -p 12865 -t TCP_STREAM -- -P 12866 > MIGRATED TCP STREAM TEST from 0.0.0.0 () port 12866 AF_INET to 10.11.12.195 () port 12866 AF_INET : demo > Recv Send Send > Socket Socket Message Elapsed > Size Size Size Time Throughput > bytes bytes bytes secs. 10^6bits/sec > > 131072 16384 16384 10.05 281.20 > ``` > > Only some netperf tests support this, but I don't think the tests > that don't support it fail when -P is passed in on > them. I'll see if I can put something together, but could be useful > for those who are testing netperf between firewalls and don't want to > open 30000-40000 (or whatever netserver chooses for the data port > during specific tests) You're right that netperf does have an option to pick a particular port, but the problem is that this option can only be supplied to the *client*. There is no way to tell netserver to stay within a particular range. And so if we were to support this in Flent, it would require that (a) Flent keeps track of how many ports it needs for each test, and (b) if used, it will prevent multiple Flent tests to run against the same server at the same time. Also, the failure mode is really ugly (netperf can request a port, but if that is not available, it will just silently use a different one). So it's kind of a deliberate omission that this is not supported in Flent, unfortunately :( A workaround is to use iptables to conditionally open the data port range when you see a control port connection. I use something like: -A INPUT -p tcp --dport 12865 -m conntrack --ctstate NEW -j SET --add-set netperf src -A INPUT -p tcp --dport 12865 -m conntrack --ctstate NEW -j ACCEPT -A INPUT -m set --match-set netperf src -p udp --dport 32768:61000 -j ACCEPT -A INPUT -m set --match-set netperf src -p tcp --dport 32768:61000 -j ACCEPT -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/tohojo/flent/issues/212#issuecomment-724660352