Re: [tsvwg] Alternative version of the UDP FRAG option

Tom Herbert <tom@herbertland.com> Sat, 16 March 2019 20:21 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 8F4FF130DEC for <tsvwg@ietfa.amsl.com>; Sat, 16 Mar 2019 13:21:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] 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 S7pvA7M4mTyH for <tsvwg@ietfa.amsl.com>; Sat, 16 Mar 2019 13:21:05 -0700 (PDT)
Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (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 CB6D1130DDA for <tsvwg@ietf.org>; Sat, 16 Mar 2019 13:21:04 -0700 (PDT)
Received: by mail-qt1-x842.google.com with SMTP id z17so13898517qtn.4 for <tsvwg@ietf.org>; Sat, 16 Mar 2019 13:21:04 -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=M6muG+F7QDw7nUvKKxWpDBFMU7JAYwT7NvLe5tMeEGs=; b=TvY7JBOoPCoxm/6pmzvS3MFyZpUS9E2+7MJ0LQfnuSEG1v74ZKUYhKkv3U8sfYkRrA q2rr9+IVpUQeN3ylQ/rDQhHW64ZSl7Si4AnN9ca17po6NHGz9xzTzk5KGidOzKVjOB0C p8cpXSd+PORDJC01tplbrB+A6RW16LtG5Ak10Ou3kjHUlBEQF8owNdAG/Hd2rI0ZFz2i 4XX0yAuUdNHnKSXmGMV1Obqe9VBwh7kXVmrZUle+NjS0AQ+2hCs0PBfVv4rN45bbIU1j PJJBgqOQhC8Q/vfFy+Zi6HIfD8Cx5gSHcKVw1uHRanZwi5hm+uEU7tBS361RUwqi7aYd /v2g==
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=M6muG+F7QDw7nUvKKxWpDBFMU7JAYwT7NvLe5tMeEGs=; b=GPsCL5SYThYB/V9yDSWHL48aIDkKvIsuv+UwBZDDcDU7xn9KylAo+qG3waze7I3W3r dxTtKr4TBtt7jVKFoKpuiVQNI+iiDUsul3p2gndnzj+FdjwsquHMmnIDiwDDKPnZ/m0u gOFc7zgcUX0HEntZ6OUNyxQF5aOsMUpd8PsSa8FrjjS8m9xPYezE8HCpmr/LPphF1+U4 iqOHfMVdzk6SPujzwPri8BsZFjTCQcZc7M5F37s4ct2js/Pi+A843HYjfXeAu1vz6w4A I1w5sszLAoGGj/Cr0qHDfU11Ti5mdhzLpkS27dYdHLj81B8OMfSLL7dOTuyLqMdg3KBG Zetg==
X-Gm-Message-State: APjAAAWExeLuIrjm2n5Hgzeng3Njy3mO+Iqqj1257bAT0ZUUpjlnEnrH aL7QutN2gMO6nQ0GlU8UCuNwJ/yqSnDhV3tFyeNEpFcJ+DE=
X-Google-Smtp-Source: APXvYqzmtwh7Zouv7M2lRqSP10wnx1O7/N95cCkjARXAMLC9IcofOL1p9UtsJ2d1fuvxOiCfhdl5ge8KkZU5W+d1GjY=
X-Received: by 2002:ac8:2c5a:: with SMTP id e26mr7943571qta.189.1552767663743; Sat, 16 Mar 2019 13:21:03 -0700 (PDT)
MIME-Version: 1.0
References: <CACL_3VE1=0OORUuOKg9GjcdVuhBNTkWhymE7PAs5WYO0ZR0DWQ@mail.gmail.com> <CALx6S37y_AbESyX5PcCSu7NEr-uPVrPXksEeAx5aSNAyqshL6Q@mail.gmail.com> <FB9C6714-4742-4730-A439-B6FAA6054C5D@strayalpha.com> <CALx6S346xiDyHR3Ww=da+GJiAD7RDeEd6ZSx77k2ODqqX2s_CA@mail.gmail.com> <273890DF-B1B3-4AB7-A7A8-CE4679E93EB0@strayalpha.com>
In-Reply-To: <273890DF-B1B3-4AB7-A7A8-CE4679E93EB0@strayalpha.com>
From: Tom Herbert <tom@herbertland.com>
Date: Sat, 16 Mar 2019 13:20:52 -0700
Message-ID: <CALx6S36fQhU-1qi+_RZ1CNm_KQHZat24+43NZeX0TRgPtXPhxw@mail.gmail.com>
To: Joe Touch <touch@strayalpha.com>
Cc: "C. M. Heard" <heard@pobox.com>, 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/dBV_xjwpEqztnBbv6IvZ96QE2r0>
Subject: Re: [tsvwg] Alternative version of the UDP FRAG option
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: Sat, 16 Mar 2019 20:21:07 -0000

On Sat, Mar 16, 2019 at 12:06 PM Joe Touch <touch@strayalpha.com> wrote:
>
>
>
> On Mar 16, 2019, at 11:37 AM, Tom Herbert <tom@herbertland.com> wrote:
>
>
>
> On Sat, Mar 16, 2019, 11:21 AM Joe Touch <touch@strayalpha.com> wrote:
>>
>>
>>
>> On Mar 16, 2019, at 9:06 AM, Tom Herbert <tom@herbertland.com> wrote:
>> Hi Mike,
>>
>> Thinking about this, it occurs to me be that the LITE option isn't
>> needed.
>>
>>
>> AFAICT, there is no LITE option the way you have been trying to evolve it.
>>
>> The assumption in the UDP options draft is that a receiver
>> needs the UDP payload to immediately follow the UDP header, but the
>> UDP payload can be anywhere in the surplus area as long as it's
>> aligned to four bytes. A receiver will know how to handle it and
>> deliver the UDP data to the application (e.g. by maintaining a pointer
>> to the data).
>>
>> So that allows a format like:
>>
>> UDP header (Length=8) | Surplus area header | Options | Payload
>>
>>
>> That’s DOA for legacy receivers.
>
>
> Legacy receivers see a UDP datagram with zero payload, just like LITE.
>
>
> I misunderstood payload to also include cases where Len > 8. Fair enough.
>
>
>>
>> It also basically kills zero-copy.
>
>
> Exactly how does it do that?
>
>
> Zero copy UDP would need to I’ve the lite payload after it has already been placed in memory. That’s not true for the current approach (it was a design goal, in fact, to allow it).

Joe,

Zero-copy can be used for both send and receive. A good background
description is in https://lwn.net/Articles/726917/

Sending is the easier of the two. Zero-copy send just needs simple
scatter-gather support. There are two buffers, one contains packets
headers and the other contains the data (e.g. a page from the page
cache). Packet in metadata (e.g. an skbuf) looks like
Header_buffer->data_buffer. The protocol headers are arbitrary (TCP,
UDP, IPv6, encapsulation, ULP headers, etc.). Protocol trailers
complicate this since the metadata now looks like
Header_buffer->data_buffer->trailer_buffer. I'm not sure that is
easily supported with current implementations. Also note, in zero copy
we're not allowed to touch the data memory so the byte swap done in
LITE can't be done in the data buffer.

Receive zero copy works in two modes: mapping receive buffers and
header data split. Mapping receive buffers (i.e. to userspace) allows
zero copy. The application gets pointers to data and extent, but they
also can access the headers and possibly data that from previous
received that wasn't overwritten-- so there are security concerns. The
data is rarely aligned to what is most useful for the application
(like we might want the receive data for a disk block to be page
aligned). Header-data split is intended to solve that problem, however
it requires the network device (NIC) to understand the ULP and locate
the application data (naively spitting out UDP or TCP data like some
early NICs did doesn't help). Programmable devices might be help solve
this problem. For protocol trailers, there is a new convolution since
now the device would need to do header-data-trailer split.

A related mechanism is parsing buffer. Parsing buffers are used in
hardware devices that want to inspect the headers of different layers
in a packet. It's basically a cache that contains the first N bytes of
a packet that can be processed. N is something like 128, 256, or more
recently 512 bytes. If the headers they device is interested in is
beyond the extent of the parsing buffer then the device may take some
undesirable action like dropping the packet or relegating it to a slow
software path. Protocol trailers are likely to be a problem for
devices with parsing buffers that want to inspect the trailers.

Tom

>
> Joe