fatalcoder524

TCP_Optimiser_Module

v2.5guide

A Magisk/KernelSU module to change tcp congestion algorithm based on current active internet type and some network enhancements.

★154 stars
•Networking & Proxies•by fatalcoder524•Proprietary•Updated Jul 1, 2026
Platforms:
✓ Magisk✓ KernelSU

Overview

TCP Optimiser Module, developed by fatalcoder524, optimizes Android networking by dynamically switching TCP congestion control algorithms and queuing disciplines (qdisc) according to the device’s currently active network interface.

Modern mobile kernels often include Google’s BBR (Bottleneck Bandwidth and RTT) algorithm. While BBR delivers massive throughput gains (often 50–60 Mbps higher upload speeds) over stable Wi-Fi connections compared to traditional Cubic, BBR can struggle on cellular networks where radio signal fluctuations and transient packet drops cause unexpected latency penalties. TCP Optimiser solves this by monitoring network interface transitions, automatically applying BBR to Wi-Fi and Cubic to mobile data.

Prerequisites & Compatibility

  • Root Solution: Compatible with Magisk, KernelSU, and APatch.
  • Kernel Requirements: The device kernel must have the desired TCP congestion algorithms compiled in (CONFIG_TCP_CONG_BBR, CONFIG_TCP_CONG_CUBIC, etc.). If an algorithm is not compiled in your kernel, the module falls back gracefully to system defaults.

There are no documented module conflicts.

Configuration & Tuning

TCP Optimiser can be controlled via its dedicated WebUI or directly via file descriptors in:

/data/adb/modules/tcp_optimiser/

Tuning via File Descriptors

The module generates two interface template files in its directory:

  • wlan_{algo}_{qdisc}: Governs Wi-Fi interfaces.
  • rmnet_data_{algo}_{qdisc}: Governs cellular interfaces.

To modify the active configuration:

  1. Change Algorithm: Rename the {algo} section (e.g., change wlan_cubic_fq to wlan_bbr_fq). Supported values include bbr, cubic, westwood, reno, and any algorithm listed in /proc/sys/net/ipv4/tcp_available_congestion_control.
  2. Change Queuing Discipline: Rename the {qdisc} section to your preferred packet queue (e.g., fq, fq_codel, pfifo_fast).
  3. Maximize Initial Windows: Create an empty file named initcwnd_initrwnd in the module directory to set initial congestion and receive windows to maximum values.
  4. Immediate Application: Create an empty file named force_apply to apply adjustments immediately without a reboot.
  5. Connection Reset (Caution): Create an empty file named kill_connections if you want existing TCP sockets terminated during interface handover. (Disabled by default to avoid interrupting background downloads).

Tuning via WebUI

For a graphical experience:

  • Open the WebUI via KernelSU or APatch manager, or using KSUWebUIStandalone on Magisk.
  • Adjust sliders and dropdown menus for cellular and Wi-Fi profiles.

Troubleshooting & Verification

  • Verify Active Algorithm: Check which algorithm is currently active for your network:
    su -c sysctl net.ipv4.tcp_congestion_control
  • Inspect Module Execution Logs:
    cat /data/adb/modules/tcp_optimiser/service.log
  • Requested Algorithm Not Applying: If an algorithm fails to engage, inspect /proc/sys/net/ipv4/tcp_available_congestion_control to verify whether your current kernel actually compiled that specific module.