Subject: RFC 8201 Packet Too Big Processing

From: Timothy Carlin <[email-masked]>
Date: Fri, 10 Apr 2020 13:07:06 -0400

Hello,

We've noticed during testing for RFC 8200 and 8201 that, for packets larger
than 1280, the Linux kernel is processing invalid Packet Too Big messages
that indicate an MTU less than 1280, and subsequently fragmenting packets
to a size of 1280. We've seen this with 4.15 and 4.18.

This is from Section 4 of RFC 8201:

>   If a node receives a Packet Too Big message reporting a next-hop MTU
>   that is less than the IPv6 minimum link MTU, it must discard it.

Have others noticed this issue with Linux or other OSes?  I'll also note
that it correctly does not generate an atomic fragment if the packet is
less than 1280 bytes.

Best Regards,
Tim Carlin
UNH-IOL

---

From: Fernando Gont <[email-masked]>
Date: Fri, 10 Apr 2020 14:14:34 -0300

Hello, Tim,

On 10/4/20 14:07, Timothy Carlin wrote:
> Hello,
> 
> We've noticed during testing for RFC 8200 and 8201 that, for packets 
> larger than 1280, the Linux kernel is processing invalid Packet Too Big 
> messages that indicate an MTU less than 1280, and subsequently 
> fragmenting packets to a size of 1280. We've seen this with 4.15 and 4.18.
> 

I'm trying to understand the scenario...

Host sends a packet of size > 1280
It receives an ICMPv6 PTB < 1280
And it retransmit the packet as a fragmented packet, where none of the 
fragments is larger than 1280 bytes?

Thanks,
-- 
Fernando Gont
SI6 Networks
e-mail: [email-masked]
PGP Fingerprint: 6666 31C6 D484 63B2 8FB1 E3C4 AE25 0D55 1D4E 7492

---

From: Timothy Carlin <[email-masked]>
Date: Fri, 10 Apr 2020 13:19:28 -0400

Hi Fernando,

> fragments is larger than 1280 bytes?
This is correct.  Since the ICMPv6 PTB < 1280, and invalid, we would expect
the PTB to be discarded, and subsequent packets (for that destination) to
remain unfragmented.

---

From: Fernando Gont <[email-masked]>
Date: Fri, 10 Apr 2020 14:27:43 -0300

On 10/4/20 14:19, Timothy Carlin wrote:
> Hi Fernando,
> 
> On Fri, Apr 10, 2020 at 1:14 PM Fernando Gont <[email-masked] 
> <mailto:[email-masked]>> wrote:
> 
>     Hello, Tim,
> 
>      >  >   If a node receives a Packet Too Big message reporting a
>     next-hop MTU
>      >  >   that is less than the IPv6 minimum link MTU, it must discard it.
>      >
> This is correct.  Since the ICMPv6 PTB < 1280, and invalid, we would 
> expect the PTB to be discarded, and subsequent packets (for that 
> destination) to remain unfragmented.

Agreed. Unless I'm missing something, there's no point in doing that (at 
the end of the day, if the offending MTU was < 1280, fragmenting packets 
at 1280 will be of no use).

Can you provide the exact kernel version, so I may try to take a look at 
the kernel code and figure out what's going on?

Thanks,

---

From: Timothy Carlin <[email-masked]>
Date: Fri, 10 Apr 2020 13:36:51 -0400

> the kernel code and figure out what's going on?
4.15.0-96-generic and 4.18.0-147 both seem to have this issue.

---

From: Fernando Gont <[email-masked]>
Date: Fri, 10 Apr 2020 14:54:01 -0300

