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

Joe Touch <touch@strayalpha.com> Sun, 14 July 2019 15:52 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 0A997120291 for <tsvwg@ietfa.amsl.com>; Sun, 14 Jul 2019 08:52:17 -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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, URIBL_BLOCKED=0.001] 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 0S8CQDI3o6Nc for <tsvwg@ietfa.amsl.com>; Sun, 14 Jul 2019 08:52:15 -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 52FDE120280 for <tsvwg@ietf.org>; Sun, 14 Jul 2019 08:52:15 -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=wKXkdn84+luBBYyoAOuUf7Wz+uRZ+2u4a5D38I1xMSk=; b=f4LCo6acMU1idPFERgZq5O6uP 7e1G8FZI/BMmoThuZ5jcfm8MQawFpprkSqImiFmFO4kXzPxMrHw2QVS0e/v+Aod/DGEa74EyuiOqH mho4kDC0jhHcbSy2PU3mTXCqdenYMAomdu/h4pBM3ZQvAW+gMZ5VDzIzacMXPSRHFJ8LAmoJrU3BF SCzAfMo4q8pLE4wIwMcigzgxGeXQwzLn8txB4iDGcvM3OSIgle1GhoVQB7Z510rL0S0jGvfp/Fbl6 uKUtup+D+NqDgWPQfwKJ4BIgcf2rPaSnOQrytlfY4Ym0Tpb7R1NvZHcPpjzBrBfLe1w6bAO2rwH9X K1sLs4W/A==;
Received: from cpe-172-250-225-198.socal.res.rr.com ([172.250.225.198]:63699 helo=[192.168.1.10]) by server217.web-hosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <touch@strayalpha.com>) id 1hmgnJ-001VA1-G3; Sun, 14 Jul 2019 11:52:14 -0400
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Joe Touch <touch@strayalpha.com>
In-Reply-To: <CALx6S36mH2M6SYnRSecWXa7k_d1u8O43+CXE-=KqeO0x2e5+qw@mail.gmail.com>
Date: Sun, 14 Jul 2019 08:52:08 -0700
Cc: Derek Fawcus <dfawcus+lists-tsvwg@employees.org>, tsvwg <tsvwg@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <82FF6486-FABF-4D2C-B5E2-178779C720A4@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>
To: Tom Herbert <tom@herbertland.com>
X-Mailer: Apple Mail (2.3445.9.1)
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/vo1J2mjFjr7UKgfAHzKttOxfaDo>
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: Sun, 14 Jul 2019 15:52:18 -0000

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:

- why does the offset distance matter, i.e., front vs. end?
- 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

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
> 
>> 
>