Re: Surprising observations on the NetBSD TCP stack

Havard Eidnes <[email protected]> Fri, 10 Oct 2025 11:53:24 +0200 (CEST)
Newsgroups gmane.os.netbsd.devel.network
Message-ID <[email protected]>
>> net.inet.tcp.recvbuf_max = 262144
>> net.inet.tcp.sendbuf_max = 262144
>
> You may need larger buffers (and larger increments).

NetBSD's default settings for the networking stack is ... quite
conservative.  I guess this is at least partially because we run
also on hardware with ... "limited memory resources", and we do
not adapt these settings to the plattform or hardware at hand.

On my desktop host (amd64, 1G-connected) I have this in
/etc/sysctl.conf:

# Tuning of TCP, slightly conservative:
kern.sbmax=1048576
net.inet6.tcp6.sendbuf_max=1048576
net.inet6.tcp6.recvbuf_max=1048576
net.inet.tcp.sendbuf_max=1048576
net.inet.tcp.recvbuf_max=1048576
net.inet.tcp.congctl.selected=cubic

(...and also execute the corresponding "sysctl -w" commands, as
no reboot is required for this reconfiguration.)

Auto-tuning of the receve window is enabled by default, so no
need to tweak that.

For the increased window to have effect for a bidirectional
connection, typically both ends need tuning.

Your mileage may vary, as may your judgement of what
"conservative" might mean in the above context.

Best regards,

- Havard