Re: hardware offload (was: Packet number encryption)

Ian Swett <ianswett@google.com> Fri, 09 February 2018 21:46 UTC

Return-Path: <ianswett@google.com>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 81F5F1270FC for <quic@ietfa.amsl.com>; Fri, 9 Feb 2018 13:46:52 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.71
X-Spam-Level:
X-Spam-Status: No, score=-2.71 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 SUSAct2yug6j for <quic@ietfa.amsl.com>; Fri, 9 Feb 2018 13:46:50 -0800 (PST)
Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (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 838BE1242F7 for <quic@ietf.org>; Fri, 9 Feb 2018 13:46:50 -0800 (PST)
Received: by mail-it0-x22f.google.com with SMTP id k6so26014ita.3 for <quic@ietf.org>; Fri, 09 Feb 2018 13:46:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Z/qd/h/9NxVDMrFl7DeqmO3onmBoZFZ0V5Qc72Gbyjw=; b=qXgExNylIrKrAa/Xk4luGRNjl4/20hm1YUZ1hAH2I34Lq2Bsgg+ZoPWt6s4lhZ4kHK 3TN0VpsUTNr1Z8yoB7jUk5b2Qh6N/DPnGZ2ShmnhYcYgNNZapePb/7egZZxixawVzuY/ dkp3o9mlDm8GfsGfftcCz7+g9mHLyynK5eEiqRj/7+JS3KY2i/R9nhHeTVT1ikRuHMt2 xcSc1vJesofM7mWzLZfehJqAla5TCOHe9xnFaeIpxo4ZNN9onxUYi2NNczVnlyGLH2F8 B2ElUJcQf1eUNY+jgu+gDSx6WIupU/IGlRhtoaAd5caQvMR3mbV4XzUWb0OTjO7NJyBb 6kHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Z/qd/h/9NxVDMrFl7DeqmO3onmBoZFZ0V5Qc72Gbyjw=; b=ZZ3vILeJaj1aEKndBp2unU0Fe9sbsUH6pYFopwwdLQ782djCTMCJEvDZNTxdWHzXKM PfWD3FCevNolzwN9RY3qzLhKC9zTYnNiHycLkaHqCf2aIK6laUtSSqppKGKRH1TAlrYz RnFM4xRdEf5bCsXFjvVNlRX4DjW6fRRQGpoEpIBJ6aYdDizgEn2qNGWMdaUJNADhglvm 56zWNHtOzWLDR0osa2n/81k9QQ7nttszr7ws51br0e4YRxzzmzLitfYP+O0Z+tUw29Io 62yiEFLAOcl6HOtnPIjbOqgv4DzhoaAo3eIf2bHGYVlQ9mbufA0vZ2HljJ7FLV2U58Lh 6bog==
X-Gm-Message-State: APf1xPC8DhgSYSuS8PTXvVVW+eVzUcqZiCf9GS6o8YcF2SCDvvES0RY3 V6Wj2hqiUsAZG+6Vs8JBaw852UYbJwcpNFNczNMZ2Q==
X-Google-Smtp-Source: AH8x226E95fMZicLLDCwwBSm9bJ43T+bbNWQqZWvVZCBZ9Q6HedWmYqanM/52F1WzdntoOrAlMNF4uxnUpzbLGGYXxM=
X-Received: by 10.36.188.135 with SMTP id n129mr5353242ite.81.1518212809553; Fri, 09 Feb 2018 13:46:49 -0800 (PST)
MIME-Version: 1.0
Received: by 10.107.222.4 with HTTP; Fri, 9 Feb 2018 13:46:28 -0800 (PST)
In-Reply-To: <b8b848ba-e811-4ac0-5406-8d56fe7f7bae@huitema.net>
References: <CABkgnnVyo3MmWtVULiV=FJTnR528qfY8-OmKGWAs0bCvri-a_g@mail.gmail.com> <bdf88936-8edc-d56e-ee59-c9d597058edd@huitema.net> <CY4PR21MB01337C8A700E58B49D90B712B6FC0@CY4PR21MB0133.namprd21.prod.outlook.com> <119b3276-5799-1cc3-8982-7479171bbf27@huitema.net> <CAOYVs2pi8-NVuS+crNMfjsP-n5upK3=5tPeQ8OSGpOvL6RTrjA@mail.gmail.com> <CY4PR21MB0133A1117B2733BBCF049C5FB6FC0@CY4PR21MB0133.namprd21.prod.outlook.com> <MWHPR08MB24327A7BB5AE1AE70FE5CDB1DAF30@MWHPR08MB2432.namprd08.prod.outlook.com> <533a0a2e-3a87-b55f-84ce-c52bc03cd81c@huitema.net> <MWHPR21MB0144C68102972A668611E1FCB6F20@MWHPR21MB0144.namprd21.prod.outlook.com> <CY4PR21MB01332141C3563ABBA240C566B6F20@CY4PR21MB0133.namprd21.prod.outlook.com> <CABcZeBNeTT79nd+d7h-KFPpFYxpr5wt1KgwPY=M0_UQpCkKq1w@mail.gmail.com> <CY4PR21MB01337A5E81D8A8A1D7518D97B6F20@CY4PR21MB0133.namprd21.prod.outlook.com> <D3800B30-E1F5-4955-8F85-6FEF36AD2E23@akamai.com> <CAKcm_gO-2zejQnLCCzHvvG=gP70o9EAUQz8v2oYUiK=nFjyUCw@mail.gmail.com> <b8b848ba-e811-4ac0-5406-8d56fe7f7bae@huitema.net>
From: Ian Swett <ianswett@google.com>
Date: Fri, 09 Feb 2018 16:46:28 -0500
Message-ID: <CAKcm_gNAUDqPxZ16nbSuzOS-815jJwiMasqwbyiiD9Cw5Gzpzg@mail.gmail.com>
Subject: Re: hardware offload (was: Packet number encryption)
To: Christian Huitema <huitema@huitema.net>
Cc: "Salz, Rich" <rsalz@akamai.com>, Praveen Balasubramanian <pravb@microsoft.com>, Eric Rescorla <ekr@rtfm.com>, "quic@ietf.org" <quic@ietf.org>
Content-Type: multipart/alternative; boundary="94eb2c11479635b1240564ce77f4"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/SYMd6hvzieTnynjCpQxdZWRFIOs>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Feb 2018 21:46:52 -0000

I should say that I don't have a specific API, implementation, or NIC in
mind, so hopefully someone(Praveen?) can provide some context about what is
possible with existing APIs or what is relatively easy to add to them.

The API I had in mind was of the "encrypt this byte string" form, but in
the NIC.  ie: When I write a sequence of packets I supply crypto info, as
well as a minimum release time(or pacing rate).  The goal is to do the bulk
crypto as the network stack is packetizing and copying into the NIC
memory.  Ideally this can avoid an extra memcpy and avoids touching the
data to be sent until the last possible moment.

Hardware acceleration of AES in modern CPUs is extremely good, so another
approach is to do the above in a userspace networking stack or the kernel
and use the CPU's AES acceleration.  If the networking code that was
writing into NIC memory had a deep understanding of QUIC, possibly it could
do the packet number encryption as a second pass?

On Fri, Feb 9, 2018 at 3:17 PM, Christian Huitema <huitema@huitema.net>
wrote:

> On 2/9/2018 8:20 AM, Ian Swett wrote:
>
> > One issue with the current encryption proposal is you can't use
> > hardware crypto offload for the bulk encryption because the packet
> > number has to be encrypted after the bulk data.
> >
> > Any suggestions on how to fix that?
>
> Ian, could you be a bit more explicit about the type of hardware offload
> that you have in mind?
>
> I can think of two extreme types. One is embedding crypto offload in the
> NIC, and is generally tied to TCP/TLS/TLO. That one type has no hope
> whatsoever of working with UDP/QUIC. The other type is simply providing
> an "encrypt this byte string" API, and can be trivially used with QUIC
> -- much like we can use Intel's AES extended instructions today. So
> obviously you have something else in mind, and maybe you should explain it.
>
> -- Christian Huitema
>
>
>
>