<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="no"?>
<?rfc subcompact="no"?>
<rfc category="bcp" docName="draft-ietf-tsvwg-behave-requirements-update-08"
     ipr="pre5378Trust200902" updates="4787, 5382, 5508 ">
  <front>
    <title abbrev="draft-ietf-tsvwg-behave-requirements-update">Network
    Address Translation (NAT) Behavioral Requirements Updates</title>

    <author fullname="Reinaldo Penno" initials="R." surname="Penno">
      <organization abbrev="Cisco">Cisco Systems, Inc.</organization>

      <address>
        <postal>
          <street>170 West Tasman Drive</street>

          <city>San Jose</city>

          <region>California</region>

          <code>95134</code>

          <country>USA</country>
        </postal>

        <email>repenno@cisco.com</email>
      </address>
    </author>

    <author fullname="Simon Perreault" initials="S." surname="Perreault">
      <organization>Jive Communications</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <country>Canada</country>
        </postal>

        <email>sperreault@jive.com</email>
      </address>
    </author>

    <author fullname="Mohamed Boucadair" initials="M." role="editor"
            surname="Boucadair">
      <organization>Orange</organization>

      <address>
        <postal>
          <street></street>

          <city>Rennes</city>

          <region></region>

          <code>35000</code>

          <country>France</country>
        </postal>

        <email>mohamed.boucadair@orange.com</email>
      </address>
    </author>

    <author fullname="Senthil Sivakumar" initials="S." surname="Sivakumar">
      <organization abbrev="Cisco">Cisco Systems, Inc.</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

          <country>United States</country>
        </postal>

        <email>ssenthil@cisco.com</email>
      </address>
    </author>

    <author fullname="Kengo Naito" initials="K." surname="Naito">
      <organization>NTT</organization>

      <address>
        <postal>
          <street></street>

          <city>Tokyo</city>

          <country>Japan</country>
        </postal>

        <email>k.naito@nttv6.jp</email>
      </address>
    </author>

    <date day="" month="" year="" />

    <area>Transport Area</area>

    <workgroup>TSVWG</workgroup>

    <keyword>address sharing</keyword>

    <keyword>IPv4 service continuity</keyword>

    <keyword>Carrier Grade NAT</keyword>

    <keyword>CGN</keyword>

    <keyword>LSN</keyword>

    <keyword>NAT traversal</keyword>

    <keyword>RFC4787</keyword>

    <keyword>RFC5382</keyword>

    <keyword>RFC5508</keyword>

    <keyword>DS-Lite</keyword>

    <keyword>NAT64</keyword>

    <keyword>Address depletion</keyword>

    <abstract>
      <t>This document clarifies and updates several requirements of RFC4787,
      RFC5382, and RFC5508 based on operational and development experience.
      The focus of this document is NAT44.</t>

      <t>This document updates RFCs 4787, 5382, and 5508.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t><xref target="RFC4787"></xref>, <xref target="RFC5382"></xref>, and
      <xref target="RFC5508"></xref> contributed to enhance Network Address
      Translation (NAT) interoperability and conformance. Operational
      experience gained through widespread deployment and evolution of NAT
      indicates that some areas of the original documents need further
      clarification or updates. This document provides such clarifications and
      updates.</t>

      <section title="Scope">
        <t>The goal of this document is to clarify and update the set of
        requirements listed in <xref target="RFC4787"></xref>, <xref
        target="RFC5382"></xref>, and <xref target="RFC5508"></xref>. The
        document focuses exclusively on NAT44.</t>

        <t>The scope of this document has been set so that it does not create
        new requirements beyond those specified in the documents cited
        above.</t>

        <t>Carrier-Grade NAT (CGN) related requirements are defined in <xref
        target="RFC6888"></xref>.</t>
      </section>

      <section title="Terminology">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
        target="RFC2119"></xref>.</t>

        <t>The reader is assumed to be familiar with the terminology defined
        in: <xref target="RFC2663"></xref>,<xref target="RFC4787">
        </xref>,<xref target="RFC5382"> </xref>, and <xref
        target="RFC5508"></xref>.</t>

        <t>In this document, the term "NAT" refers to both "Basic NAT" and
        "Network Address/Port Translator (NAPT)" (see Section 3 of <xref
        target="RFC4787"></xref>). As a reminder, Basic NAT and NAPT are two
        variations of traditional NAT, in that translation in Basic NAT is
        limited to IP addresses alone, whereas translation in NAPT is extended
        to include IP address and Transport identifier (such as TCP/UDP port
        or ICMP query ID) (refer to Section 2 of <xref
        target="RFC3022"></xref>).</t>
      </section>
    </section>

    <section anchor="tracking" title="TCP Session Tracking">
      <t><xref target="RFC5382"></xref> specifies TCP timers associated with
      various connection states but does not specify the TCP state machine a
      NAT44 should follow as a basis to apply such timers. <list
          style="hanging">
          <t hangText="Update:">The TCP state machine depicted in <xref
          target="state"></xref>, adapted from <xref target="RFC6146"></xref>,
          SHOULD be implemented by a NAT for TCP session tracking
          purposes.</t>
        </list></t>

      <t><vspace blankLines="16" /></t>

      <t><figure align="left" anchor="state"
          title="Simplified version of the TCP State Machine">
          <artwork><![CDATA[                 +----------------------------+
                 |                            |
                 V                            |
              +------+   Client               |
              |CLOSED|-----SYN------+         |
              +------+              |         |
                  ^                 |         |
                  |TCP_TRANS T.O.   |         |
                  |                 V         |
              +-------+          +-------+    |
              | TRANS |          |  INIT |    |
              +-------+          +-------+    |
                |    ^               |        |
          data pkt   |               |        |
                | Server/Client RST  |        |
                |  TCP_EST T.O.      |        |
                V    |           Server SYN   |
           +--------------+          |        |
           | ESTABLISHED  |<---------+        |
           +--------------+                   |
            |           |                     |
      Client FIN    Server FIN                |
            |           |                     |
            V           V                     |
     +---------+   +----------+               |
     |  C FIN  |   |  S FIN   |               |
     |   RCV   |   |    RCV   |               |
     +---------+   +----------+               |
         |             |                      |
     Server FIN      Client FIN            TCP_TRANS
         |             |                    T.O.
         V             V                      |
     +----------------------+                 |
     |   C FIN + S FIN RCV  |-----------------+
     +----------------------+
 Legend:
   * Messages sent or received from the server are 
     prefixed with "Server".
   * Messages sent or received from the client are
     prefixed with "Client".
   * "C" means "Client-side"
   * "S" means "Server-side".
   * TCP_EST T.O: refers to the established connection 
     idle timeout as defined in [RFC5382].
   * TCP_TRANS T.O: refers to the transitory connection  
     idle timeout as defined in [RFC5382].
]]></artwork>
        </figure></t>

      <section title="TCP Transitory Connection Idle-Timeout">
        <t>The transitory connection idle-timeout is defined as the minimum
        time a TCP connection in the partially open or closing phases must
        remain idle before the NAT considers the associated session a
        candidate for removal (REQ-5 of <xref target="RFC5382"></xref>). But
        <xref target="RFC5382"></xref> does not clearly state whether these
        can be configured separately.</t>

        <t><list style="hanging">
            <t hangText="Clarification:">This document clarifies that a NAT
            SHOULD provide different configurable parameters for configuring
            the open and closing idle timeouts.<vspace blankLines="1" />To
            accommodate deployments that consider a partially open timeout of
            4 minutes as being excessive from a security standpoint, a NAT MAY
            allow the configured timeout to be less than 4 minutes. However, a
            minimum default transitory connection idle-timeout of 4 minutes is
            RECOMMENDED.</t>
          </list></t>
      </section>

      <section title=" TCP RST">
        <t><xref target="RFC5382"></xref> leaves the handling of TCP RST
        packets unspecified.</t>

        <t><list style="hanging">
            <t hangText="Update:">This document adopts a similar default
            behavior as in <xref target="RFC6146"></xref>. Concretely, when
            the NAT receives a TCP RST matching an existing mapping, it MUST
            translate the packet according to the NAT mapping entry. Moreover,
            the NAT SHOULD wait for 4 minutes before deleting the session and
            removing any state associated with it if no packets are received
            during that 4 minutes timeout. <vspace
            blankLines="1" />Notes:<list style="symbols">
                <t>Admittedly, the NAT has to verify whether received TCP RST
                packets belong to a connection. This verification check is
                required to avoid off-path attacks.</t>

                <t>If the NAT removes immediately the NAT mapping upon receipt
                of a TCP RST message, stale connections may be maintained by
                endpoints if the first RST message is lost between the NAT and
                the recipient.</t>
              </list></t>
          </list></t>
      </section>
    </section>

    <section anchor="overlapping" title="Port Overlapping Behavior">
      <t>REQ-1 from <xref target="RFC4787"></xref> and REQ-1 from <xref
      target="RFC5382"></xref> specify a specific port overlapping behavior;
      that is the external IP address and port can be reused for connections
      originating from the same internal source IP address and port
      irrespective of the destination. This is known as endpoint-independent
      mapping (EIM). <list style="hanging">
          <t hangText="Update:">This document clarifies that this port
          overlapping behavior may be extended to connections originating from
          different internal source IP addresses and ports as long as their
          destinations are different. <vspace blankLines="1" />The following
          mechanism MAY be implemented by a NAT:<list style="empty">
              <t>If destination addresses and ports are different for outgoing
              connections started by local clients, a NAT MAY assign the same
              external port as the source ports for the connections. The port
              overlapping mechanism manages mappings between external packets
              and internal packets by looking at and storing their 5-tuple
              (protocol, source address, source port, destination address,
              destination port).</t>
            </list><vspace blankLines="1" />This enables concurrent use of a
          single NAT external port for multiple transport sessions, which
          allows a NAT to successfully process packets in an IP address
          resource limited network (e.g., deployment with high address space
          multiplicative factor (refer to <xref target="RFC6269">Appendix B.
          of </xref>)).</t>
        </list></t>

      <t></t>
    </section>

    <section anchor="app" title="Address Pooling Paired (APP)">
      <t>The "IP address pooling" behavior of "Paired" (APP) was recommended
      in REQ-2 from <xref target="RFC4787"></xref>, but the behavior when an
      external IPv4 runs out of ports was left undefined.</t>

      <t><list style="hanging">
          <t hangText="Clarification:">This document clarifies that if APP is
          enabled, new sessions from a host that already has a mapping
          associated with an external IP that ran out of ports SHOULD be
          dropped. A configuration parameter MAY be provided to allow a NAT to
          starting using ports from another external IP address when the one
          that anchored the APP mapping ran out of ports. Tweaking this
          configuration parameter is a trade-off between service continuity
          and APP strict enforcement. Note, this behavior is sometimes
          referred as 'soft-APP'. <vspace blankLines="1" />As a reminder, the
          recommendation for the particular case of a CGN is that an
          implementation must use the same external IP address mapping for all
          sessions associated with the same internal IP address, be they TCP,
          UDP, ICMP, something else, or a mix of different protocols <xref
          target="RFC6888"></xref>.</t>
        </list><list style="hanging">
          <t hangText="Update:">This behavior SHOULD apply also for TCP.</t>
        </list><!----></t>
    </section>

    <section anchor="EIM"
             title="Endpoint-Independent Mapping (EIM) Protocol Independence">
      <t>REQ-1 from <xref target="RFC4787"></xref> and REQ-1 from <xref
      target="RFC5382"></xref> do not specify whether EIM are
      protocol-dependent or protocol-independent. For example, if an outbound
      TCP SYN creates a mapping, it is left undefined whether outbound UDP
      packets can reuse such mapping.</t>

      <t><list style="hanging">
          <t hangText="Update:">EIM mappings SHOULD be protocol-dependent. A
          configuration parameter MAY be provided to allow protocols that
          multiplex TCP and UDP over the same source IP address and port
          number to use a single mapping. The default value of this
          configuration parameter MUST be protocol-dependent EIM.<vspace
          blankLines="1" />This update is consistent with the stateful NAT64
          <xref target="RFC6146"></xref> that clearly specifies three binding
          information bases (TCP, UDP, ICMP).</t>
        </list></t>
    </section>

    <section anchor="EIF"
             title="Endpoint-Independent Filtering (EIF) Protocol Independence">
      <t>REQ-8 from <xref target="RFC4787"></xref> and REQ-3 from <xref
      target="RFC5382"></xref> do not specify whether mappings with
      endpoint-independent filtering (EIF) are protocol-independent or
      protocol-dependent. For example, if an outbound TCP SYN creates a
      mapping, it is left undefined whether inbound UDP packets matching that
      mapping should be accepted or rejected.</t>

      <t><list style="hanging">
          <t hangText="Update:">EIF filtering SHOULD be protocol-dependent. A
          configuration parameter MAY be provided to make it
          protocol-independent. The default value of this configuration
          parameter MUST be protocol-dependent EIF.<vspace
          blankLines="1" />This behavior is aligned with the update in <xref
          target="EIM"></xref>. <vspace blankLines="1" />Applications that can
          be transported over a variety of transport protocols and/or support
          transport fall back schemes won't experience connectivity failures
          if the NAT is configured with protocol-independent EIM and
          protocol-independent EIF.</t>
        </list></t>
    </section>

    <section anchor="refresh"
             title="Endpoint-Independent Filtering (EIF) Mapping Refresh">
      <t>The NAT mapping Refresh direction may have a "NAT Inbound refresh
      behavior" of "True" according to REQ-6 from <xref
      target="RFC4787"></xref>, but <xref target="RFC4787"></xref> does not
      clarify how this behavior applies to EIF mappings. The issue in question
      is whether inbound packets that match an EIF mapping but do not create a
      new session due to a security policy should refresh the mapping
      timer.</t>

      <t><list style="hanging">
          <t hangText="Clarification:">This document clarifies that even when
          a NAT has an inbound refresh behavior set to 'TRUE', such packets
          SHOULD NOT refresh the mapping. Otherwise a simple attack of a
          packet every 2 minutes can keep the mapping indefinitely.</t>
        </list><list style="hanging">
          <t hangText="Update:">This behavior SHOULD apply also for TCP.</t>
        </list></t>

      <section anchor="error"
               title="Outbound Mapping Refresh and Error Packets">
        <t><list style="hanging">
            <t hangText="Update:">In the case of NAT outbound refresh
            behavior, ICMP Errors or TCP RST outbound packets, sent as
            response to inbound packets, SHOULD NOT refresh the mapping. Other
            packets which indicate the host is not interested in receiving
            packets MAY be configurable to also not refresh state, such as
            STUN error response <xref target="RFC5389"></xref> or IKE
            INVALID_SYNTAX <xref target="RFC7296"></xref>.</t>
          </list></t>
      </section>
    </section>

    <section anchor="parity" title="Port Parity">
      <t><list style="hanging">
          <t hangText="Update:">A NAT MAY disable port parity preservation for
          all dynamic mappings. Nevertheless, A NAT SHOULD support means to
          explicitly request to preserve port parity (e.g., <xref
          target="RFC7753"></xref>).</t>
        </list><list style="empty">
          <t>Note: According to <xref target="RFC6887"></xref>, dynamic
          mappings are said to be dynamic in the sense that they are created
          on demand, either implicitly or explicitly:<list style="numbers">
              <t>Implicit dynamic mappings refer to mappings that are created
              as a side effect of traffic such as an outgoing TCP SYN or
              outgoing UDP packet. Implicit dynamic mappings usually have a
              finite lifetime, though this lifetime is generally not known to
              the client using them.</t>

              <t>Explicit dynamic mappings refer to mappings that are created
              as a result, for example, of explicit Port Control Protocol
              (PCP) MAP and PEER requests. Explicit dynamic mappings have a
              finite lifetime, and this lifetime is communicated to the
              client.</t>
            </list></t>
        </list></t>
    </section>

    <section anchor="randomization" title="Port Randomization">
      <t><list style="hanging">
          <t hangText="Update:">A NAT SHOULD follow the recommendations
          specified in Section 4 of <xref target="RFC6056"></xref>,
          especially: <list style="empty">
              <t>"A NAPT that does not implement port preservation [RFC4787]
              [RFC5382] SHOULD obfuscate selection of the ephemeral port of a
              packet when it is changed during translation of that packet. A
              NAPT that does implement port preservation SHOULD obfuscate the
              ephemeral port of a packet only if the port must be changed as a
              result of the port being already in use for some other session.
              A NAPT that performs parity preservation and that must change
              the ephemeral port during translation of a packet SHOULD
              obfuscate the ephemeral ports. The algorithms described in this
              document could be easily adapted such that the parity is
              preserved (i.e., force the lowest order bit of the resulting
              port number to 0 or 1 according to whether even or odd parity is
              desired)."</t>
            </list></t>
        </list></t>
    </section>

    <section anchor="id" title="IP Identification (IP ID)">
      <t><list style="hanging">
          <t hangText="Update:">A NAT SHOULD handle the Identification field
          of translated IPv4 packets as specified in Section 5.3.1 of <xref
          target="RFC6864"></xref>.</t>
        </list></t>
    </section>

    <section anchor="icmp" title="ICMP Query Mappings Timeout">
      <t>Section 3.1 of <xref target="RFC5508"></xref> specifies that ICMP
      Query Mappings are to be maintained by a NAT. However, the specification
      doesn't discuss Query Mapping timeout values. Section 3.2 of <xref
      target="RFC5508"></xref> only discusses ICMP Query Session Timeouts.</t>

      <t><list style="hanging">
          <t hangText="Update:">ICMP Query Mappings MAY be deleted once the
          last session using the mapping is deleted.</t>
        </list></t>
    </section>

    <section anchor="hairicmp" title="Hairpinning Support for ICMP Packets">
      <t>REQ-7 from <xref target="RFC5508"></xref> specifies that a NAT
      enforcing 'Basic NAT' must support traversal of hairpinned ICMP Query
      sessions.</t>

      <t><list style="hanging">
          <t hangText="Clarification:">This implicitly means that address
          mappings from external address to internal address (similar to
          Endpoint Independent Filters) must be maintained to allow inbound
          ICMP Query sessions. If an ICMP Query is received on an external
          address, a NAT can then translate to an internal IP.</t>
        </list>REQ-7 from <xref target="RFC5508"></xref> specifies that all
      NATs must support the traversal of hairpinned ICMP Error messages.</t>

      <t><list style="hanging">
          <t hangText="Clarification:">This behavior requires a NAT to
          maintain address mappings from external IP address to internal IP
          address in addition to the ICMP Query Mappings described in Section
          3.1 of <xref target="RFC5508"></xref>.</t>
        </list></t>
    </section>

    <section anchor="iana" title="IANA Considerations">
      <t>This document does not require any IANA action.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>NAT behavioral considerations are discussed in <xref
      target="RFC4787"></xref>, <xref target="RFC5382"></xref>, and <xref
      target="RFC5508"></xref>.</t>

      <t>Because some of the clarifications and updates (e.g., <xref
      target="tracking"></xref>) are inspired from NAT64, the security
      considerations discussed in Section 5 of <xref target="RFC6146"></xref>
      apply also for this specification.</t>

      <t>The update in <xref target="overlapping"></xref> allows for an
      optimized NAT resource usage. In order to avoid service disruption, the
      NAT must not invoke this functionality unless the packets are to be sent
      to distinct destination addresses.</t>

      <t>Some of the updates (e.g., <xref target="refresh"></xref>, <xref
      target="randomization"></xref>, and <xref target="icmp"></xref>) allow
      for an increased security compared to <xref target="RFC4787"></xref>,
      <xref target="RFC5382"></xref>, and <xref target="RFC5508"></xref>.
      Particularly:</t>

      <t><list style="symbols">
          <t>The updates in <xref target="refresh"></xref> and <xref
          target="icmp"></xref> prevent an illegitimate node to maintain
          mappings activated in the NAT while these mappings should be
          cleared.</t>

          <t>Port randomization (<xref target="randomization"></xref>)
          complicates tracking hosts located behind a NAT.</t>
        </list></t>

      <t><xref target="app"></xref> and <xref target="hairicmp"></xref>
      propose updates that increase the serviceability of a host located
      behind a NAT. These updates do not introduce any additional security
      concerns to <xref target="RFC4787"></xref>, <xref
      target="RFC5382"></xref>, and <xref target="RFC5508"></xref>.</t>

      <t>The updates in <xref target="EIM"></xref> and <xref
      target="EIF"></xref> allow for a better NAT transparency from an
      application standpoint. Hosts that require a restricted filtering
      behavior should enable specific policies (e.g., access control list
      (ACL)) either locally or by soliciting a dedicated security device
      (e.g., firewall). How a host updates its filtering policies is out of
      scope of this document.</t>

      <t>The update in <xref target="parity"></xref> induces security concerns
      that are specific to the protocol used to interact with the NAT. For
      example, if PCP is used to explicitly request parity preservation for a
      given mapping, the security considerations discussed in <xref
      target="RFC6887"></xref> should be taken into account.</t>

      <t>The update in <xref target="id"></xref> may have undesired effects on
      the performance of the NAT in environments in which fragmentation is
      massively experienced. Such issue may be used as an attack vector
      against NATs.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

      <?rfc include="reference.RFC.4787"?>

      <?rfc include="reference.RFC.5382"?>

      <?rfc include="reference.RFC.5508"?>

      <?rfc include="reference.RFC.6056"?>

      <?rfc include="reference.RFC.6146"?>

      <?rfc include='reference.RFC.6864'?>
    </references>

    <references title="Informative References">
      <?rfc ?>

      <?rfc include="reference.RFC.7753"?>

      <?rfc include='reference.RFC.3022'?>

      <?rfc include='reference.RFC.6887'?>

      <?rfc include='reference.RFC.6269'?>

      <?rfc include="reference.RFC.2663"?>

      <?rfc include="reference.RFC.6888"?>

      <?rfc include='reference.RFC.5389'?>

      <?rfc include='reference.RFC.7296'?>

      <?rfc ?>
    </references>

    <section numbered="no" title="Acknowledgements">
      <t>Thanks to Dan Wing, Suresh Kumar, Mayuresh Bakshi, Rajesh Mohan, Lars
      Eggert, Gorry Fairhurst, Brandon Williams, and David Black for their
      review and discussion. <vspace blankLines="1" />Many thanks to Ben
      Laurie for the secdir review, and Dan Romascanu for the Gen-ART review.
      <vspace blankLines="1" />Dan Wing proposed some text for the
      configurable errors in <xref target="error" />.</t>
    </section>

    <section numbered="no" title="Contributors">
      <t>The following individual contributed text to the document: <list
          style="empty">
          <t>Sarat Kamiset, Insieme Networks, United States</t>
        </list></t>
    </section>
  </back>
</rfc>
