TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Peer-to-Peer Communication Across Network Address Translators (2005)

119 pointsby alanfranzalmost 8 years ago

14 comments

jmartricanalmost 8 years ago
We been doing this at Vonage since 2001. This was our &quot;secrete sauce&quot;, since at the time there wasn&#x27;t a well documented or an industry standard on how to do this. Eventually SIP through NAT papers and RFC&#x27;s did appear, but we already had our way of doing it that was just as effective.<p>We found that renewing the NAT entry at a rate of once per 20 seconds was good enough. This made it work through all the routers and gateways we came across.<p>EDIT: SIP is short for Session Initiation Protocol. Its the protocol used to connect VOIP phone calls. We used UDP. SIP&#x27;s standard port is 5060 and 5061. We had to switch to port 10,000 (any port other than the standard) because too many high end routers and gateways would manipulate our packets. These routers were trying to implement SIP through NAT on their own. I applauded their efforts but it caused problems for us. I still remember the day that I took it upon myself to change production to use port 10,000. I was really scared I was going to break something but everything worked out in the end.
评论 #15037751 未加载
jamesblondealmost 8 years ago
Strange to see this relatively old article appear. NATs are still with us. The main progress has been WebRTC. Otherwise, researcher who looked at TCP at the time (e.g., stunt) for simiulataneous TCP Syn packets failed. It was too hard to synchronize timing. Most middleware still ignores NATs and hopes it will go away (it won&#x27;t). NATs are the reason REST won over CORBA et al.
评论 #15037602 未加载
评论 #15037350 未加载
评论 #15037344 未加载
albertzeyeralmost 8 years ago
I wonder why this comes up here. This is a quite old method. I think it is used in many peer-to-peer applications. I&#x27;m quite sure that Skype has used it also in the past.<p>We have also implemented that in our game OpenLieroX. We call it UDP NAT traversal if you search for it in the code.<p>Main code: <a href="https:&#x2F;&#x2F;github.com&#x2F;albertz&#x2F;openlierox&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;albertz&#x2F;openlierox&#x2F;</a><p>UDP master server: <a href="https:&#x2F;&#x2F;github.com&#x2F;albertz&#x2F;openlierox&#x2F;tree&#x2F;0.59&#x2F;tools&#x2F;UDPMasterServer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;albertz&#x2F;openlierox&#x2F;tree&#x2F;0.59&#x2F;tools&#x2F;UDPMas...</a>
评论 #15037380 未加载
评论 #15038810 未加载
kttaalmost 8 years ago
Adam Ierymenko (@api here and reddit) has a modern and concise take on NAT<p><a href="https:&#x2F;&#x2F;www.zerotier.com&#x2F;blog&#x2F;state-of-nat-traversal.shtml" rel="nofollow">https:&#x2F;&#x2F;www.zerotier.com&#x2F;blog&#x2F;state-of-nat-traversal.shtml</a>
评论 #15038468 未加载
评论 #15042636 未加载
j_salmost 8 years ago
Autonomous NAT Traversal (2010) aka pwnat<p><a href="https:&#x2F;&#x2F;samy.pl&#x2F;pwnat&#x2F;" rel="nofollow">https:&#x2F;&#x2F;samy.pl&#x2F;pwnat&#x2F;</a><p><a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=pwnat&amp;type=comment&amp;sort=byDate" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=pwnat&amp;type=comment&amp;sort=byDate</a>
评论 #15037918 未加载
selvaknalmost 8 years ago
Plug: <a href="https:&#x2F;&#x2F;github.com&#x2F;selvakn&#x2F;p2p-port-forward" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;selvakn&#x2F;p2p-port-forward</a> Based on <a href="https:&#x2F;&#x2F;www.zerotier.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.zerotier.com&#x2F;</a>
apankratalmost 8 years ago
Keep in mind that this paper was outdated the moment it was published and announced on p2p-hackers mailing list [1].<p>It doesn&#x27;t deal with the &quot;long tail&quot; of NAT devices that increment&#x2F;decrement ports in (somewhat) predictable manner and _most importantly_ it describes hole punching as a <i>client</i>-driven process.<p>The latter is the crucial point. By tasking a dedicated (mediating) server with coordinating the punching sequence it becomes possible to time the process much more precisely and to help predictions to actually match the reality. Combined with a bit smarter port predication it brings the success rate from 80% to 95-97%... or at least it did 10 years ago when I was using this for Hamachi P2P VPN, though I suspect that very little has changed in terms of NAT type distribution since then.<p>[1] <a href="http:&#x2F;&#x2F;copilotco.com&#x2F;mail-archives&#x2F;p2p-hackers.2005&#x2F;msg00126.html" rel="nofollow">http:&#x2F;&#x2F;copilotco.com&#x2F;mail-archives&#x2F;p2p-hackers.2005&#x2F;msg00126...</a>
kevindqcalmost 8 years ago
I didn&#x27;t read the whole thing so maybe it&#x27;s addressed, but from what I understand it sends packets to both private and public IPs of the person you want to talk to, and use the first one you get an answer from.<p>What if the private IP from the other peer is in another NAT, but in your local NAT, you have another peer with that same private IP? He would answer you, and would would establish communication with the wrong peer?<p>Probably would need an extra step to validate the peer&#x27;s public IP address is also the same?
评论 #15042095 未加载
cagenutalmost 8 years ago
If I could piggyback on the topic here, can anyone speak to the practical usage of these (or other) techniques on mobile devices? Are there working peer-to-peer apps?
abvdaskeralmost 8 years ago
This is a wonderfully succinct description of the topic and probably the most approachable explanation I have read. Really interesting that this was written in 2005 since the concepts described form the basis of how the later WebRTC and its supporting infrastructure STUN&#x2F;TURN work.<p>As brilliant a hack as hole punching is I hope someday we can move to a world of IPv6 where it is no longer necessary.
xj9almost 8 years ago
overlay network are a good solution to NAT i think, i&#x27;d say they should be anonymous but something that&#x27;s just private like cjdns is pretty good too. there are some performance and latency issues to deal with, but when you overlay you don&#x27;t have to wait for network operators to fix NAT.
ctb_almost 8 years ago
IPv6
评论 #15037624 未加载
samstavealmost 8 years ago
This is the method Vizio TVs use to register with the Inscape mothership to report to the system what is being watched on every Vizio TV in existence.
评论 #15038048 未加载
Ivalmost 8 years ago
tl;dr: UDP Hole Punching using a server.