← Back to team overview

p2psp team mailing list archive

NAT Traversal Set of rules implementation

 

Hi everyone,
now I tested UDP hole punching with different combinations of NAT types
(using iptables commands from [0] and chownat [1]), and got the
following results:

    FCN 	Full-cone NAT
    RCN 	restricted-cone NAT
    PRCN 	port restricted-cone NAT
    SYM 	symmetric NAT


    Client \ server 	*FCN* 	*RCN* 	*PRCN* 	*SYM*
    *FCN* 	yes 	yes 	no 	no
    *RCN* 	yes 	yes 	no 	no
    *PRCN* 	yes 	yes 	no 	no
    *SYM* 	(no) 	(no) 	no 	no


The "(no)" shows that the server receives the client's attempt to
connect and tries to respond, but no connection can be established.
These cases maybe can work with another hole punching approach though.
The results should not be considered 100% valid, as I found
(essentially) different iptables configurations for each NAT type.

The next step I would like to do is to implement the NAT Traversal Set
of rules in Python via UDP hole punching (with the splitter as a "STUN
server"), using UDP for data transmission.
Then the only case where a connection does not work should with peers
both behind symmetric NATs. In this case, another (or the same) Set of
rules can use new port prediction methods ([2], [3]) to obtain the
public endpoint and use the NTS to establish a connection.
Some open questions:

  * Is there already some kind of case differentiation implemented,
    where the peers determine the type of NAT they are behind (using the
    splitter), and automatically choose the Set of rules they need?
  * When using UDP to transmit data, where should lost
    packages/datagrams be recovered? When using software like udptunnel,
    the P2PSP classes could expect a reliable stream; but as stated in
    the Lost chunks Recovery Set (LRS) of rules, P2PSP uses UDP for
    communication, so if LRS is used, no extra package recovery is
    necessary?
  * Is there a PDF version of the P2PSP whitepaper (protocol
    descriptions)? The HTML documentation is good, but the formatting
    and some unicode characters make it hard to read.

Thanks,
Max

[0] https://wiki.asterisk.org/wiki/display/TOP/NAT+Traversal+Testing
[1] http://samy.pl/chownat/
[2] https://www.goto.info.waseda.ac.jp/~wei/file/wei-apan-v10.pdf
[3] http://journals.sfu.ca/apan/index.php/apan/article/download/75/pdf_31

Follow ups