Re: [Int-dir] [tsvwg] Intdir early review of draft-ietf-tsvwg-udp-options-19

"C. M. Heard" <heard@pobox.com> Wed, 15 February 2023 22:55 UTC

Return-Path: <heard@pobox.com>
X-Original-To: int-dir@ietfa.amsl.com
Delivered-To: int-dir@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C6B9CC17CE8F; Wed, 15 Feb 2023 14:55:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=pobox.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zqqCfSoJH0sA; Wed, 15 Feb 2023 14:55:32 -0800 (PST)
Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 015CFC17CE88; Wed, 15 Feb 2023 14:55:30 -0800 (PST)
Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id C40BC17905E; Wed, 15 Feb 2023 17:55:26 -0500 (EST) (envelope-from heard@pobox.com)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:cc:content-type; s=sasl; bh=xoK6YAQHRqvRSFBgx9nYPCkYOTdH9Nxz AatQIBekpM4=; b=JV+cz6dRdJrlfiCOD89OA7pp1twhjLWvDOT7lXdt536bfN5V ErHkassgcfBjCTDrsJQD1dTjtvmwLbEg5IJutXZ78hvP9k3CiYDDEDMEUVRvXi/p poP5o1Xk47e3BjMos+qVbKWQBafBgyQLlKlBorRHEbAWe4jhkmpLO4eP4LU=
Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id BAAF417905D; Wed, 15 Feb 2023 17:55:26 -0500 (EST) (envelope-from heard@pobox.com)
Received: from mail-ej1-f48.google.com (unknown [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 284BE17905B; Wed, 15 Feb 2023 17:55:26 -0500 (EST) (envelope-from heard@pobox.com)
Received: by mail-ej1-f48.google.com with SMTP id ky6so882469ejc.0; Wed, 15 Feb 2023 14:55:26 -0800 (PST)
X-Gm-Message-State: AO0yUKWOPOjNFUc7QJwWNqOIQJzwkqW0sUsU7zuHLqPnYhCSC/BLZ+qx 0JcKOak6wcwbrNgmvnZG30Nr+AzFaSZ7u0ddqIA=
X-Google-Smtp-Source: AK7set9LipBHf2ag+UEtO7KeGpXuQG0mCh+YX1aTcbdzeU6WC6wh7Gq1HoOXXkAOiYt4sOc2vSuq353AbbSfTcPVeSQ=
X-Received: by 2002:a17:907:76f0:b0:8b1:30eb:9dba with SMTP id kg16-20020a17090776f000b008b130eb9dbamr1906549ejc.6.1676501725103; Wed, 15 Feb 2023 14:55:25 -0800 (PST)
MIME-Version: 1.0
References: <167599146728.42049.10916891372133731811@ietfa.amsl.com> <CBCA1F49-73BC-4242-B162-2B743F23FAAF@strayalpha.com> <0E3756C7-E473-4B3A-9D6D-C43DA3C89C91@cisco.com> <CACL_3VHcMe87XnETGAzwpdPZK_HnY4KLKyHyyj-EXBo=WWNcMA@mail.gmail.com> <B743425D-38C0-49B8-B391-7AC6E51D9B1A@cisco.com> <CACL_3VFDHhmJL2_WXV60d-tyyfE8tkW8P6rwtcBOox4mxsHRzQ@mail.gmail.com> <CALx6S35T+H5ETDJVEawbOSs7EeBO7wbvmRSvH0+TfZiTXhK5cQ@mail.gmail.com> <CACL_3VFrtuDS4FW1xWzzdB4LGibrUWSvTgWi1ashh=D1hvFaNQ@mail.gmail.com> <CALx6S34qG0uv4tj1gzZxL7LZUeX6V1vEwYJ9A9Ybtszh074ovA@mail.gmail.com> <BB7783E3-273A-4D83-B4BF-BCE3DA00E609@strayalpha.com> <CALx6S36QovfwXjFmspVP4CgEOwmJzBLGX59c=zsvSGap8sX1gQ@mail.gmail.com> <CACL_3VFDQUjp5ez70RpyptZSOYvso2-QZsRvLhRNyU9p0iMayw@mail.gmail.com> <CALx6S34y6XttaEz_Uod4bSK50F-KArrv-V=HjKAb8v-9oWoM5Q@mail.gmail.com> <CACL_3VGKuk2HU1Hy4bZymUgPJqvhtzS_xSvZ987m58=fZAAXDw@mail.gmail.com> <CALx6S34dEdPgUvTQZda0qb-H3dERzo-3rjsnZ1MyscbJwJwvoQ@mail.gmail.com> <CACL_3VEhA-Jc_GH2isrJjYsheEp0phHdh71ZgRnvBW5tCKYR5A@mail.gmail.com> <CALx6S3551sms4q_yKh8QYqeedB3uoK9ZRMNrDtVLoMxe-ENX5g@mail.gmail.com>
In-Reply-To: <CALx6S3551sms4q_yKh8QYqeedB3uoK9ZRMNrDtVLoMxe-ENX5g@mail.gmail.com>
From: "C. M. Heard" <heard@pobox.com>
Date: Wed, 15 Feb 2023 14:55:13 -0800
X-Gmail-Original-Message-ID: <CACL_3VFFoX93feS-Q8XTy6rDf6Xa6vwnCB75swohp-bPqrxdEA@mail.gmail.com>
Message-ID: <CACL_3VFFoX93feS-Q8XTy6rDf6Xa6vwnCB75swohp-bPqrxdEA@mail.gmail.com>
To: Tom Herbert <tom@herbertland.com>
Cc: Joe Touch <touch@strayalpha.com>, "Carlos Pignataro (cpignata)" <cpignata@cisco.com>, "int-dir@ietf.org" <int-dir@ietf.org>, "draft-ietf-tsvwg-udp-options.all@ietf.org" <draft-ietf-tsvwg-udp-options.all@ietf.org>, "tsvwg@ietf.org" <tsvwg@ietf.org>
Content-Type: text/plain; charset="UTF-8"
X-Pobox-Relay-ID: D60C32A2-AD83-11ED-8114-307A8E0A682E-06080547!pb-smtp2.pobox.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/int-dir/SlXHcQ_0V75sYTeBQLU3_nj_rws>
Subject: Re: [Int-dir] [tsvwg] Intdir early review of draft-ietf-tsvwg-udp-options-19
X-BeenThere: int-dir@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "This list is for discussion between the members of the Internet Area directorate." <int-dir.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/int-dir>, <mailto:int-dir-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/int-dir/>
List-Post: <mailto:int-dir@ietf.org>
List-Help: <mailto:int-dir-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/int-dir>, <mailto:int-dir-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Feb 2023 22:55:36 -0000

On Tue, Feb 14, 2023 at 9:50 AM Tom Herbert wrote:
> On Mon, Feb 13, 2023 at 3:08 PM C. M. Heard wrote:
> > Section 7 of the draft currently says:
> >
> >    Like the UDP checksum, the OCS is optional under certain
> >    circumstances and contains zero when not used. UDP checksums can be
> >    zero for IPv4 [RFC791] and for IPv6 [RFC8200] when UDP payload
> >    already covered by another checksum, as might occur for tunnels
> >    [RFC6935]. The same exceptions apply to the OCS when used to detect
> >    bit errors; an additional exception occurs for its use in the UDP
> >    datagram prior to fragmentation or after reassembly (see Section
> >    9.4).
> >
> > If this guidance is too slender, how should it be improved?
>
> Mike,
>
> The casual reference to RFC6935 is a good example of why this text is
> insufficient. RFC6935 and RFC6936 were created to allow UDPv6 packets
> to have a zero checksum. The UDP checksum was required in IPv6
> (RFC2460) because, unlike IPv4, the IPv6 header doesn't contain a
> header checksum; the UDP checksum includes the pseudo header that
> covers the IPv6 address. So the UDPv6 checksum is needed as an
> integrity check of the IPv6 addresses, and the primary risk of using
> CS=0 with UPDv6 is the potential for misdelivery when addresses are
> corrupted. That is the primary consideration of RFC6935 and RFC6936.
> Note that it is a misnomer that those RFCs allow a zero UDPv6 checksum
> for all packets, in fact it is a narrowly defined exception applicable
> to tunnel protocols under specific circumstances. Also note, in
> RFC8086 (GRE over UDP), it still took three pages of requirements to
> show how the specific protocol meets the requirements of RFC6935 and
> RFC6936. IMO an offhand statement that the exceptions of RFC6935 and
> RFC6936 are applicable for a new protocol is trite.

You have a point here.

> While the risk RFC6935 and RFC6936 is packet misdelivery, the risk of
> UDP options is misinterpretation of protocol in a packet. UDP options
> present an entirely different problem and the means to address it will
> be different. The UDP checksum is completely independent and has no
> correlation to the bits of the surplus space, the UDP checksum does
> not cover the surplus space and neither is there any coverage if "UDP
> payload is already covered by another checksum".

That's not entirely true. In the case of a reassembled UDP datagram,
the entire datagram and any trailing options will have been covered
by the OCS of the UDP fragments, if it is present. For that reason, it
it is perfectly reasonable to omit both the UDP checksum and OCS in the
reassembled datagram -- as noted in this text from Section 7:

   an additional exception occurs for its use in the UDP datagram prior
   to fragmentation or after reassembly (see Section 9.4).

The considerations would be different of course if OCS on the UDP
fragments were not present ... I will have more to say about this below.

> So the "The same
> exceptions apply to the OCS" are not valid since the exceptions refer
> to the UDP checksum which has different properties and different
> risks. Without a proper code point, the protocol of the surplus space
> needs to be determined solely based on the contents of the space, not
> the UDP checksum nor anything else in the packet, and any means of
> this determination is probabilistically correct. The probability of
> misinterpretation with a checksum is 1/65,536 which is presumably
> sufficient. If the idea is to forgo the checksum, then one would
> expect a quantitative analysis of both the probability of
> misinterpretation and the risks of misinterpretation.
>
> That being said, I see no zero value in making the checksum optional.
> Aside from its critical role in validating the surplus is indeed UDP
> options, UDPv6 packets are required to have a non-zero checksum so the
> OCS is required for all of IPv6 (again RFC6935 and RFC6936 are narrow
> exceptions). Furthermore, TCP, the original transport layer protocol
> with options, and IPv4 have had a checksums since the beginning and we
> don't see people complaining about the performance of those.

Actually, I am mostly in agreement with this point ... much of the
motivation for UDP with CS=0 has faded as hardware checksum offload has
become a thing. And even back in RFC 1122 (October 1989) we see:

            DISCUSSION:
                 Some applications that normally run only across local
                 area networks have chosen to turn off UDP checksums for
                 efficiency.  As a result, numerous cases of undetected
                 errors have been reported.  The advisability of ever
                 turning off UDP checksumming is very controversial.

Situations where we still see what IMO is legitimate resistance to UDP
checksums -- and which is part of what motivated RFC 6935 and RFC 6936
-- are implementations that have limited access to packets, i.e., that
have full access to the first N bytes of the packet but not to the
remainder. In such instances tunnelling protocols can insert UDP headers
but cannot calculate a full UDP checksum. It is conceivable that such a
a tunnel could implement UDP fragmentation but, lacking access to the
whole packet and so could not compute the OCS for the fragments. In that
case the inner packet, whatever it is, would have its own headers and
trailers, which should be completely covered by appropriate transport
checksum(s) -- e.g., by the TCP checksum, if it is a TCP segment, or
by the UDP checksum and OCS, if it is a UDP datagram with UDP options.
In this case the outer UDP fragments would legitimately have UDP CS=0
and OCS=0, by obvious extension of RFC 6935 and RFC 6936.

On Wed, Feb 15, 2023 at 8:49 AM Gorry Fairhurst <wrote:
> I for one also think that last para on whether OCS needs to be required
> in all cases is something that needs to be considered carefully.

There may be a case to be made for tightening the constraints on when
UCP CS=0 is acceptable, but I do not think that it should be banned
outright. There is a case to be made that it is appropriate and useful
under certain circumstances, some of which are discussed above.

On the other hand, there are two very practical reasons for requiring
OCS <> 0 when UDP CS <> 0. First, as noted in the draft, it bypasses
an annoying but apparently common middlebox error (see
https://datatracker.ietf.org/meeting/103/materials/slides-103-maprg-a-tale-of-two-checksums-tom-jones),
and second, it greatly facilitates hardware checksum offload (see
https://mailarchive.ietf.org/arch/msg/tsvwg/9_1YWp-TApI9mcCuia8U6jfCwTA/).

So I see coupling the two as quite logical.

Mike Heard