A Magisk/KernelSU module to change tcp congestion algorithm based on current active internet type and some network enhancements.
In certain kernel, TCP Congestion Algorithm BBR might be enabled. Or you want to enable certain algorithm or settings based on what interface you are using. I observed that in my kernel, when i use BBR with WiFi I get 50-60 Mbps more upload speed compared to cubic, but BBR gives bad upload speed in cellular. So I designed this module to switch based on active internet facing interface.
- Set TCP Congestion Algorithm based on interface(Wi-Fi/Cellular).
- Auto Change TCP Congestion Algorithm on interface change.
- Set initcwnd and initrwnd value to max.
- Install the module.
- It creates 2 files
wlan_{algo}
andrmnet_data_{algo}
in module folder. - Reboot device.
- Basic Functionality of module must run normally on boot.
- TCP Congestion Algorithm can be changed for given interface by editing
{algo}
part of file name.wlan_{algo}
for Wi-Fi andrmnet_data_{algo}
for Cellular. - Create an empty file named
initcwnd_initrwnd
to set initcwnd and initrwnd value to max values. - Create an empty file named
kill_connections
to kill all connections during switch. [Be carefull!] - Create an empty file named
force_apply
to apply changes immediately.
All the module settings can be controlled using Module WebUI in KSU and APatch or KsuWebUIStandalone app for Magisk.
{algo}
in filename can be any TCP congestion algorithm (cubic, bbr, reno etc..).- Default algorithm is cubic for cellular.
- Default algorithm is bbr if exists for WiFi. Else cubic.
- There is an option to kill current tcp connections during algorithm change. This will stop downloads, uploads or other ongoing connections. So apps affected might need to be restarted. This is disabled by default.
- Algorithm is applied only if present in kernel.
- Module logs are present in
/data/adb/modules/tcp_optimiser/service.log
.