On 10/4/20 14:36, Timothy Carlin wrote:
> On Fri, Apr 10, 2020 at 1:27 PM Fernando Gont <[email-masked] 
>      > On Fri, Apr 10, 2020 at 1:14 PM Fernando Gont
>     <[email-masked] <mailto:[email-masked]>
>      > <mailto:[email-masked] <mailto:[email-masked]>>> wrote:
>      >
>      >     Hello, Tim,
>      >
>      >      > Hello,
>      >      >
>      >      > We've noticed during testing for RFC 8200 and 8201 that,
>     for packets
>      >      > larger than 1280, the Linux kernel is processing invalid
>     Packet
>      >     Too Big
>      >      > messages that indicate an MTU less than 1280, and subsequently
>      >      > fragmenting packets to a size of 1280. We've seen this
>     with 4.15
>      >     and 4.18.
>      >      >
>      >      > This is from Section 4 of RFC 8201:
>      >      >
>      >      >  >   If a node receives a Packet Too Big message reporting a
>      >     next-hop MTU
>      >      >  >   that is less than the IPv6 minimum link MTU, it must
>     discard it.
>      >      >
>      >      > Have others noticed this issue with Linux or other OSes?  I'll
>      >     also note
>      >      > that it correctly does not generate an atomic fragment if the
>      >     packet is
>      >      > less than 1280 bytes.
>      >

Have you tried with newer kernels? e.g., I'm running 5.3.0-42-generic here.

Thanks,

---

From: Timothy Carlin <[email-masked]>
Date: Fri, 10 Apr 2020 14:33:22 -0400

On Fri, Apr 10, 2020 at 2:20 PM Fernando Gont <[email-masked]> wrote:

> >      >      > larger than 1280, the Linux kernel is processing invalid
> >     Packet
> >      >     Too Big
> >      >      > fragmenting packets to a size of 1280. We've seen this
> >     with 4.15
> >      >     and 4.18.
> >      >      >
> >      >      >  >   If a node receives a Packet Too Big message reporting
> a
> >      >     next-hop MTU
> >      >      > Have others noticed this issue with Linux or other
> OSes?  I'll
> >      >     also note
> >      >      > that it correctly does not generate an atomic fragment if
> the
> >      >     packet is
> >      >      > less than 1280 bytes.
> >      >

 I have not.  These were from two relatively new distributions, but
apparently are lagging on the kernel version.  I'll try something newer.

---

From: Timothy Carlin <[email-masked]>
Date: Fri, 10 Apr 2020 16:16:11 -0400

On Fri, Apr 10, 2020 at 2:33 PM Timothy Carlin <[email-masked]> wrote:

>> >      >      >  >   If a node receives a Packet Too Big message
>> reporting a
>> >      >     next-hop MTU

Indications are that this remains broken as of 5.3.0-050300-generic.  Let
me know if you want me to try another version.

---

From: Erik Kline <[email-masked]>
Date: Sat, 18 Apr 2020 16:37:18 -0700

If the host downgrades the path mtu to 1280 (and no lower), that seems fine
to me.
8201 section 3:

"""
   Alternatively, the node may elect to end the discovery process by
   ceasing to send packets larger than the IPv6 minimum link MTU.
"""

And later on:

"""
   The node then uses the value in the MTU field in the Packet Too Big
   message as a tentative PMTU value or the IPv6 minimum link MTU if
   that is larger, and compares the tentative PMTU to the existing PMTU.
"""

I think the "it" that is to be discarded is likely not clear.  If a node
discards the whole packet then no new MTU information can be learned.
Rather, the "it" is the MTU value in the PTB and discarding /that/ and
using IPv6 MTU instead seems perfectly reasonable to me and allowed by the
text.

On Fri, Apr 10, 2020 at 1:17 PM Timothy Carlin <[email-masked]> wrote:

