Re: [IPsec] Discussion of draft-pwouters-ipsecme-multi-sa-performance

Tero Kivinen <kivinen@iki.fi> Fri, 28 October 2022 14:16 UTC

Return-Path: <kivinen@iki.fi>
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 7D8D6C14CE23 for <ipsec@ietfa.amsl.com>; Fri, 28 Oct 2022 07:16:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.11
X-Spam-Level:
X-Spam-Status: No, score=-2.11 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, NICE_REPLY_A=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=iki.fi
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eYMs38-gYzCM for <ipsec@ietfa.amsl.com>; Fri, 28 Oct 2022 07:16:20 -0700 (PDT)
Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B690DC14CF02 for <ipsec@ietf.org>; Fri, 28 Oct 2022 07:16:19 -0700 (PDT)
Received: from fireball.acr.fi (fireball.acr.fi [83.145.195.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kivinen@iki.fi) by meesny.iki.fi (Postfix) with ESMTPSA id 1E8A0200D7; Fri, 28 Oct 2022 17:16:15 +0300 (EEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1666966575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=69Y7d1cnXVCmObFe+qsznG5TdugkH590KEQ1hXa2Owg=; b=UHkETTmzOobJ8vY+/FxYvsFEjt2Zmr+zhFXq5wuBKbFtaN0fmlVJSJW59fY2uwx9BDvAEG 79qZBH0VGLQIn7hO8+kQLFdjKGsbEzgwLOVURv17uEVzgMzAsN4jCqvrWkydcDWuRLVdjt LWD4B2VMvkM0xOY+geUQyyen24mGb2s=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1666966575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=69Y7d1cnXVCmObFe+qsznG5TdugkH590KEQ1hXa2Owg=; b=SKrqvaZw9bDuEjIFhdULrfHFXRDx1dJx3Ota9TNVOfXTOBkz6fSVrPjVoEKBISgA4eiRWV eIn9/lVIDm+MJRhaDowPLrvwURw8tzOYI52TaCIiO+g+NC1qNltZbmQMffS2F+DF0iVnS4 TOG2NHkGMNA9ff4VCjLTmNbSY59sPro=
ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=kivinen@iki.fi smtp.mailfrom=kivinen@iki.fi
ARC-Seal: i=1; s=meesny; d=iki.fi; t=1666966575; a=rsa-sha256; cv=none; b=QGyqWoUkPjFYVnd36KkfgQ8oxam02p4c0KVdhon+o2OCRvzWrZFtDSKvMcZDkUUpgzZBwP k5+xrmBQ0zrxrm1T0fOJomRh8TZC5PvHaxDT2vNzufliYfFKmrYMYKoc4f41Mz1lJue5r1 /E4rthvY6lKldofb97Dnn9EXUvveB8o=
Received: by fireball.acr.fi (Postfix, from userid 15204) id EEAB325C12F3; Fri, 28 Oct 2022 17:16:13 +0300 (EEST)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Message-ID: <25435.58413.665039.948731@fireball.acr.fi>
Date: Fri, 28 Oct 2022 17:16:13 +0300
From: Tero Kivinen <kivinen@iki.fi>
To: "Paul Ponchon (pponchon)" <pponchon=40cisco.com@dmarc.ietf.org>
Cc: Paul Wouters <paul@nohats.ca>, Steffen Klassert <steffen.klassert@secunet.com>, Valery Smyslov <smyslov.ietf@gmail.com>, Michael Richardson <mcr+ietf@sandelman.ca>, IPsecME WG <ipsec@ietf.org>
In-Reply-To: <DM6PR11MB4531023D4E06E619BAC9935DCB339@DM6PR11MB4531.namprd11.prod.outlook.com>
References: <20221021073714.GP3294086@gauss3.secunet.de> <F84D65B2-9A68-420D-BC55-2A6BD2542246@nohats.ca> <25433.44569.44812.537584@fireball.acr.fi> <DM6PR11MB4531023D4E06E619BAC9935DCB339@DM6PR11MB4531.namprd11.prod.outlook.com>
X-Mailer: VM 8.2.0b under 26.3 (x86_64--netbsd)
X-Edit-Time: 14 min
X-Total-Time: 14 min
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/6gIDIqHGy3BuyMXikwCyU_gqUfU>
Subject: Re: [IPsec] Discussion of draft-pwouters-ipsecme-multi-sa-performance
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.39
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: Fri, 28 Oct 2022 14:16:25 -0000

Paul Ponchon \(pponchon\) writes:
> > > Using different real child SA’s was needed to ensure the
> > > cryptographic security properties.
> 
> Is this requirement only based on not reusing the same IV on different cores
> or is there an additional factor I missed?

IV space and replay counter are the problem. It is just so much easier
to use different Child SAs per CPU and than trying to solve the IV
space problem.

On the G-IKEv2 we had to solve the splitting IV space to separate
senders, and that causes all kind of issues, and we have to disable
replay protection on those SAs.

Getting replay protection working on the Child SA that is shared by
multiple CPUs is much harder than creating separate Child SA for each
CPU. 

> > This is something that is really a important. The keymat between the
> > CPUs can't be same, but we could in theory create a new key hierarchy
> > that generates keys for each sub Child SAs for each CPU, but I think
> > that will just complicate things more, and having real Child SAs for
> > each cpu is the correct solution.
> 
> We're are currently facing some scalability issues with using
> multiple Child SAs and we think it is possible to reuse the same
> keymat on all the per cpu SAs.

There must be something wrong in your implementation. There should be
no scaling difference for each cpu in cases where there is one Child
SA per cpu with different keymat than cases where there is one Child
SA per cpu with same keymat than some other cpu has.

Or more likely the problem is its much harder to scale to make them
share keymat, as in that case each of the cpu needs to talk to all
other cpus to make sure they do not reuse the replay counter, or IV
space, and keep track of number of bytes transmitted etc.

If your Child SA is local to your cpu all those issues are localized
and there should not be any scaling issues.

There will be scaling issues when generating those Child SA through
IKEv2, but IKEv2 should be able to create hundreds of Child SAs per
second when using proper window size and not doing PFS on the Child
SAs.

If you are not implementing proper window size on IKEv2 then you are
limited to your RTT, i.e., if your RTT is 50 ms, then you can create
dozen or so Child SA per second, as you need to wait each Child SA
packet before you can start new one.

All this is again not stable state scaling issue, all IKEv2 issues are
issues that should not affect stable state at all.

> For this to work and respect the uniqueness of the IV, some
> mechanism would be needed. But that can be implemented without
> per-packet locks for most ciphers (e.g., by splitting the IV space,
> or making bulk IV allocations). And we would also ensure that the
> keymat is used in a FIPS compliant manner.

I remember when we had discussion of the Implicit IV (RFC8750) people
were saying that it is not clear whether the IV generation must be
inside the fips boundary or not, and if so we are not allowed to bring
external data (sequence number) and generate IV from that as that
would violate the FIPS boundaries, meaning the FIPS boundary would
grow larger, and more of the implemenation needs to be FIPS certified,
not just the actual crypto.

If we are doing similar things here, same thing might happen, meaning
suddenly we need to start FIPS certifying the actual bulk IV
allocation process or something like that and that would mean much
larger boundary for FIPS certification. 

> Would there be any other concerns in reusing the same keymat between
> multiple SAs ?

Not really, but I do not also see any reason why there would be a need
to share KEYMAT between multiple SAs.

If the issues in the IKEv2 Child SA generation are overwhelming then
we can simply use the IKEv2 KEYMAT to create new per Child SA KEYMATs
for each CPU in the cryptographically safe way (i.e., make IKEv2
extension to do that).
-- 
kivinen@iki.fi