esnet / iperf

iperf3: A TCP, UDP, and SCTP network bandwidth measurement tool
Other
6.78k stars 1.27k forks source link

Bind to interface with client (mac) #1484

Open domdorn opened 1 year ago

domdorn commented 1 year ago

Context

Optional features available: sendfile / zerocopy, support IPv4 don't fragment

Bug Report

iperf3 -B 10.0.0.170 -c 10.0.0.216
Connecting to host 10.0.0.216, port 5201
[  5] local 10.0.0.170 port 51306 connected to 10.0.0.216 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  6.56 GBytes  56.3 Gbits/sec
[  5]   1.00-2.00   sec  6.69 GBytes  57.5 Gbits/sec
[  5]   2.00-3.00   sec  6.47 GBytes  55.6 Gbits/sec
[  5]   3.00-4.00   sec  6.33 GBytes  54.4 Gbits/sec
[  5]   4.00-5.00   sec  6.55 GBytes  56.3 Gbits/sec
[  5]   5.00-6.00   sec  6.46 GBytes  55.5 Gbits/sec
[  5]   6.00-7.00   sec  5.07 GBytes  43.5 Gbits/sec
[  5]   7.00-8.00   sec   113 MBytes   947 Mbits/sec
[  5]   8.00-9.00   sec   112 MBytes   943 Mbits/sec
[  5]   9.00-10.00  sec   112 MBytes   937 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  44.4 GBytes  38.2 Gbits/sec                  sender
[  5]   0.00-10.00  sec  44.4 GBytes  38.2 Gbits/sec                  receiver

iperf Done.
davidBar-On commented 1 year ago

I am not familiar with the routing implemented by the IP stack, especially not on MacBook, but it seems reasonable that the IP stack will realize that 10.0.0.216 is a local machine address, so will rout the data internally instead of sending the data out of the machine.

Did you try using two different MacBooks to make sure that iperf3 binding is working o.k.?

andrekoehler commented 3 months ago

I had the same issue with Ubuntu 24.04 when trying to test a cable between two ethernet ports on the same compuer. Seems like Linux force-optimizes the network route even when explicitly binding to two different network interfaces. Windows 10 did no such thing, so I used Windows for all my tests.