<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" consensus="true" docName="draft-moskowitz-ipsecme-rfc7402-beet-update-04"
	category="std" ipr="trust200902" obsoletes="" updates="rfc7402" submissionType="IETF" xml:lang="en"
	tocInclude="true" tocDepth="4" symRefs="true" sortRefs="true" version="3">
  <front>
    <title abbrev="BEET mode for ESP">A Bound End-to-End Tunnel (BEET) mode for ESP</title>
	<author fullname="Robert Moskowitz" initials="R" surname="Moskowitz" role="editor">
    <organization>HTT Consulting</organization>
    <address>
      <postal>
	    <street></street>
        <city>Oak Park</city>
        <region>MI</region>
        <code>48237</code>
        <country>USA</country>
      </postal>
      <email>rgm@labs.htt-consult.com</email>
	</address>
	</author>
    <author fullname="Petri Laari" initials="P" surname="Laari">
      <organization>Ericsson</organization>
      <address>
        <postal>
          <street>Hirsalantie 11</street>
          <city>JORVAS</city>
          <code>02420</code>
          <country>Finland</country>
        </postal>
        <email>petri.laari@ericsson.com</email>
      </address>
    </author>
    <author fullname="Jan Melen" initials="J" surname="Melen">
      <organization>Ericsson Software Technology</organization>
      <address>
        <postal>
          <street>Hirsalantie 11</street>
          <city>JORVAS</city>
          <code>02420</code>
          <country>Finland</country>
        </postal>
        <email>Jan.Melen@ericsson.com</email>
      </address>
    </author>
	<author fullname="Antony Antony" initials="A" surname="Antony">
	  <organization abbrev="secunet">secunet Security Networks AG</organization>
	  <address>
	    <email>antony.antony@secunet.com</email>
	  </address>
	</author>
	<author fullname="Andrei Gurtov" initials="A." surname="Gurtov">
	<organization>Linköping University</organization>
	<address>
	  <postal>
		<street>IDA</street>
		<city>Linköping</city>
		<code>58183</code>
		<country>Sweden</country>
	  </postal>
	  <email>gurtov@acm.org</email>
	</address>
	</author>
  <date/>
    <area>sec</area>
    <workgroup>IPSECME Working Group</workgroup>
<keyword>BEET</keyword>
<keyword>ESP</keyword>
<abstract>
<t>
	This document is an update to the Bound End-to-End Tunnel (BEET)
	mode for ESP in as described in <xref target="RFC7402"/>.  It
	brings the description in alignment with the addition of BEET mode
	for IKEv2 without any processing changes as described in <xref
	target="RFC7402"/>
</t>
</abstract>
  </front>
  <middle>

<section title="Introduction">
<t>
	The Bound End-to-End Tunnel (BEET) mode for ESP <xref
	target="RFC4303"/>, is an integral part of HIP <xref
	target="RFC7401"/>.  BEET was initially defined in <xref
	target="RFC7402" section="B"/>.
</t>
<t>
	This document leaves the basic BEET processing unchanged to not
	impact any <xref target="RFC7402"/> implementations, but separately
	defines BEET for clearer referencing for use in IKEv2 <xref
	target="I-D.ietf-ipsecme-ikev2-beet-mode" format="default"/>.  To
	assist with BEET in IPsec, this document includes <xref
	target="IPsec-Policy"/>.
</t>
<t>

</t>
</section>
<section anchor="terms" numbered="true" toc="default"> <name>Terms and Definitions</name>
<section numbered="true" toc="default"> <name>Requirements Terminology</name>
	<t>
		The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
		NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
		"MAY", and "OPTIONAL" in this document are to be interpreted as
		described in BCP 14 <xref target="RFC2119" /> <xref
		target="RFC8174" /> when, and only when, they appear in all
		capitals, as shown here.
	</t>
</section>
</section>

<section title="Protocol Definition">
<t>
	In this section we define the exact protocol formats and
	operations. This section is normative.
</t>
<section title="Changes to Security Association Data Structure">
<t>
	A BEET mode Security Association contains the same data as a
	regular tunnel mode Security Association, with the exception that
	the inner selectors must be single addresses and cannot be subnets.
	The data includes the following:
</t>
<ul>
	<li>A pair of inner IP addresses.</li>
	<li>A pair of outer IP addresses.</li>
	<li>Cryptographic keys and other data as defined in <xref
	target="RFC4301" section="4.4.2"/>.</li>
</ul>
<t>
	A conforming implementation MAY store the data in a way similar to
	a regular tunnel mode Security Association.
</t>
<t>
	Note that in a conforming implementation, the inner and outer
	addresses MAY belong to different address families. All
	implementations that support both IPv4 and IPv6 SHOULD support both
	IPv4-over-IPv6 and IPv6-over-IPv4 tunneling.
</t>
</section>
<section title="Packet Format">
<t>
	The wire packet format is identical to the ESP transport mode wire
	format as defined in Section 3.1.1 of <xref target="RFC4303"/>.
	However, the resulting packet contains outer IP addresses instead
	of the inner IP addresses received from the upper layer.  The
	construction of the outer headers is defined in <xref
	target="RFC4301" section="5.1.2"/>. The following diagram
	illustrates ESP BEET mode positioning for typical IPv4 and IPv6
	packets.
</t>
<section title="Inner IPv4 Datagram">
<figure anchor="inneripv4before">
<name>IPv4 INNER DATAGRAM BEFORE APPLYING ESP</name>
<artwork align="center"><![CDATA[

+-----------------------------+
| inner IP hdr  | TCP | Data  |
+-----------------------------+

]]></artwork></figure>
<figure anchor="afterespouteripv4">
<name>AFTER APPLYING ESP, OUTER v4 ADDRESSES</name>
<artwork align="center"><![CDATA[

+--------------------------------------------------+
| outer IP hdr  |     |     |      |   ESP   | ESP |
| (any options) | ESP | TCP | Data | Trailer | ICV |
+--------------------------------------------------+
                      |<---- encryption ---->|
                |<-------- integrity ------->|

]]></artwork></figure>
<figure anchor="afterespouteripv6">
<name>AFTER APPLYING ESP, OUTER v6 ADDRESSES</name>
<artwork align="center"><![CDATA[

+------------------------------------------------------+
| outer    | new ext |     |     |      |  ESP   | ESP |
| IPv6 hdr | hdrs    | ESP | TCP | Data | Trailer| ICV |
+------------------------------------------------------+
                           |<--- encryption ---->|
                     |<------ integrity -------->|

]]></artwork></figure>
<figure anchor="ipv4inneroptions">
<name>IPv4 INNER DATAGRAM with IP options BEFORE APPLYING ESP</name>
<artwork align="center"><![CDATA[

+----------------------------+
| inner IP hdr  |     |      |
|  + options    | TCP | Data |
+----------------------------+

]]></artwork></figure>
<figure anchor="ipv4outeroptions">
<name>IPv4 AFTER APPLYING ESP, OUTER v4 ADDRESSES INNER IPv4 OPTIONS</name>
<artwork align="center"><![CDATA[

+-------------------------------------------------------+
| outer IP hdr  |     |    |     |      |   ESP   | ESP |
| (any options) | ESP | PH | TCP | Data | Trailer | ICV |
+-------------------------------------------------------+
                      |<----- encryption -------->|
                |<----------- integrity --------->|
                    PH = BEET mode Pseudo-Header

]]></artwork></figure>
<figure anchor="ipv6outeroptions">
<name>IPv4 + OPTIONS AFTER APPLYING ESP, OUTER IPv6 ADDRESSES</name>
<artwork align="center"><![CDATA[


+---------------------------------------------------------------+
| outer  | new ext |     | PH       |     |      |  ESP   | ESP |
| IP hdr | hdrs.   | ESP | Options  | TCP | Data | Trailer| ICV |
+---------------------------------------------------------------+
                         |<------ encryption ------------>|
                   |<---------- integrity --------------->|

                           PH = BEET mode Pseudo-Header


]]></artwork></figure>
</section>

<section title="Inner IPv6 Datagram">
<figure anchor="ipv6beforeesp">
<name>IPv6 DATAGRAM BEFORE APPLYING ESP</name>
<artwork align="center"><![CDATA[

+--------------------------------------+
|                |  ext   |     |      |
| inner IPv6 hdr |  hdrs  | TCP | Data |
+--------------------------------------+

]]></artwork></figure>
<figure anchor="ipv6afterespipv6">
<name>IPv6 DATAGRAM AFTER APPLYING ESP, OUTER IPv6 ADDRESSES</name>
<artwork align="center"><![CDATA[

+--------------------------------------------------------------+
| outer    | new ext |     | ext  |     |      |  ESP    | ESP |
| IPv6 hdr | hdrs.   | ESP | hdrs | TCP | Data | Trailer | ICV |
+--------------------------------------------------------------+
                           |<-------- encryption ------------->|
                     |<-------------- integrity -------------->|

]]></artwork></figure>
<figure anchor="ipv6afterespipv4">
<name>IPv6 DATAGRAM AFTER APPLYING ESP, OUTER IPv4 ADDRESSES</name>
<artwork align="center"><![CDATA[

---------------------------------------------------
| outer  |     | ext  |     |      |  ESP    | ESP |
| IP hdr | ESP | hdrs.| TCP | Data | Trailer | ICV |
---------------------------------------------------
               |<------- encryption -------->|
         |<----------- integrity ----------->|

]]></artwork></figure>
</section>
</section>
<section title="Cryptographic Processing">
<t>
	The outgoing packets MUST be protected exactly as in ESP transport
	mode <xref target="RFC4303"/>.  That is, the upper layer protocol
	packet is wrapped into an ESP header, encrypted, and authenticated
	exactly as if regular transport mode was used.  The resulting ESP
	packet is subject to IP header processing as defined in <xref
	target="IP-Header-Processing"/> and <xref
	target="Handling-of-Outgoing"/>.  The incoming ESP protected
	messages are verified and decrypted exactly as if regular transport
	mode was used. The resulting cleartext packet is subject to IP
	header processing as defined in <xref
	target="IP-Header-Processing"/> and <xref
	target="Handling-of-Incoming"/>
</t>
</section>
<section title="IP Header Processing" anchor="IP-Header-Processing">
<t>
	The biggest difference between BEET mode and the other two modes is
	in IP header processing.  In the regular transport mode, the IP
	header is kept intact.  In the regular tunnel mode, an outer IP
	header is created on output and discarded on input.  In BEET mode,
	the IP header is replaced with another one on both input and
	output.
</t>
<t>
	On the BEET mode output side, the IP header processing MUST first
	ensure that the IP addresses in the original IP header contain the
	inner addresses as specified in the SA.  This MAY be ensured by
	proper policy processing, and it is possible that no checks are
	needed at the time of SA processing.  Once the IP header has been
	verified to contain the right IP inner addresses, it is discarded.
	A new IP header is created, using the fields of the discarded inner
	header (except the IP addresses) to populate the fields of the new
	outer header.  The IP addresses in the new header MUST be the outer
	tunnel addresses.
</t>
<t>
	On the input side, the received IP header is simply discarded.
	Since the packet has been decrypted and verified, no further checks
	are necessary.  A new IP header corresponding to a BEET mode inner
	header is created, using the fields of the discarded outer header
	(except the IP addresses) to populate the fields of the new inner
	header. The IP addresses in the new header MUST be the inner
	addresses.
</t>
<t>
	As the outer header fields are used as a hint for creating the
	inner header, it must be noted that the inner header differs as
	compared to a tunnel mode inner header.  In BEET mode, the inner
	header will have the Time to Live (TTL), Don't Fragment (DF) bit,
	and other option values from the outer header.  The TTL, DF bit,
	and other option values of the inner header MUST be processed by
	the stack.
</t>
</section>
<section title="Handling of Outgoing Packets" anchor="Handling-of-Outgoing">
<t>The outgoing BEET mode packets are processed as follows:</t>
<ol>
	<li>
		The system MUST verify that the IP header contains the inner
		source and destination addresses, exactly as defined in the SA.
		This verification MAY be explicit, or it MAY be implicit, for
		example, as a result of prior policy processing.  Note that in
		some implementations there may be no real IP header at this
		time but the source and destination addresses may be carried
		out of band.  If the source address is still unassigned, it
		SHOULD be ensured that the designated inner source address
		would be selected at a later stage.
	</li>
	<li>
		The IP payload (the contents of the packet beyond the IP
		header) is wrapped into an ESP header as defined in <xref
		target="RFC4303" section="3.3"/>.
	</li>
	<li>
		A new IP header is constructed, replacing the original one.
		The new IP header MUST contain the outer source and destination
		addresses, as defined in the SA.  Note that in some
		implementations there may be no real IP header at this time but
		the source and destination addresses may be carried out of
		band. In the case where the source address must be left
		unassigned, it SHOULD be ensured that the right source address
		is selected at a later stage.  Other than the addresses, it is
		RECOMMENDED that the new IP header copies the fields from the
		original IP header.
	</li>
	<li>
		If there are any IPv4 options in the original packet, it is
		RECOMMENDED that they are discarded.  If the inner header
		contains one or more options that need to be transported
		between the tunnel endpoints, the sender MUST encapsulate the
		options as defined <xref target="IPv4-ph"/>.
	</li>
</ol>
<t>
	Instead of literally discarding the IP header and constructing a
	new one, a conforming implementation MAY simply replace the
	addresses in an existing header.  However, if the RECOMMENDED
	feature of allowing the inner and outer addresses from different
	address families is used, this simple strategy does not work.
</t>
</section>
<section title="Handling of Incoming Packets" anchor="Handling-of-Incoming">
<t>The incoming BEET mode packets are processed as follows:</t>
<ol>
	<li>
		The system MUST verify and decrypt the incoming packet
		successfully, as defined in <xref target="RFC4303"
		section="3.4"/>. If the verification or decryption fails, the
		packet MUST be discarded.
	</li>
	<li>
		The original IP header is simply discarded, without any checks.
		Since the ESP verification succeeded, the packet can be safely
		assumed to have arrived from the right sender.
	</li>
	<li>
		A new IP header is constructed, replacing the original one. The
		new IP header MUST contain the inner source and destination
		addresses, as defined in the SA.  If the sender has set the ESP
		Next Header field to 94 and included the pseudo header as
		described in <xref target="IPv4-ph"/>, the receiver MUST
		include the options after the constructed IP header.  Note that
		in some implementations the real IP header may have already
		been discarded and the source and destination addresses are
		carried out of band.  In such a case, the out-of-band addresses
		MUST be the inner addresses. Other than the addresses, it is
		RECOMMENDED that the new IP header copies the fields from the
		original IP header. [AA how about ESP in UDP and mapping
		changes?]
	</li>
</ol>
<t>
	Instead of literally discarding the IP header and constructing a
	new one, a conforming implementation MAY simply replace the
	addresses in an existing header.  However, if the RECOMMENDED
	feature of allowing the inner and outer addresses from different
	address families is used, this simple strategy does not work.
</t>
</section>
<section anchor="IPv4-ph" title="Handling of IPv4 Options">
<t>
	In BEET mode, if IPv4 options are transported inside the tunnel,
	the sender MUST include a pseudo header after the ESP header.  The
	pseudo header indicates that IPv4 options from the original packet
	are to be applied to the packet on the input side or the IPv4
	fragmentation flags and fragmentation offset is set.
</t>
<t>
	The sender MUST set the Next Header field in the ESP header to 94.
	The resulting pseudo header, including the IPv4 options, MUST be
	padded to an 8-octet boundary.  The padding length is expressed in
	octets; valid padding lengths are 0 or 4 octets, as the original
	IPv4 options are already padded to a 4-octet boundary.  The padding
	MUST be filled with No Operation (NOP) options as defined in
	(Internet Header Format) <xref target="RFC791" section="3.1"/>
	(Internet Protocol). The padding is added in front of the
	original options to ensure that the receiver is able to reconstruct
	the original IPv4 datagram.  The Header Length field contains the
	length of the IPv4 options, and padding in 8-octet units.
