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

Tom Herbert <tom@herbertland.com> Mon, 15 July 2019 15:50 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 DDB0B1201F2 for <tsvwg@ietfa.amsl.com>; Mon, 15 Jul 2019 08:50:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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 7_0TUZnkPWAi for <tsvwg@ietfa.amsl.com>; Mon, 15 Jul 2019 08:50:54 -0700 (PDT)
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 2AC6A1201E9 for <tsvwg@ietf.org>; Mon, 15 Jul 2019 08:50:54 -0700 (PDT)
Received: by mail-ed1-x529.google.com with SMTP id k8so15966300eds.7 for <tsvwg@ietf.org>; Mon, 15 Jul 2019 08:50:54 -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=Ezu4RvsXRqbKkfiBh1sVCI2qnKnVuXfiyf0IqKIY0Eo=; b=sN0Yq6Z8cbkMRnP+XxxSEU22vOWjgvaOzQjj+KgN0uyvbbXy6uqFA9Hdnl1+vgw+ma oDfQgsChFR70cn/RcM9jK8yZWMCpNjBFvFYewDGMIAXZ2fZ6Lo4SIKVAgxZU9cgizuzl pnqFBOsJQtMCWEFjYe38cCKROmuy1UG7rFiefMwy5va8SOEPXpreGaDaWMqr46oRA3yB 53Q0rHZDsRQ4sPFj7JnSAVWbs0uYTtYUU7z5Dr/1Y8IgWVUacMhurdH9Dve3/pEQKaGm 0OmPaNlGAfLkwqAf+U67EwQRDB5Gf05d7L3TC0WwjYi0W6Fu5fpxOnINW4NrgYNwWZRM 9JzQ==
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=Ezu4RvsXRqbKkfiBh1sVCI2qnKnVuXfiyf0IqKIY0Eo=; b=QEfuoqIhSkh9DJJBXkdPZCOg4WKRHrQCmK+XlsLDaIhTbcL3q6c0sbADAda7jVibWp xsYLDPR9I6oiwmqJpJU/6I9zZRt4k9V1MPTqmRGtohwpFMMinmDw0xLLdLazJqGWzue+ kfJcNN7j2RD8+YBkvbhMdRfvrpeoQ0HDrhDjdoRRsnpvY9dvh3D7N638gKbi2Kh7WuYO 48deZNNbvskKMKhoBe71yO5ofzBWAUn6/7QeSVaN52rumfXYU7sQNDMZmlvLF8cKpFgY dJhkkiG/a48a8mKJY89mCjUBdEY4pRU2ZlVpUuA7rf3PWozmWgKEaY2K0U0dxQ9TLCZJ by3g==
X-Gm-Message-State: APjAAAWuxGwB2bhWwFFyBT3vk5YH6PMC7fvsM47svcG/MkECYBvmPFh2 yzzEagrvkhhU0Y93Ug2KLNPvbpCMT6O7X13OpfStu8vK
X-Google-Smtp-Source: APXvYqzy3W8Oy0zd1Q3SVut7PCCqNxYmhTg3yjENyh4ve5SQPnnXyaN5OKDpiFF7b5Iur1WY39TJX5LC7B3jYE2/zxk=
X-Received: by 2002:a50:9646:: with SMTP id y64mr24040817eda.111.1563205852542; Mon, 15 Jul 2019 08:50:52 -0700 (PDT)
MIME-Version: 1.0
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>
In-Reply-To: <82FF6486-FABF-4D2C-B5E2-178779C720A4@strayalpha.com>
From: Tom Herbert <tom@herbertland.com>
Date: Mon, 15 Jul 2019 08:50:40 -0700
Message-ID: <CALx6S34YhtgNNJtHazqJdsGRhiMa4PQXiSOuDz0JhqqyHWfNyA@mail.gmail.com>
To: Joe Touch <touch@strayalpha.com>
Cc: Derek Fawcus <dfawcus+lists-tsvwg@employees.org>, 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/5Hf1GME4vB9wqIHrUISSaKYK0BI>
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 15:50:57 -0000

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. The fact that UDP is different from TCP is
immaterial to the requirements, except that it's good practice to
adopt some of the design principles of TCP to leverage lessons learned
and implementation. The UDP Extended Header in
draft-herbert-udp-space-hdr-01 demonstrates that.

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

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

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