When using the RACK tcpip stack, fetch will hang and eventually generate a timeout. To reproduce the problem: # uname -a FreeBSD mail.xxx.yyy 12.0-RELEASE-p6 FreeBSD 12.0-RELEASE-p6 r349226 MAIL amd64 # kldload tcp_rack # sysctl net.inet.tcp.functions_default=rack # fetch https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/JSON-PP-4.03.tar.gz When using wget, the same url can be retrieved without problems.
I think the problem might be related to the selected TCP Congestion Control algorithm. If I select Cdg as the TCP Congestion Control algorithm: # kldload cc_cdg # sysctl net.inet.tcp.cc.algorithm=cdg Tcp connections will sometimes hang and finally timeout. When this happens, the socket Send-Q is not empty and will never drain, so some or all data is never sent. # netstat -6n Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp6 0 383 2a02:xxxx:yyy:18.56748 2a04:4e42:9::729.443 ESTABLISHED The same happens with IPv4 and IPv6 connections. If I change the TCP Congestion Control to any other algorithm, the problem doesn't exist anymore. I did a quick test with NewReno, Cubic, HTcp and Chd as the selected TCP Congestion Control algorithm and all work.
I can confirm that the combination of CDG and RACK results in a stalled transfer. I tested this with FreeBSD current.
rrs@ proposed a fix, I tested it: it works. rrs@ will commit the fix soon.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=99adf230061268175a36061130e6adb0882270e8 commit 99adf230061268175a36061130e6adb0882270e8 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2021-03-02 11:32:16 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2021-03-02 11:32:16 +0000 RACK: fix an issue triggered by using the CDG CC module Obtained from: rrs@ MFC after: 3 days PR: 238741 Sponsored by: Netlix, Inc. sys/netinet/tcp_stacks/rack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=ae608d4ee7202cc34603e620bc551547e772c4d2 commit ae608d4ee7202cc34603e620bc551547e772c4d2 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2021-03-02 11:32:16 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2021-03-04 09:44:50 +0000 RACK: fix an issue triggered by using the CDG CC module Obtained from: rrs@ PR: 238741 Sponsored by: Netlix, Inc. (cherry picked from commit 99adf230061268175a36061130e6adb0882270e8) sys/netinet/tcp_stacks/rack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=dc27d5312b782b72740d71d81435a80dfe8b78bd commit dc27d5312b782b72740d71d81435a80dfe8b78bd Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2021-03-02 11:32:16 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2021-03-04 10:35:03 +0000 RACK: fix an issue triggered by using the CDG CC module Manually resolved merge conflics. Obtained from: rrs@ PR: 238741 Sponsored by: Netlix, Inc. (cherry picked from commit 99adf230061268175a36061130e6adb0882270e8) sys/netinet/tcp_stacks/rack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch releng/13.0 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=43a2f41379f5b2a5aea94cc8389b181bf2d35b65 commit 43a2f41379f5b2a5aea94cc8389b181bf2d35b65 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2021-03-02 11:32:16 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2021-03-04 11:00:34 +0000 RACK: fix an issue triggered by using the CDG CC module Obtained from: rrs@ Approved by: re (gjb) PR: 238741 Sponsored by: Netlix, Inc. (cherry picked from commit 99adf230061268175a36061130e6adb0882270e8) (cherry picked from commit ae608d4ee7202cc34603e620bc551547e772c4d2) sys/netinet/tcp_stacks/rack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)