Can you add MTU optimization in garuda assistant?

Reference-

https://wiki.archlinux.org/title/Jumbo_frames

This will allow user to send bigger packets if possible depends upon network card and cpu. This can benefit users by improving speed during web consumption especially while streaming or download single large files like isos or even prevent buffering on slow internet connections to some extent. Not sure if it is already implemented in garuda linux.

The script can keep increasing ping packet size by 4 in a loop till the loss of packets is 0% and once it exceeds 0% can find maximum MTU size by subtracting 4 from the previous mtusize variable and add 28 to it for headers. That can be temporarily set as mtu using ip link. And ping command can check if things work with the new mtu. Then it can be made permanent.

1 Like

Nice idea, but what happens when someone says "I clicked this button and then my network broke" ?

I wonder whether most of these things should be left to people who know what they are doing and so can fix any issue they create for themselves - any automated configuration really needs to be deterministic (i.e. on/off enabled/disabled in the same way rather than possibly working on some systems but not others or applying in different ways etc. - that's just asking for trouble).

3 Likes

a setting that i simply set or leave on automatic
do not know have played with such settings in the past
but now i don't have a dsl line of 1000 anymore by the way it's only the line between your computer and the router anyway
I would rather start at the router ^^

1 Like

Just to be clear it's not a one way toggle. It will be on/off mechanism, where on does the optimization by changing the mtu values, while off restores the default mtu value. All this without requiring any additional dependencies.

Just Store the default mtu value somewhere beforehand. It's just a 4 digit number. If network broke then it can be toggled off. So old 4 digit mtu value will be restored. Also please read my post carefully. I suggested to use ping command to make sure network works after changing to new mtu value otherwise it won't change. I think mtu value depends on hardware of the computer and not of the router. It's like how big a single packet can be sent at once to the router. I believe that network won't break for any an ideal scenario where user intects just with the toggle for mtu optimization.

So if toggled on,
Script fetches a list of network devices,
Suppose wlo2 and eno2 are the wifi and ethernet, the script find their mtu values by

ifconfig | grep mtu

It redirects the output and stores it to newly created mtu.oldconf file somewhere. It will contain 2 four digit number.

Now it fetches the lowest number in mtu.oldconf

Suppose 1500

Then gives it to a variable,
Now

suppose mtubase=1500

Now in a loop it keeps on increasing $mtubase by 4 and each time runs

ping -M do -s $mtubase <ip-address>

being the local ip of the interface you wish to check.

Note there is an additional 28 bytes as a header when using this method.

Just keep increasing the mtu size (in the ping command) until you get a error. On such an error stop the loop and subtract 4 from mtubase variable to get maximum MTU size, and add 28 to it. Now

ip link set <interface name> mtu $mtubase

Check using ping if network is reachable.
Otherwise restore orignal base value of mtubase in mtu.oldconf

That's it. Now the network should be far better.

If user toggled off, restore the value from mtu.oldconf
If it doesn't exist or got deleted, consider mtubase as 50 and run the program again.

I think pros of this outweigh the cons.

Also if a power failure occurs reboot restores orignal mtu values. Breaking of such a simple mechanism is highly unlikely and can anyways be restored using the mtu.oldconf backup presets. If that also doesn't exist then it can be easily recalibrated by considering mtubase value as very small value like 100. In a few minutes system will be restored. I think this function is like deploy and forget. Just the way you have update option in garuda assistant :grinning:

yes 1500 is the setting that fits LOOOOOOOOOOL
you must know your internet connection or you have a big 10gb intranet with many computers and you have a lot of traffic to send ^^
best regards from a guy from the past who modded the mtu in the early 90's

1 Like

I don't get it? Like with mtu optimization, ping latency should be less. Because larger packets are sent in less time. A perfect mtu value for each user is better than defaulting to 1500. Beefy gaming machines with wifi 6 supported new network cards will benefit hugely with this. Also other machines may be benefited, all this without installing any additional dependencies. It's no harm. Just a better way to use your wifi effectively, like saturating the single packet size until you experience packet loss.

Two links I found on this is

"A larger MTU (Maximum Transmission Unit) brings greater efficiency in transmitting because each packet carries more data; however, a packet too large may be fragmented and results in lower transmitting speed instead. Optimizing the MTU value on the network interface can improve performance and avoid issues."

Felt like sharing it as a suggestion to someone who is not aware of what's happening here.:grinning:

Again this optimization is vey subtle and allows you to utilise network exhaustively with good stability. Just like how gamemode and zen kernel run desktops at top speeds all the time on the cost of power, this optimization further helps garuda to stay ahead of other distros in terms of networking, makes more sense to me after knowing garuda disables wifi power optimization by default, this mtu optimization could be a cherry on top. Files won't download faster, but shall download more reliably in less time wasted on packet loss, and webpages could load a bit faster, YouTube sort of sites could benifit, as well as latency in online games can be greatly reduced or made more consistent. On the other side I don't see any issues to this. By default all distros are set at 1500 but many computers are capable of sending bigger packets. It's just like vm.swappiness kind of.
Also remember that this setting is not likely to create problems but rather make the the internet work more effectively (especially for people who have really good hardware) meanwhile technically improve network stability and kind of decreasing power consumption by sending lesser and larger packets to the router.

Thanks.

pimp your internet connection with mtu by the way only on minimal fact
i like more speed MB/s and ms you ping to my server

but try to pimp your connection anyway it is your time and feeling

by the way why must garuda pimp a script that not necessary
the autosettings are good

can you show on an example what it makes and make testing open for all where are the advantages to automatic will see benchmarks
did you have more down/upload or a better ping even a better performance

pls show us

i can read again what mtu does in the internet

Right - the point is that the script will work differently on different machines and different networks and different ISPs and so introduce a non-deterministic change.

This means that if someone has problems then there's no way of knowing exactly what the problem is - the script will work for some people but not others.

Therefore, it's better to leave this sort of "super optimisation" to people who:

  • know what they're doing;
  • know that making changes can break things;
  • know how to revert a change before posting on the forum;
  • know that posting on the forum won't fix the script for them.
6 Likes

i love that LOOOOOOOL
you always can super optimize you system for 1% more

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.