Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--netperf-data-port option/functionality? #212

Open
jsommerville-untangle opened this issue Nov 10, 2020 · 3 comments
Open

--netperf-data-port option/functionality? #212

jsommerville-untangle opened this issue Nov 10, 2020 · 3 comments

Comments

@jsommerville-untangle
Copy link

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)

@tohojo
Copy link
Owner

tohojo commented Nov 10, 2020 via email

@jsommerville-untangle
Copy link
Author

@tohojo Yeah I agree that netperf could use some modifications server side to make something like this work properly (ie: feeding a list of data ports server side to use when opening the data connection netserver --data-port=12866,12867,12868) but unfortunately it looks as though the netperf repository is not actively maintained (https://github.com/hewlettpackard/netperf)

I originally discovered this problem while trying to attach to a docker container running netserver, from another remote container running flent. I wanted to avoid opening all host ports to the docker container, so monitoring docker logs to determine the iptables port forwards for the host seems like it would be the only answer. I'm looking to automate running these test suites, so parsing docker logs to expose ports doesn't seem valid.

Currently my work around is to run the netperf container with host networking (network_mode: "host" for the server), I think this is the only way that won't require a hacky intervention (parsing docker logs on the host to figure out what port netserver is listening on...).

Thanks for the reply!

@Avidanborisov
Copy link

Avidanborisov commented May 30, 2024

Although a bit buried in the documentation (I found it out by going through the sources), netperf does have a way to specify local/remote data port bindings with -- -P local_port,remote_port, e.g.

netperf -H IP -p 10000 -t TCP_STREAM -- -P 10001,10002

will connect to a netserver listening on command port 10000, will bind the local netperf data port to 10001, and the remote netserver data port to 10002.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants