Subject: is non-inheritance of congestion control algorithm from the listen socket a bug or a feature?

From: Rick Jones <[email-masked]>
Date: Tue, 29 Nov 2011 12:03:45 -0800

Dave Taht asked me if I would consider adding control/reporting of the 
congestion control algorithm to netperf.  I'm in the midst of doing that 
and have noticed that setting a valid congestion control algorithm on a 
listen endpoint does not seem to be inherited by subsequent connections. 
  Rather than rely on netperf/netserver I cobbled-together a quick test 
program to show what I mean.

raj@raj-ubuntu-guest:~$ uname -a
Linux raj-ubuntu-guest 3.2.0-rc2+ #1 SMP Mon Nov 28 16:39:21 PST 2011 
x86_64 x86_64 x86_64 GNU/Linux

raj@raj-ubuntu-guest:~$ find /proc -name "*cong*" -print -exec cat {} \; 
2>/dev/null
/proc/sys/net/ipv4/tcp_congestion_control
cubic
/proc/sys/net/ipv4/tcp_available_congestion_control
cubic reno
/proc/sys/net/ipv4/tcp_allowed_congestion_control
cubic reno

# first just report what one gets
raj@raj-ubuntu-guest:~$ ./tcp_congestion_test
Will make no request to set congestion control algorithm
active socket has '' for congestion control
passive socket has '' for congestion control
after listen() passive socket has '' for congestion control
after connect() active has 'cubic' for congestion control
after accept() accepted has 'cubic' for congestion control

# now specify a valid alternative
raj@raj-ubuntu-guest:~$ ./tcp_congestion_test  reno
Will be requesting 'reno' as the congestion control algorithm
active socket has 'reno' for congestion control
passive socket has 'reno' for congestion control
after listen() passive socket has 'reno' for congestion control
after connect() active has 'reno' for congestion control
after accept() accepted has 'cubic' for congestion control

# now specify an invalid alternative just for completeness
raj@raj-ubuntu-guest:~$ ./tcp_congestion_test  bogus
Will be requesting 'bogus' as the congestion control algorithm
active socket has '' for congestion control
passive socket has '' for congestion control
after listen() passive socket has '' for congestion control
after connect() active has 'cubic' for congestion control
after accept() accepted has 'cubic' for congestion control

Is the non-inheritance of the congestion control algorithm a bug or a 
feature?

rick jones