Re: [IPsec] Teaser for pitch talk at IETF 108

Valery Smyslov <smyslov.ietf@gmail.com> Tue, 28 July 2020 08:13 UTC

Return-Path: <smyslov.ietf@gmail.com>
X-Original-To: ipsec@ietfa.amsl.com
Delivered-To: ipsec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 475C63A0824 for <ipsec@ietfa.amsl.com>; Tue, 28 Jul 2020 01:13:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 484QtsOmECIk for <ipsec@ietfa.amsl.com>; Tue, 28 Jul 2020 01:13:36 -0700 (PDT)
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (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 3BEAF3A081F for <ipsec@ietf.org>; Tue, 28 Jul 2020 01:13:36 -0700 (PDT)
Received: by mail-lf1-x12a.google.com with SMTP id d2so4886206lfj.1 for <ipsec@ietf.org>; Tue, 28 Jul 2020 01:13:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-transfer-encoding:thread-index:content-language; bh=peD9+cyWSVPwYKBk/d8cvsFddwM+iHotJQzloEWFBDI=; b=TI2jKmMT6Is5QvJzPo6kHNKAHA2jBO9do2cS6s/8/LBKSSbSeKkdvaSccNsxb8PkPv bByDRhPO8kg6tjsw09eKXRZ/ZAaawPMbTtgZun4+v4+OfQsrNK/7DCVMRBG+Gcmg9IiZ 0gw6LYh6TcFR3yqHxiCIQbHHez5wCtvr5a2TJWcyWynP2L/F6dy2RYN8c+8ma41EaKu6 LYpCMMnuXW5tDlP8S3Uo4s220RoYcVpK8gv+6LPTvQbiYHPw5znpO5ivTy1MIlSOZinV F+ns1MAVggtEi8JKT0fFyn4igh9IkyNFUnXIa6P4DhKNnNqIr5W3q/jbKTh1cTYP660S DBtg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:thread-index :content-language; bh=peD9+cyWSVPwYKBk/d8cvsFddwM+iHotJQzloEWFBDI=; b=p9LSZ6G3+lLc54AMoIcZgF77lPpTXKB2C0wZirkb6iKUfXLKPIuQNJKhOCQqbByG1B un3O3jJuwD8dF5IfsrTh1fpXYFsF66CA8S3pyyKgfEIJ5zuaGB8SerHgkPmhpKhhOBcD zOteEgrRyy5vbWz8fjCVZozyCi3+bu8M5Qf0IvICbrKiwRoc65+ehKuOZ2cHAK940/7G 0hDOwfI1y8OnhWdG+R/RffL7IHiv1yCF5lNbvBbwmUxgQJt/sRz/Lqsto2qdo6WFysII dYoevmYnMnta61pkQ2yEKvNw2vQILk0UeUnZr1U3nR699X7jw+Itepl/YaF0fHC+rXm2 AthA==
X-Gm-Message-State: AOAM533NVrHvZHqjExd8GHxlBx7oYjLIfYvvi6Sa7nNfQ75Yf7xydlHK +BVIEabejbIAujY/0g6H5GeIL4ts
X-Google-Smtp-Source: ABdhPJyrxK9YcpnU8jQjlgp77u5CeRPXM0PceSooZ8RJ9NJneYHYardLH4EXy7CsO9erkU3H+GeCtA==
X-Received: by 2002:a19:c894:: with SMTP id y142mr13162878lff.74.1595924013788; Tue, 28 Jul 2020 01:13:33 -0700 (PDT)
Received: from buildpc ([82.138.51.3]) by smtp.gmail.com with ESMTPSA id m4sm2822980ljo.70.2020.07.28.01.13.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2020 01:13:32 -0700 (PDT)
From: Valery Smyslov <smyslov.ietf@gmail.com>
To: 'Michael Rossberg' <michael.rossberg@tu-ilmenau.de>, ipsec@ietf.org
References: <023E45E1-B1AA-4042-A8E3-DD7457235BC7@tu-ilmenau.de>
In-Reply-To: <023E45E1-B1AA-4042-A8E3-DD7457235BC7@tu-ilmenau.de>
Date: Tue, 28 Jul 2020 11:13:33 +0300
Message-ID: <0fd501d664b6$fcc8c590$f65a50b0$@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQLb8KjJ82/eUG4ib/oDCzGyVFFVxqcRcapA
Content-Language: ru
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/Qb-1PMcZ98y9MkiFFuiIySlY9T4>
Subject: Re: [IPsec] Teaser for pitch talk at IETF 108
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipsec/>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jul 2020 08:13:39 -0000

Hi,

a few thoughts about this proposal.

> We have been analyzing issues ESP has in current data-center networks and came to
> the conclusion that changes in the protocol could significantly improve its behavior. Some
> of results will be presented next Tuesday in a pitch talk at IETF 108. This mail is just a
> small teaser, in case some of you wanted to gather some arguments for the discussion.
> 
> In particular, we propose the following changes to ESP:
> 
> 	* Allow multiple windows per SA to allow for scaling over CPUs, windows per QoS
> 	  class & replay protection in multicast groups

An ability to have multiple windows per SA is an interesting idea.
However, in most cases the same result can be achieved with several parallel ESP SAs
with the same traffic selectors. Comparing with this proposal:

1. Several parallel ESP SAs require more resources to set up. On the other hand I don't 
    think it really matters (2 short IKE messages per SA is not a big deal, especially if no PFS is used and
    we are going to transmit millions of ESP packets then). 
2. Several parallel ESP SAs require more resources in the kernel. This is true.
3. If multiple windows are used for several QoS classes, then this proposal won't work in case 
    of TCP encapsulation, while several ESP SAs will (if we have several IKE SAs too).

Having replay protection in case of multicast is a feature that is not currently
available in ESP. However, it's easy to add this feature (with the limitation
that it only will be available if counter mode ciphers are used) by simply 
letting all GMs know the number of SID bits, so that they can guess
Sender ID from the IV. It's very simple modification of G-IKEv2.

