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

Tom Herbert <tom@herbertland.com> Sun, 01 August 2021 17:04 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 591773A0A46 for <tsvwg@ietfa.amsl.com>; Sun, 1 Aug 2021 10:04:07 -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 PPqv1nRRXVtQ for <tsvwg@ietfa.amsl.com>; Sun, 1 Aug 2021 10:04:02 -0700 (PDT)
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 E88AC3A0A42 for <tsvwg@ietf.org>; Sun, 1 Aug 2021 10:04:01 -0700 (PDT)
Received: by mail-ej1-x636.google.com with SMTP id go31so26869084ejc.6 for <tsvwg@ietf.org>; Sun, 01 Aug 2021 10:04:01 -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=kxxQYJU57SF/BnfU48VmFC4ifYTu0YKKjtI0R2qfZ/Y=; b=EMNNhO6Xrl+g507O1xGVwuQ0xiT/03WYiN5p645oVBxGvtAFaVzrqRzqBFm9tSlhmD Kk1mqrwZjcpwGODK1XhcUGtdDOjDW+aVkmbg0eYcIRjV8vZ6wSiOZ4fDVMkNgnyZtEMo UG1d6xJfdr7RzyOMJsZ948d/Iqneux2yKkfwKe+Zd2AWneboajrf12voBZF9xTHBOwAe u4Z3En01ug8AOrfg71vgC1QRAGhOdp9sJ0VNTQLiF/3+WXqEojSMdwoaiktCYq5cxlmj xvu2BbHMDwWyexa8DlGLEL1yURaaXllWm8TGl2Ma1VFh1s+2ul8T6IW13RoYtoWvrtFd 0kNA==
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=kxxQYJU57SF/BnfU48VmFC4ifYTu0YKKjtI0R2qfZ/Y=; b=ONWP3Yt93Y7pffd34rQ4l4Ey3rjmQpLZNIhlhZf7Xc+M4JMWV8+7nefkIpTkds+OTt rhVvy6XR+2VUehrxKsNFpMxzkQxoZ2S03aZ4FCgwDvnHFfJ8+TIdld6ewceO9aA9IeFZ GOl2KmFeMPZhcJ0G4sR6QQPRZ8Vha51frHWv8EJOQFTeKGcSzw/kyiL1Sw0rfUx0hjdg jF6YbBBKVMyMnz481yK7/e8yrWptRDrruXV+yQIjllKr/jgkIQfqchL3DFd1oGNefphz i3r89Z5CyG7L55l7dAgLkSVDlk9lL9fm/mJ6xKr0GbXZe5WHRbPXiJN1y5DGK7f43WR3 RdoA==
X-Gm-Message-State: AOAM532fOlyJ9cSjt1AshVWZM139w1Zl5pqC9QIRj8pF8JKZfpInwdRl 5EKh/2SV8Bj5mr9jRMyEYJL/w+Rx8McAq8NK/guOaA==
X-Google-Smtp-Source: ABdhPJyT/W5Zi0G2IU9lCRd/eG4ipeAfGFHntjx0RnrcbLEwE1boYZ1E3ycusIllKoZDrsRO+vGWUUnKGRcDip8prNo=
X-Received: by 2002:a17:906:c20d:: with SMTP id d13mr11610857ejz.259.1627837438841; Sun, 01 Aug 2021 10:03:58 -0700 (PDT)
MIME-Version: 1.0
References: <CALx6S37zVVXnCH+Dv7_QXgwOoqcL4h0SThh+LnmAWn-5enprZQ@mail.gmail.com> <FA155FD9-2319-405C-B082-C023DEC2BF28@strayalpha.com> <CALx6S3435ZjAz8ECgbFbH=Hxm-cXAGRQjTbxgtGb9U-CTXMw=A@mail.gmail.com> <C8CE3912-55B2-4DC0-AB39-2D6EA6953500@strayalpha.com> <1178DE92-175A-4293-8A97-9B6FEBAF7B02@strayalpha.com>
In-Reply-To: <1178DE92-175A-4293-8A97-9B6FEBAF7B02@strayalpha.com>
From: Tom Herbert <tom@herbertland.com>
Date: Sun, 01 Aug 2021 10:03:47 -0700
Message-ID: <CALx6S35tB=j5y3-xr5S22y0p+WJxKX_hqk8rm30oCruFxZp5Dw@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/2epV2bpwiY2DaJT0NZrwCaCsUZU>
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: Sun, 01 Aug 2021 17:04:07 -0000

On Sat, Jul 31, 2021 at 2:17 PM Joseph Touch <touch@strayalpha.com> wrote:
>
> FWIW, there’s another option here, which could be considered unnecessarily complex if there’s no need for per-reassembled datagram options for most UDP tunnels….
>
> ----
>
> Right now, the terminal fragment has a header as follows:
>
>                    +--------+--------+--------+--------+
>                    | Kind=4 | Len=12 |   Frag. Start   |
>                    +--------+--------+--------+--------+
>                    |           Identification          |
>                    +--------+--------+--------+--------+
>                    |  Frag. Offset   |    Frag. End    |
>                    +--------+--------+--------+--------+
>
>                 Figure 12   UDP terminal FRAG option format
>
> As to whether to put the per-reassembled options before or after the terminal fragment, we could let the user decide (again, consistent with the idea of UDP), as follows.

Joe,

I suggest that the per-reassembled options be in headers in the first
fragment. This would work by specifying that options preceding the
fragment option are per-packet, options following the fragment option
in the first fragment apply to reassembled packets, and options
following a fragment option in non-first fragment would be ignored.
So, in this manner fragments don't have any protocol trailers and
therefore Frag. End isn't needed and can be removed from the fragment
option saving two bytes (the end of the fragment would coincide with
the end of the packet). As I mentioned previously, there are other
advantages to placing the options that apply to the reassembled packet
in the first fragment instead of the last.

In the tunnel case we'd also cases where UDP options might be sent
that are not fragments, however we still need to know where the
payload begins. In the fragment option this is the Frag. Start field,
but sending a whole fragment option just to convey these two bytes of
information would be way overkill. IMO a better approach is to
indicate the length of the options in a fixed header preceding the
options since the information is always required.
draft-herbert-udp-space-hdr-00 defines such a fixed header. In that
format, the options length is expressed in one byte with a multiplier
of four, so that would allow up to 1020 bytes. I know that the does
set a limit, however consider that (AFAIK) no one has ever proposed an
option or set of options in datapath protocol that would come close
needing that much space, the length of the options is already limited
by MTU where 1020 bytes already exceeds the Min MTU for IPv4 and is a
significant portion of IPv6 Min MTU, and also we know that allowing
unlimited options creates problems in itself (i.e. why we need to
limit IPv6 HbH and Dest Ops like in draft-herbert-6man-eh-limits).

Tom

>
> The code cost is small; this way an implementation could decide when it can use a single DMA or no. The only hazard is that the transmitter decides - but for the UDP tunnel case, given both sides already need configuration, it should be simple enough to encourage transmitters to use the preferred case.
>
> ----
>
> We could consider “Frag. End” to really just point to the start of the per-reassembled datagram options, so let’s instead call that field “Reassembled datagram option start”, or RDOS for short. Let’s assume there’s a “RDOE” (end pointer) as well, which we’ll compute.
>
> If so, then we could allow those options to be either before the start of the fragment (where RDOS < Frag Start) or at the end of the packet (where RDOS > Frag Start).
>
> If we allow that, then the code needs a condition to decide where the end of the packet is:
>
> if (RDOS < frag start)
> then  // single DMA case
> frag end = IP packet end
> RDOE = frag start - 1
> else  // receive processing same as for non-terminals
> frag end = RDOS-1
> RDOE = IP packet end
>
> At that point, the per-reassembled options are from RDOS to RDOE and the fragment is from frag start to frag end.
>
> ----
>
>
> On Jul 31, 2021, at 2:08 PM, Joseph Touch <touch@strayalpha.com> wrote:
>
> Right - per fragment options would be OK, not per reassembled datagram.
>
> Would that suffice?
>
> Joe
>
> On Jul 31, 2021, at 1:42 PM, Tom Herbert <tom@herbertland.com> wrote:
>
> On Sat, Jul 31, 2021 at 12:42 PM Joe Touch <touch@strayalpha.com> wrote:
>
>
>
>
> On Jul 31, 2021, at 11:58 AM, Tom Herbert <tom@herbertland.com> wrote:
>
> There’s no way that endpoint can ensure it never sees non-fragment UDP options, so it cannot support UDP options.
>
> For a tunnel, use of UDP options would just be another configuration
> parameter at the end points; we don't need negotiation to send
> non-legacy packets. If there's a mismatch in endpoint configuration
> then the operator simply detects it and fixes it like any other tunnel
> configuration problem.
>
>
> Ok, the simply don’t set any per packet options and I’ll be fine.
>
> I think you might mean the other way around. Per packet options are
> already defined in the draft to be in the headers, including the
> fragment option, so there's no issue concerning protocol trailers.
> There would only be a problem from options that apply to the
> reassembled packet which would be in trailers of the last fragment.
>
> Tom
>
> Joe
>
>
>
>