Re: [IPsec] Some thoughts regarging draft-hopps-ipsecme-iptfs-01
Steffen Klassert <steffen.klassert@secunet.com> Tue, 03 December 2019 08:10 UTC
Return-Path: <Steffen.Klassert@secunet.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 B563A120143 for <ipsec@ietfa.amsl.com>; Tue, 3 Dec 2019 00:10:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 zlFB78MqqFWn for <ipsec@ietfa.amsl.com>; Tue, 3 Dec 2019 00:10:14 -0800 (PST)
Received: from a.mx.secunet.com (a.mx.secunet.com [62.96.220.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AC653120131 for <ipsec@ietf.org>; Tue, 3 Dec 2019 00:10:13 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id BA2BC20523; Tue, 3 Dec 2019 09:10:09 +0100 (CET)
X-Virus-Scanned: by secunet
Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iHCGCxLmpm0I; Tue, 3 Dec 2019 09:10:09 +0100 (CET)
Received: from mail-essen-01.secunet.de (mail-essen-01.secunet.de [10.53.40.204]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 30B4320411; Tue, 3 Dec 2019 09:10:09 +0100 (CET)
Received: from gauss2.secunet.de (10.182.7.193) by mail-essen-01.secunet.de (10.53.40.204) with Microsoft SMTP Server id 14.3.439.0; Tue, 3 Dec 2019 09:10:08 +0100
Received: by gauss2.secunet.de (Postfix, from userid 1000) id B4459318017A; Tue, 3 Dec 2019 09:10:08 +0100 (CET)
Date: Tue, 03 Dec 2019 09:10:08 +0100
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Christian Hopps <chopps@chopps.org>
CC: IPsecME WG <ipsec@ietf.org>, Valery Smyslov <smyslov.ietf@gmail.com>
Message-ID: <20191203081008.GO13225@gauss3.secunet.de>
References: <039e01d5a5f2$ac51d350$04f579f0$@gmail.com> <20191202080154.GM13225@gauss3.secunet.de> <A9879D9C-970D-4826-B207-0A856CA583FC@chopps.org> <20191202141145.GJ14361@gauss3.secunet.de> <D62BE846-251A-4F07-89FE-5BC71CDC912F@chopps.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <D62BE846-251A-4F07-89FE-5BC71CDC912F@chopps.org>
User-Agent: Mutt/1.9.4 (2018-02-28)
X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/wNmkqCnJ0U3bID2SaO5byRM57WI>
Subject: Re: [IPsec] Some thoughts regarging draft-hopps-ipsecme-iptfs-01
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, 03 Dec 2019 08:10:16 -0000
On Mon, Dec 02, 2019 at 10:57:59AM -0500, Christian Hopps wrote: > > On Dec 2, 2019, at 9:11 AM, Steffen Klassert <steffen.klassert@secunet.com> wrote: > > On Mon, Dec 02, 2019 at 06:22:26AM -0500, Christian Hopps wrote: > >>> On Dec 2, 2019, at 3:01 AM, Steffen Klassert <steffen.klassert@secunet.com> wrote: > >>> On Thu, Nov 28, 2019 at 04:49:36PM +0300, Valery Smyslov wrote: > >>> > >>>> 4. I'd like to see more text in the draft regarding reassembling of incoming packets. > >>> > >>> Yes, I think some words on how to reassemble the fragments are really > >>> needed. > >>> > >>>> It seems to me that it can be done pretty easy by linking the reassembly logic > >>>> with replay protection window. > >>> > >>> While it looks like doing the reassembling based on ESP sequence numbers > >>> might be an easy approach, it could be also dangerous. > >>> > >>> Consider a system that encapsulates two flows on different cpus > >>> with the same SA. This system can TX packets in the following > >>> order: > >>> > >>> TX cpu0 inner flow0 SA0: > >>> > >>> Offset: 0 Offset: 100 > >>> [ ESP1 (1500) ] [ ESP3 (1500) ] > >>> [--800--][--800- -][-----1400---] > >>> > >>> -------------------------------------------------------------------------------------- > >>> TX cpu1 inner flow1 SA0: > >>> Offset: 0 Offset: 100 > >>> [ ESP2 (1500) ] [ ESP4 (1500) ] > >>> [--800--][--800- -][----1400----] > >>> > >>> > >>> On the receive side, it is not that clear how to reassemble the fragments > >>> from ESP3 and ESP4 into the fragments from ESP1 and ESP2. Maybe some > >>> packet ID in the IP-TFS header could help to identify related fragments. > >> > >> Indeed the code mustn't fragment this way. :) > >> > >> We could add a bit of text that one should avoid this mistake. > > > > I'm not so sure whether the receiver should rely on that > > the sender did the fragmentation right. I think a packet > > ID, like IP fragments have, would just solve the problem. > > The implementation would not even need to care about this > > multicore race then. > > The receiver can do any number of wrong things with what it sends, but I'd normally call those bugs. :) Yes, that's true. But if the protocol allows to do things wrong, it is a bug in the protocol :) Maybe you can just make it clear at the sender side by saying something like 'Fragments must be sent ordered and ESP encapsulated with consecutive sequence numbers.' > > Technically though, attaching a packet ID to the fragments to allowing sending them in any order saves only a little on code complexity (i.e., not using an ordering queue) on the sender side; I hoped to avoid such an ordering/serialization queue as I fear this will become a bottleneck. With the current design, I don't see how to do this without a queue. I know, it is an implementation detail, but implementation matters too :) > however, it seems to add a disproportionate amount of complexity to the receiver/reassembly (which could e.g., be aggregating VPN server). Yes, if you know that the next fragment comes with the next ESP packet, things are much easier. So we have the complexity either at the sender or the receiver side, not so sure what performs better. > Adding a packet ID also means that you can't just chain the inner traffic buffers together to form the IP-TFS payload as you must now insert an extra header between each of the inner packets, this is going to affect performance and memory use on whitebox/software based deployments as well as reduce available bandwidth on the tunnel. Good point. You can always chain extra headers and inner packets with a scatter-gather list, but it will have some performance impact. > I think we should try and keep fragmentation and reassembly as simple as possible so that it is easy to implement and get right. I absolutely agree here. > Having coded this using just the ESP sequence numbers to correct-order the received packets, I can say it's an easy-to-moderate complex function that performs well, it took a few iterations on the code to get it right and well tested. Adding another level to this receive complexity should only be done if we absolutely have to. I don't think we are there yet, given that the use of a simple ordering queue on the sender side is all we are talking about. > > Again it's easy to add some text to the document to highlight what needs to be paid attention to if one is using multiple cores to send on a single IPsec SA. As said above, just make it clear how the sender must order the fragments if you don't want a packet ID. Steffen
- [IPsec] Some thoughts regarging draft-hopps-ipsec… Valery Smyslov
- [IPsec] IKEv2 IPTFS transform [Re: Some thoughts … Christian Hopps
- Re: [IPsec] IKEv2 IPTFS transform [Re: Some thoug… Valery Smyslov
- [IPsec] ESP next payload number [Re: Some thought… Christian Hopps
- Re: [IPsec] ESP next payload number [Re: Some tho… Valery Smyslov
- Re: [IPsec] IKEv2 IPTFS transform [Re: Some thoug… Christian Hopps
- Re: [IPsec] IKEv2 IPTFS transform [Re: Some thoug… Valery Smyslov
- Re: [IPsec] ESP next payload number [Re: Some tho… Christian Hopps
- Re: [IPsec] ESP next payload number [Re: Some tho… Valery Smyslov
- Re: [IPsec] ESP next payload number [Re: Some tho… Christian Hopps
- Re: [IPsec] ESP next payload number [Re: Some tho… Michael Richardson
- Re: [IPsec] ESP next payload number [Re: Some tho… Michael Richardson
- Re: [IPsec] ESP next payload number [Re: Some tho… Christian Hopps
- Re: [IPsec] IKEv2 IPTFS transform [Re: Some thoug… Paul Wouters
- Re: [IPsec] ESP next payload number [Re: Some tho… Paul Wouters
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Paul Wouters
- Re: [IPsec] ESP next payload number [Re: Some tho… Christian Hopps
- Re: [IPsec] IKEv2 IPTFS transform [Re: Some thoug… Christian Hopps
- Re: [IPsec] ESP next payload number [Re: Some tho… Benjamin Kaduk
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Steffen Klassert
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Valery Smyslov
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Steffen Klassert
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Valery Smyslov
- Re: [IPsec] ESP next payload number [Re: Some tho… Christian Hopps
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Christian Hopps
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Steffen Klassert
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Christian Hopps
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Steffen Klassert
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Valery Smyslov
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Christian Hopps
- Re: [IPsec] Some thoughts regarging draft-hopps-i… Christian Hopps