Re: [tsvwg] UDP options and header-data split (zero copy)

Tom Herbert <tom@herbertland.com> Mon, 19 July 2021 14:37 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 F1B7D3A35E7 for <tsvwg@ietfa.amsl.com>; Mon, 19 Jul 2021 07:37:29 -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, 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 XY6xtXvH2dU4 for <tsvwg@ietfa.amsl.com>; Mon, 19 Jul 2021 07:37:24 -0700 (PDT)
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (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 0E39A3A35B6 for <tsvwg@ietf.org>; Mon, 19 Jul 2021 07:37:18 -0700 (PDT)
Received: by mail-ej1-x634.google.com with SMTP id go30so29074980ejc.8 for <tsvwg@ietf.org>; Mon, 19 Jul 2021 07:37:18 -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:content-transfer-encoding; bh=AXoetGJkxjeU1kigaja5geX8jp3j46OM/m6ubk2RL8k=; b=v21dPU7J4Ia1FRavnjqIO9tumglCadaSVPg1XLxX8oZZNuZGcMiks9MVC65Fa6omOM O9n7s0hVFL9JZLtig2S1GSHllBs3Fm5DUyAoYuvSwRfeqyK4CNwNGhX5MX27tK1+Xm2t gr2q0yqFs4kNdgTRJbkm7+RQ7sCxE5UbBvUUFrp0AITvpgx3oeoUnflZNnkLEGHYF+WQ aSEZn1mJAXPA8s8/ojr+GWVryxk4c8US/l9c2qjqnxbQILG/peRN6f1tYPbLBcVq8qr/ IAdJ3NtICQ5GdkWrxBsYn+4k9ngstFBYi5qcX6n2utRb8kFs3OK0nxLL0Hm4VclLYEsQ d+sQ==
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:content-transfer-encoding; bh=AXoetGJkxjeU1kigaja5geX8jp3j46OM/m6ubk2RL8k=; b=jt5ljKyjJ5hkaULT+kM6+hi+oIFCDoWG8HUbBJuuejMYg+HkQ5oFRlpr5JvSPGHJe3 tjFtS+6k2yZMFUEn9mI25FCn23nuKv5lr5bYUWlpt4OJzhjahYiIIXnvJktTcbrMtDwZ Q6/EnCsVN2erOW0+gjeDu3lNB2wLS9b286/F2eloC6RyDyxWnmu6YV/gygtM2VN3Ns/s 3FSJ4wkah31wN4ypWWyERTovEbA9M1DDrS5TdF6sB3qx+4zYTFqR3VViDmXrKnaKaOyc Ciruob9L1FK8bMLoUFlOjTn2JDAKPIAA3TShNrV+hLX/AnmZcFQ6XnLG7nmvDSGux15r Eg+g==
X-Gm-Message-State: AOAM532K/9DlhIgI+CkpJfrGW1vSGCSV+E4C3XAXHHrcH2Jc+EuGJ0F7 NlpA4SmgcfUHNl90111XHjy4fEQ+tn5+GrcNQWkVTDi4IcWsow==
X-Google-Smtp-Source: ABdhPJxMugXmEybOrkCCLIvpIhmtYfdVSRBO65ab10fm+dFoOA8nrPWx34DfHsskZEWZ8El/RHx6+YOJ8IgTIXZ+8zI=
X-Received: by 2002:a17:906:498b:: with SMTP id p11mr28029504eju.295.1626705435795; Mon, 19 Jul 2021 07:37:15 -0700 (PDT)
MIME-Version: 1.0
References: <CALx6S34WtGABWJEL_CBJAhSFb9JpR97Dr9emX-K0PxUGZ3VvnQ@mail.gmail.com> <927E12B2-D77E-4810-BABC-18D090F0A022@strayalpha.com> <CALx6S37H6wAt4FyGqwm038R=GeiOY0Wt-YY1Hb+XDjGX4Cw_QQ@mail.gmail.com> <6ADBCB38-9C0B-4A43-8877-4177F162D001@strayalpha.com>
In-Reply-To: <6ADBCB38-9C0B-4A43-8877-4177F162D001@strayalpha.com>
From: Tom Herbert <tom@herbertland.com>
Date: Mon, 19 Jul 2021 07:37:04 -0700
Message-ID: <CALx6S368+gozryvmkiZVk5jZsOJgtU96Mcpi8pqLBAqJObHh4A@mail.gmail.com>
To: Joseph Touch <touch@strayalpha.com>
Cc: tsvwg <tsvwg@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/3TYh4NIoeC9xQvhd96sGz5ZWogQ>
Subject: Re: [tsvwg] UDP options and header-data split (zero copy)
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: Mon, 19 Jul 2021 14:37:40 -0000

On Sat, Jul 17, 2021 at 7:56 PM Joseph Touch <touch@strayalpha.com> wrote:
>
>
>
> > On Jul 17, 2021, at 6:05 PM, Tom Herbert <tom@herbertland.com> wrote:
> >
> > On Sat, Jul 17, 2021 at 4:06 PM Joe Touch <touch@strayalpha.com> wrote:
> >>
> >>
> >>
> >>> On Jul 17, 2021, at 2:58 PM, Tom Herbert <tom@herbertland.com> wrote:
> >>>
> >>> If I'm reading the draft correctly, it is possible that UDP options
> >>> could appear both in the headers and trailers of a packet. If that is
> >>> correct, then that means an implementation needs to be able to handle
> >>> both headers and trailers within the *same* packet.
> >>
> >> That is always the case for non-fragmented packets - the only mode that supports transparent use of options that don’t change the payload data with legacy receivers.
> >
> > Perhaps I'm not reading it correctly, but it seems like in legacy mode
> > all options are in trailers in the surplus area. In the last fragment
> > case, the packet may look like
> > UDP-header/UDP-options-per-packet/Frag-data-UDP-options-for-reassembled-packets.
> > So in that case, there are UDP options in both headers and trailers in
> > the same packet.
>
> Again, that happens for legacy packets too - the existing UDP header is in the front and options are in the trailer.
>
> > If that's true, then a device that can't handle
> > protocol headers can't handle the case where there are trailing
> > options in the last fragment.
>
> I can’t parse this in a way that makes sense. A device that can’t handle protocol headers can’t do UDP’s existing header.

> A device that can’t ALSO handle trailers can’t process UDP options for non-fragment packets.

Joe,

To be specific, a device that can't handle protocol trailers would not
be able to process UDP options in the trailing surplus area.
Non-legacy mode, when UDP length is zero, can carry non-fragmented
packets. In non-legacy mode, such a device would be able to process
UDP options if they were contained in the headers of the packet.

Consider that there are whole classes of devices that terminate UDP
but will not be able to process protocol trailers. For instance many
routers that terminate VXLAN can only append headers for TX and can
only process headers in a limited parsing buffer on RX (these same
routers probably cannot compute the UDP checksum either which was the
motivation for RFC6935 and RFC6936). Can the benefits of UDP options
be enjoyed in an environment with such devices?

There will be deployments, say limited domains, that don't need or
want support for legacy mode and have devices that can't support
protocol trailers anyway. For example, consider a user who wants to
use UDP options but is only interested in fragmentation. Since the
fragment TLV lives in the headers this deployment scenario is
technically viable since protocol trailers are not involved. Is the
user allowed to use UDP options in this case?  If the answer is yes
then what is the correct behavior if someone misconfigures a node to
start sending options in protocol trailers? Does a receiver need to
drop the packet, ignore the trailer options, etc.?

Elaborating on this scenario, suppose a payload compression TLV is
developed. SImilar to fragmentation, this is a type of data transform
so the option must be processed and hence cannot be used in legacy
mode. Again, it seems like the user can safely configure this for
non-fragmented packets in non-legacy mode by doing per packet
compression where the compression TLV lives in the headers. But what
if the user wants to use fragmentation and compression at the same
time (i.e. because compression is more efficient over larger blocks of
data)? Per the current draft, I don't believe they would be able to do
this, since the compression TLV would need to be in protocol trailers
which their devices couldn't process. But if the compression TLV were
to appear in the headers then our user would be able to do this.

Eliminating the reliance on protocol trailers in non-legacy mode would
also reduce packet overhead. In the last fragment TLV, there are two
pointers: one to the start of the fragment data and one to the start
of the protocol trailer. If there are no protocol trailers then the
latter pointer is unneeded and can be removed saving two bytes and
making the format of the two fragment TLVs identical. Furthermore,
since all we need to know the length of the UDP options this could be
indicated by a single byte in a fixed header (perhaps with a
multiplier of four to allow up to 1020 bytes of options like in
draft-herbert-udp-space-hdr). This would reduce the size of the
fragment TLV by two bytes byte with a net savings of one byte, but
more significantly, when non-legacy mode is be used to carry a
non-fragmented packet, like in the compression use case described
above, a fragment TLV is not needed at all and so the packet overhead
is reduced from twelve bytes to one byte.

Furthermore, placing the options that apply to the reassembled packet
in the first fragment instead of the last allows some nice
implementation optimizations. For instance, with the aforementioned
compression TLV we could decompress packets as they are received
instead of waiting to get the final fragment before starting. Also,
there's the possibility that the final fragment might contain a
mandatory option that the receiver doesn't understand and so the
reassembled packet needs to be dropped; if the option is in the first
fragment instead of the last, the action to drop the packet can be
detected much earlier so fragment data received in subsequent packets
does not need to be stored which avoids unnecessarily tying up memory
resources in reassembly with data that is never used for anything.

Tom

>
> > If those options were in the headers
> > instead, then it could handle that case. Or maybe the idea is that a
> > receiver can ignore options after the last fragment data since they
> > are in trailers like legacy mode?
>
> The idea is that, after reassembly, UDP processing *continues exactly as it would for a non-reassembled packet.
>
> Those trailing options apply to the WHOLE reassembled packet, not just the final fragment.
>
> Joe
>
>