RFC 5780 - Order of mapping tests
John Selbie <john <at> selbie.com>
2011-12-22 21:20:58 GMT
<adding subject header - sorry for dupe>
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.
<div><p><adding subject header - sorry for dupe><br><br>In regards to the NAT mapping test described in RFC 5780, section 4.3.<br><br>If I read the RFC correctly:<br><br>Test 1 - binding request to Primary IP and Primary Port (<a href="http://stun1.mydomain.com:3478/" target="_blank">stun1.mydomain.com:3478</a>)<br>
If no NAT detected, then stop, otherwise perform test 2.<br><br>Test 2 - binding request to Alternate IP and Primary Port (<a href="http://stun2.mydomain.com:3478/" target="_blank">stun2.mydomain.com:3478</a>)<br>If port mapping from test 1 is the same, then infer "endpoint-indepenent", otherwise test 3<br><br>Test 3 - binding request to Alternate IP and Alternate Port (<a href="http://stun2.mydomain.com:3479/" target="_blank">stun2.mydomain.com:3479</a>)<br> Infer either "address dependent" or "address+port dependent" mapping based on result<br><br>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. <br><br>Otherwise, as the test sequence stands now, it implies that there could never be "port dependent mapping".<br><br>Thoughts?<br><br>John Selbie<br><br>4.3. Determining NAT Mapping Behavior<br><br> This will require at most three tests. In test I, the client<br>
performs the UDP connectivity test. The server will return its<br> alternate address and port in OTHER-ADDRESS in the binding response.<br> If OTHER-ADDRESS is not returned, the server does not support this<br> usage and this test cannot be run. The client examines the XOR-<br>
MAPPED-ADDRESS attribute. If this address and port are the same as<br> the local IP address and port of the socket used to send the request,<br> the client knows that it is not NATed and the effective mapping will<br>
be Endpoint-Independent.<br><br> In test II, the client sends a Binding Request to the alternate<br> address, but primary port. If the XOR-MAPPED-ADDRESS in the Binding<br> Response is the same as test I the NAT currently has Endpoint-<br>
Independent Mapping. If not, test III is performed: the client sends<br> a Binding Request to the alternate address and port. If the XOR-<br> MAPPED-ADDRESS matches test II, the NAT currently has Address-<br> Dependent Mapping; if it doesn't match it currently has Address and<br>
Port-Dependent Mapping.<br><br><br></p></div>