What type of NAT combinations requires a TURN server?

☆樱花仙子☆ 提交于 2019-12-11 02:19:52

问题


According to:

https://en.wikipedia.org/wiki/Network_address_translation

there are 4 types of NAT configurations:

Full-cone, Address restricted, Port restricted, and Symmetric.

Now, suppose we have client A and client B on separate networks and are hidden behind their own separate NATs.

What combinations of "client A NAT type" + "client B NAT type" would require a TURN server to be involved (i.e. not solvable by the STUN protocol) if they want to p2p communicate?

For example, I would suspect:

" client A NAT = Symmetric + client B NAT = Symmetric " would require a TURN server.

What are the rest of the combinations?


回答1:


Symmetric to Symmetric : TURN

Symmetric to Port Restricted : TURN

Symmetric to Address Restricted: STUN (but probably not reliable)

Symmetric to Cone: STUN

Everything else can be through STUN.

There are known techniques whereby the port allocation algorithm can be guessed for a Symmetric NAT (typically a symmetric NAT just keeps using the next incremental port number). Thus, if you know through STUN that the NAT is symmetric and observe through STUN tests that the port mapping for two different addresses is only off by one, then the next port allocation can be guessed and used as an address candidate.

Even for the NAT pairings listed as STUN above, STUN isn't 100% reliable and is less reliable for TCP than it is for UDP. Relays in the cloud get you closer to 100% traversal.



来源:https://stackoverflow.com/questions/31424904/what-type-of-nat-combinations-requires-a-turn-server

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