哪种类型的NAT组合需要TURN服务器? [英] What type of NAT combinations requires a TURN server?

查看:124
本文介绍了哪种类型的NAT组合需要TURN服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据:

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

有4种类型的NAT配置:

there are 4 types of NAT configurations:

全锥,地址受限,端口受限和对称.

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

现在,假设我们的客户端A和客户端B位于单独的网络中,并且被隐藏在各自独立的NAT之后.

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

如果要进行p2p通讯,客户端A NAT类型" +客户端B NAT类型"的哪些组合将要求TURN服务器参与(即STUN协议无法解决)?

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?

例如, 我会怀疑:

" 客户端A NAT =对称+客户端B NAT =对称 " 需要TURN服务器.

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

其余的组合是什么?

推荐答案

从对称到对称:TURN

Symmetric to Symmetric : TURN

对端口限制是对称的:TURN

Symmetric to Port Restricted : TURN

对地址的对称限制:STUN(但可能不可靠)

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

对称于圆锥:STUN

Symmetric to Cone: STUN

其他一切都可以通过STUN完成.

Everything else can be through STUN.

有一些已知的技术可以据此猜测对称NAT的端口分配算法(通常,对称NAT一直使用下一个递增的端口号).因此,如果您通过STUN知道NAT是对称的,并且通过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.

即使对于上面列为STUN的NAT配对,STUN也不是100%可靠,并且对TCP的可靠性不如对UDP的可靠性.云中的中继使您更接近100%遍历.

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.

这篇关于哪种类型的NAT组合需要TURN服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