Re: [tsvwg] RDMA Support by UDP FRAG Option

Tom Herbert <tom@herbertland.com> Sun, 20 June 2021 01:01 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 C16703A113C for <tsvwg@ietfa.amsl.com>; Sat, 19 Jun 2021 18:01:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.003
X-Spam-Level:
X-Spam-Status: No, score=0.003 tagged_above=-999 required=5 tests=[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 UF_PAK43BrIy for <tsvwg@ietfa.amsl.com>; Sat, 19 Jun 2021 18:01:21 -0700 (PDT)
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 EF31C3A113B for <tsvwg@ietf.org>; Sat, 19 Jun 2021 18:01:20 -0700 (PDT)
Received: by mail-ed1-x52e.google.com with SMTP id i13so13831854edb.9 for <tsvwg@ietf.org>; Sat, 19 Jun 2021 18:01:20 -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=XA8ILUVadVgdVNZgTJqRNCrCwnbXx9a+wMsAahfs13Y=; b=zgzN/eFxacGKnn+HITUjXo2UlwwyKxEjRrvSlL8QocD5W2MdCgrKd09iN15sX1/xVJ SKxizMarlzShEaZ6zmvnPRuTgRWXwGFTVyFRMaXWt6C5EaOsUmPf8vcF+rCluW0OqBVf tWEjVxehYVLaHXSEuQVr6Ib9pLs9wvtwmgkH8dSkuoCcALqrnZ0xqh9Qn/Ut8WPxpm64 JhtPIfzhQjGbc9nYhujRMm2bukAEfKqFC60hv3m8vghtCuOkZrFrHnBbhmdsJHVn9VEx FURjec2CVGxRErADKBLxSyw65SZI5IPyY/Vw/qCjMGQGGTmxpKXVVWAg2Ouv9IF6+tcK N0vw==
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=XA8ILUVadVgdVNZgTJqRNCrCwnbXx9a+wMsAahfs13Y=; b=GBsNz9vEWHKU7vDI1oZdE99FdfbA90B28Q/j7BylQTfmw87CzLIKzq9MVFPkYrUnuD 7G0NMq1cWlOIyYbDaQNvwyvMnp19bQMq1Axf/8HczB0aAg2fzeE1ltEAXHmyXn/TVD4g tHKDX7e5jKfA4KvHaSHG21bKmPTB2aB9LBOwz6hROsnZFQQK7cv1WMONkBSIKOslJ93I gpzq4uXVbvfwo8JlllIduTijHq7vzXzMpWNa1DNfilI/Sod7hFP0uEkvGINKGw+ANGbz VxNRp/hSM1f00dsG5gjqq8aHE9AnqWK0Ol62LZ85X5m7EYtaMKw0uhFSOeB0BesMpFrw Gn9A==
X-Gm-Message-State: AOAM532OhtFUBrw/j/aqhX7Vbny4khJ2aixSH8zsqAfi82V8gl63jjwb KDpfA1J7vcPNSs9M12e/rQIBv47j6FwOUYQo+GOJfw==
X-Google-Smtp-Source: ABdhPJyxdTMzClVSGs+CRnNg5db3RqZs2NTUS/3yADPhzCgPOy5NMk1U0gsSQq9wBqbVXVlI6WVBUzIVYAL7bBYg0ko=
X-Received: by 2002:a05:6402:26c7:: with SMTP id x7mr13268517edd.383.1624150877677; Sat, 19 Jun 2021 18:01:17 -0700 (PDT)
MIME-Version: 1.0
References: <CACL_3VEyLdQZ-3hvzXxyA8ehtWs2hXESZ2OqyAx+BeSg85+-cA@mail.gmail.com> <CACL_3VFE4TjKvmkfZjvNpWo6vVfKjz5w85=Q+yqnYZKcwbYLmQ@mail.gmail.com> <63FFC34B-2179-47F1-B325-21CAC3D1543A@strayalpha.com> <CACL_3VHTfxWaBj7TFEmBXBqovrrAj7XuFEZFUag_iBHr3Hx09g@mail.gmail.com> <0EBFC9B0-591A-4860-B327-6E617B83F4D1@strayalpha.com> <CALx6S34pT81TbfQDk2vKF8wBrXL312As79K=rEzUQ3Lmg7UvpA@mail.gmail.com> <7C51D926-9DBB-41F5-93B2-10F716F672B1@strayalpha.com> <CALx6S37uN8TsXQZ3cv5jmxwxSyBRjK=-GQ_MsWxPWSs21XoGHw@mail.gmail.com> <CACL_3VEx7+VnLz7OLdXyhZU41e+-oBz3dc8JdMV_7pLMfic6=w@mail.gmail.com> <fcc8762f-c042-7999-d2e4-f28384950a19@erg.abdn.ac.uk> <CALx6S36sWGcZmFpAhF4DfOMyf6Z0w5F9bemNfeM1yWV-r0M+BA@mail.gmail.com> <8af3abf9-943f-13c1-e239-5efca27cf68c@erg.abdn.ac.uk> <CACL_3VHdyLAmzMbWsTVfJD+4tTzsMvcTzKS1B1CAdZ3k5U957g@mail.gmail.com> <CALx6S34DUrUBYd94LPPg4Hgh0FnZYZjZ4eKEYuaxb-7zbzb=pQ@mail.gmail.com> <CACL_3VEq9R=HmWXGbu_zcrgWfG0=q0z+HWM3cQ9Vh68hTCUR-w@mail.gmail.com> <CALx6S35bdGwY8FagGn8x5CaO4O3zW3U+NnB5ejC7bB6BHsXtJg@mail.gmail.com> <CACL_3VFwUJzT7uiXh33gBffboqqb51uFWJAEh290SsD0=aAzaQ@mail.gmail.com>
In-Reply-To: <CACL_3VFwUJzT7uiXh33gBffboqqb51uFWJAEh290SsD0=aAzaQ@mail.gmail.com>
From: Tom Herbert <tom@herbertland.com>
Date: Sat, 19 Jun 2021 18:01:06 -0700
Message-ID: <CALx6S34Lai=YS8i1VTC1zKHqsCTt_XUeKfwob7Qe_BA49bHC3A@mail.gmail.com>
To: "C. M. Heard" <heard@pobox.com>
Cc: Gorry Fairhurst <gorry@erg.abdn.ac.uk>, Joseph Touch <touch@strayalpha.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/7X74n0UwoSbqwnISkjx3XHE15oE>
Subject: Re: [tsvwg] RDMA Support by 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: Sun, 20 Jun 2021 01:01:26 -0000

On Sat, Jun 19, 2021 at 4:40 PM C. M. Heard <heard@pobox.com> wrote:
>
> On Sat, Jun 19, 2021 at 11:09 AM Tom Herbert wrote:
>>
>> On Sat, Jun 19, 2021 at 11:01 AM C. M. Heard wrote:
>> > Is there a use case for employing UDP options with GRE/UDP? Or GUE?
>>
>> We can divide UDP encapsulations into two flavors. Those that are
>> extensible and contain their own TLVs or equivalent method to encode
>> ancillary data, and those that don't have that. GUE and Geneve are
>> examples of UDP encapsulation protocols that have their own
>> extensibility mechanisms and hence wouldn't be used with UDP options,
>> GRE/UDP and VXLAN don't have extensibility so UDP options could be
>> useful with those protocols.
>
>
> OK, thanks. To loop back to your original point:
>
>>
>>  The stack will attempt to offload the innermost checksum which is the
>>
>> TCP checksum. The TCP checksum is the one offloaded regardless of
>> whether or not the outer UDP checksum is zero (if it's non-zero then
>> the stack would set it using local checksum offload (LCO)). The
>> offloaded TCP checksum computation would start the computation at the
>> first byte of the TCP header through the end of the whole packet. So
>> unless the surplus area is properly checksummed then the computed TCP
>> checksum will be invalid and the packet will be dropped at the
>> receiver. This is not just a problem for offload for offload, I
>> believe that this wouldn't work properly in existing software stacks
>> without some major changes.
>>
>> So to make all uses of transport checksum computation and offload
>> reasonably robust, when the UDP surplus area is being used both the
>> UDP checksum and checksum over the surplus area MUST always be set.
>>
>> FYI, here is some nice background checksum offload is
>> https://www.kernel.org/doc/html/latest/networking/checksum-offloads.html
>>
>
> This was also helpful: https://www.ietf.org/proceedings/95/slides/slides-95-nvo3-3.pdf
>
> Even after looking at the referenced material, however, I must confess that I still need clarification on the following points:
>
> 1.) I do not understand why the UDP checksum (or anything prior to csum_start) would matter for the inner packet checksum offload.
>
It's relevant to checksum offload where devices can only offload one
checksum in the packet hence the best one to offload is the innermost
one since we can take advantage of techniques like LRO.

> 2.) Assuming that the trailer checksum (OCS) is present, it is not clear how offload for the inner packet checksum could be expected to work properly without change. Remember, OCS does not cause the data in the trailer to sum to zero. It causes it to sum to the ones-complement of the trailer length.
>
Regardless, of anything else, the hard requirement is that all
checksums in the packet must be correctly computed when transmitting.
If we are offloading a checksum in the packet, be it the outer UDP
checksum or an inner TCP checksum, the result must be correct. So if
there's bits in the surplus area and that the offload checksum covers
then the surplus area needs to sum to zero or whatever value is
necessary to ensure the offloaded transport checksum is correctly
computed.

> The modifications needed to handle point #2 are small -- specifically, adding the trailer length to whatever would normally be preloaded into the inner packet. The FRAG proposal in draft-ietf-tsvwg-udp-options-13#section-5.5, which proposes to sandwich the payload in between option headers, would make it a whole lot harder.
>
Protocol trailers are a fundamental problem. At this point it's not
clear to me that there is a way to make them work correctly in all use
cases with deployed HW.  Protocol headers, like those used per FRAG,
shouldn't be a problem,

Tom

> Looking forward to your reply.
>
> Mike