For iperf2, the -B doesn't bind to an interface but only sets the source ip
address in the packet.   The routing tables decide the output interface.

https://sourceforge.net/p/iperf2/discussion/general/thread/f856ae2c/

Here's an article:
https://codingrelic.geekhold.com/2009/10/code-snippet-sobindtodevice.html

*The bind() system call is frequently misunderstood. It is used to bind to
a particular IP address. Only packets destined to that IP address will be
received, and any transmitted packets will carry that IP address as their
source. bind() does not control anything about the routing of transmitted
packets. So for example, if you bound to the IP address of eth0 but you
send a packet to a destination where the kernel's best route goes out eth1,
it will happily send the packet out eth1 with the source IP address of
eth0. This is perfectly valid for TCP/IP, where packets can traverse
unrelated networks on their way to the destination.*

*In Linux, to control the physical topology of communication you use the
SOBINDTODEVICE socket option.*

Bob


On Fri, Apr 13, 2018 at 11:25 AM, Bruce A. Mah <b...@es.net> wrote:

> If memory serves me right, Marcel wrote:
>
> > I'm trying to do an iperf3 test using a Huawei ME909 wwan modem on a
> > raspberry pi zero w.
> >
> > I use the command as iperf3 -c 12.12.12.12 -t 3 -p 5201 -B 12.34.56.78
> >
> > where 12.12.12.12 is the ip of the server machine and 12.34.56.78 is the
> > ip of the Huawei modem.
> >
> > With this command, I get a timeout error, but when I ommit the -B part
> > with the ip of the modem, iperf3 uses the wlan0 interface and behaves
> > normally.
> >
> > I should also mention that I connected the modem with AT commands
> > (AT+COPS, AT^NDISDUP) and when I do a ping over that interface it also
> > behaves as expected, but when I use a package size over 1300 for ping, I
> > also get a timeout error.
> >
> > I'm quite new to this kind of stuff, so I would appreciate any help!
>
> Hi Marcel--
>
> Hmmm...I don't completely understand the networking setup, but the
> argument to -B is supposed to be the address of the network interface on
> the iperf3 client machine that you want to bind to.  So you're saying
> the Huawei modem presents an IP network interface with the address
> 12.34.56.78 (I presume that's not the real address, which is fine).
>
> Any chance you can do "ip addr" (or the equivalent) for this interface?
> I'd like to check if the address assigned is really the same as what
> you're giving in the "-B" parameter to iperf3.  Also you can see the MTU
> for the link (might help with the ping issue you mentioned).
>
> While the test is running you might be able to (from another window) use
> "netstat -an" as additional verification of the local address being used.
>
> Bruce.
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Iperf-users mailing list
> Iperf-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iperf-users
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iperf-users mailing list
Iperf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iperf-users

Reply via email to