public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jonathan Thibault <jonathan@navigue•com>
To: "netdev@vger•kernel.org" <netdev@vger•kernel.org>
Subject: Re: gretap default MTU question
Date: Thu, 10 Mar 2016 09:30:50 -0500	[thread overview]
Message-ID: <56E1851A.2030407@navigue.com> (raw)
In-Reply-To: <56E05C8F.1060901@navigue.com>

On 09/03/16 12:25 PM, Jonathan Thibault wrote:
> Hello good people of netdev,
>
> When setting up gretap devices like so:
>
> ip link add mydev type gretap remote 1.1.1.1 local 2.2.2.2 nopmtudisc
>
> I'm observing two different behavior:
>
> - On system A, the MTU of 'mydev' is set to the MTU of the 'parent'
> interface (currently 1600) minus 38. All other interfaces on that system
> have a default MTU of 1500, only the parent was forced to 1600 to avoid
> fragmentation.  So 'mydev' accurately figures out that its MTU is 1562.
>
> - On system B, with the 'parent' interface MTU set to 1600 and all other
> defaulting to 1500 (same situation as A), the MTU of 'mydev' gets set to
> 1462.
>
> I'm trying to figure out which behavior is normal and what mechanism (if
> any) causes the MTU to be set differently.  In both cases the 'parent'
> device has an MTU of 1600.  The code in ip_gre.c does this:
>
> dev->mtu = ETH_DATA_LEN - t_hlen - 4;
>
> In this case, system B would have the expected behavior and I need some
> way to explain what goes on with system A.
>
> Of course I can force the MTU on system B but I was rather pleased with
> the 'magic' on system A.
>
> If anyone here familiar with this code can offer an explanation, it
> would greatly ease my curiosity.
>
> Jonathan
Replying to myself to leave a trace.

Turns out that the MTU of the gretap device is based on the MTU of the
interface that has a route to the 'remote' address.  In my specific
case, it used the default route on system B and a static route on system
A.  The cause of the discrepancy was a missing route.

Jonathan

      reply	other threads:[~2016-03-10 14:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 17:25 gretap default MTU question Jonathan Thibault
2016-03-10 14:30 ` Jonathan Thibault [this message]

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=56E1851A.2030407@navigue.com \
    --to=jonathan@navigue$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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