Webrtc stream traffic trough janus server even if set custom STUN, TURN

761 views
Skip to first unread message

Egor Mikheev

unread,
Jul 18, 2017, 9:53:47 AM7/18/17
to meetecho-janus
Thanks for great job!

May be i don't understend  "Janus" engine, but why if i set custom STUN / TURN servers on a client- or server- sides all traffic goes throug janus server?

example:

client side:

janus = new Janus(
 
{ server: server,
                                  iceServers
: [ {urls: "stun:stun.l.google.com:19302"}]


server side: janus.conf

[nat]
stun_server
= stun.l.google.com
stun_port
= 19302
nice_debug
= true
;ice_lite = true
;ice_tcp = true



If i use two webrtc connections in videoroomtest.html example, that shows

@treminal -nload

incoming traffic  Curr: 370.66 kBit/s
outgoing traffic  
Curr: 397.70 kBit/s


@termnal tail -f /var/logs/janus.log

...
[Tue Jul 18 16:51:35 2017]    Parsing compound packet (total of 56 bytes)
[Tue Jul 18 16:51:35 2017]      #1 RR (201)
[Tue Jul 18 16:51:35 2017] jitter=601.000000, fraction=0, loss=787
[Tue Jul 18 16:51:35 2017]        RTCP PT 201, length: 32 bytes
[Tue Jul 18 16:51:35 2017]      #2 REMB -- PSFB (206)
[Tue Jul 18 16:51:35 2017]        -- -- -- REMB: 213940 * 2^0 = 213940 (1 SSRCs, 3049380507)
[Tue Jul 18 16:51:35 2017]        RTCP PT 206, length: 24 bytes
[Tue Jul 18 16:51:35 2017]   End of compound packet
[Tue Jul 18 16:51:35 2017] Got REMB bitrate 213940
[Tue Jul 18 16:51:35 2017] [8135059763530996]  Got an RTCP packet (bundled stream)!
[Tue Jul 18 16:51:35 2017] [8135059763530996] Incoming RTCP, bundling: this is video (remote SSRC: video=77092922, audio=22505644, got 77092922)
...


Mirko Brankovic

unread,
Jul 18, 2017, 10:29:20 AM7/18/17
to meetecho-janus
Janus is a SFU, selective forwarding unit, so that means you only upload stream once and it will distribute stream to all interested parties/clients.

At least for Videoroom plugin, audiobridge is different. In case you want Peer2Peer then you need a Signaling server only not SFU.

--
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.



--
Regards,
Mirko

Lorenzo Miniero

unread,
Jul 18, 2017, 10:33:59 AM7/18/17
to meetecho-janus
Il giorno martedì 18 luglio 2017 15:53:47 UTC+2, Egor Mikheev ha scritto:
Thanks for great job!

May be i don't understend  "Janus" engine, but why if i set custom STUN / TURN servers on a client- or server- sides all traffic goes throug janus server?



I think you have ideas a bit confused on the different roles here. Janus and STUN/TURN servers play a very different role in the WebRTC ecosystem. STUN/TURN are only needed to allow you to traverse NATs and firewalls: Janus is a WebRTC server, and so its purpose is terminating WebRTC PeerConnections to allow you to manipulate/route media depending on the plugin and application logic. if users can't create PeerConnections with Janus directly, they'll need support from a STUN and/or TURN server.

As explained in the configuration (I encourage you to go through the comments in there) you most likely will not need to configure a STUN or TURN server for Janus itself, but only for users, as Janus is very likely publicly reachable and not behind a NAT (which means your example is broken).

If this is still confusing, please look for some tutorials on WebRTC in general, e.g., on webrtchacks.com which contains several introductions to distinctions like this.
Lorenzo 
Reply all
Reply to author
Forward
0 new messages