<?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="yes"?>
<?rfc subcompact="no"?>
<rfc category="bcp" docName="draft-ietf-tsvwg-behave-requirements-update-04"
     ipr="trust200902">
  <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." surname="Boucadair">
      <organization>France Telecom</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>

    <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>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t><xref target="RFC4787"></xref>, <xref target="RFC5382"></xref> and
      <xref target="RFC5508"></xref> greatly advanced NAT interoperability and
      conformance. But with widespread deployment and evolution of Network
      Address Translation (NAT) more development and operational experience
      was acquired 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.
        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 withe 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.<figure align="left" anchor="state" title="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 to (resp. received from) the server
     are prefixed with "Server".
   * Messages sent to (resp. 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>
        </list></t>

      <t></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 to configure the timeout to be less than 4 minutes. Still,
            this specification recommends the default "transitory connection
            idle-timeout" minimum value to be set to 4 minutes.</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 the NAT mapping entry. Moreover,
            the NAT SHOULD wait for 4 minutes before deleting the session and
            removing any state associate with it if no packets are received
            during that 4 minutes timeout. <vspace
            blankLines="1" />Admittedly, the NAT has to verify whether
            received TCP RST packets belong to a connection. These
            verification checks are required to avoid off-path attacks.<vspace
            blankLines="1" />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>
      </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 Address Pooling Paired (APP) behavior for a NAT was recommended
      in REQ-2 from <xref target="RFC4787"></xref>, but the behavior when a
      public 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. <vspace blankLines="1" />The administrator MAY provide a
          configurable parameter that allows a NAT to starting using ports
          from another external IP address when the one that anchored the APP
          mapping ran out of ports. This is a trade-off between service
          continuity and APP strict enforcement. (Note, this behavior is
          sometimes referred as 'soft-APP'.)</t>
        </list><list style="hanging">
          <t hangText="Update:">This behavior SHOULD apply also for TCP.</t>
        </list><!--<section
title="End-point Independent Filtering (EIF)"
><t
>REQ-8  from <xref
target="RFC4787"
><ns:textPlaceholder
xmlns:ns="http://www.xmlmind.com/xmleditor/namespace/clipboard"
></ns:textPlaceholder
></xref
> and REQ-3  from <xref
target="RFC5382"
><ns:textPlaceholder
xmlns:ns="http://www.xmlmind.com/xmleditor/namespace/clipboard"
></ns:textPlaceholder
></xref
> recommends a NAT to use Endpoint-Independent Filtering (EIF). This behavior could potentially result in receiving unwanted traffic from the public realm.</t
><t
><list
style="hanging"
><t
hangText="Update:"
>In order to handle the aforementioned issue, strict filtering checks SHOULD be performed in the inbound direction. A configuration parameter SHOULD be provided to limit the number of inbound sessions and a configuration parameter SHOULD be provided to enable or disable EIF on a per-application basis. This is specially important in the case of mobile networks where such attacks can consume radio resources and count against the user quota.</t
></list
></t
></section
--></t>
    </section>

    <section anchor="EIF" title="EIF Protocol Independence">
      <t>REQ-8 from <xref target="RFC4787"></xref> and REQ-3 from <xref
      target="RFC5382"></xref> do not specify whether EIF mappings are
      protocol-independent. In other words, if an outbound TCP SYN creates a
      mapping, it is left undefined whether inbound UDP packets destined to
      that mapping should be forwarded.</t>

      <t><list style="hanging">
          <t hangText="Update:">This document specifies that EIF mappings
          SHOULD be protocol-independent in order allow inbound packets for
          protocols that multiplex TCP and UDP over the same IP address and
          port through the NAT and also maintain compatibility with stateful
          NAT64 . The administrator MAY provide a configuration parameter to
          make it protocol-dependent. The default value of this configuration
          parameter is to allow for protocol-independent EIF.<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 as a function of the
          underlying transport protocol or the filtering mode enabled at the
          NAT.</t>
        </list></t>
    </section>

    <section anchor="refresh" title="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 title="Outbound Mapping Refresh and Error Packets">
        <t><list style="hanging">
            <t hangText="Update:">In the case of NAT outbound refresh behavior
            there are certain types of packets that should not refresh the
            mapping even if their direction is outbound. For example, if the
            mapping is kept alive by ICMP Errors or TCP RST outbound packets
            sent as response to inbound packets, these SHOULD NOT refresh the
            mapping.</t>
          </list></t>
      </section>
    </section>

    <section anchor="EIM" title="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-independent. In other words, if a outbound TCP SYN creates a
      mapping it is left undefined whether outbound UDP can reuse such mapping
      and create session. On the other hand, stateful NAT64 <xref
      target="RFC6146"></xref> clearly specifies three binding information
      bases (TCP, UDP, ICMP).</t>

      <t><list style="hanging">
          <t hangText="Update:">EIM mappings SHOULD be protocol-dependent. A
          configuration parameter MAY be provided in order allow protocols
          that multiplex TCP and UDP over the same source IP address and port
          number to use a single mapping.</t>
        </list></t>
    </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="I-D.ietf-pcp-port-set"></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 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><!--D. Wing: Please add a discussion on the scalability and attack vectors of complying with this SHOULD.--></t>
    </section>

    <section anchor="icmp" title="ICMP Query Mappings Timeout">
      <t>Section 3.1 of <xref target="RFC5508"></xref> precises 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 the 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 invoke this functionality only if packets are to be sen 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="EIF"></xref> and <xref
      target="EIM"></xref> allow for a better NAT transparency from an
      application standpoint. Hosts which require a restricted filtering
      behavior should enable security-dedicated features (e.g., ACL) either
      locally or by soliciting a dedicated security device (e.g., firewall).
      </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.6888"?>

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

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

      <?rfc include="reference.I-D.ietf-pcp-port-set"?>

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

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

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

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

      <?rfc ?>
    </references>

    <section numbered="no" title="Acknowledgements">
      <t>Thanks to Dan Wing, Suresh Kumar, Mayuresh Bakshi, Rajesh Mohan, Lars
      Eggert, and Gorry Fairhurst for their review and discussion.</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>
