<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes" ?>
<?rfc compact="yes" ?>
<?rfc sortrefs="no" ?>
<rfc category="std" ipr="full2026"
     docName="draft-jennings-midcom-stun-results-00">
<front>
  <title abbrev= "STUN Test Results" >
    NAT Classification Results using STUN
  </title >
  <author initials="C." surname="Jennings" fullname="Cullen Jennings">
    <organization>Cisco Systems</organization>
    <address>
      <postal>
        <street>170 West Tasman Drive</street>
        <street>Mailstop SJC-21/2</street>
	<city>San Jose</city>
	<region>CA</region>
	<code>95134</code>
	<country>USA</country>
      </postal>
      <phone>+1 408 421 9990</phone>
      <email>fluffy@cisco.com </email>
    </address>
  </author>
  <date month="February" day="8" year="2004"/>
  <area>Transport</area>
  <workgroup>MIDCOM WG</workgroup>
  <keyword>I-D</keyword>
  <keyword>Internet-Draft</keyword>
  <keyword>STUN</keyword>
  <abstract>
    
 <t>
IETF has several groups that are considering the impact of NATs on various
protocols. Having a classification of the types of NATs
that are being developed and deployed is useful in gauging the impact of various
solutions. This draft records the results of classifying NATs using the STUN
protocol. </t>
<t>
This work is being discussed on the midcom@ietf.org mailing list.
 </t>

  </abstract> 
</front>


<middle>
  
  <section title = "Conventions" >			
    <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">RFC-2119</xref>.</t> 
<t>
In this document, the term NAT means port address translation. This is an
unfortunate use of the terminology but is what NAT has come to mean. </t>
    
  </section>

<section title= "Introduction" >
<t>
A major issue in working with NAT traversal solutions for various protocols is
that NATs behave in many different ways. RFC 3489 (STUN) classifies these and
provides a method to test them. This draft describes the results of testing
several residential style NATs. </t>
<t>
Several NATs attempt to use the same external port number as the internal host
used. This is referred to as port preservation. On the NATs that did this, some
were found to have different characteristics depending on whether the port was already in
use or not. This was tested by running the STUN tests from a particular port on
one internal IP address and then running them again from the same port on a
different internal IP address. The results from the first interface, where the
port was preserved are referred to as the primary type while the results from
the second interface, which did not manage to get the same external port because
it was already in use, is referred to as the secondary type. On most NATs the
secondary type is the same as the primary but on some it is different; these
are referred to as nondeterministic NATs, since a client with a single internal
IP address can not figure out what the type of the NAT is. </t>
<t>
There are several NATs that would be detected as address restricted by the STUN
tests but are not. These NATs always use the same external port as the
internal port and store the IP address of the most recent internal host to send
a packet on that port. The NATs then forward any traffic arriving to the
external interface of the NAT on this port to the most recent internal host to
use it. These NATs are labeled of type "Bad" in the result table since they do
not meet the definitions of NAPT in RFC 3022.  Interestingly, as long as the
clients behind the NAT choose random port numbers, they often do work. STUN
detects these NATs as address restricted although they are really not address
restricted NATs. This type of NAT is easily detected by sending a STUN packet
from the same port on two different internal IP addresses and looking at the
mapped port in the return. If both packets were mapped to the same external port, the
NAT is of the Bad type. </t>
<t>
Another important aspect of a NAT for some applications is whether it can send media
from one internal host back to another host behind the same NAT. This is
referred to as supporting hairpin media. </t>
<t>
Some NATs were rumored to exist that looked in arbitrary packets for either the
NATs' external IP address or for the internal host IP address - either in binary or
dotted decimal form - and rewrote it to something else. STUN could be extended to
test for exactly this type of behavior by echoing arbitrary client data and the
mapped address but sending the bits inverted so these evil NATs did not mess
with them. NATs that do this will break integrity detection on payloads. </t>
<t>
To help organize the NATs by what types of applications they can support, the
following groups are defined. The application of using a SIP phone with a TLS
connection for signaling and using STUN for media ports is considered. It is
assumed the RTP/RTCP media is on random port pairs as recommended for RTP.</t>
<list>
<t>
Group A: NATs that are deterministic, not symmetric, and support hairpin
media. These NATs would work with many phones behind them.  </t>
<t>
Group B: NATs that are not symmetric on the primary mapping. This group would
work with many IP phones as long as the media ports did not conflict. This is
unlikely to happen often but will occasionally happen. Because they may not support
hairpin media, a call from one phone behind a NAT to another phone behind the same
NAT may not work. </t>
<t>
Group D: NATs of the type Bad. These have the same limitations of group B but
when the ports conflict, media gets delivered to a random phone behind the
NAT. </t>
<t>
Group F: These NATs are symmetric and phones will not work. </t>
</list>

