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

Joe Touch <touch@strayalpha.com> Mon, 15 July 2019 16:15 UTC

Return-Path: <touch@strayalpha.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 2905B1202AF for <tsvwg@ietfa.amsl.com>; Mon, 15 Jul 2019 09:15:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.219
X-Spam-Level:
X-Spam-Status: No, score=-1.219 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, MIME_QP_LONG_LINE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=strayalpha.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 6YrJaY-V3Miz for <tsvwg@ietfa.amsl.com>; Mon, 15 Jul 2019 09:15:12 -0700 (PDT)
Received: from server217-3.web-hosting.com (server217-3.web-hosting.com [198.54.115.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 41CFA12011C for <tsvwg@ietf.org>; Mon, 15 Jul 2019 09:15:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=strayalpha.com; s=default; h=To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CNIl8Wb7sdKi3r3sENEI7Fa8ofAOywpr3qZZzpo/Jw0=; b=LIHp2LqiAGpuF5X4QQtX7wl/2 9+fehcXsTKqZQya4VDm3sJ8CzUmaFe3mMnnNcZS+GNz6wJH35pBDcJpoeQZN1gV0wqPVlwl7N5/sD fRJChf09acF427T8BWrideX6myKJNKccy3Te5QKObbNtJQaCsUeX0C44ChUig3vZVgEspegwJHth2 um/KGg01Be/X/4XTr02ANRSxWczuQsljU6tBBD9ftAcA0HdIFi/XFLNQiNVwzt1+4emm21t7iEzyO p7rRsIwUcptgybAw3P2TGR9EElgYq1BZmwqGlqAXZQZsw08cCXTSqjIQIDLy7GDQftGkD1qjA7ij6 U7NO9373A==;
Received: from [38.64.80.138] (port=56920 helo=[172.21.15.50]) by server217.web-hosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <touch@strayalpha.com>) id 1hn3cx-000kkH-M2; Mon, 15 Jul 2019 12:15:05 -0400
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (1.0)
From: Joe Touch <touch@strayalpha.com>
X-Mailer: iPhone Mail (16F203)
In-Reply-To: <CALx6S34YhtgNNJtHazqJdsGRhiMa4PQXiSOuDz0JhqqyHWfNyA@mail.gmail.com>
Date: Mon, 15 Jul 2019 09:14:59 -0700
Cc: Derek Fawcus <dfawcus+lists-tsvwg@employees.org>, tsvwg <tsvwg@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <757FDD92-EC4A-4AC2-B491-74B75119A951@strayalpha.com>
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> <CALx6S34YhtgNNJtHazqJdsGRhiMa4PQXiSOuDz0JhqqyHWfNyA@mail.gmail.com>
To: Tom Herbert <tom@herbertland.com>
X-OutGoing-Spam-Status: No, score=-0.5
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server217.web-hosting.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - strayalpha.com
X-Get-Message-Sender-Via: server217.web-hosting.com: authenticated_id: touch@strayalpha.com
X-Authenticated-Sender: server217.web-hosting.com: touch@strayalpha.com
X-Source:
X-Source-Args:
X-Source-Dir:
X-From-Rewrite: unmodified, already matched
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/Y0zEQt9GPON4-hSiDLxbpTZt5-w>
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: Mon, 15 Jul 2019 16:15:18 -0000


> On Jul 15, 2019, at 8:50 AM, Tom Herbert <tom@herbertland.com> wrote:
> 
>> On Sun, Jul 14, 2019 at 8:52 AM Joe Touch <touch@strayalpha.com> wrote:
>> 
>> So, *given* that we *are* different from UDP and TCP, i.e., we do NOT have the luxury of a fixed-offset location for this checksum
> 
> Joe,
> 
> There's no requirement that precludes defining a fixed header that
> precedes the surplus space.

It clearly can’t be a fixed location. Thats all I was asserting. 

Or do you disagree?

>> - why does the offset distance matter, i.e., front vs. end?
> 
> Because some implementations assume that checksums are in protocol
> headers towards the beginning of the packet. For instance, for
> checksum offload the e1000e NIC stores offsets of checksum start and
> checksum field in a byte. If either offset is greater than 255 then
> the checksum can't be offloaded to the hardware.

That’s a nonstarter. We cannot make that limit. Any other reason?
> 
>> - how *MUCH* does the offset alignment matter, keeping in mind:
>>        - no offset might require 1 byte-swap at some point, but consumes the least space
>>        - half-word alignment wastes 4 bits on avg.
>>        - full-word alignment wastes 12 bits (1.5 bytes) on avg
>> 
>> In comms, the typical figure of merit is 1 opcode per bit. So, IMO:
>> 
>> - if we can save 4 bits with 4 or fewer opcodes, it’s a win
>> - if we can save 12 bits with 12 or fewer opcodes, it’s a win
>> 
> The tradeoff between maintaining alignment and efficiency in overhead
> is well known. For instance RFC8200 states:
> 
> "Individual options may have specific alignment requirements, to
> ensure that multi-octet values within Option Data fields fall on
> natural boundaries"
> 
> Note RFC8200 does not require option alignment; per robustness
> principle receivers should be prepared to deal with unaligned options.
> However, also by the robustness principle senders should send aligned
> options especially if they want to minimize the chances that a
> receiver drops packets or relegates them to slow path processing.
> Personally, in my implemenation and protocols, I will always align
> protocol fields to their natural boundaries if possible-- I have never
> seen any complain about too much space being wasted for alignment, but
> I have seen issues when protocol fields were unaligned.

That would be good reasons for a SHOULD, but clearly not a MUST - regarding starting aligned. 

Joe

> 
> Tom
> 
> 
>> My assumption is that offload engines or the core processor need to do “non-halfword length” cleanup regardless.
>> 
>> That cleanup should be at most 5 opcodes:
>>        load
>>        mask the addend
>>        add w/carry
>>        mask the sum (for the 1’s compl wrap)
>>        add w/carry (for the 1’s compl wrap)
>>        swap (if not half-word aligned)
>> 
>> That suggests we’re either very close to no real penalty for “no offset” or that we win by using at least half-word offset.
>> 
>> Note: the alignment overhead will also NEED to be zero - and checked that it’s zero, which are additional opcodes needed that are not too far from the cleanup ones above.
>> 
>> i.e., given the similarity of the zero-check and the cleanup, why is it useful to waste these bytes?
>> 
>> Joe
>> 
>>> On Jul 13, 2019, at 11:49 AM, Tom Herbert <tom@herbertland.com> wrote:
>>> 
>>> On Sat, Jul 13, 2019 at 11:26 AM Derek Fawcus
>>> <dfawcus+lists-tsvwg@employees.org> wrote:
>>>> 
>>>>> On Thu, Jul 11, 2019 at 07:07:39PM -0700, Joe Touch wrote:
>>>>> 
>>>>> Not sure I follow here - so there are only a few variants that seem viable:
>>>>> 
>>>>> 1.- at the front of the surplus space
>>>>> 2.- at the front of the surplus space after alignment NOPs
>>>>> 3.- at the end of the surplus space
>>>>> 4.- at the end of the surplus space with alignment
>>>>> 
>>>>> AFAICT, there’s no real help in requiring OCS be aligned (it can be designed to tolerate any alignment), which means we don’t need #2 or #4.
>>>> 
>>>> Agree.  I see no need for alignment.
>>>> 
>>>>> So what’s preferable here? #1 or #3?
>>>> 
>>>> Not sure.
>>>> 
>>>> I'd be inclined to pick 1, but could be convinced that 3 is better.
>>>> 
>>>> If we're talking of h/w offload engines [*], I imagine that they could
>>>> handle 'write to 2 bytes before end of packet' more easily than
>>>> 'write to start of surplus'.
>>> 
>>> Derek,
>>> 
>>> It's the other way around because offload engines are primarily built
>>> to deal TCP and UDP checksums which have always been in headers
>>> towards beginning of the packet. Similarly, HW can optimize for
>>> checksum being aligned since UDP and TCP checksums have always been
>>> aligned.
>>> 
>>>> 
>>>> DF
>>>> 
>>>> [*] How many do this with random logic?  My current impression is that
>>>>   most such devices are programmable cores, e.g. ARM or MIPS cores.
>>> 
>>> Actually no, checksum offload is in ASICs and maybe some FPGA. NICs
>>> are getting cores now in so called Smart-NICs, but those are more
>>> likely to be applied towards more complex protocol parsing and
>>> processing. CPUs in the NIC won't fundamentally improve how checksum
>>> offload, the solutions for that are well established and understood.
>>> 
>>> If you're interested, we will be presenting a technlogy deep dive
>>> @IETF105 that will cover a lot of topics around NIC technology:
>>> https://datatracker.ietf.org/meeting/105/materials/agenda-105-tdd-01
>>> 
>>> Tom
>>> 
>>>> 
>>> 
>>