Cake-Autorate-Reborn: A lightweight C rewrite with LuCI UI integration v1.0.1

If @kamikaonashi can reproduce the logging (especially SUMMARY) and log file management that’d be terrific. Then we can just tail the log file to see exactly what’s going on. It’ll help with further development.

3 Likes

Oh this is nifty, very cool to see a C version of the script!

As it happens I’ve recently been toying with making my Rust version of sqm-autorate variant more extensible, so that I could among other things, try to port the cake-autorate algorithm to it, since I thought it’d be interesting to make it possible to choose between different variants in one project, so it’s just a toggle to change between them.

Whether it’s worthwhile doing now that someone’s working on a performant C rewrite is a different matter, but it may be serving different audiences. What I’m up to is a much more heavy-duty option, so love to see a lightweight project that’ll serve low-powered routers well :slight_smile:

Some ideas I’m toying with:

  • Access TCP info (timestamps) for an extra source of RTT data. Not sure if it could replace actively pinging on its own, so considering supplementing ICMP for now or just monitoring it and see where it leads me
  • Related to the above, also considering pulling info about open TCP connections that we have RTT on, and probing if they accept ICMP, if they do add to the pool. Curious about correlating TCP RTT / ICMP data for the same host
  • Making it possible to replace the built-in ratecontroller(s) with an external Lua script that’ll get loaded to calculate the next rate, such that tweaks can be done without recompiling
  • Extend with other algorithms available like cake-autorate, tievolu’s Perl autorate script and anything else interesting depending on viability

Sorry if I’m hijacking a bit here, just wanted to share what I’m up to as well since I’m seeing new fun stuff happening :slight_smile:

3 Likes

Major rework on the rewrite

  • LuCi Ui and cake autorate reborn itself are now one apk/ipk

  • remove dependency of sqm scripts
    everything is handled just via the cake-autorate-reborn now. no need to install sqm scripts.

  • add ICMP type 13 pinger support
    you can now select between standard type 8 and type 13 pinging.
    if you use type 13, you will need to add your custom pinger list. recommended to get closest to your location (https://github.com/tievolu/timestamp-reflectors)
    make a text file called reflectors.txt and add the ip addresses.
    example

94.131.99.64
5.149.41.177
5.145.13.36
85.195.226.210
85.195.233.252
212.60.39.97
195.65.111.111
164.128.130.135
213.202.32

save the text file and push it to the router, example to /etc/
then add the path in the "reflectors file" text field. example: "/etc/reflectors.txt"
if youre using less than 6, make sure to adjust the pinger numbers. just a reminder

  • add cake_mq support if the router supports it
    you can now toggle cake_mq if the router is on latest 25.12.0 and supports cake_mq. if your router doesnt support it, its greyed out

  • microoptimizing
    optimize and reduce code for lower end routers to get better performance

Bugs:
after changing a setting, you should use the start or restart button to restart the service, sometimes it hangs. (didnt happen on latest version for me, just a headsup if something aint working)

hotfix pushed for a small bug when not using enough pingers.

1 Like