Having said this, I think that the replay protection for multicast 
is not a feature that is absolutely needed. Multicast is performed
over UDP, so application protocols have to deal with packet 
replication and loss in any case (when they are used without 
IPsec protection). So, while a nice feature to have, I don't think
it's absolutely necessary and if one needed, it can be achieved without any 
modification to ESP with the same limitations as the proposed 
solution.

> 	* 64 bit sequence counters in each header to ease protocol handling and allow for
> 	  replay protection in multicast groups

This would simplify replay protection logic on receiver, but will waste
4 bytes on the wire for unicast SAs. I agree that ESN with ESP would not be available 
for multicast even if the above mentioned solution (letting GMs know SID) is implemented.
But I'm still not convinced we need it.

> 	* Removing the trailer to ease segment & fragment handling and alignment

I was told by Linux kernel people that having trailer in ESP is a headache for them.
However, this simplification has its cost:

1. Ciphers that require padding  cannot be used. I admit that CBC and the like
     are out of fashion today, but I don't know which cipher modes will be in fashion tomorrow
     and what requirement for padding they will have.
2. No Next Header field eliminates transport mode (BTW, widely used for multicast!)
     and makes it difficult to implement TFC (you can add TFC  padding, but you can't send 
     dummy packets and you can't use IPTFS)

> 	* Implicit IVs in spirit of RFC 8750 removing the need for AAD

I don't consider removing AAD is a benefit, since all the AEAD schemes I'm aware of
allow to have AAD. On the other hand, implicit IV is only applicable
to some transforms. I'm not only talking about non counter-based AEAD ciphers,
(like CBC), but even for counter-based AEAD  a situation is possible when there is a need
for IV to be somehow structured and not be a plain counter (e.g if you implement key trees).

> Further details and benchmark results may be found in a paper preprint [1] and a
> presentation [2] we held with at the Linux IPsec Workshop.

A few more considerations. 

It seems that performance of this proposal depends on ICV size 
for the plaintext to be properly aligned.
If ICV is 16 bytes, then plaintext is ideally aligned on 32 bytes,
but if one use 12 byes ICV (e.g. ENCR_AES_GCM_12)
then the plaintext is aligned on 4 bytes, that is even worse
than ESP, where it is for most AEAD transforms aligned on 16 bytes.

Since this proposal allows only tunnel mode, it will have
larger overhead for small packets. This is partially
compensated by having IV to be implicit...

And about security. In order to have IV combined with 
ESN and sub-windows identifiers this proposal removes secret 
salt from the nonce. This may have impact on security. 
I'm not a cryptographer, but I believe the impact is not negligible.
On the last CFRG session a draft draft-wood-cfrg-aead-limits was
discussed that calculates limits of data to be safely encrypted
by various AEAD ciphers. The authors claimed that having 
secret salt in the nonce increases this limits in case of multi-user
attacks and that the results in the draft are calculated
for this case. If plain AEAD ciphers (with no secret salt) are used
the limits are lower. 

So, on one hand this proposal makes it possible to transfer
larger amount of data with a single key (because you can 
combine all the traffic from different QoS classes and
all the CPU cores into one SA, no need to have
several ESP SAs). On the other hand
it simultaneously decreases the limit of data that 
can be safely protected with a single key.

I think that it's an interesting work, but I don't think it is 
a candidate for ESP replacement. The main problems with it
(as I see it from my corner) is that it is not generic enough:
it is optimized for small number of crypto transforms and 
use cases.

Regards,
Valery.

> Michael
> 
> 
> [1] https://telematik.prakinf.tu-ilmenau.de/files/packetformat.pdf
> [2] https://telematik.prakinf.tu-ilmenau.de/files/VPE.pdf