</t>
<figure anchor="pseudoheader">
<name>BEET mode pseudo header format</name>
<artwork align="center"><![CDATA[

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Next Header  |   Header Len  |    Pad Len    |       Reserved|
+---------------+---------------+-------------------------------+
|              Padding (if needed)                              |
+-----------------------------------------+---------------------+
|                     IPv4 options ...                          |
|                                                               |
+---------------------------------------------------------------+

]]></artwork></figure>
	<dl newline="false" spacing="normal" indent="20">
		<dt>Next Header</dt>
		<dd>
			identifies the data following this header.
		</dd>
		<dt>Length in octets</dt>
		<dd>
			8-bit unsigned integer.  Length of the pseudo header in
			8-octet units, not including the first 8 octets.
		</dd>
	</dl>
<t>
	The receiver MUST remove this pseudo header and padding as a part
	of BEET processing, in order to reconstruct the original IPv4
	datagram. The IPv4 options included in the pseudo header MUST be
	added after the reconstructed IPv4 (inner) header on the receiving
	side.
</t>
<t>
	[AA NOTE: Note: when the IPv4 options are present, the outer
	header's IHL would be different from the inner header IHL NEXT
	paragraph is extra???]
</t>
</section>
<section title="Handling of Inner IP Fragment" anchor="IP-Frag">
<section title="Inner IPv4 Fragment" anchor="IPv4-Frag">
<t>
	When the inner IPv4 datagram is a fragment (as specified by the
	"more-fragments" flag being set to one <xref target="RFC791"/>),
	this flag MUST NOT be copied to the outer ESP datagram header.
	Additionally, for any non-first fragment with a "more-fragments"
	flag or "fragment offset field," these two fields MUST NOT be
	copied to the outer IPv4 header of the ESP datagram.
</t>
<t>
	Here are a few possible ways to deal with these IPv4 fragments.
</t>
<ol>
 <li>
  Re-assemble the IPv4 fragments, send to ESP, and ESP datagram may be
  fragmented as required.
 </li>
 <li>
  Drop the IPv4 fragments, i.e., BEET mode IPv4 support for fragments
  is optional.
 </li>
 <li>
   Copy the fragment flag and offset length from the inner IPv4 header
   to BEET pseudo-header, <xref target="pseudoheader-frag"/>.
 </li>
 </ol>
  <t>
	The sender MUST set the next protocol field on the ESP header as
	94. The resulting pseudo header including the IPv4 options,  MUST
	be padded to 8 octet boundary.  The padding length is expressed in
	octets, valid padding lengths are 0 or 4 octets as the original
	IPv4 options are already padded to 4 octet boundary.  The padding
	MUST be filled with NOP options as defined in Internet Protocol
	<xref target="RFC791" section="3.1"/> Internet header format.  The
	padding is added in front of the original options to ensure that
	the receiver is able to reconstruct the original IPv4 datagram. The
	Header Length field contains the length of the IPv4 options, and
	padding in 8 octets units.
   </t>
<figure align="center" anchor="pseudoheader-frag">
        <name> BEET mode pseudo header format </name>
        <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Next Header  |   Header Len  |    Pad Len    |F = 2| Reserved|
   +---------------+---------------+-------------------------------+
   | IHF = 3 |Fragment offset (opt.) = 13 | PH padding             |
   +-----------------------------------------+---------------------+
   |                     IPv4 options (opt.) | Opt Padding         |
   +---------------------------------------------------------------+
  ]]></artwork>
</figure>
	<dl newline="false" spacing="normal" indent="26">
		<dt>Next Header</dt>
		<dd>
			Identifies the data following this header.
		</dd>
		<dt>Header Len</dt>
		<dd>
			8-bit unsigned integer. Length of the pseudo header in
			8-octet units, including IHF and Fragment offset, IPv4
			options, when present, not including the first 8 octets.
		</dd>
		<dt>Pad Len</dt>
		<dd>
			<t>8-bits unsigned integer. Length of padding in octets, valid
			padding lengths are:</t>
		<dl newline="false" spacing="normal" indent="8">
		<dt>0, 4</dt>
		<dd>
			no IPv4 fragment and options are present [AA Note : old case]
		</dd>
		<dt>2, 6</dt>
		<dd>
			IPv4 fragment and no IPv4 options.
		</dd>
		<dt>2, 6</dt>
		<dd>
			IPv4 fragment and options.
		</dd>
		</dl>
		</dd>
		<dt>F</dt>
		<dd>
			2 bits Flags. 00 IP options, 01 Fragment, 10 IP options and
			Fragment, 11 Reserved
		</dd>
		<dt>Reserved</dt>
		<dd>
			Lower 6-bits, set to zero
		</dd>
		<dt>IHF</dt>
		<dd>
			Flags from the inner IP header (optional) when F = 01 or 10
		</dd>
		<dt>Fragment offset 13 bits</dt>
		<dd>
			Fragment offset from the inner IP header (optional) when F
			= 01 or 10
		</dd>
		<dt>Padding</dt>
		<dd>
			0, 2 or 4 octets of zeros, depending on the fragment flag.
		</dd>
		<dt>IPv4 options</dt>
		<dd>
			IPv4 options from the inner IP header with optional
			padding. Alligned to 32 bits.
		</dd>
	</dl>
<t>
	The receiver MUST remove this pseudo-header and padding as a part
	of BEET processing, in order to reconstruct the original IPv4
	datagram. The IPv4 options included in the pseudo-header MUST be
	added after the reconstructed IPv4 (inner) header on the receiving
	side. Also copy the flags and Fragment offset when the PH flags is
	01, 10.
</t>
<t>
	Note: when the IPv4 options are present, the outer header's IHL
	would be different from the inner header IHL.
</t>
<t>
	The receiver MUST remove this pseudo-header and padding as a part
	of BEET processing, in order reconstruct the original IPv4
	datagram. The IPv4 options included into the pseudo-header MUST be
	added after the reconstructed IPv4 (inner) header on the receiving
	side.
</t>
<t>
	Note: When the pseudo-header is present due to the presence of IPv4
	options in the inner IP header, the outer header's IHL (Internet
	Header Length) would be different from the inner IP header IHL.
</t>
</section>
<section title="Inner IPv6 Fragment" anchor="IPv6-Frag">
 <t>
	It's crucial to highlight that IPv6 uses fragmentation information
	in a distinct manner than IPv4 <xref target="RFC8200"
	section="4.5"/>. Specifically, an IPv6 fragment uses IPv6 optional
	extension headers for fragments. BEET mode treats the IPv6 optional
	extensions as ESP payload and move from inner header to ESP
	payload.
</t>
</section>
<section title="IPv4-in-IPv6" anchor="IPv4IPv6-Frag">
<t>
	Mixed family IPv4 inside and IPv6 outside.The inner datagram's IP
	version MUST be independent of the outer IP version. The inner
	address family and address are taken from the negotiated Traffic
	Selectors. When the inner datagram contains IPv4 with fragments or
	IPv4 options, use <xref target="IPv4-Frag"/>.
</t>
</section>
<section title="IPv6-in-IPv4" anchor="IPv6IPv4-Frag">
<t>
	Mixed family IPv6 inside and IPv4 outside.
	When the inner datagram is an IPv6 datagram with IPv6 optional
	extension headers, copy it into ESP payload <xref target="IPv6-Frag"/>
</t>
</section>
</section>
</section>

<section anchor="IPsec-Policy" title="IPsec Specific Policy Considerations">
<t>
	In this section we describe how BEET mode affects IPsec policy
	processing.  This section is normative.
</t>
<t>
	A BEET Security Association SHOULD NOT be used with NULL
	authentication.
</t>
<t>
	On the output side, the IPsec policy processing mechanism SHOULD
	take care that only packets with IP addresses matching the inner
	addresses of a Security Association are passed on to that Security
	Association. If the policy mechanism does not provide full
	assurance on this point, the SA processing MUST check the
	addresses.  Further policy distinction may be specified based on IP
	version, upper layer protocol, and ports.  If such restrictions are
	defined, they MUST be enforced.
</t>
<t>
	On the output side, the policy rules SHOULD prevent any packets
	containing the pair of inner IP addresses from escaping to the wire
	in cleartext.
</t>
<t>
	On the input side, no policy processing is necessary for encrypted
	packets.  The SA is deduced from the SPI and destination address.
	A single SA MAY be associated with several outter destination
	addresses.  Since the outer IPsec addresses are discarded, and
	since the packet authenticity and integrity are protected by ESP,
	there is no need to check the outer addresses.  Since the inner
	addresses are fixed and restored from the SA, there is no need to
	check them. There MAY be further policy rules specifying allowed
	upper layer protocols and ports. If such restrictions are defined,
	they MUST be enforced.
</t>
<t>
	On the input side, there SHOULD be a policy rule that filters out
	cleartext packets that contain the inner addresses.
</t>
</section>

<section title="Security Considerations">
<t>
	In this document, the usage of ESP [RFC4303] between hosts to
	protect data traffic is introduced. The security considerations for
	ESP are discussed in the ESP specification.
</t>
<t>
	In this section we discuss the security properties of the BEET
	mode, discussing some and point out some of its limitations <xref
	target="RFC3552"/>.
</t>
<t>
	There are no known new vulnerabilities that the introduction of the
	BEET mode would create.
</t>
<t>
	Because in BEET mode the outer header source address is not checked
	at the time of input handling, there is a potential for a DoS
	attack where the attacker would send random packets that match the
	SPI of some BEET-mode SA. This kind of attack would cause the
	victim to perform unnecessary integrity checks that would result in
	a failure. However, if this kind of behavior is detected, the node
	may request rekeying using IKEv2 rekey, and after rekeying. If the
	attacker was not on the path, the new SPI value would not be known
	by the attacker.
</t>
</section>

<section title="IANA Considerations">
<t>NONE</t>
</section>

<section title="Implementation Status">
<t>
	BEET mode was first implemented as a patch to Linux kernel by
	Helsinki Institute for Information Technology, Finland around 2007.
	It was later submitted for kernel integration and included into
	mainstream release around 2010. See BEET patch for 2.6.20.21 linux
	kernel (Joakim Koskela). <xref target="HIPL" format="default"/>
	(HIP for Linux) is a software project that implements the Host
	Identity Protocol (HIP) on Linux systems. It was funded under
	InfraHIP label by Finnish innovation agency Tekes.
</t>
<t>[Note to RFC Editor: Please remove this section and the reference to
<xref target="RFC6982"/> before publication.]</t>

<t>This section records the status of known implementations of the
protocol defined by this specification at the time of posting of this
Internet-Draft, and is based on a proposal described in <xref
target="RFC7942"/>. The description of implementations in this section
is intended to assist the IETF in its decision processes in progressing
drafts to RFCs. Please note that the listing of any individual
implementation here does not imply endorsement by the IETF.
Furthermore, no effort has been spent to verify the information
presented here that was supplied by IETF contributors. This is not
intended as, and must not be construed to be, a catalog of available
implementations or their features. Readers are advised to note that
other implementations may exist.</t>

<t>According to <xref target="RFC7942"/>, "this will allow reviewers
and working groups to assign due consideration to documents that have
the benefit of running code, which may serve as evidence of valuable
experimentation and feedback that have made the implemented protocols
more mature.  It is up to the individual working groups to use this
information as they see fit".</t>

<t>Authors are requested to add a note to the RFC Editor at the top of
this section, advising the Editor to remove the entire section before
publication, as well as the reference to <xref target="RFC7942"/>.</t>

</section>

<section title="Acknowledgments">
<t>
	Antony Antony performed the original extraction of <xref
	target="RFC7402" section="B"/> to form this draft.  Most of the
	work after that has been cleaning up the formatting and adding more
	IPsec specific content.
</t>
</section>

</middle>
<back>
<displayreference target="I-D.ietf-ipsecme-ikev2-beet-mode" to="ikev2-beet-mode"/>
<references title="Normative References">
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4301.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4303.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.791.xml"/>
</references>
<references title="Informative References">
	<xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-ipsecme-ikev2-beet-mode.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3552.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6982.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7942.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7401.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7402.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8200.xml"/>
	<reference anchor="HIPL"  target="https://mkomu.kapsi.fi/hipl/">
		<front>
			<title>HIP for Linux</title>
			<author>
				<organization>Helsinki Institute for Information Technology</organization>
			</author>
		</front>
	</reference>
</references>

  </back>
</rfc>
