Can P2P be done without port forwarding?

2019-04-16 14:39发布

I was making a simple file transfer program through IRC and when I was reading up I saw that IRC when sharing a file creates a direct connection between the two users independent of the server (DCC, Direct Client Connect). After searching a while I have found this: Direct Connect and Advanced Direct Connect.

None of these pages answer this question that I can't get out of my head: Is P2P data transfer possible without any user doing a special port-forward? An intermediate server which helps set up the connection (as in the IRC examples) is allowed. The data transfer itself must be independent of the server.

2条回答
贼婆χ
2楼-- · 2019-04-16 15:20

Practical JXTA II (available for reading on Scribd) has a chapter explaining techniques to perform NAT traversal. Hole punching is a subset of techniques to perform NAT traversal.

查看更多
Rolldiameter
3楼-- · 2019-04-16 15:37

Yes - if you can get an external server to forward the connection request for you, there are so-called hole-punching techniques that can be used to set up a direct connection. This technical paper has a more detailed explanation.

Note that these do not necessarily work on all NATs - but they do work on quite a lot of them.

查看更多
登录 后发表回答