Alice身后是对称NAT,能否与强制使用Turn中继的Bob建立WebRTC连接?

huangapple go评论49阅读模式
英文:

Can Alice behind a symmetric NAT establish a webrtc connection with Bob who is forced to use Turn relay?

问题

假设Alice身后是对称NAT,而Bob身后是普通NAT(例如全锥形)。

Alice的iceServer列表只有一个stun,Bob的iceServer列表只有一个被强制配置为中继的turn。他们都能够访问这个turn。

Alice和Bob能够建立WebRTC连接吗?如果可以,选择了哪个候选对?

换句话说,是否拥有一个TURN服务器(两端都可以访问)能够保证建立WebRTC连接的能力,而不考虑网络架构?

英文:

Assuming Alice is behind a symmetric NAT and Bob is behind a normal NAT (e.g. Full cone).

Alice's iceServer list only has a stun, Bob's iceServer list only has a turn which is forced to be configured as relay. Both of them can reach the turn.

Can Alice and Bob establish a WebRTC connection? If can, what candidate pair choosed?

In other words, does having one TURN server (both ends can reach it) guarantee the ability to establish a WebRTC connection regardless of the network architecture?

答案1

得分: 1

.. 是否拥有一个TURN服务器能够保证在网络架构方面建立WebRTC连接的能力?

是的,只要双方都能够访问相同的TURN服务器。但是,Alice和Bob都需要与相同的TURN服务器通信,以获得在ICE协商期间匹配的中继候选项。当它们这样做时,TURN服务器将创建一个中继会话,在其中它将简单地接受来自一个客户端的RTP和RTCP数据包,并将其通过已经建立的连接发送到另一个客户端。

如果Alice使用的是STUN服务器,而不是与Bob相同的TURN服务器,它将无法正常工作。

英文:

> .. does having a TURN server guarantee the ability to establish a WebRTC connection regardless of the network architecture?

Yes it does as long as both parties can reach that same TURN server. But both Alice and Bob will need to talk to the same TURN server to get relay candidates that will match during the ICE negotiation. When they do, the TURN server will create a relay-session where it will simply accept RTP and RTCP packets from one client and send it to the other over the connections that are already established.

It won't work if Alice uses a STUN server, i.e., not the same TURN server as Bob.

huangapple
  • 本文由 发表于 2023年5月22日 13:36:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76303280.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定