Can P2P be done without port forwarding?

怎甘沉沦 提交于 2019-12-06 14:42:20

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/4692367/can-p2p-be-done-without-port-forwarding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!