Comment 3 for bug 1329029

Revision history for this message
Jeff Lane  (bladernr) wrote :

On Wed, Apr 2, 2014 at 4:41 PM, Daniel Manrique
<email address hidden> wrote:

> Perhaps we can come up with a network_state script to centralize this
> stopping/restarting of connections, to ensure everything is brought to the
> original state, and that works on both server and client. I'm not certain
> this is the right approach, it certainly bears some thinking.

Or the nuke from orbit action:

sudo restart networking at the end of each test run when the script
restores interfaces. This will trigger a recreation of the routing
table and restore the default route.

This is the easiest way of doing this, that I've found.

>> I would be all for binding, actually.
>
>
> This would be ideal. My experience with iperf is that -B doesn't really
> work, but it may be due to what Jeff says about the kernel just doing its
> thing regardless of what iperf wants.

Yeah, it doesn't work well, here's an example:

ubuntu@supermicro:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:48:65:5e:0c
          inet addr:10.0.0.123 Bcast:10.0.0.0 Mask:255.255.255.0
          [SNIP]

eth1 Link encap:Ethernet HWaddr 00:30:48:65:5e:0d
          inet addr:10.0.0.128 Bcast:10.0.0.0 Mask:255.255.255.0
         [SNIP]

So we can see that .128 is eth1 and .123 is eth0.

Now a netstat -ni, followed by an iperf run binding to .128 and a
second netstat -ni:

ubuntu@supermicro:~$ netstat -ni
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 23200 0 0 0 4471 0
0 0 BMRU
eth1 1500 0 101 0 0 0 12035 0
0 0 BMRU
lo 65536 0 0 0 0 0 0 0
0 0 LRU
ubuntu@supermicro:~$ iperf -c 10.0.0.1 -B 10.0.0.128 -n 1024M
------------------------------------------------------------
Client connecting to 10.0.0.1, TCP port 5001
Binding to local address 10.0.0.128
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.0.0.128 port 5001 connected with 10.0.0.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 9.1 sec 1.00 GBytes 943 Mbits/sec
ubuntu@supermicro:~$ netstat -ni
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 64329 0 0 0 746034 0
0 0 BMRU
eth1 1500 0 101 0 0 0 12035 0
0 0 BMRU
lo 65536 0 0 0 0 0 0 0
0 0 LRU

Notice that it appears that ALL the iperf traffic went out of eth0
instead of eth1, even though I bound it to eth1.

THAT, however, I am not sure is a bug in iperf or an effect of kernel
best-path routing.