Skip to content

tailscale0 MTU set incorrectly on GCP #246

Closed

Description

@danderson

tailscale0 MTU seems to be set at a static 1420 bytes. This works fine on clouds that give customers 1500 bytes of MTU, but GCP only gives customers 1460 bytes. So, pings work, but anything more hefty (e.g. SSH) either times out, or takes an eternity to function.

Fixing is a bit tricky, since by definition we don't quite know which path we might be using to peer with people. We could set an ultra conservative 1280b everywhere, but blerg. We could set min(mtus)-wireguard_overhead. Or we could handle PMTU discovery and packet fragmentation in tailscaled.

cc @bradfitz @crawshaw

┆Issue is synchronized with this Asana task by Unito

Activity

  1. added
    connectivity
    on Apr 4, 2020
  2. danderson commented on Apr 4, 2020

    @danderson
    MemberAuthor

    wgengine/userspace.go:83: tundev, err := tun.CreateTUN(tunname, device.DefaultMTU)

    We've been lucky so far, because most places where folks use Tailscale have 1500b base MTUs. However, this probably explains a couple of mystery "can't connect" bugs we have (e.g. DSL boxes squashing the MTU a little, telcos with weird cell network MTUs, ...).

    We probably need explicit PMTUd probing to get 100% (similar to what QUIC had to do), but we can likely get a 90% fix with slightly smarter MTU selection at startup, or forcing a 1280b MTU at the cost of efficiency.

  3. bradfitz commented on Apr 4, 2020

    @bradfitz
    Member

    I think forcing 1280 for now is what we need to do, even if it's a little sad. It'll be more motivation to do PMTU.

  4. danderson commented on Apr 4, 2020

    @danderson
    MemberAuthor

    Yeah, much as I dislike that, it's the right call for now.

  5. bradfitz commented on Apr 5, 2020

    @bradfitz
    Member

    Objections, @apenwarr?

  6. sylr commented on Apr 8, 2020

    @sylr
    Contributor

    If this is defaulted to 1280, could this be overriden by an option, --mtu ?

  7. added
    L5 All users
    P5 Halts deployment
    and removed on Apr 22, 2020
  8. apenwarr commented on Apr 22, 2020

    @apenwarr
    Member

    I think @danderson "fixed" this (hardcoded MTU, but to something a bit bigger than 1280) a while back. The real fix is PMTU, so I don't think we should spend time adding config options for it (which people will probably also end up setting wrong and creating hard-to-debug problems; MTU can be constrained by either end of a link).

  9. apenwarr commented on Apr 22, 2020

    @apenwarr
    Member

    Added #311 to properly fix this.

  10. DanielJoyce commented on Dec 21, 2020

    @DanielJoyce

    PMTU isn't fully supported, and breaks down if not every router between supports the process. Sometimes you need manual MTU

  11. apenwarr commented on Dec 22, 2020

    @apenwarr
    Member
  12. danderson commented on Dec 22, 2020

    @danderson
    MemberAuthor
  13. DanielJoyce commented on Dec 22, 2020

    @DanielJoyce

    That's fine, just there should always be a manual switch. I've been working with similar product from another vendor, and all the fancy auto stuff invariably breaks down and some point you just need to set a value and have it be done and working for customers/clients/workers. And yes they swear up and down it does till they find out it doesn't.

    Hope for the best, plan for the worst.

  14. apenwarr commented on Dec 24, 2020

    @apenwarr
    Member
  15. michaelglass commented on Mar 17, 2022

    @michaelglass

    @sylr as of 1.1.0 you can use the environmental variable TS_DEBUG_MTU as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    L5 All usersP5 Halts deploymentT6 Major usabilityconnectivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions