home *** CD-ROM | disk | FTP | other *** search
/ Internet Core Protocols / Oreilly-InternetCoreProtocols.iso / RFCs / rfc2663.txt < prev    next >
Encoding:
Text File  |  1999-10-14  |  72.2 KB  |  1,684 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                       P. Srisuresh
  8. Request for Comments: 2663                                   M. Holdrege
  9. Category: Informational                              Lucent Technologies
  10.                                                              August 1999
  11.  
  12.  
  13.     IP Network Address Translator (NAT) Terminology and Considerations
  14.  
  15. Status of this Memo
  16.  
  17.    This memo provides information for the Internet community.  It does
  18.    not specify an Internet standard of any kind.  Distribution of this
  19.    memo is unlimited.
  20.  
  21. Copyright Notice
  22.  
  23.    Copyright (C) The Internet Society (1999).  All Rights Reserved.
  24.  
  25. Preface
  26.  
  27.    The motivation behind this document is to provide clarity to the
  28.    terms used in conjunction with Network Address Translators.  The term
  29.    "Network Address Translator" means different things in different
  30.    contexts. The intent of this document is to define the various
  31.    flavors of NAT and standardize the meaning of terms used.
  32.  
  33.    The authors listed are editors for this document and owe the content
  34.    to contributions from members of the working group. Large chunks of
  35.    the document titled, "IP Network Address Translator (NAT)" were
  36.    extracted almost as is, to form the initial basis for this document.
  37.    The editors would like to thank the authors Pyda Srisuresh and Kjeld
  38.    Egevang for the same. The editors would like to thank Praveen
  39.    Akkiraju for his contributions in describing NAT deployment
  40.    scenarios. The editors would also like to thank the IESG members
  41.    Scott Bradner, Vern Paxson and Thomas Narten for their detailed
  42.    review of the document and adding clarity to the text.
  43.  
  44. Abstract
  45.  
  46.    Network Address Translation is a method by which IP addresses are
  47.    mapped from one realm to another, in an attempt to provide
  48.    transparent routing to hosts. Traditionally, NAT devices are used to
  49.    connect an isolated address realm with private unregistered addresses
  50.    to an external realm with globally unique registered addresses. This
  51.    document attempts to describe the operation of NAT devices and the
  52.    associated considerations in general, and to define the terminology
  53.    used to identify various flavors of NAT.
  54.  
  55.  
  56.  
  57.  
  58. Srisuresh & Holdrege         Informational                      [Page 1]
  59.  
  60. RFC 2663           NAT Terminology and Considerations        August 1999
  61.  
  62.  
  63. 1. Introduction and Overview
  64.  
  65.    The need for IP Address translation arises when a network's internal
  66.    IP addresses cannot be used outside the network either because they
  67.    are invalid for use outside, or because the internal addressing must
  68.    be kept private from the external network.
  69.  
  70.    Address translation allows (in many cases, except as noted in
  71.    sections 8 and 9) hosts in a private network to transparently
  72.    communicate with destinations on an external network and vice versa.
  73.    There are a variety of flavors of NAT and terms to match them. This
  74.    document attempts to define the terminology used and to identify
  75.    various flavors of NAT. The document also attempts to describe other
  76.    considerations applicable to NAT devices in general.
  77.  
  78.    Note, however, this document is not intended to describe the
  79.    operations of individual NAT variations or the applicability of NAT
  80.    devices.
  81.  
  82.    NAT devices attempt to provide a transparent routing solution to end
  83.    hosts trying to communicate from disparate address realms. This is
  84.    achieved by modifying end node addresses en-route and maintaining
  85.    state for these updates so that datagrams pertaining to a session are
  86.    routed to the right end-node in either realm. This solution only
  87.    works when the applications do not use the IP addresses as part of
  88.    the protocol itself. For example, identifying endpoints using DNS
  89.    names rather than addresses makes applications less dependent of the
  90.    actual addresses that NAT chooses and avoids the need to also
  91.    translate payload contents when NAT changes an IP address.
  92.  
  93.    The NAT function cannot by itself support all applications
  94.    transparently and often must co-exist with application level gateways
  95.    (ALGs) for this reason. People looking to deploy NAT based solutions
  96.    need to determine their application requirements first and assess the
  97.    NAT extensions (i.e., ALGs) necessary to provide application
  98.    transparency for their environment.
  99.  
  100.    IPsec techniques which are intended to preserve the Endpoint
  101.    addresses of an IP packet will not work with NAT enroute for most
  102.    applications in practice. Techniques such as AH and ESP protect the
  103.    contents of the IP headers (including the source and destination
  104.    addresses) from modification. Yet, NAT's fundamental role is to alter
  105.    the addresses in the IP header of a packet.
  106.  
  107. 2. Terminology and concepts used
  108.  
  109.    Terms most frequently used in the context of NAT are defined here for
  110.    reference.
  111.  
  112.  
  113.  
  114. Srisuresh & Holdrege         Informational                      [Page 2]
  115.  
  116. RFC 2663           NAT Terminology and Considerations        August 1999
  117.  
  118.  
  119. 2.1. Address realm or realm
  120.  
  121.    An address realm is a network domain in which the network addresses
  122.    are uniquely assigned to entities such that datagrams can be routed
  123.    to them. Routing protocols used within the network domain are
  124.    responsible for finding routes to entities given their network
  125.    addresses. Note that this document is limited to describing NAT in
  126.    IPv4 environment and does not address the use of NAT in other types
  127.    of environment. (e.g. IPv6 environments)
  128.  
  129. 2.2. Transparent routing
  130.  
  131.    The term "transparent routing" is used throughout the document to
  132.    identify the routing functionality that a NAT device provides.  This
  133.    is different from the routing functionality provided by a traditional
  134.    router device in that a traditional router routes packets within a
  135.    single address realm.
  136.  
  137.    Transparent routing refers to routing a datagram between disparate
  138.    address realms, by modifying address contents in the IP header to be
  139.    valid in the address realm into which the datagram is routed.
  140.    Section 3.2 has a detailed description of transparent routing.
  141.  
  142. 2.3. Session flow vs. Packet flow
  143.  
  144.    Connection or session flows are different from packet flows.  A
  145.    session flow  indicates the direction in which the session was
  146.    initiated with reference to a network interface. Packet flow is the
  147.    direction in which the packet has traveled with reference to a
  148.    network interface. Take for example, an outbound telnet session.  The
  149.    telnet session consists of packet flows in both inbound and outbound
  150.    directions. Outbound telnet packets carry terminal keystrokes and
  151.    inbound telnet packets carry screen displays from the telnet server.
  152.  
  153.    For purposes of discussion in this document, a session is defined as
  154.    the set of traffic that is managed as a unit for translation.
  155.    TCP/UDP sessions are uniquely identified by the tuple of (source IP
  156.    address, source TCP/UDP port, target IP address, target TCP/UDP
  157.    port). ICMP query sessions are identified by the tuple of (source IP
  158.    address, ICMP query ID, target IP address). All other sessions are
  159.    characterized by the tuple of (source IP address, target IP address,
  160.    IP protocol).
  161.  
  162.    Address translations performed by NAT are session based and would
  163.    include translation of incoming as well as outgoing packets belonging
  164.    to that session. Session direction is identified by the direction of
  165.    the first packet of that session (see sec 2.5).
  166.  
  167.  
  168.  
  169.  
  170. Srisuresh & Holdrege         Informational                      [Page 3]
  171.  
  172. RFC 2663           NAT Terminology and Considerations        August 1999
  173.  
  174.  
  175.    Note, there is no guarantee that the idea of a session, determined as
  176.    above by NAT, will coincide with the application's idea of a session.
  177.    An application might view a bundle of sessions (as viewed by NAT) as
  178.    a single session and might not even view its communication with its
  179.    peers as a session. Not all applications are guaranteed to work
  180.    across realms, even with an ALG (defined below in section 2.9)
  181.    enroute.
  182.  
  183. 2.4. TU ports, Server ports, Client ports
  184.  
  185.    For the reminder of this document, we will refer TCP/UDP ports
  186.    associated with an IP address simply as "TU ports".
  187.  
  188.    For most TCP/IP hosts, TU port range 0-1023 is used by servers
  189.    listening for incoming connections. Clients trying to initiate a
  190.    connection typically select a source TU port in the range of 1024-
  191.    65535. However, this convention is not universal and not always
  192.    followed. Some client stations initiate connections using a source TU
  193.    port number in the range of 0-1023, and there are servers listening
  194.    on TU port numbers in the range of 1024-65535.
  195.  
  196.    A list of assigned TU port services may be found in RFC 1700 [Ref 2].
  197.  
  198. 2.5. Start of session for TCP, UDP and others
  199.  
  200.    The first packet of every TCP session tries to establish a session
  201.    and contains connection startup information. The first packet of a
  202.    TCP session may be recognized by the presence of SYN bit and absence
  203.    of ACK bit in the TCP flags. All TCP packets, with the exception of
  204.    the first packet, must have the ACK bit set.
  205.  
  206.    However, there is no deterministic way of recognizing the start of a
  207.    UDP based session or any non-TCP session. A heuristic approach would
  208.    be to assume the first packet with hitherto non-existent session
  209.    parameters (as defined in section 2.3) as constituting the start of
  210.    new session.
  211.  
  212. 2.6. End of session for TCP, UDP and others
  213.  
  214.    The end of a TCP session is detected when FIN is acknowledged by both
  215.    halves of the session or when either half receives a segment with the
  216.    RST bit in TCP flags field. However, because it is impossible for a
  217.    NAT device to know whether the packets it sees will actually be
  218.    delivered to the destination (they may be dropped between the NAT
  219.    device and the destination), the NAT device cannot safely assume that
  220.    the segments containing FINs or SYNs will be the last packets of the
  221.    session (i.e., there could be retransmissions).  Consequently, a
  222.    session can be assumed to have been terminated only after a period of
  223.  
  224.  
  225.  
  226. Srisuresh & Holdrege         Informational                      [Page 4]
  227.  
  228. RFC 2663           NAT Terminology and Considerations        August 1999
  229.  
  230.  
  231.    4 minutes subsequent to this detection. The need for this extended
  232.    wait period is described in RFC 793 [Ref 7], which suggests a TIME-
  233.    WAIT duration of 2 * MSL (Maximum Segment Lifetime) or 4 minutes.
  234.  
  235.    Note that it is also possible for a TCP connection to terminate
  236.    without the NAT device becoming aware of the event (e.g., in the case
  237.    where one or both peers reboot). Consequently, garbage collection is
  238.    necessary on NAT devices to clean up unused state about TCP sessions
  239.    that no longer exist. However, it is not possible in the general case
  240.    to distinguish between connections that have been idle for an
  241.    extended period of time from those that no longer exist.  In the case
  242.    of UDP-based sessions, there is no single way to determine when a
  243.    session ends, since UDP-based protocols are application specific.
  244.  
  245.    Many heuristic approaches are used to terminate sessions. You can
  246.    make the assumption that TCP sessions that have not been used for
  247.    say, 24 hours, and non-TCP sessions that have not been used for a
  248.    couple of minutes, are terminated. Often this assumption works, but
  249.    sometimes it doesn't. These idle period session timeouts vary a great
  250.    deal both from application to application and for different sessions
  251.    of the same application. Consequently, session timeouts must be
  252.    configurable. Even so, there is no guarantee that a satisfactory
  253.    value can be found. Further, as stated in section 2.3, there is no
  254.    guarantee that NAT's view of session termination will coincide with
  255.    that of the application.
  256.  
  257.    Another way to handle session terminations is to timestamp entries
  258.    and keep them as long as possible and retire the longest idle session
  259.    when it becomes necessary.
  260.  
  261. 2.7. Public/Global/External network
  262.  
  263.    A Global or Public Network is an address realm with unique network
  264.    addresses assigned by Internet Assigned Numbers Authority (IANA) or
  265.    an equivalent address registry. This network is also referred as
  266.    External network during NAT discussions.
  267.  
  268. 2.8. Private/Local network
  269.  
  270.    A private network is an address realm independent of external network
  271.    addresses. Private network may also be referred alternately as Local
  272.    Network. Transparent routing between hosts in private realm and
  273.    external realm is facilitated by a NAT router.
  274.  
  275.    RFC 1918 [Ref 1] has recommendations on address space allocation for
  276.    private networks. Internet Assigned Numbers Authority (IANA) has
  277.    three blocks of IP address space, namely 10/8, 172.16/12, and
  278.    192.168/16 set aside for private internets. In pre-CIDR notation, the
  279.  
  280.  
  281.  
  282. Srisuresh & Holdrege         Informational                      [Page 5]
  283.  
  284. RFC 2663           NAT Terminology and Considerations        August 1999
  285.  
  286.  
  287.    first block is nothing but a single class A network number, while the
  288.    second block is a set of 16 contiguous class B networks, and the
  289.    third block is a set of 256 contiguous class C networks.
  290.  
  291.    An organization that decides to use IP addresses in the address space
  292.    defined above can do so without coordination with IANA or any other
  293.    Internet registry such as APNIC, RIPE and ARIN.  The address space
  294.    can thus be used privately by many independent organizations at the
  295.    same time. However, if those independent organizations later decide
  296.    they wish to communicate with each other or the public Internet, they
  297.    will either have to renumber their networks or enable NAT on their
  298.    border routers.
  299.  
  300. 2.9. Application Level gateway (ALG)
  301.  
  302.    Not all applications lend themselves easily to translation by NAT
  303.    devices; especially those that include IP addresses and TCP/UDP ports
  304.    in the payload. Application Level Gateways (ALGs) are application
  305.    specific translation agents that allow an application on a host in
  306.    one address realm to connect to its counterpart running on a host in
  307.    different realm transparently. An ALG may interact with NAT to set up
  308.    state, use NAT state information, modify application specific payload
  309.    and perform whatever else is necessary to get the application running
  310.    across disparate address realms.
  311.  
  312.    ALGs may not always utilize NAT state information. They may glean
  313.    application payload and simply notify NAT to add additional state
  314.    information in some cases. ALGs are similar to Proxies, in that, both
  315.    ALGs and proxies facilitate Application specific communication
  316.    between clients and servers. Proxies use a special protocol to
  317.    communicate with proxy clients and relay client data to servers and
  318.    vice versa. Unlike Proxies, ALGs do not use a special protocol to
  319.    communicate with application clients and do not require changes to
  320.    application clients.
  321.  
  322. 3. What is NAT?
  323.  
  324.    Network Address Translation is a method by which IP addresses are
  325.    mapped from one address realm to another, providing transparent
  326.    routing to end hosts. There are many variations of address
  327.    translation that lend themselves to different applications.  However,
  328.    all flavors of NAT devices should share the following
  329.    characteristics.
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Srisuresh & Holdrege         Informational                      [Page 6]
  339.  
  340. RFC 2663           NAT Terminology and Considerations        August 1999
  341.  
  342.  
  343.           a) Transparent Address assignment.
  344.           b) Transparent routing through address translation.
  345.              (routing here refers to forwarding packets, and not
  346.              exchanging routing information)
  347.           c) ICMP error packet payload translation.
  348.  
  349.    Below is a diagram illustrating a scenario in which NAT is enabled on
  350.    a stub domain border router, connected to the Internet through a
  351.    regional router made available by a service provider.
  352.  
  353.        \ | /                  .                               /
  354.    +---------------+  WAN     .           +-----------------+/
  355.    |Regional Router|----------------------|Stub Router w/NAT|---
  356.    +---------------+          .           +-----------------+\
  357.                               .                      |        \
  358.                               .                      |  LAN
  359.                               .               ---------------
  360.                         Stub border
  361.  
  362.         Figure 1: A typical NAT operation scenario
  363.  
  364. 3.1. Transparent Address Assignment
  365.  
  366.    NAT binds addresses in private network with addresses in global
  367.    network and vice versa to provide transparent routing for the
  368.    datagrams traversing between address realms. The binding in some
  369.    cases may extend to transport level identifiers (such as TCP/UDP
  370.    ports). Address binding is done at the start of a session. The
  371.    following sub-sections describe two types of address assignments.
  372.  
  373. 3.1.1. Static Address assignment
  374.  
  375.    In the case of static address assignment, there is one-to-one address
  376.    mapping for hosts between a private network address and an external
  377.    network address for the lifetime of NAT operation.  Static address
  378.    assignment ensures that NAT does not have to administer address
  379.    management with session flows.
  380.  
  381. 3.1.2. Dynamic Address assignment
  382.  
  383.    In this case, external addresses are assigned to private network
  384.    hosts or vice versa, dynamically based on usage requirements and
  385.    session flow determined heuristically by NAT. When the last session
  386.    using an address binding is terminated, NAT would free the binding so
  387.    that the global address could be recycled for later use. The exact
  388.    nature of address assignment is specific to individual NAT
  389.    implementations.
  390.  
  391.  
  392.  
  393.  
  394. Srisuresh & Holdrege         Informational                      [Page 7]
  395.  
  396. RFC 2663           NAT Terminology and Considerations        August 1999
  397.  
  398.  
  399. 3.2. Transparent routing
  400.  
  401.    A NAT router sits at the border between two address realms and
  402.    translates addresses in IP headers so that when the packet leaves one
  403.    realm and enters another, it can be routed properly. Because NAT
  404.    devices have connections to multiple address realms, they must be
  405.    careful to not improperly propagate information (e.g., via routing
  406.    protocols) about networks from one address realm into another, where
  407.    such an advertisement would be deemed unacceptable.
  408.  
  409.    There are three phases to Address translation, as follows. Together
  410.    these phases result in creation, maintenance and termination of state
  411.    for sessions passing through NAT devices.
  412.  
  413. 3.2.1. Address binding
  414.  
  415.    Address binding is the phase in which a local node IP address is
  416.    associated with an external address or vice versa, for purposes of
  417.    translation. Address binding is fixed with static address assignments
  418.    and is dynamic at session startup time with dynamic address
  419.    assignments. Once the binding between two addresses is in place, all
  420.    subsequent sessions originating from or to this host will use the
  421.    same binding for session based packet translation.
  422.  
  423.    New address bindings are made at the start of a new session, if such
  424.    an address binding didn't already exist. Once a local address is
  425.    bound to an external address, all subsequent sessions originating
  426.    from the same local address or directed to the same local address
  427.    will use the same binding.
  428.  
  429.    The start of each new session will result in the creation of a state
  430.    to facilitate translation of datagrams pertaining to the session.
  431.    There can be many simultaneous sessions originating from the same
  432.    host, based on a single address binding.
  433.  
  434. 3.2.2. Address lookup and translation
  435.  
  436.    Once a state is established for a session, all packets belonging to
  437.    the session will be subject to address lookup (and transport
  438.    identifier lookup, in some cases) and translation.
  439.  
  440.    Address or transport identifier translation for a datagram will
  441.    result in the datagram forwarding from the origin address realm to
  442.    the destination address realm with network addresses appropriately
  443.    updated.
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Srisuresh & Holdrege         Informational                      [Page 8]
  451.  
  452. RFC 2663           NAT Terminology and Considerations        August 1999
  453.  
  454.  
  455. 3.2.3. Address unbinding
  456.  
  457.    Address unbinding is the phase in which a private address is no
  458.    longer associated with a global address for purposes of translation.
  459.    NAT will perform address unbinding when it believes that the last
  460.    session using an address binding has terminated.  Refer section 2.6
  461.    for some heuristic ways to handle session terminations.
  462.  
  463. 3.3. ICMP error packet translation
  464.  
  465.    All ICMP error messages (with the exception of Redirect message type)
  466.    will need to be modified, when passed through NAT. The ICMP error
  467.    message types needing NAT modification would include Destination-
  468.    Unreachable, Source-Quench, Time-Exceeded and Parameter-Problem.  NAT
  469.    should not attempt to modify a Redirect message type.
  470.  
  471.    Changes to ICMP error message will include changes to the original IP
  472.    packet (or portions thereof) embedded in the payload of the ICMP
  473.    error message. In order for NAT to be completely transparent to end
  474.    hosts, the IP address of the IP header embedded in the payload of the
  475.    ICMP packet must be modified, the checksum field of the same IP
  476.    header must correspondingly be modified, and the accompanying
  477.    transport header. The ICMP header checksum must also be modified to
  478.    reflect changes made to the IP and transport headers in the payload.
  479.    Furthermore, the normal IP header must also be modified.
  480.  
  481. 4.0. Various flavors of NAT
  482.  
  483.    There are many variations of address translation that lend themselves
  484.    to different applications. NAT flavors listed in the following sub-
  485.    sections are by no means exhaustive, but they do capture the
  486.    significant differences that abound.
  487.  
  488.    The following diagram will be used as a base model to illustrate NAT
  489.    flavors. Host-A, with address Addr-A is located in a private realm,
  490.    represented by the network N-Pri. N-Pri is isolated from external
  491.    network through a NAT router. Host-X, with address Addr-X is located
  492.    in an external realm, represented by the network N-Ext.  NAT router
  493.    with two interfaces, each attached to one of the realms provides
  494.    transparent routing between the two realms. The interface to the
  495.    external realm is assigned an address of Addr-Nx and the interface to
  496.    private realm is assigned an address of Addr-Np.  Further, it may be
  497.    understood that addresses Addr-A and Addr-Np correspond to N-Pri
  498.    network and the addresses Addr-X and Addr-Nx correspond to N-Ext
  499.    network.
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. Srisuresh & Holdrege         Informational                      [Page 9]
  507.  
  508. RFC 2663           NAT Terminology and Considerations        August 1999
  509.  
  510.  
  511.                                   ________________
  512.                                  (                )
  513.                                 (   External       )    +--+
  514.                                (  Address Realm     )-- |__|
  515.                                 (     (N-Ext)      )   /____\
  516.                                  (________________)    Host-X
  517.                                         |              (Addr-X)
  518.                                         |(Addr-Nx)
  519.                            +--------------+
  520.                            |              |
  521.                            |  NAT router  |
  522.                            |              |
  523.                            +--------------+
  524.                              |(Addr-Np)
  525.                              |
  526.                      ----------------
  527.                     (                )
  528.         +--+       (     Private      )
  529.         |__|------(    Address Realm   )
  530.        /____\      (     (N-pri)      )
  531.        Host-A       (________________)
  532.        (Addr-A)
  533.  
  534.              Figure 2: A base model to illustrate NAT terms.
  535.  
  536. 4.1. Traditional NAT (or) Outbound NAT
  537.  
  538.    Traditional NAT would allow hosts within a private network to
  539.    transparently access hosts in the external network, in most cases.
  540.    In a traditional NAT, sessions are uni-directional, outbound from the
  541.    private network. This is in contrast with Bi-directional NAT, which
  542.    permits sessions in both inbound and outbound directions. A detailed
  543.    description of Bi-directional NAT may be found in section 4.2.
  544.  
  545.    The following is a description of the properties of realms supported
  546.    by traditional NAT. IP addresses of hosts in external network are
  547.    unique and valid in external as well as private networks. However,
  548.    the addresses of hosts in private network are unique only within the
  549.    private network and may not be valid in the external network. In
  550.    other words, NAT would not advertise private networks to the external
  551.    realm. But, networks from the external realm may be advertised within
  552.    the private network.  The addresses used within private network must
  553.    not overlap with the external addresses. Any given address must
  554.    either be a private address or an external address; not both.
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562. Srisuresh & Holdrege         Informational                     [Page 10]
  563.  
  564. RFC 2663           NAT Terminology and Considerations        August 1999
  565.  
  566.  
  567.    A traditional NAT router in figure 2 would allow Host-A to initiate
  568.    sessions to Host-X, but not the other way around. Also, N-Ext is
  569.    routable from within N-Pri, whereas N-Pri may not be routable from
  570.    N-Ext.
  571.  
  572.    Traditional NAT is primarily used by sites using private addresses
  573.    that wish to allow outbound sessions from their site.
  574.  
  575.    There are two variations to traditional NAT, namely Basic NAT and
  576.    NAPT (Network Address Port Translation). These are discussed in the
  577.    following sub-sections.
  578.  
  579. 4.1.1. Basic NAT
  580.  
  581.    With Basic NAT, a block of external addresses are set aside for
  582.    translating addresses of hosts in a private domain as they originate
  583.    sessions to the external domain. For packets outbound from the
  584.    private network, the source IP address and related fields such as IP,
  585.    TCP, UDP and ICMP header checksums are translated. For inbound
  586.    packets, the destination IP address and the checksums as listed above
  587.    are translated.
  588.  
  589.    A Basic NAT router in figure 2 may be configured to translate N-Pri
  590.    into a block of external addresses, say Addr-i through Addr-n,
  591.    selected from the external network N-Ext.
  592.  
  593. 4.1.2. Network Address Port Translation (NAPT)
  594.  
  595.    NAPT extends the notion of translation one step further by also
  596.    translating transport identifier (e.g., TCP and UDP port numbers,
  597.    ICMP query identifiers). This allows the transport identifiers of a
  598.    number of private hosts to be multiplexed into the transport
  599.    identifiers of a single external address. NAPT allows a set of hosts
  600.    to share a single external address. Note that NAPT can be combined
  601.    with Basic NAT so that a pool of external addresses are used in
  602.    conjunction with port translation.
  603.  
  604.    For packets outbound from the private network, NAPT would translate
  605.    the source IP address, source transport identifier and related fields
  606.    such as IP, TCP, UDP and ICMP header checksums. Transport identifier
  607.    can be one of TCP/UDP port or ICMP query ID. For inbound packets, the
  608.    destination IP address, destination transport identifier and the IP
  609.    and transport header checksums are translated.
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618. Srisuresh & Holdrege         Informational                     [Page 11]
  619.  
  620. RFC 2663           NAT Terminology and Considerations        August 1999
  621.  
  622.  
  623.    A NAPT router in figure 2 may be configured to translate sessions
  624.    originated from N-Pri into a single external address, say Addr-i.
  625.  
  626.    Very often, the external interface address Addr-Nx of NAPT router is
  627.    used as the address to map N-Pri to.
  628.  
  629. 4.2. Bi-directional NAT (or) Two-Way NAT
  630.  
  631.    With a Bi-directional NAT, sessions can be initiated from hosts in
  632.    the public network as well as the private network. Private network
  633.    addresses are bound to globally unique addresses, statically or
  634.    dynamically as connections are established in either direction.  The
  635.    name space (i.e., their Fully Qualified Domain Names) between hosts
  636.    in private and external networks is assumed to be end-to-end unique.
  637.    Hosts in external realm access private realm hosts by using DNS for
  638.    address resolution. A DNS-ALG must be employed in conjunction with
  639.    Bi-Directional NAT to facilitate name to address mapping.
  640.    Specifically, the DNS-ALG must be capable of translating private
  641.    realm addresses in DNS Queries and responses into their external
  642.    realm address bindings, and vice versa, as DNS packets traverse
  643.    between private and external realms.
  644.  
  645.    The address space requirements outlined for traditional NAT routers
  646.    are applicable here as well.
  647.  
  648.    A Bi-directional NAT router in figure 2 would allow Host-A to
  649.    initiate sessions to Host-X, and Host-X to initiate sessions to
  650.    Host-A. Just as with traditional NAT, N-Ext is routable from within
  651.    N-Pri, but N-Pri may not be routable from N-Ext.
  652.  
  653. 4.3. Twice NAT
  654.  
  655.    Twice NAT is a variation of NAT in that both the source and
  656.    destination addresses are modified by NAT as a datagram crosses
  657.    address realms. This is in contrast to Traditional-NAT and Bi-
  658.    Directional NAT, where only one of the addresses (either source or
  659.    destination) is translated. Note, there is no such term as 'Once-
  660.    NAT'.
  661.  
  662.    Twice NAT is necessary when private and external realms have address
  663.    collisions. The most common case where this would happen is when a
  664.    site had (improperly) numbered its internal nodes using public
  665.    addresses that have been assigned to another organization.
  666.    Alternatively, a site may have changed from one provider to another,
  667.    but chosen to keep (internally) the addresses it had been assigned by
  668.    the first provider. That provider might then later reassign those
  669.    addresses to someone else. The key issue in such cases is that the
  670.    address of the host in the external realm may have been assigned the
  671.  
  672.  
  673.  
  674. Srisuresh & Holdrege         Informational                     [Page 12]
  675.  
  676. RFC 2663           NAT Terminology and Considerations        August 1999
  677.  
  678.  
  679.    same address as a host within the local site. If that address were to
  680.    appear in a packet, it would be forwarded to the internal node rather
  681.    than through the NAT device to the external realm. Twice-NAT attempts
  682.    to bridge these realms by translating both source and destination
  683.    address of an IP packet, as the packet transitions realms.
  684.  
  685.    Twice-NAT works as follows. When Host-A wishes to initiate a session
  686.    to Host-X, it issues a DNS query for Host-X. A DNS-ALG intercepts the
  687.    DNS query, and in the response returned to Host-A the DNS-ALG
  688.    replaces the address for Host-X with one that is properly routable in
  689.    the local site (say Host-XPRIME). Host A then initiates communication
  690.    with Host-XPRIME. When the packets traverse the NAT device, the
  691.    source IP address is translated (as in the case of traditional NAT)
  692.    and the destination address is translated to Host-X. A similar
  693.    translation is performed on return packets coming from Host-X.
  694.  
  695.    The following is a description of the properties of realms supported
  696.    by Twice-NAT. Network address of hosts in external network are unique
  697.    in external networks, but not within private network.  Likewise, the
  698.    network address of hosts in private network are unique only within
  699.    the private network. In other words, the address space used in
  700.    private network to locate hosts in private and public networks is
  701.    unrelated to the address space used in public network to locate hosts
  702.    in private and public networks.  Twice NAT would not be allowed to
  703.    advertise local networks to the external network or vice versa.
  704.  
  705.    A Twice NAT router in figure 2 would allow Host-A to initiate
  706.    sessions to Host-X, and Host-X to initiate sessions to Host-A.
  707.    However, N-Ext (or a subset of N-Ext) is not routable from within N-
  708.    Pri, and N-Pri is not routable from N-Ext.
  709.  
  710.    Twice NAT is typically used when address space used in a Private
  711.    network overlaps with addresses used in the Public space.  For
  712.    example, say a private site uses the 200.200.200.0/24 address space
  713.    which is officially assigned to another site in the public internet.
  714.    Host_A (200.200.200.1) in Private space seeks to connect to Host_X
  715.    (200.200.200.100) in Public space. In order to make this connection
  716.    work, Host_X's address is mapped to a different address for Host_A
  717.    and vice versa. The twice NAT located at the Private site border may
  718.    be configured as follows:
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. Srisuresh & Holdrege         Informational                     [Page 13]
  731.  
  732. RFC 2663           NAT Terminology and Considerations        August 1999
  733.  
  734.  
  735.        Private to Public : 200.200.200.0/24 -> 138.76.28.0/24
  736.        Public to Private : 200.200.200.0/24 -> 172.16.1.0/24
  737.  
  738.        Datagram flow  : Host_A(Private) ->  Host_X(Public)
  739.  
  740.        a) Within private network
  741.  
  742.           DA: 172.16.1.100      SA: 200.200.200.1
  743.  
  744.        b) After twice-NAT translation
  745.  
  746.          DA: 200.200.200.100    SA: 138.76.28.1
  747.  
  748.        Datagram flow Host_X (Public) -> Host_A (Private)
  749.  
  750.        a) Within Public network
  751.  
  752.           DA: 138.76.28.1       SA: 200.200.200.100
  753.  
  754.        b) After twice-NAT translation, in private network
  755.  
  756.           SA: 200.200.200.1     DA: 172.16.1.100
  757.  
  758. 4.4. Multihomed NAT
  759.  
  760.    There are limitations to using NAT. For example, requests and
  761.    responses pertaining to a session must be routed via the same NAT
  762.    router, as a NAT router maintains state information for sessions
  763.    established through it. For this reason, it is often suggested that
  764.    NAT routers be operated on a border router unique to a stub domain,
  765.    where all IP packets are either originated from the domain or
  766.    destined to the domain. However, such a configuration would turn a
  767.    NAT router into a single point of failure.
  768.  
  769.    In order for a private network to ensure that connectivity with
  770.    external networks is retained even as one of the NAT links fail, it
  771.    is often desirable to multihome the private network to same or
  772.    multiple service providers with multiple connections from the private
  773.    domain, be it from same or different NAT boxes.
  774.  
  775.    For example, a private network could have links to two different
  776.    providers and the sessions from private hosts could flow through the
  777.    NAT router with the best metric for a destination. When one of NAT
  778.    routers fail, the other could route traffic for all connections.
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786. Srisuresh & Holdrege         Informational                     [Page 14]
  787.  
  788. RFC 2663           NAT Terminology and Considerations        August 1999
  789.  
  790.  
  791.    Multiple NAT boxes or multiple links on the same NAT box, sharing the
  792.    same NAT configuration can provide fail-safe backup for each other.
  793.    In such a case, it is necessary for backup NAT device to exchange
  794.    state information so that a backup NAT can take on session load
  795.    transparently when the primary NAT fails. NAT backup becomes simpler,
  796.    when configuration is based on static maps.
  797.  
  798. 5.0. Realm Specific IP (RSIP)
  799.  
  800.    "Realm Specific IP" (RSIP) is used to characterize the functionality
  801.    of a realm-aware host in a private realm, which assumes realm-
  802.    specific IP address to communicate with hosts in private or external
  803.    realm.
  804.  
  805.    A "Realm Specific IP Client" (RSIP client) is a host in a private
  806.    network that adopts an address in an external realm when connecting
  807.    to hosts in that realm to pursue end-to-end communication. Packets
  808.    generated by hosts on either end in such a setup would be based on
  809.    addresses that are end-to-end unique in the external realm and do not
  810.    require translation by an intermediary process.
  811.  
  812.    A "Realm Specific IP Server" (RSIP server) is a node resident on both
  813.    private and external realms, that can facilitate routing of external
  814.    realm packets within a private realm. These packets may either have
  815.    been originated by an RSIP client or directed to an RSIP-client.
  816.    RSIP-Server may also be the same node that assigns external realm
  817.    addresses to RSIP-Clients.
  818.  
  819.    There are two variations to RSIP, namely Realm-specific Address IP
  820.    (RSA-IP) and Realm-Specific Address and Port IP (RSAP-IP). These
  821.    variations are discussed in the following sub-sections.
  822.  
  823. 5.1. Realm Specific Address IP (RSA-IP)
  824.  
  825.    A Realm Specific Address IP (RSA-IP) client adopts an IP address from
  826.    the external address space when connecting to a host in external
  827.    realm. Once an RSA-IP client assumes an external address, no other
  828.    host in private or external domain can assume the same address, until
  829.    that address is released by the RSA-IP client.
  830.  
  831.    The following is a discussion of routing alternatives that may be
  832.    pursued for the end-to-end RSA-IP packets within private realm.  One
  833.    approach would be to tunnel the packet to the destination. The outer
  834.    header can be translated by NAT as normal without affecting the
  835.    addresses used in the internal header. Another approach would be to
  836.    set up a bi-directional tunnel between the RSA-IP Client and the
  837.    border router straddling the two address realms. Packets to and from
  838.    the client would be tunneled, but packets would be forwarded as
  839.  
  840.  
  841.  
  842. Srisuresh & Holdrege         Informational                     [Page 15]
  843.  
  844. RFC 2663           NAT Terminology and Considerations        August 1999
  845.  
  846.  
  847.    normal between the border router and the remote destination. Note,
  848.    the tunnel from the client TO the border router may not be necessary.
  849.    You might be able to just forward the packet directly. This should
  850.    work so long as your internal network isn't filtering packets based
  851.    on source addresses (which in this case would be external addresses).
  852.  
  853.    As an example, Host-A in figure 2 above, could assume an address
  854.    Addr-k from the external realm and act as RSA-IP-Client to allow
  855.    end-to-end sessions between Addr-k and Addr-X. Traversal of end-to-
  856.    end packets within private realm may be illustrated as follows:
  857.  
  858.    First method, using NAT router enroute to translate:
  859.    ===================================================
  860.  
  861.    Host-A               NAT router               Host-X
  862.    ------               -----------              ------
  863.  
  864.    <Outer IP header, with
  865.    src=Addr-A, Dest=Addr-X>,
  866.    embedding
  867.    <End-to-end packet, with
  868.    src=Addr-k, Dest=Addr-X>
  869.    ----------------------------->
  870.  
  871.                         <Outer IP header, with
  872.                         src=Addr-k, Dest=Addr-X>,
  873.                         embedding
  874.                         <End-to-end packet, with
  875.                         src=Addr-k,  Dest=Addr-X>
  876.                         --------------------------->
  877.  
  878.                              .
  879.                              .
  880.                              .
  881.  
  882.                                               <Outer IP header, with
  883.                                               src=Addr-X, Dest=Addr-k>,
  884.                                               embedding
  885.                                               <End-to-end packet, with
  886.                                               src=Addr-X, Dest=Addr-k>
  887.                                      <---------------------------------
  888.  
  889.                         <Outer IP header, with
  890.                         src=Addr-X, Dest=Addr-A>,
  891.                         embedding <End-to-end packet,
  892.                         with src=Addr-X, Dest=Addr-k>
  893.               <--------------------------------------
  894.  
  895.  
  896.  
  897.  
  898. Srisuresh & Holdrege         Informational                     [Page 16]
  899.  
  900. RFC 2663           NAT Terminology and Considerations        August 1999
  901.  
  902.  
  903.    Second method, using a tunnel within private realm:
  904.    ==================================================
  905.  
  906.    Host-A               NAT router               Host-X
  907.    ------               -----------              ------
  908.  
  909.    <Outer IP header, with
  910.    src=Addr-A, Dest=Addr-Np>,
  911.    embedding
  912.    <End-to-end packet, with
  913.    src=Addr-k, Dest=Addr-X>
  914.    ----------------------------->
  915.  
  916.                         <End-to-end packet, with
  917.                         src=Addr-k, Dest=Addr-X>
  918.                         ------------------------------->
  919.  
  920.                              .
  921.                              .
  922.                              .
  923.  
  924.                                              <End-to-end packet, with
  925.                                              src=Addr-X, Dest=Addr-k>
  926.                                     <--------------------------------
  927.  
  928.                         <Outer IP header, with
  929.                         src=Addr-Np, Dest=Addr-A>,
  930.                         embedding <End-to-end packet,
  931.                         with src=Addr-X, Dest=Addr-k>
  932.                   <----------------------------------
  933.  
  934.    There may be other approaches to pursue.
  935.  
  936.    An RSA-IP-Client has the following characteristics. The collective
  937.    set of operations performed by an RSA-IP-Client may be termed "RSA-
  938.    IP".
  939.  
  940.    1. Aware of the realm to which its peer nodes belong.
  941.  
  942.    2. Assumes an address from external realm when communicating with
  943.       hosts in that realm. Such an address may be assigned statically
  944.       or obtained dynamically (through a yet-to-be-defined protocol)
  945.       from a node capable of assigning addresses from external realm.
  946.       RSA-IP-Server could be the node coordinating external realm
  947.       address assignment.
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954. Srisuresh & Holdrege         Informational                     [Page 17]
  955.  
  956. RFC 2663           NAT Terminology and Considerations        August 1999
  957.  
  958.  
  959.    3. Route packets to external hosts using an approach amenable to
  960.       RSA-IP-Server. In all cases, RSA-IP-Client will likely need
  961.       to act as a tunnel end-point, capable of encapsulating
  962.       end-to-end packets while forwarding and decapsulating in the
  963.       return path.
  964.  
  965.    "Realm Specific Address IP Server" (RSA-IP server) is a node resident
  966.    on both private and external realms, that facilitates routing of
  967.    external realm packets specific to RSA-IP clients inside a private
  968.    realm. An RSA-IP-Server may be described as having the following
  969.    characteristics.
  970.  
  971.    1. May be configured to assign addresses from external realm to
  972.       RSA-IP-Clients, either statically or dynamically.
  973.  
  974.    2. Must be a router resident on both the private and external
  975.       address realms.
  976.  
  977.    3. Must be able to provide a mechanism to route external realm
  978.       packets within private realm. Of the two approaches described,
  979.       the first approach requires RSA-IP-Server to be a NAT router
  980.       providing transparent routing for the outer header. This
  981.       approach requires the external peer to be a tunnel end-point.
  982.  
  983.       With the second approach, an RSA-IP-Server could be any router
  984.       (including a NAT router) that can be a tunnel end-point with
  985.       RSA-IP-Clients.  It would detunnel end-to-end packets outbound
  986.       from RSA-IP-Clients and forward to external hosts. On the
  987.       return path, it would locate RSA-IP-Client tunnel, based on the
  988.       destination address of the end-to-end packet and encapsulate the
  989.       packet in a tunnel to forward to RSA-IP-Client.
  990.  
  991.    RSA-IP-Clients may pursue any of the IPsec techniques, namely
  992.    transport or tunnel mode Authentication and confidentiality using AH
  993.    and ESP headers on the embedded packets. Any of the tunneling
  994.    techniques may be adapted for encapsulation between RSA-IP-Client and
  995.    RSA-IP-Server or between RSA-IP-Client and external host.  For
  996.    example, IPsec tunnel mode encapsulation is a valid type of
  997.    encapsulation that ensures IPsec authentication and confidentiality
  998.    for the embedded end-to-end packets.
  999.  
  1000. 5.2 Realm Specific Address and port IP (RSAP-IP)
  1001.  
  1002.    Realm Specific Address and port IP (RSAP-IP) is a variation of RSIP
  1003.    in that multiple private hosts use a single external address,
  1004.    multiplexing on transport IDentifiers (i.e., TCP/UDP port numbers and
  1005.    ICMP Query IDs).
  1006.  
  1007.  
  1008.  
  1009.  
  1010. Srisuresh & Holdrege         Informational                     [Page 18]
  1011.  
  1012. RFC 2663           NAT Terminology and Considerations        August 1999
  1013.  
  1014.  
  1015.    "RSAP-IP-Client" may be defined similar to RSA-IP-Client with the
  1016.    variation that RSAP-IP-Client assumes a tuple of (external address,
  1017.    transport Identifier) when connecting to hosts in external realm to
  1018.    pursue end-to-end communication. As such, communication with external
  1019.    nodes for an RSAP-IP-Client may be limited to TCP, UDP and ICMP
  1020.    sessions.
  1021.  
  1022.    "RSAP-IP-Server" is similar to RSA-IP-Server in that it facilitates
  1023.    routing of external realm packets specific to RSAP-IP clients inside
  1024.    a private realm. Typically, an RSAP-IP-Server would also be the one
  1025.    to assign transport tuples to RSAP-IP-Clients.
  1026.  
  1027.    A NAPT router enroute could serve as RSAP-IP-Server, when the outer
  1028.    encapsulation is TCP/UDP based and is addressed between the RSAP-IP-
  1029.    Client and external peer. This approach requires the external peer to
  1030.    be  the end-point of TCP/UDP based tunnel. Using this approach,
  1031.    RSAP-IP-Clients may pursue any of the IPsec techniques, namely
  1032.    transport or tunnel mode authentication and confidentiality using AH
  1033.    and ESP headers on the embedded packets.  Note however, IPsec tunnel
  1034.    mode is not a valid type of encapsulation, as a NAPT router cannot
  1035.    provide routing transparency to AH and ESP protocols.
  1036.  
  1037.    Alternately, packets may be tunneled between RSAP-IP-Client and
  1038.    RSAP-IP-Server such that RSAP-IP-Server would detunnel packets
  1039.    outbound from RSAP-IP-Clients and forward to external hosts. On the
  1040.    return path, RSAP-IP-Server  would locate RSAP-IP-Client tunnel,
  1041.    based on the tuple of (destination address, transport Identifier) and
  1042.    encapsulate the original packet within a tunnel to forward to RSAP-
  1043.    IP-Client. With this approach, there is no limitation on the
  1044.    tunneling technique employed between RSAP-IP-Client and RSAP-IP-
  1045.    Server. However, there are limitations to applying IPsec based
  1046.    security on end-to-end packets.  Transport mode based authentication
  1047.    and integrity may be attained.  But, confidentiality cannot be
  1048.    permitted because RSAP-IP-Server must be able to examine the
  1049.    destination transport Identifier in order to identify the RSAP-IP-
  1050.    tunnel to forward inbound packets to. For this reason, only the
  1051.    transport mode TCP, UDP and ICMP packets protected by AH and ESP-
  1052.    authentication can traverse a RSAP-IP-Server using this approach.
  1053.  
  1054.    As an example, say Host-A in figure 2 above, obtains a tuple of
  1055.    (Addr-Nx, TCP port T-Nx) from NAPT router to act as RSAP-IP-Client to
  1056.    initiate end-to-end TCP sessions with Host-X.  Traversal of end-to-
  1057.    end packets within private realm may be illustrated as follows. In
  1058.    the first method, outer layer of the outgoing packet from Host-A uses
  1059.    (private address Addr-A, source port T-Na) as source tuple to
  1060.    communicate with Host-X. NAPT router enroute translates this tuple
  1061.    into (Addr-Nx, Port T-Nxa). This translation is independent of RSAP-
  1062.    IP-Client tuple parameters used in the embedded packet.
  1063.  
  1064.  
  1065.  
  1066. Srisuresh & Holdrege         Informational                     [Page 19]
  1067.  
  1068. RFC 2663           NAT Terminology and Considerations        August 1999
  1069.  
  1070.  
  1071.    First method, using NAPT router enroute to translate:
  1072.    ====================================================
  1073.  
  1074.    Host-A               NAPT router              Host-X
  1075.    ------               -----------              ------
  1076.  
  1077.    <Outer TCP/UDP packet, with
  1078.    src=Addr-A, Src Port=T-Na,
  1079.    Dest=Addr-X>,
  1080.    embedding
  1081.    <End-to-end packet, with
  1082.    src=Addr-Nx, Src Port=T-Nx, Dest=Addr-X>
  1083.    ----------------------------->
  1084.  
  1085.                         <Outer TCP/UDP packet, with
  1086.                         src=Addr-Nx, Src Port=T-Nxa,
  1087.                         Dest=Addr-X>,
  1088.                         embedding
  1089.                         <End-to-end packet, with
  1090.                         src=Addr-Nx, Src Port=T-Nx, Dest=Addr-X>
  1091.                         --------------------------------------->
  1092.  
  1093.                              .
  1094.                              .
  1095.                              .
  1096.  
  1097.                                              <Outer TCP/UDP packet with
  1098.                                              src=Addr-X, Dest=Addr-Nx,
  1099.                                              Dest Port=T-Nxa>,
  1100.                                              embedding
  1101.                                              <End-to-end packet, with
  1102.                                              src=Addr-X, Dest=Addr-Nx,
  1103.                                              Dest Port=T-Nx>
  1104.                                      <----------------------------------
  1105.  
  1106.                         <Outer TCP/UDP packet, with
  1107.                         src=Addr-X, Dest=Addr-A,
  1108.                         Dest Port=T-Na>,
  1109.                         embedding
  1110.                         <End-to-end packet, with
  1111.                         src=Addr-X, Dest=Addr-Nx,
  1112.                         Dest Port=T-Nx>
  1113.               <-----------------------------------
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122. Srisuresh & Holdrege         Informational                     [Page 20]
  1123.  
  1124. RFC 2663           NAT Terminology and Considerations        August 1999
  1125.  
  1126.  
  1127.    Second method, using a tunnel within private realm:
  1128.    ==================================================
  1129.  
  1130.    Host-A               NAPT router              Host-X
  1131.    ------               -----------              ------
  1132.  
  1133.    <Outer IP header, with
  1134.    src=Addr-A, Dest=Addr-Np>,
  1135.    embedding
  1136.    <End-to-end packet, with
  1137.    src=Addr-Nx, Src Port=T-Nx,
  1138.    Dest=Addr-X>
  1139.    ----------------------------->
  1140.  
  1141.                         <End-to-end packet, with
  1142.                         src=Addr-Nx, Src Port=T-Nx,
  1143.                         Dest=Addr-X>
  1144.                         -------------------------------->
  1145.  
  1146.                              .
  1147.                              .
  1148.                              .
  1149.  
  1150.                                              <End-to-end packet, with
  1151.                                              src=Addr-X, Dest=Addr-Nx,
  1152.                                              Dest Port=T-Nx>
  1153.                                    <----------------------------------
  1154.  
  1155.                         <Outer IP header, with
  1156.                         src=Addr-Np, Dest=Addr-A>,
  1157.                         embedding
  1158.                         <End-to-end packet, with
  1159.                         src=Addr-X, Dest=Addr-Nx,
  1160.                         Dest Port=T-Nx>
  1161.                 <----------------------------------
  1162.  
  1163. 6.0. Private Networks and Tunnels
  1164.  
  1165.    Let us consider the case where your private network is connected to
  1166.    the external world via tunnels. In such a case, tunnel encapsulated
  1167.    traffic may or may not contain translated packets depending upon the
  1168.    characteristics of address realms a tunnel is bridging.
  1169.  
  1170.    The following subsections discuss two scenarios where tunnels are
  1171.    used (a) in conjunction with Address translation, and (b) without
  1172.    translation.
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178. Srisuresh & Holdrege         Informational                     [Page 21]
  1179.  
  1180. RFC 2663           NAT Terminology and Considerations        August 1999
  1181.  
  1182.  
  1183. 6.1. Tunneling translated packets
  1184.  
  1185.    All variations of  address translations discussed in the previous
  1186.    section can be applicable to direct connected links as well as
  1187.    tunnels and virtual private networks (VPNs).
  1188.  
  1189.    For example, a private network connected to a business partner
  1190.    through a VPN could employ traditional NAT to communicate with the
  1191.    partner. Likewise, it is possible to employ twice NAT, if the
  1192.    partner's address space overlapped with the private network.  There
  1193.    could be a NAT device on one end of the tunnel or on both ends of the
  1194.    tunnel. In all cases, traffic across the VPN can be encrypted for
  1195.    security purposes. Security here refers to security for traffic
  1196.    across VPNs alone. End-to-end security requires trusting NAT devices
  1197.    within private network.
  1198.  
  1199. 6.2. Backbone partitioned private Networks
  1200.  
  1201.    There are many instances where a private network (such as a corporate
  1202.    network) is spread over different locations and use public backbone
  1203.    for communications between those locations. In such cases, it is not
  1204.    desirable to do address translation, both because large numbers of
  1205.    hosts may want to communicate across the backbone, thus requiring
  1206.    large address tables, and because there will be more applications
  1207.    that depend on configured addresses, as opposed to going to a name
  1208.    server. We call such a private network a backbone-partitioned private
  1209.    network.
  1210.  
  1211.    Backbone-partitioned stubs should behave as though they were a non-
  1212.    partitioned stub. That is, the routers in all partitions should
  1213.    maintain routes to the local address spaces of all partitions. Of
  1214.    course, the (public) backbones do not maintain routes to any local
  1215.    addresses. Therefore, the border routers must tunnel (using VPNs)
  1216.    through the backbones using encapsulation.  To do this, each NAT box
  1217.    will set aside a global address for tunneling.
  1218.  
  1219.    When a NAT box x in stub partition X wishes to deliver a packet to
  1220.    stub partition Y, it will encapsulate the packet in an IP header with
  1221.    destination address set to the global address of NAT box y that has
  1222.    been reserved for encapsulation. When NAT box y receives a packet
  1223.    with that destination address, it decapsulates the IP header and
  1224.    routes the packet internally.  Note, there is no address translation
  1225.    in the process; merely transfer of private network packets over an
  1226.    external network tunnel backbone.
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234. Srisuresh & Holdrege         Informational                     [Page 22]
  1235.  
  1236. RFC 2663           NAT Terminology and Considerations        August 1999
  1237.  
  1238.  
  1239. 7.0. NAT operational characteristics
  1240.  
  1241.    NAT devices are application unaware in that the translations are
  1242.    limited to IP/TCP/UDP/ICMP headers and ICMP error messages only.  NAT
  1243.    devices do not change the payload of the packets, as payloads tend to
  1244.    be application specific.
  1245.  
  1246.    NAT devices (without the inclusion of ALGs) do not examine or modify
  1247.    transport payload. For this reason, NAT devices are transparent to
  1248.    applications in many cases. There are two areas, however, where NAT
  1249.    devices often cause difficulties: 1) when an application payload
  1250.    includes an IP address, and 2) when end-to-end security is needed.
  1251.    Note, this is not a comprehensive list.
  1252.  
  1253.    Application layer security techniques that do not make use of or
  1254.    depend on IP addresses will work correctly in the presence of NAT
  1255.    (e.g., TLS,  SSL and ssh). In contrast, transport layer techniques
  1256.    such as IPSec transport mode or the TCP MD5 Signature Option RFC 2385
  1257.    [Ref 17] do not.
  1258.  
  1259.    In IPSec transport mode, both AH and ESP have an integrity check
  1260.    covering the entire payload. When the payload is TCP or UDP, the
  1261.    TCP/UDP checksum is covered by the integrity check. When a NAT device
  1262.    modifies an address the checksum is no longer valid with respect to
  1263.    the new address. Normally, NAT also updates the checksum, but this is
  1264.    ineffective when AH and ESP are used.  Consequently, receivers will
  1265.    discard a packet either because it fails the IPSec integrity check
  1266.    (if the NAT device updates the checksum), or because the checksum is
  1267.    invalid (if the NAT device leaves the checksum unmodified).
  1268.  
  1269.    Note that IPsec tunnel mode ESP is permissible so long as the
  1270.    embedded packet contents are unaffected by the outer IP header
  1271.    translation. Although this technique does not work in traditional NAT
  1272.    deployments (i.e., where hosts are unaware that NATs are present),
  1273.    the technique is applicable to Realm-Specific IP as described in
  1274.    Section 5.0.
  1275.  
  1276.    Note also that end-to-end ESP based transport mode authentication and
  1277.    confidentiality are permissible for packets such as ICMP, whose IP
  1278.    payload content is unaffected by the outer IP header translation.
  1279.  
  1280.    NAT devices also break fundamental assumptions by public key
  1281.    distribution infrastructures such as Secure DNS RFC 2535 [Ref 18] and
  1282.    X.509 certificates with signed public keys. In the case of Secure
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Srisuresh & Holdrege         Informational                     [Page 23]
  1291.  
  1292. RFC 2663           NAT Terminology and Considerations        August 1999
  1293.  
  1294.  
  1295.    DNS, each DNS RRset is signed with a key from within the zone.
  1296.    Moreover, the authenticity of a specific key is verified by following
  1297.    a chain of trust that goes all the way to the DNS root.  When a DNS-
  1298.    ALG modifies addresses (e.g., as in the case of Twice-NAT),
  1299.    verification of signatures fails.
  1300.  
  1301.    It may be of interest to note that IKE (Session key negotiation
  1302.    protocol) is a UDP based session layer protocol and is not protected
  1303.    by network based IPsec security. Only a portion of the individual
  1304.    payloads within IKE are protected. As a result, IKE sessions are
  1305.    permissible across NAT, so long as IKE payload does not contain
  1306.    addresses and/or transport IDs specific to one realm and not the
  1307.    other. Given that IKE is used to setup IPSec associations, and there
  1308.    are at present no known ways of making IPSec work through a NAT
  1309.    function, it is a future work item to take advantage of IKE through a
  1310.    NAT box.
  1311.  
  1312.    One of the most popular internet applications "FTP" would not work
  1313.    with the definition of NAT as described. The following sub-section is
  1314.    devoted to describing how FTP is supported on NAT devices.  FTP ALG
  1315.    is an integral part of most NAT implementations. Some vendors may
  1316.    choose to include additional ALGs to custom support other
  1317.    applications on the NAT device.
  1318.  
  1319. 7.1. FTP support
  1320.  
  1321.    "PORT" command and "PASV" response in FTP control session payload
  1322.    identify the IP address and TCP port that must be used for the data
  1323.    session it supports. The arguments to the PORT command and PASV
  1324.    response are an IP address and a TCP port in ASCII. An FTP ALG is
  1325.    required to monitor and update the FTP control session payload so
  1326.    that information contained in the payload is relevant to end nodes.
  1327.    The ALG must also update NAT with appropriate data session tuples and
  1328.    session orientation so that NAT could set up state information for
  1329.    the FTP data sessions.
  1330.  
  1331.    Because the address and TCP port are encoded in ASCII, this may
  1332.    result in a change in the size of packet.  For instance,
  1333.    10,18,177,42,64,87 is 18 ASCII characters, whereas
  1334.    193,45,228,137,64,87 is 20 ASCII characters. If the new size is same
  1335.    as the previous, only the TCP checksum needs adjustment as a result
  1336.    of change of data. If the new size is less than or greater than the
  1337.    previous, TCP sequence numbers must also be changed to reflect the
  1338.    change in length of FTP control data portion.  A special table may be
  1339.    used by the ALG to correct the TCP sequence and acknowledge numbers.
  1340.    The sequence number and acknowledgement correction will need to be
  1341.    performed on all future packet of the connection.
  1342.  
  1343.  
  1344.  
  1345.  
  1346. Srisuresh & Holdrege         Informational                     [Page 24]
  1347.  
  1348. RFC 2663           NAT Terminology and Considerations        August 1999
  1349.  
  1350.  
  1351. 8.0. NAT limitations
  1352.  
  1353. 8.1. Applications with IP-address Content
  1354.  
  1355.    Not All applications lend themselves easily to address translation by
  1356.    NAT devices. Especially, the applications that carry IP address (and
  1357.    TU port, in case of NAPT) inside the payload. Application Level
  1358.    Gateways, or ALGs must be used to perform translations on packets
  1359.    pertaining to such applications. ALGs may optionally utilize address
  1360.    (and TU port) assignments made by NAT and perform translations
  1361.    specific to the application. The combination of NAT functionality and
  1362.    ALGs will not provide end-to-end security assured by IPsec.  However,
  1363.    tunnel mode IPsec can be accomplished with NAT router serving as
  1364.    tunnel end point.
  1365.  
  1366.    SNMP is one such application with address content in payload. NAT
  1367.    routers would not translate IP addresses within SNMP payloads. It is
  1368.    not uncommon for an SNMP specific ALG to reside on a NAT router to
  1369.    perform SNMP MIB translations proprietary to the private network.
  1370.  
  1371. 8.2. Applications with inter-dependent control and data sessions
  1372.  
  1373.    NAT devices operate on the assumption that each session is
  1374.    independent.  Session characteristics like session orientation,
  1375.    source and destination IP addresses, session protocol, and source and
  1376.    destination transport level identifiers are determined independently
  1377.    at the start of each new session.
  1378.  
  1379.    However, there are applications such as H.323 that use one or more
  1380.    control sessions to set the characteristics of the follow-on sessions
  1381.    in their control session payload. Such applications require use of
  1382.    application specific ALGs that can interpret and translate the
  1383.    payload, if necessary. Payload interpretation would help NAT be
  1384.    prepared for the follow-on data sessions.
  1385.  
  1386. 8.3. Debugging Considerations
  1387.  
  1388.    NAT increases the probability of mis-addressing. For example, same
  1389.    local address may be bound to different global address at different
  1390.    times and vice versa. As a result, any traffic flow study based
  1391.    purely on global addresses and TU ports could be confused and might
  1392.    misinterpret the results.
  1393.  
  1394.    If a host is abusing the Internet in some way (such as trying to
  1395.    attack another machine or even sending large amounts of junk mail or
  1396.    something) it is more difficult to pinpoint the source of the trouble
  1397.    because the IP address of the host is hidden in a NAT router.
  1398.  
  1399.  
  1400.  
  1401.  
  1402. Srisuresh & Holdrege         Informational                     [Page 25]
  1403.  
  1404. RFC 2663           NAT Terminology and Considerations        August 1999
  1405.  
  1406.  
  1407. 8.4. Translation of fragmented FTP control packets
  1408.  
  1409.    Translation of fragmented FTP control packets is tricky when the
  1410.    packets contain "PORT" command or response to "PASV" command.
  1411.    Clearly, this is a pathological case. NAT router would need to
  1412.    assemble the fragments together first and then translate prior to
  1413.    forwarding.
  1414.  
  1415.    Yet another case would be when each character of packets containing
  1416.    "PORT" command or response to "PASV" is sent in a separate datagram,
  1417.    unfragmented. In this case, NAT would simply have to let the packets
  1418.    through, without translating the TCP payload. Of course, the
  1419.    application will fail if the payload needed to be altered. The
  1420.    application could still work in a few cases, where the payload
  1421.    contents can be valid in both realms, without modifications enroute.
  1422.    For example, FTP originated from a private host would still work
  1423.    while traversing a traditional NAT or bi-directional NAT device, so
  1424.    long as the FTP control session employed PASV command to establish
  1425.    data sessions. The reason being that the address and port number
  1426.    specified by FTP server in the PASV response (sent as multiple
  1427.    unfragmented packets) is valid to the private host, as is. The NAT
  1428.    device will simply view the ensuing data session (also originating
  1429.    from private host) as an independent TCP session.
  1430.  
  1431. 8.5. Compute intensive
  1432.  
  1433.    NAT is compute intensive even with the help of a clever checksum
  1434.    adjustment algorithm, as each data packet is subject to NAT lookup
  1435.    and modifications.  As a result, router forwarding throughput could
  1436.    be slowed considerably. However, so long as the processing capacity
  1437.    of the NAT device exceeds line processing rate, this should not be a
  1438.    problem.
  1439.  
  1440. 9.0. Security Considerations
  1441.  
  1442.    Many people view traditional NAT router as a one-way (session)
  1443.    traffic filter, restricting sessions from external hosts into their
  1444.    machines. In addition, when address assignment in NAT router is done
  1445.    dynamically, that makes it harder for an attacker to point to any
  1446.    specific host in the NAT domain. NAT routers may be used in
  1447.    conjunction with firewalls to filter unwanted traffic.
  1448.  
  1449.    If NAT devices and ALGs are not in a trusted boundary, that is a
  1450.    major security problem, as ALGs could snoop end user traffic payload.
  1451.    Session level payload could be encrypted end to end, so long as the
  1452.    payload does not contain IP addresses and/or transport identifiers
  1453.    that are valid in only one of the realms. With the exception of RSIP,
  1454.    end-to-end IP network level security assured by current IPsec
  1455.  
  1456.  
  1457.  
  1458. Srisuresh & Holdrege         Informational                     [Page 26]
  1459.  
  1460. RFC 2663           NAT Terminology and Considerations        August 1999
  1461.  
  1462.  
  1463.    techniques is not attainable with NAT devices in between. One of the
  1464.    ends must be a NAT box. Refer section 7.0 for a discussion on why
  1465.    end-to-end IPsec security cannot be assured with NAT devices along
  1466.    the route.
  1467.  
  1468.    The combination of NAT functionality, ALGs and firewalls will provide
  1469.    a transparent working environment for a private networking domain.
  1470.    With the exception of RSIP, end-to-end network security assured by
  1471.    IPsec cannot be attained for end-hosts within the private network
  1472.    (Refer section 5.0 for RSIP operation). In all other cases, if you
  1473.    want to use end-to-end IPsec, there cannot be a NAT device in the
  1474.    path. If we make the assumption that NAT devices are part of a
  1475.    trusted boundary, tunnel mode IPsec can be accomplished with NAT
  1476.    router (or a combination of NAT, ALGs and firewall) serving as tunnel
  1477.    end point.
  1478.  
  1479.    NAT devices, when combined with ALGs, can ensure that the datagrams
  1480.    injected into Internet have no private addresses in headers or
  1481.    payload. Applications that do not meet these requirements may be
  1482.    dropped using firewall filters. For this reason, it is not uncommon
  1483.    to find NAT, ALG and firewall functions co-exist to provide security
  1484.    at the borders of a private network. NAT gateways can be used as
  1485.    tunnel end points to provide secure VPN transport of packet data
  1486.    across an external network domain.
  1487.  
  1488.    Below are some additional security considerations associated with NAT
  1489.    routers.
  1490.  
  1491.    1. UDP sessions are inherently unsafe. Responses to a datagram
  1492.       could come from an address different from the target address
  1493.       used by sender ([Ref 4]). As a result, an incoming UDP packet
  1494.       might match the outbound session of a traditional NAT router
  1495.       only in part (the destination address and UDP port number of
  1496.       the packet match, but the source address and port number may
  1497.       not). In such a case, there is a potential security compromise
  1498.       for the NAT device in permitting inbound packets with partial
  1499.       match. This UDP security issue is also inherent to firewalls.
  1500.  
  1501.       Traditional NAT implementations that do not track datagrams on
  1502.       a per-session basis but lump states of multiple UDP sessions
  1503.       using the same address binding into a single unified session
  1504.       could compromise the security even further. This is because,
  1505.       the granularity of packet matching would be further limited to
  1506.       just the destination address of the inbound UDP packets.
  1507.  
  1508.    2. Multicast sessions (UDP based) are another source for security
  1509.       weakness for traditional-NAT routers. Once again, firewalls face
  1510.       the same security dilemma as the NAT routers.
  1511.  
  1512.  
  1513.  
  1514. Srisuresh & Holdrege         Informational                     [Page 27]
  1515.  
  1516. RFC 2663           NAT Terminology and Considerations        August 1999
  1517.  
  1518.  
  1519.       Say, a host on private network initiated a multicast session.
  1520.       Datagram sent by the private host could trigger responses in the
  1521.       reverse direction from multiple external hosts. Traditional-NAT
  1522.       implementations that use a single state to track a multicast
  1523.       session cannot determine for certain if the incoming UDP packet
  1524.       is in response to an existing multicast session or the start of
  1525.       new UDP session initiated by an attacker.
  1526.  
  1527.    3. NAT devices can be a target for attacks.
  1528.  
  1529.       Since NAT devices are Internet hosts they can be the target of a
  1530.       number of different attacks, such as SYN flood and ping flood
  1531.       attacks. NAT devices should employ the same sort of protection
  1532.       techniques as Internet-based servers do.
  1533.  
  1534. REFERENCES
  1535.  
  1536.    [1]  Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot,G. and E.
  1537.         Lear, "Address Allocation for Private Internets", BCP 5, RFC
  1538.         1918, February 1996.
  1539.  
  1540.    [2]  Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC 1700,
  1541.         October, 1994.
  1542.  
  1543.    [3]  Braden, R., "Requirements for Internet Hosts -- Communication
  1544.         Layers", STD 3, RFC 1122, October 1989.
  1545.  
  1546.    [4]  Braden, R., "Requirements for Internet Hosts -- Application and
  1547.         Support", STD 3, RFC 1123, October 1989.
  1548.  
  1549.    [5]  Baker, F., "Requirements for IP Version 4 Routers", RFC 1812,
  1550.         June 1995.
  1551.  
  1552.    [6]  Postel, J. and J. Reynolds, "File Transfer Protocol (FTP)", STD
  1553.         9, RFC 959, October 1985.
  1554.  
  1555.    [7]  Postel, J., "Transmission Control Protocol (TCP) Specification",
  1556.         STD 7,  RFC 793, September 1981.
  1557.  
  1558.    [8]  Postel, J., "Internet Control Message Protocol Specification"
  1559.         STD 5, RFC 792, September 1981.
  1560.  
  1561.    [9]  Postel, J., "User Datagram Protocol (UDP)", STD 6, RFC 768,
  1562.         August 1980.
  1563.  
  1564.    [10] Mogul, J. and J. Postel, "Internet Standard Subnetting
  1565.         Procedure", STD 5, RFC 950, August 1985.
  1566.  
  1567.  
  1568.  
  1569.  
  1570. Srisuresh & Holdrege         Informational                     [Page 28]
  1571.  
  1572. RFC 2663           NAT Terminology and Considerations        August 1999
  1573.  
  1574.  
  1575.    [11] Carpenter, B., Crowcroft, J. and Y. Rekhter, "IPv4 Address
  1576.         Behavior Today", RFC 2101, February 1997.
  1577.  
  1578.    [12] Kent, S. and  R. Atkinson, "Security Architecture for the
  1579.         Internet Protocol", RFC 2401, November 1998.
  1580.  
  1581.    [13] Kent, S. and  R. Atkinson, "IP Encapsulating Security Payload
  1582.         (ESP)", RFC 2406, November 1998.
  1583.  
  1584.    [14] Kent, S. and  R. Atkinson, "IP Authentication Header", RFC 2402,
  1585.         November 1998.
  1586.  
  1587.    [15] Harkins, D. and  D. Carrel, "The Internet Key Exchange (IKE)",
  1588.         RFC 2409, November 1998.
  1589.  
  1590.    [16] Piper, D., "The Internet IP Security Domain of Interpretation
  1591.         for ISAKMP", RFC 2407, November 1998.
  1592.  
  1593.    [17] Heffernan, A., "Protection of BGP Sessions via the TCP MD5
  1594.         Signature Option", RFC 2385, August 1998.
  1595.  
  1596.    [18] Eastlake, D., "Domain Name System Security Extensions", RFC
  1597.         2535, March 1999.
  1598.  
  1599. Authors' Addresses
  1600.  
  1601.    Pyda Srisuresh
  1602.    Lucent Technologies
  1603.    4464 Willow Road
  1604.    Pleasanton, CA 94588-8519
  1605.    U.S.A.
  1606.  
  1607.    Phone: (925) 737-2153
  1608.    Fax:   (925) 737-2110
  1609.    EMail: srisuresh@lucent.com
  1610.  
  1611.  
  1612.    Matt Holdrege
  1613.    Lucent Technologies
  1614.    1701 Harbor Bay Parkway
  1615.    Alameda, CA 94502
  1616.  
  1617.    Phone: (510) 769-6001
  1618.    EMail: holdrege@lucent.com
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626. Srisuresh & Holdrege         Informational                     [Page 29]
  1627.  
  1628. RFC 2663           NAT Terminology and Considerations        August 1999
  1629.  
  1630.  
  1631. Full Copyright Statement
  1632.  
  1633.    Copyright (C) The Internet Society (1999).  All Rights Reserved.
  1634.  
  1635.    This document and translations of it may be copied and furnished to
  1636.    others, and derivative works that comment on or otherwise explain it
  1637.    or assist in its implementation may be prepared, copied, published
  1638.    and distributed, in whole or in part, without restriction of any
  1639.    kind, provided that the above copyright notice and this paragraph are
  1640.    included on all such copies and derivative works.  However, this
  1641.    document itself may not be modified in any way, such as by removing
  1642.    the copyright notice or references to the Internet Society or other
  1643.    Internet organizations, except as needed for the purpose of
  1644.    developing Internet standards in which case the procedures for
  1645.    copyrights defined in the Internet Standards process must be
  1646.    followed, or as required to translate it into languages other than
  1647.    English.
  1648.  
  1649.    The limited permissions granted above are perpetual and will not be
  1650.    revoked by the Internet Society or its successors or assigns.
  1651.  
  1652.    This document and the information contained herein is provided on an
  1653.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  1654.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  1655.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  1656.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  1657.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  1658.  
  1659. Acknowledgement
  1660.  
  1661.    Funding for the RFC Editor function is currently provided by the
  1662.    Internet Society.
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682. Srisuresh & Holdrege         Informational                     [Page 30]
  1683.  
  1684.