Re: [tsvwg] draft-ietf-udp-options issues from IETF 104

Tom Herbert <tom@herbertland.com> Wed, 17 July 2019 18:33 UTC

Return-Path: <tom@herbertland.com>
X-Original-To: tsvwg@ietfa.amsl.com
Delivered-To: tsvwg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2B92312085E for <tsvwg@ietfa.amsl.com>; Wed, 17 Jul 2019 11:33:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=herbertland-com.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QikbyF8aYnOc for <tsvwg@ietfa.amsl.com>; Wed, 17 Jul 2019 11:33:54 -0700 (PDT)
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B8DE61201DC for <tsvwg@ietf.org>; Wed, 17 Jul 2019 11:33:53 -0700 (PDT)
Received: by mail-ed1-x52d.google.com with SMTP id w13so27039986eds.4 for <tsvwg@ietf.org>; Wed, 17 Jul 2019 11:33:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L19I11X0jOVOLcTyAYqsa/H6q6jKeDqq2FpV9Bj05tY=; b=0PHVVzgTnIeuu7Wzb+IPEtYh5pOAml3fUaAxxtrzWgBYTFDwTNTbiqUxw9uPzzf2Fe CQfXhqiDR7uABzr1GluY1Omsgu1DlX/T7XSxbQjdDUHvLmu+NivEt7TZD7QxTD8Tbxtt 8HpzIUDlqKVW8P1jj7AD6z9MmI5fUlVXr60BeeqOuR9HZuyKYOrEiJb9tvKakVD3Yqkf olaEegHvlIxpbOTyV10TrCuXUeX9ZfEuyjoYlCaKE1BRPJN/qlzBry0qMwdzh3goFBpH x59G6qJJnIMpOgQnqRY0s87FcMvozYqGcNt933PXWNb2d7M2eeoc89N2MrxKhPrlH4hP W0yQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=L19I11X0jOVOLcTyAYqsa/H6q6jKeDqq2FpV9Bj05tY=; b=abvHzRXTSq+qMt9caDpCEikfknBtPWOGOeiWsV4ecJDBJCTLBtf55sEZ3NS1flkwY0 aAx5i/DcH+a5TNy+EgC6rh/Lhmld04pAhXGWVaD2kuuqvt3kaNLwoG81SdqhOCqV5AQ4 zdQ5N66Mv2teZsEJKpx/fKJKGQvMbohSUAwXYgzGXFjMMXMDe3HWouIxOXAuyLh8numt 2n9RvFP/JfAD7/EIfXuq6/FUnjtXDiSCXY2KTocr78T1g6brbpKnAddE3p05M23hH+Op egtjBuMv3RAhEBu8B201Z3siFmx3h1ptXn+iDKwNkKBCbc8BCsGyroaxQ6KaDoaK8z2x QYpw==
X-Gm-Message-State: APjAAAVRx43gJmQ1r1gPPQQOvD7oh15vrkqN3iCb+nGsuar7WgyDhAgh Vx0CzlrSBQXp7kNucBYYq/Md+NwR5PPSlpdqw7w=
X-Google-Smtp-Source: APXvYqy+RHWp3q+Iu2yb8NCGWXhdnyPGsNw0d/drNgQy15gidilvZaSevfMT0nyEDzspoxRtoXunktNqQ7P5LkD3T+0=
X-Received: by 2002:a17:906:85d7:: with SMTP id i23mr32276841ejy.119.1563388432112; Wed, 17 Jul 2019 11:33:52 -0700 (PDT)
MIME-Version: 1.0
References: <CAPDqMeq9GjEQKukH1pZOTdE50e_rc3U6gpdxT-5qrS5phD0RGw@mail.gmail.com> <646D45AD-D79B-4BD2-A084-7DA97CE2C415@strayalpha.com> <7EC37B50-45D5-4CF1-B113-205E55BF244E@strayalpha.com> <CALx6S34s7L7xo+26bt5Cdaqi4Es5Aci42GHk1WNKzugr5st-Gw@mail.gmail.com> <B525BF50-EFCC-44A5-A604-6CDDA914A1CB@strayalpha.com> <CAPDqMep3R6z9PRKkHyOvrh6sV9n5Sc0B++-zVz0FYJCwE6swrQ@mail.gmail.com> <E42A2AE2-F499-465E-BDE6-5EFC0AB20042@strayalpha.com> <CE03DB3D7B45C245BCA0D24327794936306138E9@MX307CL04.corp.emc.com> <CAPDqMeoyNb7vQTdqxLpZpnKb9S7QKeDJNLyQJBmq95yXhB+xfQ@mail.gmail.com> <7D365770-64FE-40BC-901D-B4D7DF6B484B@strayalpha.com> <20190713182554.GB39770@clarinet.employees.org> <CALx6S36mH2M6SYnRSecWXa7k_d1u8O43+CXE-=KqeO0x2e5+qw@mail.gmail.com> <82FF6486-FABF-4D2C-B5E2-178779C720A4@strayalpha.com> <30c17e9c174f6b0da3ecc6b503a8cb17@strayalpha.com> <CACL_3VGs7j+y5vFNT3OL9OKX8ue4rv-Cxi467KR-vbhnMdx86g@mail.gmail.com> <2f71a292f924a9b8de4227c4bbc2f809@strayalpha.com> <CACL_3VGrF5UnbVsSzZZoy1i57WKiQKBX2T3a16UyEVHY=Kr3XA@mail.gmail.com> <CE03DB3D7B45C245BCA0D243277949363061EF7A@MX307CL04.corp.emc.com> <CACL_3VE7+3WD3Uzubf8X9uQX9ZYPnZVhXjheUOuL9EfjT1JkGQ@mail.gmail.com> <CALx6S35V-d3Rn_wjrhbHUHgS=_+dVjR4hbMJ0-JBsG-1BuFuZg@mail.gmail.com> <CACL_3VEDU_ueAS7L9K6Buz3Ft4CPZ+0iOzkMvAxEXJG_EEybaQ@mail.gmail.com>
In-Reply-To: <CACL_3VEDU_ueAS7L9K6Buz3Ft4CPZ+0iOzkMvAxEXJG_EEybaQ@mail.gmail.com>
From: Tom Herbert <tom@herbertland.com>
Date: Wed, 17 Jul 2019 11:33:40 -0700
Message-ID: <CALx6S37p5D9Q22=H9PeZ8wjRGiONBOdDyXkpcEHLmB+zkUhCnQ@mail.gmail.com>
To: "C. M. Heard" <heard@pobox.com>
Cc: "Black, David" <David.Black@dell.com>, Joe Touch <touch@strayalpha.com>, tsvwg <tsvwg@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/t5BRJUrqVU518iBJJncbKWua8TE>
Subject: Re: [tsvwg] draft-ietf-udp-options issues from IETF 104
X-BeenThere: tsvwg@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Transport Area Working Group <tsvwg.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tsvwg/>
List-Post: <mailto:tsvwg@ietf.org>
List-Help: <mailto:tsvwg-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Jul 2019 18:33:56 -0000

