There's the question to address and a little clarification for this specific case (congestion).
A kernel module is a part of the kernel that is optional and doesn't have to be present at kernel initial start nor later if not needed. It's a kind of plug-in. This allows to have most functionalities available on-demand, without using memory if never used. Most modules can be compiled as modules or built-in. If built-in, it implies you won't find a .ko
module file because it's already in the initial kernel.
You can check what was done:
either by knowing the configuration option (here CONFIG_TCP_CONG_CUBIC
), having access to the configuration used, usually as a file in /boot/config-$(uname -r)
, and verifying what option was used:
grep CONFIG_TCP_CONG_CUBIC /boot/config-$(uname -r)
or by knowing the module name and checking if the module is in the list of built-in modules:
fgrep tcp_cubic.ko /lib/modules/$(uname -r)/modules.builtin
Examples of likely results for your case since you didn't find the module, but with cubic the likely default it probably means it was built-in:
$ grep _CUBIC /boot/config-$(uname -r)
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_CUBIC=y
$ fgrep tcp_cubic.ko /lib/modules/$(uname -r)/modules.builtin
kernel/net/ipv4/tcp_cubic.ko
So this answers the question: consider you have the module always loaded, because it's built-in. It makes sense to have the default be built-in (it's often required).
The list of built-in module files you might expect to find somewhere in /lib/modules/$(uname -r)
and be displayed with lsmod
but that you won't, can be displayed with cat /lib/modules/$(uname -r)/modules.builtin
. They are not special, but were chosen so (by your Linux distribution) often but not always because a default had to be chosen among a list of choices, to be built-in, including all related module dependencies.
Now about the little clarification: of course a module has to be loaded (or built-in) to have its functionality available. But the Q/A you linked to didn't say you only had to load the tcp congestion module to have it activated. Quote:
To try one of these you need to install it using modprobe -a
tcp_westwood or whatever you want. You can then test it using this
echo "westwood" > /proc/sys/net/ipv4/tcp_congestion_control
Since this pseudo-file is read/write, you can just query it to know what congestion is in use with probably this result:
$ cat /proc/sys/net/ipv4/tcp_congestion_control
cubic
Now to change the algorithm:
# lsmod | grep tcp_westwood
# echo westwood > /proc/sys/net/ipv4/tcp_congestion_control
# lsmod | grep tcp_westwood
tcp_westwood 16384 1
The module was auto-loaded and is now in use (some systems might not auto-load).
Anyway the adequate information for this specific case is in /proc/sys/net/ipv4/tcp_congestion_control
, not lsmod
's output.