</section>
<section title= "Results" >
<t>
The following table shows the results from several NATs. This includes some
random NATs the author had lying around as well as every NAT that could be
purchased in February 2004 in the San Jose Fry's, Best Buy, CompUSA, and Circuit
City. Clearly this is not a very good approximation to a random sample. It is
clear that the NATs widely purchased in the US are different from what are
available in Japan or in Europe. </t>
<t>
In the following table the Prim column indicates the primary type of the NAT. A
value of Port indicates port restricted, Cone is a full cone, Bad is described
in the next section, Symm is Symmetric, and Addr is Address restricted. The Hair
column value of Y or N indicates whether the NAT will hairpin media. The Pres column
indicates whether the NAT attempts to preserve port numbers. The Sec column indicates the
secondary type of the NAT, and a value of Same indicates it is the same as the primary
type. The Grp indicates the group that this NAT falls into. </t>
<t>
<figure><artwork><![CDATA[
Vendor      Model       Fimware            Prim  Sec  Hair Pres Grp

Airlink     ASOHO4P     V1.01.0095         Port  Symm  N    Y    B
Apple       Air Base StaV5.2               Cone  Same  Y    N    A
Belkin      F5D5321     V1.13              Port  Same  N    N    B
Cisco       IOS                            Port  Symm            -
Cisco       PIX                            Port  Same            -
Corega      BAR Pro2    R1.00 Feb 21 2003  Cone                  -
DLink       DI-604      2.0 Jun 2002       Cone  Same  N    N    B
DLink       DI-704P     2.61 build 2       Cone  Same  Y    N    A
Dlink       DI-804      .30, Tue,Jun 24 20 Cone  Same  Y    N    A
Hawkings    FR24        6.26.02h Build 004 Bad   Same  Y    Y    D
Linksys     BEFSR11                        Port                  B
Linksys     BEFSR11 V2  1.42.7, Apr 02 200 Port                  B
Linksys     BEFSR41     v1.44.2            Port                  B
Linksys     BEFSR81     2.42.7.1 June 2002 Addr  Same  N    Y    B
Linksys     BEFSRU31                       Port                  B
Linksys     BEFSX41     1.44.3, Dec 24 200 Port                  B
Linksys     BEFVP41     1.41.1, Sep 04 200 Port                  B
Linksys     BEFW11S4    1.45.3, Jul 1 2003 Port                  B
Linksys     WRT54G      1.42.2             Port  Symm  N    Y    B
Linksys     WRT55AG     1.04, Jun.30, 2003 Port                  B
Linksys     WRV54G      2.03               Port  Same  N    Y    B
Microsoft   MN-700      02.00.07.0331      Cone  Same  N    N    B
Netgear     FVS318      V1.4 Jul. 15 2003  Port  Same  N    N    B
Netgear     RP114       3.26(CD.0) 8/17/20 Cone                  -
Netgear     RP614       4.00 April 2002    Cone  Same  Y    N    A
NetworkEver NR041       Version 1.0 Rel 10 Symm  Same  N    N    F
NetworkEver NR041       Version 1.2 Rel 03 Bad   Same  Y    Y    D
SMC         2804WBRP-G  v1.00 Oct 14 2003  Port  Symm  Y    Y    B
SMC         7004ABR     V1.42.003          Port  Same  N    N    B
SMC         7004VBR     v1.03 Jun 12, 2002 Cone                  -
Toshiba     WRC-1000    1.07.03a-C024a     Port  Cone  N    Y    B
umax        ugate-3000  2.06h              Port                  -
US Robotics USR8003     1.04 08            Cone  Same  N    N    B
ZOT         BR1014      Unknown            Bad   Same  N    Y    D
]]></artwork></figure></t>

    </section>

<section title= "Discussion" >
<t>
It is clear from discussions with various vendors and watching how tests have
changed over the years that symmetric is becoming less common. This change is
being driven primarily by the desire to make online gaming work; many games use methods
similar to STUN for NAT traversal. The only symmetric NAT found was an old
device. More recent version of the software on the same device were not
symmetric. It is clear that other symmetric NATs are deployed, but it is hard to
find them. </t>
    </section>

<section title= "Security Concerns" >
<t>
It is often assumed that symmetric NATs are more secure than port
restricted NATs. This is not true - they are identical from a security point of
view. They both only allow a packet to come inside the NAT if the host inside
has previously sent to the exact same external IP and port. One can argue that
cone is less secure than port restricted, but this is not true if the attacker
can spoof the IP address, which is fairly easy to do in many cases. What level of
security can be expected from NATs at all is a strange and curious topic. With
all the NATs, if you allow packets out, packets can come in, so don't be
surprised if NATs provide less security that anticipated.
</t>
</section>

 <section title= "Open Issues" >