>>> >      >      > that it correctly does not generate an atomic fragment
>>> if the
>>> >      >     packet is
>>> >      >      > less than 1280 bytes..
>>> >      >
>>> >     Agreed. Unless I'm missing something, there's no point in doing
>>> that
>>> >     (at
> --------------------------------------------------------------------
> IETF IPv6 working group mailing list
> [email-masked]
> Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
> --------------------------------------------------------------------
>

---

From: Timothy Winters <[email-masked]>
Date: Mon, 20 Apr 2020 12:10:30 -0400

Hi Erik,

So I think the confusion comes from this line in 8021.

"The recommendation in the previous bullet ensures that there are
      no longer any valid reasons for ICMPv6 PTB error messages
      reporting an MTU value smaller than the minimum IPv6 MTU
      (1280 bytes).  IPv6 nodes should therefore be updated to ignore
      ICMPv6 PTB error messages reporting an MTU smaller than 1280 bytes
      as invalid."

So devices should ignore ICMPv6 PTB if smaller then 1280 based on this
reading.

~Tim

On Sat, Apr 18, 2020 at 7:38 PM Erik Kline <[email-masked]> wrote:

> If the host downgrades the path mtu to 1280 (and no lower), that seems
> fine to me.
> 8201 section 3:
>
> """
>>>> >      >      >  >   that is less than the IPv6 minimum link MTU, it
>>>> must
>>>> >     discard it.
>>>> >      >      >
>>>> >      >      > less than 1280 bytes...

---

From: Bob Hinden <[email-masked]>
Date: Mon, 20 Apr 2020 09:35:26 -0700

Tim,

RFC8201 is very clear on this, from Section 4:

   If a node receives a Packet Too Big message reporting a next-hop MTU
   that is less than the IPv6 minimum link MTU, it must discard it.  A
   node must not reduce its estimate of the Path MTU below the IPv6
   minimum link MTU on receipt of a Packet Too Big message.

Bob

> On Apr 20, 2020, at 9:10 AM, Timothy Winters <[email-masked]> wrote:
> 
> Hi Erik,
> 
> So devices should ignore ICMPv6 PTB if smaller then 1280 based on this reading.
> 
> ~Tim
> 
> If the host downgrades the path mtu to 1280 (and no lower), that seems fine to me.
> 8201 section 3:
> 
> """
> I think the "it" that is to be discarded is likely not clear.  If a node discards the whole packet then no new MTU information can be learned.  Rather, the "it" is the MTU value in the PTB and discarding /that/ and using IPv6 MTU instead seems perfectly reasonable to me and allowed by the text..
> 
> >      >      > less than 1280 bytes....
>  I have not.  These were from two relatively new distributions, but apparently are lagging on the kernel version.  I'll try something newer.
> 
> Indications are that this remains broken as of 5.3.0-050300-generic.  Let me know if you want me to try another version.

---

From: Timothy Winters <[email-masked]>
Date: Mon, 20 Apr 2020 13:12:08 -0400

Hi Bob,

Thanks for the clarity, I couldn't find that line earlier.  I think this
means that Linux is currently not following this line and processing the
PTB.

~Tim

On Mon, Apr 20, 2020 at 12:35 PM Bob Hinden <[email-masked]> wrote:

> text..
> > Indications are that this remains broken as of 5.3.0-050300-generic.
> Let me know if you want me to try another version.

---

From: Tom Herbert <[email-masked]>
Date: Mon, 20 Apr 2020 10:44:12 -0700

On Mon, Apr 20, 2020 at 10:14 AM Timothy Winters <[email-masked]> wrote:
>
> Hi Bob,
>
> Thanks for the clarity, I couldn't find that line earlier.  I think this means that Linux is currently not following this line and processing the PTB.
>
Timothy,

Yes, Linux does not check the MTU value in the PTB message, it sets
PMTU to the maximum of 1280 and the received value. I'll propose a fix
on netdev list shortly.

Tom

>> > I think the "it" that is to be discarded is likely not clear..  If a node discards the whole packet then no new MTU information can be learned.  Rather, the "it" is the MTU value in the PTB and discarding /that/ and using IPv6 MTU instead seems perfectly reasonable to me and allowed by the text..
>> >