

Hey people my name is Eliomar.I am new on webrtc and I am trying to develop a simple webRTC tool that could work over the internet.I am trying to launch my server on internet with just STUN server (can I do that, right? or the TURN server is mandatory? even if I do not need for most of connections?).
I am running two peers on internet and trying to establish a webRTC between each other using my signaling server, which only has STUN information and not TURN information.The problem is the following:SOMETIMES IT GETS CONNECTED, AND SOMETIMES NOT (most part of the time it does not get connected).So by the times that it gets connected I assume that the TURN server is not necessary. But I would like to understand why that is happening. I'll explain better the situation:
In my application, both peers provide host (many candidates) and srflx candidates, for example:candidate:953528780 1 tcp 1518280447 10.81.41.1 9 typ host tcptype active generation 0 network-id 1 network-cost 900candidate:1985367356 1 udp 2122260223 10.81.41.1 49058 typ host generation 0 network-id 1 network-cost 900candidate:2507656144 1 udp 1686052607 147.241.212.105 8546 typ srflx raddr 10.81.41.1 rport 49058 generation 0 network-id 1 network-cost 900but I read in this link https://rollout.io/blog/webrtc-issues-and-how-to-debug-them/"When both parties provide a srflx packet, it means both parties should be connectable via a STUN-only setup but does not mean both parties can connect to each other with such.It is likely that they can, however."
Can someone tell me, when that's not possible?
What may be happening? I also checked some data from failed session (no connection) and a successful session.THE CANDIDATES WHERE EXACTLY THE SAME
does that make any sense?I also checked the webrtc-internals page and for the failed session I got the following outputs for iceConnectionStateChange and connectionStateChange :And the successful session:
Another difference between a failed session and a successful session was the currentLocalDescription property of one of the peers. I was checking and in a failed session the currentLocalDescription had no candidates. While the successful session had host and srflx candidates.e.g.:↵a=candidate:953528780 1 tcp 1518280447 10.81.41.1 9 typ host tcptype active generation 0 network-id 1 network-cost 900↵a=candidate:1985367356 1 udp 2122260223 10.81.41.1 49058 typ host generation 0 network-id 1 network-cost 900↵a=candidate:2507656144 1 udp 1686052607 179.241.212.105 8546 typ srflx raddr 10.81.41.1 rport 49058 generation 0 network-id 1 network-cost 900the localDescription property should have also the local candidates that I sent to the otehr peer? If so, it is not automatic?
Maybe my signaling process is wrong? what should be happening in order to get a reliable STUN srflx connection?
I appreciate all the possible help. Please you can also refer me to other documents that you think could contain the answer.
Thanks in advance to everyone.
Regards.Eliomar.--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/bd5eac43-13e3-445f-aa1f-8a648cf86761n%40googlegroups.com.
It is not mandated. However, things just don't work when not using one which is the actual reason people lots of people spend a lot of money on running them.
but I read in this link https://rollout.io/blog/webrtc-issues-and-how-to-debug-them/"When both parties provide a srflx packet, it means both parties should be connectable via a STUN-only setup but does not mean both parties can connect to each other with such.It is likely that they can, however."*Likely*, not guaranteed.
Can someone tell me, when that's not possible?Symmetric NAT, the usual hole punching techniques simply don't work there.
What may be happening? I also checked some data from failed session (no connection) and a successful session.THE CANDIDATES WHERE EXACTLY THE SAMEexactly the same is unlikely since the ports are randomly bound, no?
Is this between the *same* pair of machines and the same infrastructure, in particular the nat routers in between?If it is inconsistent between the same pair of machine that might indicate a bug in your signalling as it should be fairly deterministic.There are bugs like https://bugs.chromium.org/p/webrtc/issues/detail?id=5813& but their impact is hard to quantify beyond "fairly low probability".
In general pc.localDescription should contain all candidates that have been signalled via onicecandidate. If you see a difference between .localDescription and .currentLocalDescription file a bug.
Maybe my signaling process is wrong? what should be happening in order to get a reliable STUN srflx connection?The general consensus is that this isn't possible without a TURN server and paying the cost for it.
I appreciate all the possible help. Please you can also refer me to other documents that you think could contain the answer.https://webrtchacks.com/an-intro-to-webrtcs-natfirewall-problem/ might be helpful. It has aged quite well.https://doc-kurento.readthedocs.io/en/6.14.0/knowledge/nat.html is quite ok too.
Thanks in advance to everyone.sorry if this turned into a bit of a rant :-)
--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/005d3ecc-483a-480f-a3b3-03ae3b645b94n%40googlegroups.com.
AddIceCandidate returns a promise.You should always check whether that promise is rejected or not (such as by writing "await AddIceCandidate()".We see that in the wild, a certain percentage (less than 1%) of candidates are rejected because local or remote SDP are not set; it is likely that this happens because the app writers haven't made sufficiently sure that the ICE candidate is only added after local and remote SDP are set.
> To unsubscribe from this group and stop receiving emails from it, send an email to discuss...@googlegroups.com.
When you say mapping, did you mean port numbers for the srflx host? Yes, I get a different port and the same host IP, every time I ask the STUN server. I added two STUN servers, I get two different ports.
Things are a little more nuanced then this thread suggests. Sorry this
might not give you the answer you are looking for, but I think the info
is good long term.
I would avoid using the term 'Symmetric NAT'. There are a few different
attributes, and this doesn't do a great job of describing them. You can
read about them all in https://tools.ietf.org/html/rfc4787
The big things that matter is
* Mapping reuse behavior (Do you get a new mapping for every request?)
* Filtering (What remote hosts can use your mapping?)
* Refresh (How long does your mapping last)
When working with developers that use Pion I have heard of lots of weird
NAT behaviors as well.
* LTE Modem would change NAT Types depending on location?
* One ISP would only give you N NAT Mappings, and you would get a
more restrictive Mapping/Filtering if you created too many.
Here are some other things that might be worth checking out
* https://groups.google.com/forum/#!msg/discuss-webrtc/t7xfb8jHcsM/_YmTXMsMCAAJ
* https://github.com/pion/stun/tree/master/cmd/stun-nat-behaviour
I am also working on a Open Source book to try and make this stuff
easier to learn. https://webrtcforthecurious.com/docs/03-connecting/