<t>
The hairpin media tests were done by having a single host use STUN to find a
public address on the NAT and then send media to itself and see if it was
received. It is possible that NATs might not hairpin media to the same host but
would hairpin media to another host behind the same NAT. It is possible that
because of this, the hairpin results reported here are wrong.  </t>
<t>
This sample set of NATs is very US-centric: D-Link, Lynksys, and Netgear
dominate the US consumer market. It would be good to
get more results from other places. </t>
<t>
These test results should be verified by another group. This has not been done
yet. </t>
</section>
    <section title= "Acknowledgments" >
<t>
Many people and several mailing lists have contributed to the material on
understanding NATs in this document. Many thanks to Larry Metzger, Dan Wing, and
Rohan Mahy. The STUN server and client is open source and available at
http://sourceforge.net/projects/stun and thank you to Jason Fischl who runs the
public STUN server at larry.gloo.net.  Thanks to Yutaka Takeda who tested and
found bugs and Christian Stredicke for getting people thinking. </t>
      
    </section>
    
    
  </middle>
  <back>
    <references title= "Normative References" >
      
      <reference anchor='RFC3489'>
        
        <front>
          <title>STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)</title>
          <author initials='J.' surname='Rosenberg' fullname='J. Rosenberg'>
            <organization /></author>
<author initials='J.' surname='Weinberger' fullname='J. Weinberger'>
<organization /></author>
<author initials='C.' surname='Huitema' fullname='C. Huitema'>
<organization /></author>
<author initials='R.' surname='Mahy' fullname='R. Mahy'>
<organization /></author>
<date month='March' year='2003' /></front>

<seriesInfo name='RFC' value='3489' />
</reference>

<reference anchor='RFC2119'>

<front>
<title abbrev='RFC Key Words'>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='Scott Bradner'>
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>sob@harvard.edu</email></address></author>
<date month='March' year='1997' />
<area>General</area>
<keyword>keyword</keyword>
<abstract>
</abstract></front>

<seriesInfo name='BCP' value='14' />
<seriesInfo name='RFC' value='2119' />
<format type='TXT' octets='4723' target='ftp://ftp.isi.edu/in-notes/rfc2119.txt' />
<format type='HTML' octets='15905' target='http://xml.resource.org/public/rfc/html/rfc2119.html' />
<format type='XML' octets='5661' target='http://xml.resource.org/public/rfc/xml/rfc2119.xml' />
</reference>



		</references>
  <references title='Informative References'>

<reference anchor='RFC3424'>

<front>
<title>IAB Considerations for UNilateral Self-Address Fixing (UNSAF) Across Network Address Translation</title>
<author initials='L.' surname='Daigle' fullname='L. Daigle'>
<organization /></author>
<author>
<organization>IAB</organization></author>
<date month='November' year='2002' /></front>

<seriesInfo name='RFC' value='3424' />
</reference>

<reference anchor='RFC3022'>

<front>
<title>Traditional IP Network Address Translator (Traditional NAT)</title>
<author initials='P.' surname='Srisuresh' fullname='P. Srisuresh'>
<organization /></author>
<author initials='K.' surname='Egevang' fullname='K. Egevang'>
<organization /></author>
<date month='January' year='2001' /></front>

<seriesInfo name='RFC' value='3022' />
</reference>

<reference anchor='RFC2663'>

<front>
<title abbrev='NAT Terminology and Considerations'>IP Network Address Translator (NAT) Terminology and Considerations</title>
<author initials='P.' surname='Srisuresh' fullname='Pyda Srisuresh'>
<organization>Lucent Technologies</organization>
<address>
<postal>
<street>4464 Willow Road</street>
<city>Pleasanton</city>
<region>CA</region>
<code>94588-8519</code>
<country>US</country></postal>
<phone>+1 925 737 2153</phone>
<email>srisuresh@lucent.com</email></address></author>
<author initials='M.' surname='Holdrege' fullname='Matt Holdrege'>
<organization>Lucent Technologiesv</organization>
<address>
<postal>
<street>1701 Harbor Bay Parkway</street>
<city>Alameda</city>
<region>CA</region>
<code>94502</code>
<country>US</country></postal>
<phone>+1 510 769 6001</phone>
<email>holdrege@lucent.com</email></address></author>
<date month='August' year='1999' />
<abstract>
<t>Network Address Translation is a method by which IP addresses are mapped from one realm to another, in an attempt to provide transparent routing to hosts. Traditionally, NAT devices are used to connect an isolated address realm with private unregistered addresses to an external realm with globally unique registered addresses. This document attempts to describe the operation of NAT devices and the associated considerations in general, and to define the terminology used to identify various flavors of NAT.</t></abstract></front>

<seriesInfo name='RFC' value='2663' />
</reference>

    </references>
    
	</back>
</rfc>
