Public bug reported:

Summary:

TCP source ports assigned by autobind results in even number ports
almost always. This causes issues with LACP xmit_hash_policy layer3+4
policy as only the first nic in a two port bond will be utilized.

Details:

kurt@cypher:~$ lsb_release -rd
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
kurt@cypher:~$ uname -a
Linux cypher 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 
x86_64 x86_64 GNU/Linux

Example iperf run demonstrating source ports are sequentially moving up
by 2:

kurt@cypher:~$ iperf  -t 30 -c saio -P 15
------------------------------------------------------------
Client connecting to saio, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  9] local 172.16.2.38 port 34520 connected with 172.16.2.32 port 5001
[  3] local 172.16.2.38 port 34496 connected with 172.16.2.32 port 5001
[  7] local 172.16.2.38 port 34498 connected with 172.16.2.32 port 5001
[  5] local 172.16.2.38 port 34500 connected with 172.16.2.32 port 5001
[  6] local 172.16.2.38 port 34502 connected with 172.16.2.32 port 5001
[  4] local 172.16.2.38 port 34504 connected with 172.16.2.32 port 5001
[ 11] local 172.16.2.38 port 34506 connected with 172.16.2.32 port 5001
[ 13] local 172.16.2.38 port 34510 connected with 172.16.2.32 port 5001
[ 12] local 172.16.2.38 port 34508 connected with 172.16.2.32 port 5001
[ 16] local 172.16.2.38 port 34512 connected with 172.16.2.32 port 5001
[ 17] local 172.16.2.38 port 34514 connected with 172.16.2.32 port 5001
[ 10] local 172.16.2.38 port 34516 connected with 172.16.2.32 port 5001
[ 15] local 172.16.2.38 port 34522 connected with 172.16.2.32 port 5001
[  8] local 172.16.2.38 port 34524 connected with 172.16.2.32 port 5001
[ 14] local 172.16.2.38 port 34518 connected with 172.16.2.32 port 5001
[ ID] Interval       Transfer     Bandwidth
[ 11]  0.0-30.0 sec   304 MBytes  85.0 Mbits/sec
[ 16]  0.0-30.0 sec   306 MBytes  85.5 Mbits/sec
[ 17]  0.0-30.0 sec   299 MBytes  83.6 Mbits/sec
[  9]  0.0-30.0 sec   323 MBytes  90.3 Mbits/sec
[  8]  0.0-30.0 sec   305 MBytes  85.4 Mbits/sec
[  3]  0.0-30.0 sec   300 MBytes  83.8 Mbits/sec
[  5]  0.0-30.0 sec   166 MBytes  46.3 Mbits/sec
[  6]  0.0-30.0 sec   305 MBytes  85.3 Mbits/sec
[ 10]  0.0-30.0 sec   315 MBytes  88.0 Mbits/sec
[ 15]  0.0-30.0 sec   104 MBytes  29.1 Mbits/sec
[  7]  0.0-30.0 sec  99.9 MBytes  27.9 Mbits/sec
[ 13]  0.0-30.0 sec   196 MBytes  54.8 Mbits/sec
[ 14]  0.0-30.1 sec   107 MBytes  29.7 Mbits/sec
[  4]  0.0-30.1 sec   111 MBytes  30.9 Mbits/sec
[ 12]  0.0-30.1 sec   138 MBytes  38.4 Mbits/sec
[SUM]  0.0-30.1 sec  3.30 GBytes   942 Mbits/sec

Expected behaviour:

TCP autobind assigning source ports either sequentially by 1, or more
securely randomly.

Note that after multiple attempts TCP autobind may result in an odd
numbered source port, however it predominately results in even numbered
source ports.

Here is an example where one port was odd out of 15 ports. The result is
that LACP xmit_hash_policy layer3+4 is able to direct that connection
over a different nic and the resulting bandwidth is doubled (2x 1G nic
in LACP):

kurt@cypher:~$ iperf  -t 30 -c saio -P 15
------------------------------------------------------------
Client connecting to saio, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 12] local 172.16.2.38 port 34676 connected with 172.16.2.32 port 5001
[  4] local 172.16.2.38 port 34648 connected with 172.16.2.32 port 5001
[  6] local 172.16.2.38 port 34650 connected with 172.16.2.32 port 5001
[  3] local 172.16.2.38 port 34654 connected with 172.16.2.32 port 5001
[  5] local 172.16.2.38 port 34652 connected with 172.16.2.32 port 5001
[  7] local 172.16.2.38 port 34656 connected with 172.16.2.32 port 5001
[  9] local 172.16.2.38 port 34658 connected with 172.16.2.32 port 5001
[ 13] local 172.16.2.38 port 34660 connected with 172.16.2.32 port 5001
[ 14] local 172.16.2.38 port 34664 connected with 172.16.2.32 port 5001
[ 10] local 172.16.2.38 port 34662 connected with 172.16.2.32 port 5001
[ 11] local 172.16.2.38 port 34666 connected with 172.16.2.32 port 5001
[ 17] local 172.16.2.38 port 34668 connected with 172.16.2.32 port 5001
[ 16] local 172.16.2.38 port 34672 connected with 172.16.2.32 port 5001
[ 15] local 172.16.2.38 port 34670 connected with 172.16.2.32 port 5001
[  8] local 172.16.2.38 port 34673 connected with 172.16.2.32 port 5001
[ ID] Interval       Transfer     Bandwidth
[ 12]  0.0-30.0 sec   294 MBytes  82.2 Mbits/sec
[  8]  0.0-30.0 sec  3.28 GBytes   940 Mbits/sec
[  7]  0.0-30.0 sec   302 MBytes  84.4 Mbits/sec
[ 10]  0.0-30.0 sec   296 MBytes  82.7 Mbits/sec
[  4]  0.0-30.0 sec   232 MBytes  64.9 Mbits/sec
[  3]  0.0-30.0 sec   133 MBytes  37.3 Mbits/sec
[ 14]  0.0-30.0 sec   282 MBytes  78.7 Mbits/sec
[  9]  0.0-30.0 sec   362 MBytes   101 Mbits/sec
[ 13]  0.0-30.0 sec   273 MBytes  76.2 Mbits/sec
[ 11]  0.0-30.0 sec   342 MBytes  95.5 Mbits/sec
[ 15]  0.0-30.0 sec   230 MBytes  64.2 Mbits/sec
[ 17]  0.0-30.0 sec   196 MBytes  54.8 Mbits/sec
[  6]  0.0-30.1 sec   133 MBytes  37.1 Mbits/sec
[ 16]  0.0-30.1 sec   188 MBytes  52.4 Mbits/sec
[  5]  0.0-30.1 sec   117 MBytes  32.5 Mbits/sec
[SUM]  0.0-30.1 sec  6.58 GBytes  1.88 Gbits/sec

This demonstrates that the LACP xmit_hash_policy layer3+4 configuration
is working correctly but due to the predominately even number source
ports, it primarily utilizes one nic.

** Affects: kernel-package (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1656394

Title:
  TCP autobind almost always returns an even numbered port

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/kernel-package/+bug/1656394/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to