<div dir="ltr"><div dir="ltr">Bart asked, </div><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Does someone know why these IPsec SAs are unidirectional? Usually the<br>RFC describes some reasoning behind certain design decisions. However, I<br>can't seem to find a justification other than "It's by design". On the<br>Internet however, I read that the two SA requirement is chosen from a<br>security perspective; If the key material of one of the SAs leaks, only<br>one way of the traffic can be inspected by a third party. The problem<br>with this reasoning is that I can't seem to find an additional source<br>claiming the same thing. Therefore, I'm not sure whether it's true.  <br clear="all"></blockquote><div><br></div><div>I like this question :) so I apologize for a lengthy response. Or, let's give you a tl;dr version: for key separation and refresh, mainly for security considerations. </div><div><br></div><div></div><div>So: </div><div>- The _keys_ used in both directions should (preferably) be different, for security. You mentioned one reason, i.e., that the if one of them leaks, the other one will remain secure; I guess that's true, although one may wonder about the scenarios in which only one of the two leaks, as they are used in same devices. A more relevant reason imho is that it may be easier to expose one of the two keys using cryptanalysis, e..g, since attacker can control the plaintext (chosen-plaintext) or can know the plaintext (known-plaintext). Yes, we all know that these are not the common attacks, still, IPsec is designed to defeat these too...</div><div><br></div><div>- As Brandon mentioned, the SPIs in the two directions differ. No, that's _not_ a mistake. By keeping these different, we allow each party to choose the SPI of traffic sent to it (that's how it works). This can be used for (1) efficiency - use predefined array of SPIs (think HW), (2) security - choose SPI randomly, defeating spoofed packets sent as part of DoS attack against IPsec tunnel (by off-path attacker). </div><div><br></div><div>- And then there's key management. When refreshing a key, or more precisely, changing a key due to exceeding max usage amount/period, we typically negotiate a new key and SPI. Once we got the `ack' from the remote peer (with the new SPI), we can start using the new key, while our peer may still be using an old key to send traffic to us (in fact we have the flexibility of not changing both keys together, e.g., if changing based on amount of traffic). </div><div><br></div><div>BTW, 

I was actually around in the initial design, but I can't claim to remember the process well enough to say these were exactly the reasons for this at the time; but these are the reasons I'm aware of (and I'll love to learn if there are more or if any of these are incorrect). 

</div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br>Amir <br><br></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 16, 2020 at 5:30 PM Brandon Martin <<a href="mailto:lists.nanog@monmotha.net">lists.nanog@monmotha.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2/15/20 1:17 PM, Bart Hermans wrote:<br>
> Does someone know why these IPsec SAs are unidirectional?<br>
<br>
My take on it:<br>
<br>
* IP, on which IPSec is directly built, is not a bidirectional protocol. <br>
  It is unidirection and fire-and-forget.  There's no assumption made <br>
that the source address specified in a given packet is even reachable <br>
from the destination address (much to the chagrin of many network <br>
operators), though it's supposed to be the case that it is.  Making SAs <br>
bidirectional would therefore represent something of a layering <br>
inversion which the IP suite has been surprisingly careful to avoid.<br>
<br>
* While many protocols built on top of IP, including ISAKMP are <br>
bidirectional, not all are, so having unidirectional SAs is potentially <br>
useful especially in the case of e.g. multicast as another poster <br>
pointed out.<br>
<br>
* ISAKMP is not the only way to key IPSec SAs.  It's a fairly complex <br>
protocol and is separate from the base IPSec specifications.  Someone <br>
could come up with another, possibly better way to do it.  You can also <br>
key them manually.  Again, projecting the nature of ISAKMP onto IPSec <br>
would be a layering violation and might inhibit future use cases of the <br>
latter.<br>
<br>
* An IPSec SA itself is quite simple.  Making it unidirectional is <br>
in-line with that notion and appears to have few consequences.<br>
<br>
* An IPSec SPD is also unidirectional (one could argue that this is a <br>
mistake, but see all the above), and an SA follows directly from an SPD.<br>
-- <br>
Brandon Martin<br>
</blockquote></div></div>