iceConnectionState goes from checking to failed after few seconds (across networks connection)

216 views
Skip to first unread message

Ashika M

unread,
Feb 19, 2023, 6:43:12 PM2/19/23
to discuss-webrtc
Hi folks,

I'm new to webRTC and would appreciate your help or suggestions on the below issue.
I am working on an existing repository which uses webRTC to establish video calls, with a python backend and ReactJS frontend. It works perfectly when I run it on two windows/two browsers/two devices on the local network. 

It fails to connect the ice candidates when on different networks. The iceconnectionstate changes directly from checking to disconnected. I am not using a TURN server currently. I was told that this setup, was previously working on different networks even without a TURN server.

So my question is what could the possible issue here be and how to solve it without a TURN server? 

I have attached the logs I see on Chrome.
ChromeIceError.png

fantadrinker 123

unread,
Aug 17, 2023, 10:31:27 AM8/17/23
to discuss-webrtc
To my knowledge, TURN server is required in your case because:
1. WebRTC requires the two peers (2 applications running on 2 devices) to know each other's IP address. 2 tabs on local works because they can discover they're both on the same machine (internal IP within your router) with STUN protocol.
2. Your two devices are on different networks, which means 99% chance both of them is behind a symmetric NAT (https://doc-kurento.readthedocs.io/en/latest/knowledge/nat.html#symmetric-nat).
3. With symmetric NAT, it's generally impossible to know which port to contact even with STUN server. So you need a TURN server in a public IP address to act as a relay node to make WebRTC work.

I am also learning on this topic so some of the explanation might be wrong. I hope someone with more knowledge can soon help provide more insights.
Reply all
Reply to author
Forward
0 new messages