Subject: [BEHAVE] (no subject)

From: John Selbie <[email-masked]>
Date: Thu, 22 Dec 2011 13:17:11 -0800

In regards to the NAT mapping test described in RFC 5780, section 4.3.

If I read the RFC correctly:

Test 1 - binding request to Primary IP and Primary Port (
stun1.mydomain.com:3478)
If no NAT detected, then stop, otherwise perform test 2.

Test 2 - binding request to Alternate IP and Primary Port (
stun2.mydomain.com:3478)
If port mapping from test 1 is the same, then infer "endpoint-indepenent",
otherwise test 3

Test 3 - binding request to Alternate IP and Alternate Port (
stun2.mydomain.com:3479)
   Infer either "address dependent" or "address+port dependent" mapping
based on result

I am curious about this.  But it seems like if test 2 and test 3 should be
swapped. Such that test 2 was the one that hits the alternate port on the
alternate IP.  And if the result was the same as test 1, then that would be
more reliable to infer "endpoint independent" mapping than just comparing
the two test results against identical port numbers on different IPs.

Otherwise, as the test sequence stands now, it implies that there could
never be "port dependent mapping".

Thoughts?

John Selbie

4.3.  Determining NAT Mapping Behavior

   This will require at most three tests.  In test I, the client
   performs the UDP connectivity test.  The server will return its
   alternate address and port in OTHER-ADDRESS in the binding response.
   If OTHER-ADDRESS is not returned, the server does not support this
   usage and this test cannot be run.  The client examines the XOR-
   MAPPED-ADDRESS attribute.  If this address and port are the same as
   the local IP address and port of the socket used to send the request,
   the client knows that it is not NATed and the effective mapping will
   be Endpoint-Independent.

   In test II, the client sends a Binding Request to the alternate
   address, but primary port.  If the XOR-MAPPED-ADDRESS in the Binding
   Response is the same as test I the NAT currently has Endpoint-
   Independent Mapping.  If not, test III is performed: the client sends
   a Binding Request to the alternate address and port.  If the XOR-
   MAPPED-ADDRESS matches test II, the NAT currently has Address-
   Dependent Mapping; if it doesn't match it currently has Address and
   Port-Dependent Mapping.