--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Is there a way to put the Janus gateway behind a NAT without any port forwarding or other configuration on the firewall? There are a couple of topics in this forum that talk about NAT/ISP/firewall, but none of the posts offer a good clarification, other than reiterating that Janus is not recommended to be behind a NAT. This is confusing, because WebRTC/ICE is supposed to provide p2p connectivity across NAT (except in symmetric NATs - lets ignore that case for this topic)
Couple of things are confusing:- WebRTC needs a signalling mechanism to convey session information and start the ICE negotiation across the NAT. No samples or docs I have seen talk about how signalling can be used with Janus.- It appears to me that that the http/websockets ports must be port-forwarded across the NAT. This defeats the purpose of using ICE/STUN/TURN negotiation (yes, ICE is also used for media negotiation, but lets put that aside for the sake of this topic)
Il giorno sabato 9 settembre 2017 22:13:32 UTC+2, V Venkatesh ha scritto:Is there a way to put the Janus gateway behind a NAT without any port forwarding or other configuration on the firewall? There are a couple of topics in this forum that talk about NAT/ISP/firewall, but none of the posts offer a good clarification, other than reiterating that Janus is not recommended to be behind a NAT. This is confusing, because WebRTC/ICE is supposed to provide p2p connectivity across NAT (except in symmetric NATs - lets ignore that case for this topic)Of course it works. A server behind a NAT is always suboptimal, though, as being on a public and reachable address makes it much easier to eventually succeed, especially in edge cases. If Janus is behind a NAT too, it will also have to take care of STUN etc., which if you can avoid it's better.
Signalling has nothing to do with WebRTC, it's explicitly out of scope. It definitely has nothing to do with ICE/STUN/TURN at all, as that only applies to the media you negotiate.Making signalling work behind a NAT, via proxying, reverse something, wrapping of the API with something you build is up to you.
On Sunday, September 10, 2017 at 5:54:41 AM UTC-4, Lorenzo Miniero wrote:Il giorno sabato 9 settembre 2017 22:13:32 UTC+2, V Venkatesh ha scritto:Is there a way to put the Janus gateway behind a NAT without any port forwarding or other configuration on the firewall? There are a couple of topics in this forum that talk about NAT/ISP/firewall, but none of the posts offer a good clarification, other than reiterating that Janus is not recommended to be behind a NAT. This is confusing, because WebRTC/ICE is supposed to provide p2p connectivity across NAT (except in symmetric NATs - lets ignore that case for this topic)Of course it works. A server behind a NAT is always suboptimal, though, as being on a public and reachable address makes it much easier to eventually succeed, especially in edge cases. If Janus is behind a NAT too, it will also have to take care of STUN etc., which if you can avoid it's better.Please bear with me as this reply is a bit long. We are somewhat in agreement. Yes, agree with you about a publicly available address. However, respectfully disagree about the NAT comment - once the ICE negotiation has concluded and a p2p direct path is found, performance can be just as good as a publicly available service. Of course, as you suggest, there are edge cases where no pathway is found and a TURN server relay needs to be used, but lets put this edge case aside for the moment.
Signalling has nothing to do with WebRTC, it's explicitly out of scope. It definitely has nothing to do with ICE/STUN/TURN at all, as that only applies to the media you negotiate.Making signalling work behind a NAT, via proxying, reverse something, wrapping of the API with something you build is up to you.Again, respectfully disagree, WebRTC (i.e. ICE for all intents and purposes) needs signalling when NATs are involved, but leaves the signalling implementation up to the developer. WebRTC wraps around ICE, which uses STUN and TURN to find a pathway between two nodes.
My understanding - is that for ICE to find a p2p pathway between parties Alice and Bob, this is the workflow - :(a) Alice and Bob determine a set of "local candidates" using a publicly available STUN server. Simplified, a "candidate" is a combo of IP address and port.(b) Alice must send to Bob her candidates. To Bob, Alice's candidates are Bob's "remote candidates"(c) Bob does the same thing - send Alice his candidates (Alice's remote candidates)(e) ICE initiates negotiation once all candidates have been exchanged. ICE then determines at least one local and remote candidate pair that can be used to establish the p2p connection. If not, the TURN relay is a fallback.If both Alice and Bob are behind NATs whose firewall config cannot be touched, then the only way to do (b) and (c) above is to use an external publicly available relay - and not the TURN server - "signalling" in ICE. So a method to hook this external signalling channel is the missing tweak in Janus.Since Janus uses libnice, so I took a peek there and then at the Janus code:- First, this post seems to confirm that you need a 3rd party custom relay when NATs are involved. https://lists.freedesktop.org/archives/nice/2012-January/000495.html"libnice does not provide any serialization method, you will still always need athird party server to do the candidate exchange and that will depend on theprotocol used by this server, could be XMPP, could be SIP, could be custom, itreally all depends on what your needs are and what the server supports/accepts."- Second, libnice has a function to set remote candidates: https://nice.freedesktop.org/libnice/NiceAgent.html and http://docs.huihoo.com/libnice/libnice-talk-gcds2009.pdf(slide 25)// ... Send local candidates to the peer and set the peer's remote candidatesnice_agent_set_remote_candidates (agent, stream_id, 1, rcands);And it does appear that janus.c processes incoming messages and setting of remote candidates in janus_process_incoming_request() so maybe that's a good place to hook in signalling?I am wondering whether an api can be exposed (maybe a small header and lib) so that a developer can integrate signalling, and maybe a config option to let Janus know to use external signalling. Of course, the front end js will also have to be similarly have an exposed signalling api...but one thing at a time. Just throwing out ideas.Sorry for the long post, your thoughts are much appreciated!
That said, the transports mechanism is modular. This means you can implement your own transport plugin, and Janus will accept it. You're free to implement whatever transport you want there, if you'd like it to do some traversal by itself.
(some original posts material removed, getting too crowded)
On Monday, September 11, 2017 at 5:32:58 AM UTC-4, Lorenzo Miniero wrote:That said, the transports mechanism is modular. This means you can implement your own transport plugin, and Janus will accept it. You're free to implement whatever transport you want there, if you'd like it to do some traversal by itself.Interesting, ok, that's great and might work, where in the code would I start on that?
As you point out, Janus does not trickle (libnice limitation?), which could affect latency, which in turn makes the argument for a publicly available server stronger. Unfortunately, in my case, I am compelled to put Janus on a PI behind a NAT I don't control, so I'll have to explore being creative in turning it into an endpoint. :-) Maybe Janus can be front-ended by a custom bridge as you suggest. NAT<--ICE-->nginx-->Janus?