Re: Hardware acceleration and packet number encryption

Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com> Sat, 24 March 2018 21:35 UTC

Return-Path: <mikkelfj@gmail.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 1589A126C25 for <quic@ietfa.amsl.com>; Sat, 24 Mar 2018 14:35:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.698
X-Spam-Level:
X-Spam-Status: No, score=-2.698 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 OCvSqRHuQT7o for <quic@ietfa.amsl.com>; Sat, 24 Mar 2018 14:35:28 -0700 (PDT)
Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (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 5B873126BF7 for <quic@ietf.org>; Sat, 24 Mar 2018 14:35:28 -0700 (PDT)
Received: by mail-it0-x234.google.com with SMTP id c1-v6so6555582itj.1 for <quic@ietf.org>; Sat, 24 Mar 2018 14:35:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :cc; bh=PQ9NekkLQA183Tyc4RjTVtsJBxNKl/X5lv8YUAWwDkE=; b=aOnBxRjK16B6qEb/oxVhpGU2E9bieAQXO8UCddureVjfTxcIlED7lcj2mtFP7Hv1fm As5XW5HB+pxQ9E6oXj89BPL3OKqNNTLt5ajYcQJ4WVliownirUrWgaaPMZUw7t6J/jFI bcSw27mIJqzCQBytifotSlmOFGQrMapZaJ53UYGsAQgmOrUEBfotzwJJbtxTNf0KQP8v zgfMTn26IssVzPdIABvXpd4tKmS16Sg7OD/3en7y134x3ubmokpJQVbTO83JUnE/CpLx FDQ/0wx19MwxxbHLEUSeoGwNVACpgDr/r7IY+zBtqudD7R1ZEDg/wbiR+l8pZE+ZPjAH 56Yg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=PQ9NekkLQA183Tyc4RjTVtsJBxNKl/X5lv8YUAWwDkE=; b=HtEGLdAEaWJhgrF21dsU8uwTk7XsgHdYmxA1d6LLwjACWAOF5gaPLRZarsMlHfKXi9 KTSZyd9TmDfbRdCdd8wrsLkR/HoibVUeNvdlhEW+Bf/k9Yp0EpilA8ZsUPIPFQaHR58E nCEjRYO8QDiOQgmOcJQ7GP2qc1rk5CF24x30LyP0rIhzSTriqx2SByHtCmAOJZLQ3UX5 onm6UMEMQByoM9NrmCa2QP1i1okVbYMJKv3L09HHz84GMIHQVTdKm/qYGjZwjWbGq1Oe UCtvJM5mCWLcg/+72qu9ZgDRYTAhrKkPC4G8ffkInWZcLJ0hvQRyiYZzTQ0v8WSajQmg EUvA==
X-Gm-Message-State: AElRT7FobixO18Qx+Sj/IeTJhZqV9NM1j+YcuF/qZbXnhiIjN2mvzioO /mJrzQaD7BlW6zWygOaFDKv+AlUCtnzzfLLWyyY=
X-Google-Smtp-Source: AIpwx4+IYREFTB1bFov64JMm4x3eIrsVDNh0rNzj70Kg9m9PqW/w5iPAHqcaLq3fl4lW3/+Oq4qU/LrwWO7kjSL9KwQ=
X-Received: by 2002:a24:5085:: with SMTP id m127-v6mr6839507itb.118.1521927327557; Sat, 24 Mar 2018 14:35:27 -0700 (PDT)
Received: from 1058052472880 named unknown by gmailapi.google.com with HTTPREST; Sat, 24 Mar 2018 17:35:26 -0400
From: Mikkel Fahnøe Jørgensen <mikkelfj@gmail.com>
In-Reply-To: <CABcZeBM3PfPkqVxPMcWM-Noyk=M2eCFWZw2Eq-XytbHM=0T9Uw@mail.gmail.com>
References: <7fd34142-2e14-e383-1f65-bc3ca657576c@huitema.net> <F9FCC213-62B9-437C-ADF9-1277E6090317@gmail.com> <CABcZeBM3PfPkqVxPMcWM-Noyk=M2eCFWZw2Eq-XytbHM=0T9Uw@mail.gmail.com>
X-Mailer: Airmail (420)
MIME-Version: 1.0
Date: Sat, 24 Mar 2018 17:35:26 -0400
Message-ID: <CAN1APdfjuvd1eBWCYedsbpi1mx9_+Xa6VvZ3aq_Bhhc+HN67ug@mail.gmail.com>
Subject: Re: Hardware acceleration and packet number encryption
To: Eric Rescorla <ekr@rtfm.com>, Kazuho Oku <kazuhooku@gmail.com>
Cc: "Deval, Manasi" <manasi.deval@intel.com>, Christian Huitema <huitema@huitema.net>, IETF QUIC WG <quic@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000bbaad805682f5160"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/7ocGqNXUJ6vLOBoCZgC3Wl90u8M>
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: Sat, 24 Mar 2018 21:35:31 -0000

AERO: I did not read all of it, but it does indeed sound esoteric.
It can do two things of interest: reduce space used by packet numbers, and
presumably fix the encryption issue.

However, it has a W parameter which is the limit of reordering which is
default 64 and recommended at most 255 for security reasons. This is way
way too low (I would assume) if packet clusters take multiple transatlantic
paths.

If we accepted such a limit, I could very trivially come up with an
efficient solution to PN encryption. Since we cover at most 64 packets, we
only need a 5 bit packet number and reject false positives on AEAD tag. To
simplify, make it 8 bits. The algorithm is to AES encrypt a counter similar
to a typical AES based PRNG. Then, for each packet take one byte from the
stream and use it as packet number. The receiver creates the same stream
and maps the received byte to an index it has. It might occasionally have
to try multiple packet numbers since the mapping is not unique. Longer
packet numbers reduce this conflict ratio. To help with this detection some
short trial decryption might be included. The PN size can be extended as
needed.

The cost of doing this is much lower than direct encryption for as proposes
in PR because 1) a single encryption covers multiple packets, 2) the
encryption can be parallelised resulting in a 4-5 fold performance
increase. Combined this results in sub-nanosecond overhead for AES-NI.

However, you have to deal with uncertainties which is why this isn’t a very
good idea unless you have some very good knowledge of the traffic pattern.
It also complicates HW offloading, but I don’t see why it couldn’t be done
efficiently.


Mikkel


On 24 March 2018 at 17.26.47, Eric Rescorla (ekr@rtfm.com) wrote:

3. A more exotic solution like AERO (
https://tools.ietf.org/html/draft-mcgrew-aero-00#ref-MF07)..