Giter Club home page Giter Club logo

Comments (5)

ViRb3 avatar ViRb3 commented on August 26, 2024 3

I agree with you. I will set the default MTU to 1280 and leave an optimization notice in the README. Thanks a lot!

from wgcf.

 avatar commented on August 26, 2024 2

While it's slightly worse to have 1280 mtu than the precise mtu for your network setup, it would still be better than having it not work by default.

It's better to have defaults that work for most people and then leave the optimizations for people who are capable of that. I've seen some issues here that I think were caused by mtu problems (#39 #32 and #16 ).

I also want to note that while leaving the mtu as default would rarely work on my network, my speed is more than halved. Here are my speedtest stats:

  • No Warp: 110-120Mbps
  • With warp and default 1420 mtu: 50Mbps
  • With warp and 1280 mtu: 110-120Mbps
  • With warp and 1392 mtu: 110-120Mbps

I don't have any speed change with warp when my mtu is set properly (1280 vs 1392).

from wgcf.

ViRb3 avatar ViRb3 commented on August 26, 2024

Do you have an explanation of why reducing the MTU makes your internet work? I"ve been using the default MTU (1480?) for almost a year without any issues. I am happy to make this change if we can prove it is needed.

from wgcf.

 avatar commented on August 26, 2024

You could check with the ping command to see that the mtu value that needs to be set is supposed to be lower. https://kb.netgear.com/19863/Ping-Test-to-determine-Optimal-MTU-Size-on-Router

I made a small bash script that automates the instructions above and makes it work on linux. It does take some time (less than 10 secs) : https://paste.debian.net/1161002/

If you decide to use the script run it like this: ./script.sh 1.1.1.1.

While the mtu value the script keeps giving me is 1392 (which is probably works better), the cf's android client has it set to 1280 so I'd rather just use whatever they use on their official android client.

Sorry I can't give you any explanation besides that it worked for me.

from wgcf.

ViRb3 avatar ViRb3 commented on August 26, 2024

Thank you for the information! I ran some tests myself and here's what I found:

  • Windows 10, netsh interface ipv4 show subinterfaces:
    • Wi-fi: 1500
    • Wireguard (default): 1420
  • Android 9, cat /sys/class/net/*/mtu:
    • wlan0: 1500
    • tun0 (Wireguard through 1.1.1.1 app): 1280

I did some more reading on the choice of a MTU, and here are some references:

Essentially, the difference comes down to how you are connected to the internet - if through PPPoE, then the maximum MTU supported is usually 1420, while for direct Ethernet connection it should be 1500. This is sometimes mitigated by the router, as it can forcefully fragment frames that are too large, but this causes excess CPU usage and you may not always have such a router. Cloudflare seem to have gone for the lowest possible MTU to ensure highest compatibility, while still supporting IPv6 - that is - MTU of 1280. I ran some quick tests and performance with a MTU of 1280 seems to be slightly worse for me than the default 1420, but I will run better testing tomorrow and report here.

from wgcf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.