wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: "Rémi Lapeyre" <remi.lapeyre@lenstra.fr>
To: wireguard@lists.zx2c4.com
Subject: MTU on wireguard-apple for IPv6
Date: Wed, 18 Dec 2019 02:41:40 -0800	[thread overview]
Message-ID: <CAFsReqQf_kVBd_PROWBqiTi+VBXRXCv5pwd2SoAFqwZLxj-Q7w@mail.gmail.com> (raw)

Hi, we have users that are reporting many issues when using the
WireGuard client on MacOS laptops with IPv6 networks. It seems that
most of those issues disappear when we set the MTU to 1280 in the
configuration.

Since they are using laptops, some are frequently on badly behaved
networks. Reading the source code, it seems that this situation is
handled differently on iOS vs MacOS in generateNetworkSettings():


        let mtu = tunnelConfiguration.interface.mtu ?? 0

        /* 0 means automatic MTU. In theory, we should just do
         * `networkSettings.tunnelOverheadBytes = 80` but in
         * practice there are too many broken networks out there.
         * Instead set it to 1280. Boohoo. Maybe someday we'll
         * add a nob, maybe, or iOS will do probing for us.
         */
        if mtu == 0 {
            #if os(iOS)
            networkSettings.mtu = NSNumber(value: 1280)
            #elseif os(macOS)
            networkSettings.tunnelOverheadBytes = 80
            #else
            #error("Unimplemented")
            #endif
        } else {
            networkSettings.mtu = NSNumber(value: mtu)
        }


Does `networkSettings.tunnelOverheadBytes = 80` means the MTU will
used be the one of the interface minus 80 bits of overhead for the
WireGuard protocol?

Some of our users where tethering over their phone connection so it
seems that 1280 is appropriate in that case, but I’m confused as to
why connections not going through the WireGuard tunnel where not
impacted in that case.

Does it really make sense to treat laptops and iOS devices differently
are sometime connected to random networks? Should this be changed to
`networkSettings.mtu = NSNumber(value: 1280)` in all cases?

Rémi
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

             reply	other threads:[~2019-12-19  1:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 10:41 Rémi Lapeyre [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-12-17 18:26 MTU on wireguard-apple for IPv6 Rémi Lapeyre
2019-12-19  1:27 ` Jason A. Donenfeld
2019-12-19 10:37   ` Rémi Lapeyre
2019-12-27 16:10   ` Rémi Lapeyre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFsReqQf_kVBd_PROWBqiTi+VBXRXCv5pwd2SoAFqwZLxj-Q7w@mail.gmail.com \
    --to=remi.lapeyre@lenstra.fr \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).