On Wed, Jul 17, 2019 at 10:25 AM C. M. Heard <heard@pobox.com> wrote:
>
> On Tue, Jul 16, 2019 at 6:13 PM Tom Herbert wrote:
> > On Tue, Jul 16, 2019 at 5:43 PM C. M. Heard wrote:
> > > What I intended to say might be more accurately expressed by saying
> > > that the default receive behavior is:
> > >
> > > - If UDP CS != 0, perform the UDP checksum validation and discard the
> > >   entire packet if the validation fails. In addition, if a surplus area
> > >   is present, perform the OCS validation, and discard the surplus area
> > >   if the validation fails.
> > >
> > > - If UDP CS == 0, do not perform either of those checks. Accept or
> > >   discard the UDP datagram and its surplus area depending on whether
> > >   UDP CS == 0 is or is not allowed for the socket in question.
> > >
> > > Implementations MAY, but need not, support the following configuration
> > > options: (a) disable checking of OCS when UDP CS != 0 and (b) enable
> > > checking of OCS when UDP CS == 0.
> >
> > Mike,
> >
> > UDP options should not need to change the specified behavior of UDP
> > checksum.
>
> I don't think that the words above say that; in any case, I certainly didn't
> intend to suggest that. What I did intend to say was the opposite, i.e.,
> that the presence or absence of the UDP check should affect how the option
> checksum is handled.
>
> > In IPv4, if the checksum is zero, the packet is accepted.
>
> RFC 1122 allows the application to control that behavior:
>
>             If a UDP datagram is received with a checksum that is non-
>             zero and invalid, UDP MUST silently discard the datagram.
>             An application MAY optionally be able to control whether UDP
>             datagrams without checksums should be discarded or passed to
>             the application.
>
>
> My assumption was that would imply a per-socket option.
>
Mike,

Yes, the RFC optionally allows it, but I doubt any implementations has
bothered to implement it. In IPv4, accepting UDP datagrams wiht zero
checksums is always protocol compliant. Interestingly, the converse to
true for IPv6; dropping UDPv6 datagrams with a zero checksum is always
protocol compliant.

> > In IPv6, if the checksum is zero then the packet is dropped with the
> > narrow exception that that a tunneling protocol is used and the port
> > is explictly configured to allow zero checksums. That's what the specs
> > say and that's what's currently implemented.
>
> The text was intended to allow (not require) exactly that.
>
> > Also, if you say "is or is not allowed for the socket in question"
> > that implies that we have to perform a socket lookup in the fast path
> > just to decide whether to basic packet verification. That's not cheap
> > and some devices performing the checksum verification might not even
> > have a way to configure this. It's much better just be deterministic
> > without needing state or configuration and verify the packet solely
> > based on its contents and what the protocol specification says to do.
>
> Should I have used the word "port" rather than "socket"? The assumption
> I made is that in IPv6 the application would do the explicit configuration
> to allow UDP CS=0 datagrams through the (socket) API.

Technically, it's a tuple (socket) lookup. The way the Linux
implentation works is a socket lookup is performed, and if a socket is
matched there is a field in the returned structure that indicates if
UDPv6 zero checksum is allowed. Conceptually, this would specific
control over connected sockets (e.g. full 4-tuple is matched), however
the only users of this are UDP encapsulation protocols that just bind
to some socket so it is effectively a lookup by port.

>
> In any case, it would be best to phrase this in terms of actual behavior
> (as RFC 1122 does) instead of in terms of a particular API.

Yes. For instance, "socket" is not a protocol term, but "port" and
"5-tuple" are.

Tom

>
> Mike