Re: [IPsec] draft-xu-ipsecme-esp-in-udp-lb-07

Paul Wouters <paul@nohats.ca> Thu, 22 July 2021 18:43 UTC

Return-Path: <paul@nohats.ca>
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 AFF573A0D75 for <ipsec@ietfa.amsl.com>; Thu, 22 Jul 2021 11:43:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.304
X-Spam-Level:
X-Spam-Status: No, score=-1.304 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nohats.ca
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 yPbvbe62izLo for <ipsec@ietfa.amsl.com>; Thu, 22 Jul 2021 11:43:09 -0700 (PDT)
Received: from mx.nohats.ca (unknown [193.110.157.85]) (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 1E4EB3A0D4D for <ipsec@ietf.org>; Thu, 22 Jul 2021 11:43:03 -0700 (PDT)
Received: from localhost (localhost [IPv6:::1]) by mx.nohats.ca (Postfix) with ESMTP id 4GW1Y11k4Jz319; Thu, 22 Jul 2021 20:43:01 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nohats.ca; s=default; t=1626979381; bh=Q5MBps22eRcS5UtgN3eQTeaf3zQ+pHsQZBZ66PKOiyU=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=YYvMOYgJmdL7K1cCfM86BhBOhpfBRq/sz1SqXExsDAnWrbYJkrevYUatuWwf0fl2X Is1v9rzuKiyL817+uwhox6NntygxfghuYo7zLsieRgQXcYyrCujVZYgROhlCEiZVPW X+BitIjspvCuJiZze1rqCbEwth8eAghvp2My15V4=
X-Virus-Scanned: amavisd-new at mx.nohats.ca
Received: from mx.nohats.ca ([IPv6:::1]) by localhost (mx.nohats.ca [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id Wo1cweJNfFus; Thu, 22 Jul 2021 20:42:59 +0200 (CEST)
Received: from bofh.nohats.ca (bofh.nohats.ca [193.110.157.194]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.nohats.ca (Postfix) with ESMTPS; Thu, 22 Jul 2021 20:42:59 +0200 (CEST)
Received: by bofh.nohats.ca (Postfix, from userid 1000) id B87D2CE57A; Thu, 22 Jul 2021 14:42:57 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1]) by bofh.nohats.ca (Postfix) with ESMTP id B5408CE579; Thu, 22 Jul 2021 14:42:57 -0400 (EDT)
Date: Thu, 22 Jul 2021 14:42:57 -0400
From: Paul Wouters <paul@nohats.ca>
To: "Bottorff, Paul" <paul.bottorff@hpe.com>
cc: Tobias Brunner <tobias@strongswan.org>, Valery Smyslov <smyslov.ietf@gmail.com>, 'Tero Kivinen' <kivinen@iki.fi>, "antony.antony@secunet.com" <antony.antony@secunet.com>, 'IPsec' <ipsec@ietf.org>, Mahendra Maddur Puttaswamy <mpmahendra@juniper.net>, Shraddha Hegde <shraddha@juniper.net>, 徐小虎 <xiaohu.xu@capitalonline.net>
In-Reply-To: <CS1PR8401MB11927872F9940F7DC0BCDDF9FE119@CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM>
Message-ID: <1cd199e7-2db4-7547-59d4-9cdf0aa1671@nohats.ca>
References: <CS1PR8401MB11928BE251D4B6E05184D941FE619@CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM> <20210331103220.GA21137@moon.secunet.de> <CS1PR8401MB119267E038AFBDFD996F0441FE7C9@CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM> <24678.19440.553333.890224@fireball.acr.fi> <036401d72786$91047b90$b30d72b0$@gmail.com> <CS1PR8401MB11924CD1BF4CC233523180F3FE7A9@CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM> <CS1PR8401MB119239134AD78A9B30754AE4FE139@CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM> <f0cf6bca-f3b8-c991-2257-90def87f40c9@strongswan.org> <CS1PR8401MB11925D7FE5542E0E14F86F6CFE129@CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM> <7cd40215-563d-9860-62fa-4110f1bd3895@strongswan.org> <CS1PR8401MB11928BB2C45625F3867EB774FE119@CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM> <5766259-f771-b4fd-8236-15dfd3c4fb25@nohats.ca> <CS1PR8401MB11927872F9940F7DC0BCDDF9FE119@CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-2022-jp"; format="flowed"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/6Bgh0F08Ngc8CxYj8tyCmSNvtbQ>
Subject: Re: [IPsec] draft-xu-ipsecme-esp-in-udp-lb-07
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: Thu, 22 Jul 2021 18:43:16 -0000

On Fri, 16 Jul 2021, Bottorff, Paul wrote:

> Hi Paul:
>
> Below,
>
> Cheers,

The below did not clear things up for me. I think it would be useful to
describe things in the draft much more carefully and details with some
ascii art.

Paul

> Paul
>
> -----Original Message-----
> From: Paul Wouters [mailto:paul@nohats.ca]
> Sent: Friday, July 16, 2021 12:46 PM
> To: Bottorff, Paul <paul.bottorff@hpe.com>
> Cc: Tobias Brunner <tobias@strongswan.org>; Valery Smyslov <smyslov.ietf@gmail.com>; 'Tero Kivinen' <kivinen@iki.fi>; antony.antony@secunet.com; 'IPsec' <ipsec@ietf.org>; Mahendra Maddur Puttaswamy <mpmahendra@juniper.net>; Shraddha Hegde <shraddha@juniper.net>; 徐小虎 <xiaohu.xu@capitalonline.net>
> Subject: Re: [IPsec] draft-xu-ipsecme-esp-in-udp-lb-07
>
> On Fri, 16 Jul 2021, Bottorff, Paul wrote:
>
>> Somehow I think we are mis-understanding. Please excuse the long introduction to answer your question.
>
> I am also very confused.
>
>> Consider an IPSEC initiator sitting behind a NAPT talking with an IPSEC responder on the Internet (within a DC).
>>
>> The initiator will start with IKE. The IKE packets will not be LB and since a NAPT would be detected, the IKE packets would use source and destination port 4500.
>
> Just to clarify, on the initiator those source/dest ports will be 4500, but on the responder the source port can be anything and the destination port will be 4500.
>
> PB>No, on the responder the destination port is not 4500, but is the source port received from the initiator. The reason for this is the NAPT translated the source port of the initiator IKE packet and to reverse the mapping as the responder sends to the initiator it must use the port mapped by the NAPT as the destination. This port will be translated back to 4500 by the NAPT before it is delivered to the initiator behind the NAPT.
>
>> After IKE established the SA, load balancing will be used with ESPinUDP packet exchanges.
>>
>> Both the initiator and the responder can exchange ESPinUDP with LB after the SA is established.
>
> Which SA? The initial IPsec SA ?
>
>> For ESPinUDP with LB the source port will be used for entropy. This does not necessary mean the source port is random, however does mean the source port must cover a range of values sufficient to provide the required level of entropy. Draft-xu-ipsecme-esp-in-udp-lb does not provide specific guidance on entropy values, however for NAT interoperability it is desirable to limit the number of entropy values.
>
> I think you are saying "pick a random port and keep using it" and not "use a random port for each packet", right ?
>
> PB>More precisely, pick a range of ports for use as entropy code points and use them by mapping the flows of the packets within the ESP to them. The source port picked is not really random since for LB to work properly we must retain flow integrity. Typically the port would be determined by a hash of the packet now encrypted with as an ESP. Also we can't choose a single port for entropy since the objective is to use the source port for spreading traffic over multiple paths. What I am saying is that for most applications we can choose (preferably contiguous) a port range (which might be as small as 2 ports or as large as 256 ports) which would be used for LB. The choise of these ports would then depend on the hash function applied to inside packet before ESP.
>
>> At an IPSEC initiator (behind NAPT) using
>> draft-xu-ipsecme-esp-in-udp-lb will generate LB ESPinUDP packets with
>> the entropy value in the source port and a new destination port
>
> Where does this "new destination port" come from? You only have a NAT mapping for port 500 and a NAT mapping for port 4500. Did a new destination port get negotiated over IKE? I don't see that specified in the draft. Or do you expect the non-NAT IPsec endpoint to auto-detect these packets to random ports based on encap payload and SPI ?
>
> PB>The new source port is proposed by draft-xu-ipsecme-esp-in-udp-lb and is to be obtained from IANA. This is a point of disagreement between myself and the authors of draft-xu-ipsecme-esp-in-udp-lb which I describe in a little more detail as follows.
>
>> , however the use of a new port to designate LB complicates the situation. Instead, if we consider both ends of the SA being configured for LB, then we can simply use the existing 4500 port to designate the ESPinUDP encapsulation. Using this observation IPSEC LB packets transmitted from the initiator (behind the NAPT) would have entropy in the source port and 4500 in the destination port.
>
> But when using only destination port 4500, then you run into the problem of NAT mapping updates. If you send a ESPinUDP packet to port 4500 from source port X, the peer will update its IPsec SA endpoint and start sending all packets to that single source port.
> So any entropy gain is lost.
>
> PB>We are in agreement here. What I am proposing is that this IPSEC behaviour (dynamic updating) needs to change to support LB through NAT. To support IPSEC LB through NAPT. For LB the IPsec SA endpoint needs to NOT update its end point, but instead use the end point established for IKE.
>
>> Each IPSEC initiator LB packet with a different entropy value will result in a new mapping at the NAPT.
>
> Yes, a new mapping, but the old mapping will be deleted. Is your draft saying we should _keep_ those mappings? If so, how would you ever detect a _rela_ IKE/ESP port remapping from the NAPT router between the endpoints?
>
> PB>The mappings generated by ESPinUDP with LB don't need to be preserved, only the IKE mapping needs to be preserved. Since IKE used a different source port (4500) from the ESPinUDP LB packets these should appear at different non-overlapping translations.
>
>> The normal behaviour of the responder (outside the NAPT) is to
>> transmit to the destination address and port of the last packet source
>> address and port (from the initiator)
>
> Not without MOBIKE. And with MOBIKE this requires explicit signaling via the INFORMATIONAL IKE message containing an UPDATE_ADDRESS payload.
>
> PB>I not certain we disagree since this is a matter of frame of reference. The initiator will always see the same destination port and addresses.
>
>> however this is where we deviate for a LB implementation. Instead the responder (outside the NAPT) transmits all responses to the address and port established for IKE, however with an entropy value in the source port. Since the NAPT has the IKE mapping this will deliver the ESPinUDP packet to the initiator where the destination port will be restored to 4500 and the source port will be the entropy value.
>
> I don't see how this can properly work. It would be really helpful if you can explain this with ASCII art in your draft document.
>
> PB>I have not put forward any draft on this topic, because my use case does not have any need for NAT. See draft-bottorff-ipsecme-mtdcuc-psec-lb. The only reason I bring it up is that NAT was raised as an issue in the previous email thread on draft-xu-ipsecme-esp-in-udp-lb. My only intent is to suggest that there probably is a way to solve NAPT traversal combined with LB.
>
>> So to your question about NAPT filtering. If the NAPT follows REQ-8 in RFC 4787, then filtering will pass the responder packets since the destination address and port will be mapped and the source address will also be known. In the event a NAPT violates REQ-8 and does Address and Port - Dependent Filtering then the responder packets might be filtered. There may be solutions for this case, however for the present discussion it does not seem worth pursuing the case were a NAPT violates REQ-8.
>
> I still don't see how you avoid reducing everything to 1 NAT mapping on the NAPT router, and thus with no extra entropy, as it seems multiple different source IPs are racing with the regular endpoint NAT mapping update. And if you change that behaviour to not update but keep the old NAT mappings, you need to not only change the kernel behaviour, you also need to signal whether this is supported through IKE, and whether you want it activated. Eg you would need some _SUPPORTED notify and then some USE_ notify.
>
> Paul W
>