SlideShare a Scribd company logo
1 of 90
Download to read offline
Scaling server-side WebRTC applications:
the Janus challenge
Lorenzo Miniero
@elminiero
CommCon 2018
June 27th 2018, Wotton House, Surrey (UK)
Sorry Dan, pineapples on pizza = BIG NO
A picture of me as a kid for no reason
Lorenzo Miniero
• Ph.D @ UniNA
• Chairman @ Meetecho
• Open source believer
Contacts and info
• lorenzo@meetecho.com
• https://twitter.com/elminiero
• https://www.slideshare.net/LorenzoMiniero
1. No, I don’t know what happened...
2. Yes, Police is still looking for who stole my cheeks
Ok, let’s stop clowning around...
Lorenzo Miniero
• Ph.D @ UniNA
• Chairman @ Meetecho
• Open source believer
Contacts and info
• lorenzo@meetecho.com
• https://twitter.com/elminiero
• https://www.slideshare.net/LorenzoMiniero
What is Janus?
Janus
General purpose, open source WebRTC server
• https://github.com/meetecho/janus-gateway
• Demos and documentation: https://janus.conf.meetecho.com
• Community: https://groups.google.com/forum/#!forum/meetecho-janus
Modular architecture
• The core only implements the WebRTC stack
• JSEP/SDP, ICE, DTLS-SRTP, Data Channels, ...
• Plugins expose Janus API over different “transports”
• Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg
• “Application” logic implemented in plugins too
• Users attach to plugins via the Janus core
• The core handles the WebRTC stuff
• Plugins route/manipulate the media/data
• Plugins can be combined on client side as “bricks”
• Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
Modular architecture
• The core only implements the WebRTC stack
• JSEP/SDP, ICE, DTLS-SRTP, Data Channels, ...
• Plugins expose Janus API over different “transports”
• Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg
• “Application” logic implemented in plugins too
• Users attach to plugins via the Janus core
• The core handles the WebRTC stuff
• Plugins route/manipulate the media/data
• Plugins can be combined on client side as “bricks”
• Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
Modular architecture
• The core only implements the WebRTC stack
• JSEP/SDP, ICE, DTLS-SRTP, Data Channels, ...
• Plugins expose Janus API over different “transports”
• Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg
• “Application” logic implemented in plugins too
• Users attach to plugins via the Janus core
• The core handles the WebRTC stuff
• Plugins route/manipulate the media/data
• Plugins can be combined on client side as “bricks”
• Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
Modular architecture
• The core only implements the WebRTC stack
• JSEP/SDP, ICE, DTLS-SRTP, Data Channels, ...
• Plugins expose Janus API over different “transports”
• Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg
• “Application” logic implemented in plugins too
• Users attach to plugins via the Janus core
• The core handles the WebRTC stuff
• Plugins route/manipulate the media/data
• Plugins can be combined on client side as “bricks”
• Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
Extensible Architecture and API
Extensible Architecture and API
A quick look at plugins: SIP gateway
A quick look at plugins: RTP rebroadcaster
A quick look at plugins: Audio MCU
A quick look at plugins: Video SFU
The first step towards scaling: benchmarking
• Measuring Janus performance is not trivial...
• Different plugins have different behaviours
• Different technologies have different impact
• Need to focus on individual features
• SIP Gateway (SIP plugin)
• Multimedia streaming (Streaming plugin)
• Audio mixing (AudioBridge plugin)
• Video routing (VideoRoom plugin)
• ...
What about the results?1
• When just relaying, bandwidth is typically the real bottleneck
• Linear vs. exponential resource increase depends on plugin and topologies
1
https://janus.conf.meetecho.com/citeus
The first step towards scaling: benchmarking
• Measuring Janus performance is not trivial...
• Different plugins have different behaviours
• Different technologies have different impact
• Need to focus on individual features
• SIP Gateway (SIP plugin)
• Multimedia streaming (Streaming plugin)
• Audio mixing (AudioBridge plugin)
• Video routing (VideoRoom plugin)
• ...
What about the results?1
• When just relaying, bandwidth is typically the real bottleneck
• Linear vs. exponential resource increase depends on plugin and topologies
1
https://janus.conf.meetecho.com/citeus
The first step towards scaling: benchmarking
• Measuring Janus performance is not trivial...
• Different plugins have different behaviours
• Different technologies have different impact
• Need to focus on individual features
• SIP Gateway (SIP plugin)
• Multimedia streaming (Streaming plugin)
• Audio mixing (AudioBridge plugin)
• Video routing (VideoRoom plugin)
• ...
What about the results?1
• When just relaying, bandwidth is typically the real bottleneck
• Linear vs. exponential resource increase depends on plugin and topologies
1
https://janus.conf.meetecho.com/citeus
Beyond a single Janus instance: different strategies
• Once performance is evaluated, other aspects come into play
• Does a user stream need to stay within the plugin?
• Can it be sent to/received from somewhere else?
• Will this affect other connections?
• How much is the context important?
• What level of orchestration is needed?
• All those questions can lead to different answers/solutions, e.g.
1 Plain load balancing
2 Media resource brokering (MRB)
3 Sharing the “burden”
4 Cascaded delivery
5 ...
Beyond a single Janus instance: different strategies
• Once performance is evaluated, other aspects come into play
• Does a user stream need to stay within the plugin?
• Can it be sent to/received from somewhere else?
• Will this affect other connections?
• How much is the context important?
• What level of orchestration is needed?
• All those questions can lead to different answers/solutions, e.g.
1 Plain load balancing
2 Media resource brokering (MRB)
3 Sharing the “burden”
4 Cascaded delivery
5 ...
Plain load balancing
• The simplest strategy of them all
• You have N Janus instances available
• You allocate users on one according to some logic
• No orchestration needed, just knowledge of Janus addresses
• User has list vs. HAProxy vs. nginx vs. ...
• Logic can differ depending on the application
• Pick a random server?
• Use round robin?
• Pick the one closest to the user?
• Pick the least loaded?
• Something else and/or any combination of the above?
Plain load balancing
• The simplest strategy of them all
• You have N Janus instances available
• You allocate users on one according to some logic
• No orchestration needed, just knowledge of Janus addresses
• User has list vs. HAProxy vs. nginx vs. ...
• Logic can differ depending on the application
• Pick a random server?
• Use round robin?
• Pick the one closest to the user?
• Pick the least loaded?
• Something else and/or any combination of the above?
Plain load balancing
• The simplest strategy of them all
• You have N Janus instances available
• You allocate users on one according to some logic
• No orchestration needed, just knowledge of Janus addresses
• User has list vs. HAProxy vs. nginx vs. ...
• Logic can differ depending on the application
• Pick a random server?
• Use round robin?
• Pick the one closest to the user?
• Pick the least loaded?
• Something else and/or any combination of the above?
Plain load balancing examples
Plain load balancing examples
Plain load balancing examples
Plain load balancing limitations
• The only safe option is the SIP plugin
• All streams are independent of each other
• Even those that are related, are related via the SIP infrastructure
• It might work with the Streaming plugin...
• ... as long as you make sure the same mountpoints exist on all servers...
• ... and they’re all fed with the same data!
• With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple
• Users meant for the same room may end up on different servers
• ... unless the balancing component is aware of the context (“room”)
• What about hosting the same room on different servers?
• May work, but is also messy
• Different contexts, multiple signalling channels, events overhead
Plain load balancing limitations
• The only safe option is the SIP plugin
• All streams are independent of each other
• Even those that are related, are related via the SIP infrastructure
• It might work with the Streaming plugin...
• ... as long as you make sure the same mountpoints exist on all servers...
• ... and they’re all fed with the same data!
• With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple
• Users meant for the same room may end up on different servers
• ... unless the balancing component is aware of the context (“room”)
• What about hosting the same room on different servers?
• May work, but is also messy
• Different contexts, multiple signalling channels, events overhead
Plain load balancing limitations
• The only safe option is the SIP plugin
• All streams are independent of each other
• Even those that are related, are related via the SIP infrastructure
• It might work with the Streaming plugin...
• ... as long as you make sure the same mountpoints exist on all servers...
• ... and they’re all fed with the same data!
• With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple
• Users meant for the same room may end up on different servers
• ... unless the balancing component is aware of the context (“room”)
• What about hosting the same room on different servers?
• May work, but is also messy
• Different contexts, multiple signalling channels, events overhead
Plain load balancing limitations
• The only safe option is the SIP plugin
• All streams are independent of each other
• Even those that are related, are related via the SIP infrastructure
• It might work with the Streaming plugin...
• ... as long as you make sure the same mountpoints exist on all servers...
• ... and they’re all fed with the same data!
• With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple
• Users meant for the same room may end up on different servers
• ... unless the balancing component is aware of the context (“room”)
• What about hosting the same room on different servers?
• May work, but is also messy
• Different contexts, multiple signalling channels, events overhead
Plain load balancing limitations
• The only safe option is the SIP plugin
• All streams are independent of each other
• Even those that are related, are related via the SIP infrastructure
• It might work with the Streaming plugin...
• ... as long as you make sure the same mountpoints exist on all servers...
• ... and they’re all fed with the same data!
• With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple
• Users meant for the same room may end up on different servers
• ... unless the balancing component is aware of the context (“room”)
• What about hosting the same room on different servers?
• May work, but is also messy
• Different contexts, multiple signalling channels, events overhead
Media resource brokering
• A step above Plain load balancing
• You have N Janus instances available
• You allocate users based on logic AND context
• Orchestration needed, here
• You need to know which Janus instances are available...
• ... and which one is doing what
• Logic will differ depending on the context
• Before allocating users, you allocate the context itself (e.g., a conference room)
• Users are then sent wherever their context belongs to
• Unlike Plain load balancing, can be used for everything
• You just need to implement context awareness somehow, and track resources
Media resource brokering
• A step above Plain load balancing
• You have N Janus instances available
• You allocate users based on logic AND context
• Orchestration needed, here
• You need to know which Janus instances are available...
• ... and which one is doing what
• Logic will differ depending on the context
• Before allocating users, you allocate the context itself (e.g., a conference room)
• Users are then sent wherever their context belongs to
• Unlike Plain load balancing, can be used for everything
• You just need to implement context awareness somehow, and track resources
Media resource brokering
• A step above Plain load balancing
• You have N Janus instances available
• You allocate users based on logic AND context
• Orchestration needed, here
• You need to know which Janus instances are available...
• ... and which one is doing what
• Logic will differ depending on the context
• Before allocating users, you allocate the context itself (e.g., a conference room)
• Users are then sent wherever their context belongs to
• Unlike Plain load balancing, can be used for everything
• You just need to implement context awareness somehow, and track resources
Media resource brokering
• A step above Plain load balancing
• You have N Janus instances available
• You allocate users based on logic AND context
• Orchestration needed, here
• You need to know which Janus instances are available...
• ... and which one is doing what
• Logic will differ depending on the context
• Before allocating users, you allocate the context itself (e.g., a conference room)
• Users are then sent wherever their context belongs to
• Unlike Plain load balancing, can be used for everything
• You just need to implement context awareness somehow, and track resources
Media resource brokering use case
• Will work nicely with all plugins, if you manage the context
• Context may give more info to SIP balancing logic
• Conference rooms and Streaming mountpoints can be associated to instances
• Broadcasting with Streaming plugin...
• ... if MRB knows Janus X hosts mountpoint Y, it can send users there
• Conference rooms with AudioBridge and/or VideoRoom...
• New rooms can be “deployed” on a specific instance
• Attempts to join room Y can be sent to Janus instance responsible for it
• Won’t help much when the same resource needs to be scaled, though
• e.g., many small rooms vs. one very large room
• For that, some different approach is needed
Media resource brokering use case
• Will work nicely with all plugins, if you manage the context
• Context may give more info to SIP balancing logic
• Conference rooms and Streaming mountpoints can be associated to instances
• Broadcasting with Streaming plugin...
• ... if MRB knows Janus X hosts mountpoint Y, it can send users there
• Conference rooms with AudioBridge and/or VideoRoom...
• New rooms can be “deployed” on a specific instance
• Attempts to join room Y can be sent to Janus instance responsible for it
• Won’t help much when the same resource needs to be scaled, though
• e.g., many small rooms vs. one very large room
• For that, some different approach is needed
Media resource brokering use case
• Will work nicely with all plugins, if you manage the context
• Context may give more info to SIP balancing logic
• Conference rooms and Streaming mountpoints can be associated to instances
• Broadcasting with Streaming plugin...
• ... if MRB knows Janus X hosts mountpoint Y, it can send users there
• Conference rooms with AudioBridge and/or VideoRoom...
• New rooms can be “deployed” on a specific instance
• Attempts to join room Y can be sent to Janus instance responsible for it
• Won’t help much when the same resource needs to be scaled, though
• e.g., many small rooms vs. one very large room
• For that, some different approach is needed
Media resource brokering use case
• Will work nicely with all plugins, if you manage the context
• Context may give more info to SIP balancing logic
• Conference rooms and Streaming mountpoints can be associated to instances
• Broadcasting with Streaming plugin...
• ... if MRB knows Janus X hosts mountpoint Y, it can send users there
• Conference rooms with AudioBridge and/or VideoRoom...
• New rooms can be “deployed” on a specific instance
• Attempts to join room Y can be sent to Janus instance responsible for it
• Won’t help much when the same resource needs to be scaled, though
• e.g., many small rooms vs. one very large room
• For that, some different approach is needed
Media resource brokering examples
Media resource brokering examples
Media resource brokering examples
Media resource brokering examples
Sharing the “burden”
• A bit different from Brokering described before
• You have N Janus instances available
• You use one or more of them to serve the same context
• Again, orchestration needed here too
• You need to know which Janus instances are available...
• ... and which one is serving which “subset” of the resource
• Logic will differ depending on the resource
• You identify how you can “split” the resource (unrelated parts)
• Users are then sent where the resource “subset” is allocated
• Less flexible than Balancing and Brokering, and more specific
• Can greatly help optimize delivery scenarios, though, depending on the context
Sharing the “burden”
• A bit different from Brokering described before
• You have N Janus instances available
• You use one or more of them to serve the same context
• Again, orchestration needed here too
• You need to know which Janus instances are available...
• ... and which one is serving which “subset” of the resource
• Logic will differ depending on the resource
• You identify how you can “split” the resource (unrelated parts)
• Users are then sent where the resource “subset” is allocated
• Less flexible than Balancing and Brokering, and more specific
• Can greatly help optimize delivery scenarios, though, depending on the context
Sharing the “burden”
• A bit different from Brokering described before
• You have N Janus instances available
• You use one or more of them to serve the same context
• Again, orchestration needed here too
• You need to know which Janus instances are available...
• ... and which one is serving which “subset” of the resource
• Logic will differ depending on the resource
• You identify how you can “split” the resource (unrelated parts)
• Users are then sent where the resource “subset” is allocated
• Less flexible than Balancing and Brokering, and more specific
• Can greatly help optimize delivery scenarios, though, depending on the context
Sharing the “burden”
• A bit different from Brokering described before
• You have N Janus instances available
• You use one or more of them to serve the same context
• Again, orchestration needed here too
• You need to know which Janus instances are available...
• ... and which one is serving which “subset” of the resource
• Logic will differ depending on the resource
• You identify how you can “split” the resource (unrelated parts)
• Users are then sent where the resource “subset” is allocated
• Less flexible than Balancing and Brokering, and more specific
• Can greatly help optimize delivery scenarios, though, depending on the context
Sharing the “burden” use case
• A typical use case is larger conferences
• Many active participants, with many viewers
• The first step is identifying the resources, and how they’re related
• Publishers will send media: they don’t “depend” on each other
• Subscribers only receive media: they depend on a specific publisher
• Publishers can be the “subset”, here
• A large conference room becomes N 1-to-many smaller broadcasts
• Each publisher→subscribers distribution is allocated separately
• Controlling application makes sure that viewer picks streams from the right place
• Bob from Janus1, Alice from Janus2, Tom from Janus3, Jim from Janus2, ...
Sharing the “burden” use case
• A typical use case is larger conferences
• Many active participants, with many viewers
• The first step is identifying the resources, and how they’re related
• Publishers will send media: they don’t “depend” on each other
• Subscribers only receive media: they depend on a specific publisher
• Publishers can be the “subset”, here
• A large conference room becomes N 1-to-many smaller broadcasts
• Each publisher→subscribers distribution is allocated separately
• Controlling application makes sure that viewer picks streams from the right place
• Bob from Janus1, Alice from Janus2, Tom from Janus3, Jim from Janus2, ...
Sharing the “burden” use case
• A typical use case is larger conferences
• Many active participants, with many viewers
• The first step is identifying the resources, and how they’re related
• Publishers will send media: they don’t “depend” on each other
• Subscribers only receive media: they depend on a specific publisher
• Publishers can be the “subset”, here
• A large conference room becomes N 1-to-many smaller broadcasts
• Each publisher→subscribers distribution is allocated separately
• Controlling application makes sure that viewer picks streams from the right place
• Bob from Janus1, Alice from Janus2, Tom from Janus3, Jim from Janus2, ...
Sharing the “burden” use case
• A typical use case is larger conferences
• Many active participants, with many viewers
• The first step is identifying the resources, and how they’re related
• Publishers will send media: they don’t “depend” on each other
• Subscribers only receive media: they depend on a specific publisher
• Publishers can be the “subset”, here
• A large conference room becomes N 1-to-many smaller broadcasts
• Each publisher→subscribers distribution is allocated separately
• Controlling application makes sure that viewer picks streams from the right place
• Bob from Janus1, Alice from Janus2, Tom from Janus3, Jim from Janus2, ...
Sharing the “burden” example
Sharing the “burden” example
Sharing the “burden” example
Sharing the “burden” example
Sharing the “burden” example
RTP forwarding
• All strategies so far assume related streams stay together
• In smaller rooms, publishers and subscribers are all on the same server
• In larger rooms, only the publisher and its subscribers are on the same server
• No scenario where this relationship is broken
• Apart from SIP and Streaming, but those are different (legacy interop)
• How can streams from different servers interact?
• Janus plugins don’t talk to each other...
• ... and neither do different Janus instances!
RTP forwarding
A way to relay RTP behind the curtains, without WebRTC
• e.g., relay VideoRoom publisher’s media to a Streaming mountpoint
RTP forwarding
• All strategies so far assume related streams stay together
• In smaller rooms, publishers and subscribers are all on the same server
• In larger rooms, only the publisher and its subscribers are on the same server
• No scenario where this relationship is broken
• Apart from SIP and Streaming, but those are different (legacy interop)
• How can streams from different servers interact?
• Janus plugins don’t talk to each other...
• ... and neither do different Janus instances!
RTP forwarding
A way to relay RTP behind the curtains, without WebRTC
• e.g., relay VideoRoom publisher’s media to a Streaming mountpoint
RTP forwarding
• All strategies so far assume related streams stay together
• In smaller rooms, publishers and subscribers are all on the same server
• In larger rooms, only the publisher and its subscribers are on the same server
• No scenario where this relationship is broken
• Apart from SIP and Streaming, but those are different (legacy interop)
• How can streams from different servers interact?
• Janus plugins don’t talk to each other...
• ... and neither do different Janus instances!
RTP forwarding
A way to relay RTP behind the curtains, without WebRTC
• e.g., relay VideoRoom publisher’s media to a Streaming mountpoint
RTP forwarding
• All strategies so far assume related streams stay together
• In smaller rooms, publishers and subscribers are all on the same server
• In larger rooms, only the publisher and its subscribers are on the same server
• No scenario where this relationship is broken
• Apart from SIP and Streaming, but those are different (legacy interop)
• How can streams from different servers interact?
• Janus plugins don’t talk to each other...
• ... and neither do different Janus instances!
RTP forwarding
A way to relay RTP behind the curtains, without WebRTC
• e.g., relay VideoRoom publisher’s media to a Streaming mountpoint
RTP forwarding example
RTP forwarding example
While “plain” RTP, and not WebRTC?
• Why not use WebRTC to “move” media around?
• WebRTC uses RTP too, after all, and has a lot of useful stuff
• Orchestrated properly, you can have one Janus see another Janus as a WebRTC user
• Many reasons why we went for “plain” RTP, actually
1 Recipient may not be WebRTC compliant (e.g., FFmpeg script)
2 A lot of existing tools support RTP (and other things) natively
3 You may not need an encrypted stream (although RTP forwarders can do SRTP)
4 You may need to “feed” many recipients at the same time
5 Plain RTP is simpler to distribute in different topologies
6 You can take advantage of multicast networks easily
7 More in general, WebRTC has too much overhead for that
While “plain” RTP, and not WebRTC?
• Why not use WebRTC to “move” media around?
• WebRTC uses RTP too, after all, and has a lot of useful stuff
• Orchestrated properly, you can have one Janus see another Janus as a WebRTC user
• Many reasons why we went for “plain” RTP, actually
1 Recipient may not be WebRTC compliant (e.g., FFmpeg script)
2 A lot of existing tools support RTP (and other things) natively
3 You may not need an encrypted stream (although RTP forwarders can do SRTP)
4 You may need to “feed” many recipients at the same time
5 Plain RTP is simpler to distribute in different topologies
6 You can take advantage of multicast networks easily
7 More in general, WebRTC has too much overhead for that
While “plain” RTP, and not WebRTC?
• Why not use WebRTC to “move” media around?
• WebRTC uses RTP too, after all, and has a lot of useful stuff
• Orchestrated properly, you can have one Janus see another Janus as a WebRTC user
• Many reasons why we went for “plain” RTP, actually
1 Recipient may not be WebRTC compliant (e.g., FFmpeg script)
2 A lot of existing tools support RTP (and other things) natively
3 You may not need an encrypted stream (although RTP forwarders can do SRTP)
4 You may need to “feed” many recipients at the same time
5 Plain RTP is simpler to distribute in different topologies
6 You can take advantage of multicast networks easily
7 More in general, WebRTC has too much overhead for that
While “plain” RTP, and not WebRTC?
• Why not use WebRTC to “move” media around?
• WebRTC uses RTP too, after all, and has a lot of useful stuff
• Orchestrated properly, you can have one Janus see another Janus as a WebRTC user
• Many reasons why we went for “plain” RTP, actually
1 Recipient may not be WebRTC compliant (e.g., FFmpeg script)
2 A lot of existing tools support RTP (and other things) natively
3 You may not need an encrypted stream (although RTP forwarders can do SRTP)
4 You may need to “feed” many recipients at the same time
5 Plain RTP is simpler to distribute in different topologies
6 You can take advantage of multicast networks easily
7 More in general, WebRTC has too much overhead for that
While “plain” RTP, and not WebRTC?
• Why not use WebRTC to “move” media around?
• WebRTC uses RTP too, after all, and has a lot of useful stuff
• Orchestrated properly, you can have one Janus see another Janus as a WebRTC user
• Many reasons why we went for “plain” RTP, actually
1 Recipient may not be WebRTC compliant (e.g., FFmpeg script)
2 A lot of existing tools support RTP (and other things) natively
3 You may not need an encrypted stream (although RTP forwarders can do SRTP)
4 You may need to “feed” many recipients at the same time
5 Plain RTP is simpler to distribute in different topologies
6 You can take advantage of multicast networks easily
7 More in general, WebRTC has too much overhead for that
While “plain” RTP, and not WebRTC?
• Why not use WebRTC to “move” media around?
• WebRTC uses RTP too, after all, and has a lot of useful stuff
• Orchestrated properly, you can have one Janus see another Janus as a WebRTC user
• Many reasons why we went for “plain” RTP, actually
1 Recipient may not be WebRTC compliant (e.g., FFmpeg script)
2 A lot of existing tools support RTP (and other things) natively
3 You may not need an encrypted stream (although RTP forwarders can do SRTP)
4 You may need to “feed” many recipients at the same time
5 Plain RTP is simpler to distribute in different topologies
6 You can take advantage of multicast networks easily
7 More in general, WebRTC has too much overhead for that
While “plain” RTP, and not WebRTC?
• Why not use WebRTC to “move” media around?
• WebRTC uses RTP too, after all, and has a lot of useful stuff
• Orchestrated properly, you can have one Janus see another Janus as a WebRTC user
• Many reasons why we went for “plain” RTP, actually
1 Recipient may not be WebRTC compliant (e.g., FFmpeg script)
2 A lot of existing tools support RTP (and other things) natively
3 You may not need an encrypted stream (although RTP forwarders can do SRTP)
4 You may need to “feed” many recipients at the same time
5 Plain RTP is simpler to distribute in different topologies
6 You can take advantage of multicast networks easily
7 More in general, WebRTC has too much overhead for that
While “plain” RTP, and not WebRTC?
• Why not use WebRTC to “move” media around?
• WebRTC uses RTP too, after all, and has a lot of useful stuff
• Orchestrated properly, you can have one Janus see another Janus as a WebRTC user
• Many reasons why we went for “plain” RTP, actually
1 Recipient may not be WebRTC compliant (e.g., FFmpeg script)
2 A lot of existing tools support RTP (and other things) natively
3 You may not need an encrypted stream (although RTP forwarders can do SRTP)
4 You may need to “feed” many recipients at the same time
5 Plain RTP is simpler to distribute in different topologies
6 You can take advantage of multicast networks easily
7 More in general, WebRTC has too much overhead for that
While “plain” RTP, and not WebRTC?
• Why not use WebRTC to “move” media around?
• WebRTC uses RTP too, after all, and has a lot of useful stuff
• Orchestrated properly, you can have one Janus see another Janus as a WebRTC user
• Many reasons why we went for “plain” RTP, actually
1 Recipient may not be WebRTC compliant (e.g., FFmpeg script)
2 A lot of existing tools support RTP (and other things) natively
3 You may not need an encrypted stream (although RTP forwarders can do SRTP)
4 You may need to “feed” many recipients at the same time
5 Plain RTP is simpler to distribute in different topologies
6 You can take advantage of multicast networks easily
7 More in general, WebRTC has too much overhead for that
A specific scenario: broadcasting
• Tree topology with several levels
• Broadcaster is at the root
• Intermediate levels are relayers (RTP trunks)
• Attendees attached at edge nodes (WebRTC)
• Waterfalls and Valves
• Only one flow between related nodes
• Different encodings can be different flows
• Number of relay levels can vary
• No levels → Broadcaster feeding edge nodes directly
• 1-N levels → distribution network (unicast/simulcast)
SOLEIL
Streaming Of Large Scale Events over Internet cLouds
A specific scenario: broadcasting
• Tree topology with several levels
• Broadcaster is at the root
• Intermediate levels are relayers (RTP trunks)
• Attendees attached at edge nodes (WebRTC)
• Waterfalls and Valves
• Only one flow between related nodes
• Different encodings can be different flows
• Number of relay levels can vary
• No levels → Broadcaster feeding edge nodes directly
• 1-N levels → distribution network (unicast/simulcast)
SOLEIL
Streaming Of Large Scale Events over Internet cLouds
A specific scenario: broadcasting
• Tree topology with several levels
• Broadcaster is at the root
• Intermediate levels are relayers (RTP trunks)
• Attendees attached at edge nodes (WebRTC)
• Waterfalls and Valves
• Only one flow between related nodes
• Different encodings can be different flows
• Number of relay levels can vary
• No levels → Broadcaster feeding edge nodes directly
• 1-N levels → distribution network (unicast/simulcast)
SOLEIL
Streaming Of Large Scale Events over Internet cLouds
A specific scenario: broadcasting
• Tree topology with several levels
• Broadcaster is at the root
• Intermediate levels are relayers (RTP trunks)
• Attendees attached at edge nodes (WebRTC)
• Waterfalls and Valves
• Only one flow between related nodes
• Different encodings can be different flows
• Number of relay levels can vary
• No levels → Broadcaster feeding edge nodes directly
• 1-N levels → distribution network (unicast/simulcast)
SOLEIL
Streaming Of Large Scale Events over Internet cLouds
SOLEIL architecture: a simple overview
SOLEIL architecture: a simple overview
Another scenario: cascaded conferencing
• Multiple VideoRoom instances “feeding” each other
• Publisher on Janus X → relayed on other Janus instances too
• Users can subscribe even when not on Janus X
• Can be used for scaling purposes
• Potential audience of publisher goes beyond capabilities of single Janus instance
• Broadcasting seen before applied to conferencing, basically
• Very interesting for geographic access to rooms too, though
• Users always contact Janus closest to them
• Behind the scenes, the Janus instances exchange media for all publishers
• Typically, intra- and inter-datacenter network speed > Users network speed
Another scenario: cascaded conferencing
• Multiple VideoRoom instances “feeding” each other
• Publisher on Janus X → relayed on other Janus instances too
• Users can subscribe even when not on Janus X
• Can be used for scaling purposes
• Potential audience of publisher goes beyond capabilities of single Janus instance
• Broadcasting seen before applied to conferencing, basically
• Very interesting for geographic access to rooms too, though
• Users always contact Janus closest to them
• Behind the scenes, the Janus instances exchange media for all publishers
• Typically, intra- and inter-datacenter network speed > Users network speed
Another scenario: cascaded conferencing
• Multiple VideoRoom instances “feeding” each other
• Publisher on Janus X → relayed on other Janus instances too
• Users can subscribe even when not on Janus X
• Can be used for scaling purposes
• Potential audience of publisher goes beyond capabilities of single Janus instance
• Broadcasting seen before applied to conferencing, basically
• Very interesting for geographic access to rooms too, though
• Users always contact Janus closest to them
• Behind the scenes, the Janus instances exchange media for all publishers
• Typically, intra- and inter-datacenter network speed > Users network speed
Another scenario: cascaded conferencing
Another scenario: cascaded conferencing
A few words on nuts and bolts
• We use Docker A LOT in our deployments
• Even though Janus can deal with NATs, we do prefer it to have a public IP
• Host networking makes it tricky to place more instances on the same machine
• Pipework: assign a dedicated IP address to a container
https://github.com/jpetazzo/pipework
• Docker native macvlan network driver also allows you to assign custom IPs to
containers. We’ll move to it sooner or later...
• Several people (including us) using Janus in clustered environments (Docker
Swarm, Kubernetes, ...)
• Auto-scaling by spawning new replicas as needed
• Live monitoring of machines’ resources (e.g., CPU, # connections, bandwidth) drives
the deployment process
A few words on nuts and bolts
• We use Docker A LOT in our deployments
• Even though Janus can deal with NATs, we do prefer it to have a public IP
• Host networking makes it tricky to place more instances on the same machine
• Pipework: assign a dedicated IP address to a container
https://github.com/jpetazzo/pipework
• Docker native macvlan network driver also allows you to assign custom IPs to
containers. We’ll move to it sooner or later...
• Several people (including us) using Janus in clustered environments (Docker
Swarm, Kubernetes, ...)
• Auto-scaling by spawning new replicas as needed
• Live monitoring of machines’ resources (e.g., CPU, # connections, bandwidth) drives
the deployment process
A few words on nuts and bolts
• We use Docker A LOT in our deployments
• Even though Janus can deal with NATs, we do prefer it to have a public IP
• Host networking makes it tricky to place more instances on the same machine
• Pipework: assign a dedicated IP address to a container
https://github.com/jpetazzo/pipework
• Docker native macvlan network driver also allows you to assign custom IPs to
containers. We’ll move to it sooner or later...
• Several people (including us) using Janus in clustered environments (Docker
Swarm, Kubernetes, ...)
• Auto-scaling by spawning new replicas as needed
• Live monitoring of machines’ resources (e.g., CPU, # connections, bandwidth) drives
the deployment process
A real-world example
A real-world example
Thanks! Questions? Comments?
Contacts
• https://twitter.com/elminiero
• https://twitter.com/meetecho
• http://www.meetecho.com

More Related Content

What's hot

Deep dive into highly available open stack architecture openstack summit va...
Deep dive into highly available open stack architecture   openstack summit va...Deep dive into highly available open stack architecture   openstack summit va...
Deep dive into highly available open stack architecture openstack summit va...
Arthur Berezin
 
How to Choose a Software Update Mechanism for Embedded Linux Devices
How to Choose a Software Update Mechanism for Embedded Linux DevicesHow to Choose a Software Update Mechanism for Embedded Linux Devices
How to Choose a Software Update Mechanism for Embedded Linux Devices
Leon Anavi
 

What's hot (20)

Scaling server side web rtc applications the janus challenge by lorenzo miniero
Scaling server side web rtc applications the janus challenge by lorenzo minieroScaling server side web rtc applications the janus challenge by lorenzo miniero
Scaling server side web rtc applications the janus challenge by lorenzo miniero
 
Architecting your WebRTC application for scalability, Arin Sime
Architecting your WebRTC application for scalability, Arin SimeArchitecting your WebRTC application for scalability, Arin Sime
Architecting your WebRTC application for scalability, Arin Sime
 
Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Deep dive into highly available open stack architecture openstack summit va...
Deep dive into highly available open stack architecture   openstack summit va...Deep dive into highly available open stack architecture   openstack summit va...
Deep dive into highly available open stack architecture openstack summit va...
 
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
 
Introduction to CNI (Container Network Interface)
Introduction to CNI (Container Network Interface)Introduction to CNI (Container Network Interface)
Introduction to CNI (Container Network Interface)
 
HA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and KeepalivedHA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and Keepalived
 
Présentation ubuntu 12.10 PDF
Présentation ubuntu  12.10 PDFPrésentation ubuntu  12.10 PDF
Présentation ubuntu 12.10 PDF
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
How to Choose a Software Update Mechanism for Embedded Linux Devices
How to Choose a Software Update Mechanism for Embedded Linux DevicesHow to Choose a Software Update Mechanism for Embedded Linux Devices
How to Choose a Software Update Mechanism for Embedded Linux Devices
 
An Introduction To Jenkins
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To Jenkins
 
Docker Registry V2
Docker Registry V2Docker Registry V2
Docker Registry V2
 
Introducing GitLab (June 2018)
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)
 
Linux Instrumentation
Linux InstrumentationLinux Instrumentation
Linux Instrumentation
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
HAProxy
HAProxy HAProxy
HAProxy
 

Similar to Scaling WebRTC applications with Janus

How DreamHost builds a public cloud with OpenStack.pdf
How DreamHost builds a public cloud with OpenStack.pdfHow DreamHost builds a public cloud with OpenStack.pdf
How DreamHost builds a public cloud with OpenStack.pdf
OpenStack Foundation
 

Similar to Scaling WebRTC applications with Janus (20)

Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021
 
Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020
 
Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019
 
Janus workshop @ RTC2019 Beijing
Janus workshop @ RTC2019 BeijingJanus workshop @ RTC2019 Beijing
Janus workshop @ RTC2019 Beijing
 
Janus @ ClueCon 2019
Janus @ ClueCon 2019Janus @ ClueCon 2019
Janus @ ClueCon 2019
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019
 
WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017
 
Janus @ RTC2017 Beijing
Janus @ RTC2017 BeijingJanus @ RTC2017 Beijing
Janus @ RTC2017 Beijing
 
Janus/HOMER/HEPIC @ OpenSIPS18
Janus/HOMER/HEPIC @ OpenSIPS18Janus/HOMER/HEPIC @ OpenSIPS18
Janus/HOMER/HEPIC @ OpenSIPS18
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Vimeo and Open Source (SMPTE Forum 2015)
Vimeo and Open Source (SMPTE Forum 2015)Vimeo and Open Source (SMPTE Forum 2015)
Vimeo and Open Source (SMPTE Forum 2015)
 
Experiences with Microservices at Tuenti
Experiences with Microservices at TuentiExperiences with Microservices at Tuenti
Experiences with Microservices at Tuenti
 
The challenges of hybrid meetings @ CommCon 2023
The challenges of hybrid meetings @ CommCon 2023The challenges of hybrid meetings @ CommCon 2023
The challenges of hybrid meetings @ CommCon 2023
 
Janus/SIP @ OpenSIPS 2017
Janus/SIP @ OpenSIPS 2017Janus/SIP @ OpenSIPS 2017
Janus/SIP @ OpenSIPS 2017
 
How DreamHost builds a public cloud with OpenStack.pdf
How DreamHost builds a public cloud with OpenStack.pdfHow DreamHost builds a public cloud with OpenStack.pdf
How DreamHost builds a public cloud with OpenStack.pdf
 
How DreamHost builds a Public Cloud with OpenStack
How DreamHost builds a Public Cloud with OpenStackHow DreamHost builds a Public Cloud with OpenStack
How DreamHost builds a Public Cloud with OpenStack
 
Project Flogo: Serverless Integration, Powered by Flogo and Lambda
Project Flogo: Serverless Integration, Powered by Flogo and LambdaProject Flogo: Serverless Integration, Powered by Flogo and Lambda
Project Flogo: Serverless Integration, Powered by Flogo and Lambda
 
JUC Europe 2015: Continuous Integration and Distribution in the Cloud with DE...
JUC Europe 2015: Continuous Integration and Distribution in the Cloud with DE...JUC Europe 2015: Continuous Integration and Distribution in the Cloud with DE...
JUC Europe 2015: Continuous Integration and Distribution in the Cloud with DE...
 
WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021
 

More from Lorenzo Miniero

More from Lorenzo Miniero (15)

Getting AV1/SVC to work in the Janus WebRTC Server
Getting AV1/SVC to work in the Janus WebRTC ServerGetting AV1/SVC to work in the Janus WebRTC Server
Getting AV1/SVC to work in the Janus WebRTC Server
 
WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023
 
BWE in Janus
BWE in JanusBWE in Janus
BWE in Janus
 
Real-Time Text and WebRTC @ Kamailio World 2023
Real-Time Text and WebRTC @ Kamailio World 2023Real-Time Text and WebRTC @ Kamailio World 2023
Real-Time Text and WebRTC @ Kamailio World 2023
 
Become a rockstar using FOSS!
Become a rockstar using FOSS!Become a rockstar using FOSS!
Become a rockstar using FOSS!
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022
 
JamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceJamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConference
 
Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021
 
Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021
 
Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021
 
Virtual IETF meetings with WebRTC @ IETF 109 MOPS
Virtual IETF meetings with WebRTC @ IETF 109 MOPSVirtual IETF meetings with WebRTC @ IETF 109 MOPS
Virtual IETF meetings with WebRTC @ IETF 109 MOPS
 
Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020
 
Turning live events to virtual with Janus
Turning live events to virtual with JanusTurning live events to virtual with Janus
Turning live events to virtual with Janus
 
Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019
 
Welcome to JanusCon! -- Past, Present and Future of Janus
Welcome to JanusCon! -- Past, Present and Future of JanusWelcome to JanusCon! -- Past, Present and Future of Janus
Welcome to JanusCon! -- Past, Present and Future of Janus
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Scaling WebRTC applications with Janus

  • 1. Scaling server-side WebRTC applications: the Janus challenge Lorenzo Miniero @elminiero CommCon 2018 June 27th 2018, Wotton House, Surrey (UK)
  • 2. Sorry Dan, pineapples on pizza = BIG NO
  • 3. A picture of me as a kid for no reason Lorenzo Miniero • Ph.D @ UniNA • Chairman @ Meetecho • Open source believer Contacts and info • lorenzo@meetecho.com • https://twitter.com/elminiero • https://www.slideshare.net/LorenzoMiniero
  • 4. 1. No, I don’t know what happened...
  • 5. 2. Yes, Police is still looking for who stole my cheeks
  • 6. Ok, let’s stop clowning around... Lorenzo Miniero • Ph.D @ UniNA • Chairman @ Meetecho • Open source believer Contacts and info • lorenzo@meetecho.com • https://twitter.com/elminiero • https://www.slideshare.net/LorenzoMiniero
  • 7. What is Janus? Janus General purpose, open source WebRTC server • https://github.com/meetecho/janus-gateway • Demos and documentation: https://janus.conf.meetecho.com • Community: https://groups.google.com/forum/#!forum/meetecho-janus
  • 8. Modular architecture • The core only implements the WebRTC stack • JSEP/SDP, ICE, DTLS-SRTP, Data Channels, ... • Plugins expose Janus API over different “transports” • Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg • “Application” logic implemented in plugins too • Users attach to plugins via the Janus core • The core handles the WebRTC stuff • Plugins route/manipulate the media/data • Plugins can be combined on client side as “bricks” • Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
  • 9. Modular architecture • The core only implements the WebRTC stack • JSEP/SDP, ICE, DTLS-SRTP, Data Channels, ... • Plugins expose Janus API over different “transports” • Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg • “Application” logic implemented in plugins too • Users attach to plugins via the Janus core • The core handles the WebRTC stuff • Plugins route/manipulate the media/data • Plugins can be combined on client side as “bricks” • Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
  • 10. Modular architecture • The core only implements the WebRTC stack • JSEP/SDP, ICE, DTLS-SRTP, Data Channels, ... • Plugins expose Janus API over different “transports” • Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg • “Application” logic implemented in plugins too • Users attach to plugins via the Janus core • The core handles the WebRTC stuff • Plugins route/manipulate the media/data • Plugins can be combined on client side as “bricks” • Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
  • 11. Modular architecture • The core only implements the WebRTC stack • JSEP/SDP, ICE, DTLS-SRTP, Data Channels, ... • Plugins expose Janus API over different “transports” • Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg • “Application” logic implemented in plugins too • Users attach to plugins via the Janus core • The core handles the WebRTC stuff • Plugins route/manipulate the media/data • Plugins can be combined on client side as “bricks” • Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
  • 14. A quick look at plugins: SIP gateway
  • 15. A quick look at plugins: RTP rebroadcaster
  • 16. A quick look at plugins: Audio MCU
  • 17. A quick look at plugins: Video SFU
  • 18. The first step towards scaling: benchmarking • Measuring Janus performance is not trivial... • Different plugins have different behaviours • Different technologies have different impact • Need to focus on individual features • SIP Gateway (SIP plugin) • Multimedia streaming (Streaming plugin) • Audio mixing (AudioBridge plugin) • Video routing (VideoRoom plugin) • ... What about the results?1 • When just relaying, bandwidth is typically the real bottleneck • Linear vs. exponential resource increase depends on plugin and topologies 1 https://janus.conf.meetecho.com/citeus
  • 19. The first step towards scaling: benchmarking • Measuring Janus performance is not trivial... • Different plugins have different behaviours • Different technologies have different impact • Need to focus on individual features • SIP Gateway (SIP plugin) • Multimedia streaming (Streaming plugin) • Audio mixing (AudioBridge plugin) • Video routing (VideoRoom plugin) • ... What about the results?1 • When just relaying, bandwidth is typically the real bottleneck • Linear vs. exponential resource increase depends on plugin and topologies 1 https://janus.conf.meetecho.com/citeus
  • 20. The first step towards scaling: benchmarking • Measuring Janus performance is not trivial... • Different plugins have different behaviours • Different technologies have different impact • Need to focus on individual features • SIP Gateway (SIP plugin) • Multimedia streaming (Streaming plugin) • Audio mixing (AudioBridge plugin) • Video routing (VideoRoom plugin) • ... What about the results?1 • When just relaying, bandwidth is typically the real bottleneck • Linear vs. exponential resource increase depends on plugin and topologies 1 https://janus.conf.meetecho.com/citeus
  • 21. Beyond a single Janus instance: different strategies • Once performance is evaluated, other aspects come into play • Does a user stream need to stay within the plugin? • Can it be sent to/received from somewhere else? • Will this affect other connections? • How much is the context important? • What level of orchestration is needed? • All those questions can lead to different answers/solutions, e.g. 1 Plain load balancing 2 Media resource brokering (MRB) 3 Sharing the “burden” 4 Cascaded delivery 5 ...
  • 22. Beyond a single Janus instance: different strategies • Once performance is evaluated, other aspects come into play • Does a user stream need to stay within the plugin? • Can it be sent to/received from somewhere else? • Will this affect other connections? • How much is the context important? • What level of orchestration is needed? • All those questions can lead to different answers/solutions, e.g. 1 Plain load balancing 2 Media resource brokering (MRB) 3 Sharing the “burden” 4 Cascaded delivery 5 ...
  • 23. Plain load balancing • The simplest strategy of them all • You have N Janus instances available • You allocate users on one according to some logic • No orchestration needed, just knowledge of Janus addresses • User has list vs. HAProxy vs. nginx vs. ... • Logic can differ depending on the application • Pick a random server? • Use round robin? • Pick the one closest to the user? • Pick the least loaded? • Something else and/or any combination of the above?
  • 24. Plain load balancing • The simplest strategy of them all • You have N Janus instances available • You allocate users on one according to some logic • No orchestration needed, just knowledge of Janus addresses • User has list vs. HAProxy vs. nginx vs. ... • Logic can differ depending on the application • Pick a random server? • Use round robin? • Pick the one closest to the user? • Pick the least loaded? • Something else and/or any combination of the above?
  • 25. Plain load balancing • The simplest strategy of them all • You have N Janus instances available • You allocate users on one according to some logic • No orchestration needed, just knowledge of Janus addresses • User has list vs. HAProxy vs. nginx vs. ... • Logic can differ depending on the application • Pick a random server? • Use round robin? • Pick the one closest to the user? • Pick the least loaded? • Something else and/or any combination of the above?
  • 29. Plain load balancing limitations • The only safe option is the SIP plugin • All streams are independent of each other • Even those that are related, are related via the SIP infrastructure • It might work with the Streaming plugin... • ... as long as you make sure the same mountpoints exist on all servers... • ... and they’re all fed with the same data! • With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple • Users meant for the same room may end up on different servers • ... unless the balancing component is aware of the context (“room”) • What about hosting the same room on different servers? • May work, but is also messy • Different contexts, multiple signalling channels, events overhead
  • 30. Plain load balancing limitations • The only safe option is the SIP plugin • All streams are independent of each other • Even those that are related, are related via the SIP infrastructure • It might work with the Streaming plugin... • ... as long as you make sure the same mountpoints exist on all servers... • ... and they’re all fed with the same data! • With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple • Users meant for the same room may end up on different servers • ... unless the balancing component is aware of the context (“room”) • What about hosting the same room on different servers? • May work, but is also messy • Different contexts, multiple signalling channels, events overhead
  • 31. Plain load balancing limitations • The only safe option is the SIP plugin • All streams are independent of each other • Even those that are related, are related via the SIP infrastructure • It might work with the Streaming plugin... • ... as long as you make sure the same mountpoints exist on all servers... • ... and they’re all fed with the same data! • With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple • Users meant for the same room may end up on different servers • ... unless the balancing component is aware of the context (“room”) • What about hosting the same room on different servers? • May work, but is also messy • Different contexts, multiple signalling channels, events overhead
  • 32. Plain load balancing limitations • The only safe option is the SIP plugin • All streams are independent of each other • Even those that are related, are related via the SIP infrastructure • It might work with the Streaming plugin... • ... as long as you make sure the same mountpoints exist on all servers... • ... and they’re all fed with the same data! • With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple • Users meant for the same room may end up on different servers • ... unless the balancing component is aware of the context (“room”) • What about hosting the same room on different servers? • May work, but is also messy • Different contexts, multiple signalling channels, events overhead
  • 33. Plain load balancing limitations • The only safe option is the SIP plugin • All streams are independent of each other • Even those that are related, are related via the SIP infrastructure • It might work with the Streaming plugin... • ... as long as you make sure the same mountpoints exist on all servers... • ... and they’re all fed with the same data! • With other plugins (e.g., AudioBridge or VideoRoom), it’s not as simple • Users meant for the same room may end up on different servers • ... unless the balancing component is aware of the context (“room”) • What about hosting the same room on different servers? • May work, but is also messy • Different contexts, multiple signalling channels, events overhead
  • 34. Media resource brokering • A step above Plain load balancing • You have N Janus instances available • You allocate users based on logic AND context • Orchestration needed, here • You need to know which Janus instances are available... • ... and which one is doing what • Logic will differ depending on the context • Before allocating users, you allocate the context itself (e.g., a conference room) • Users are then sent wherever their context belongs to • Unlike Plain load balancing, can be used for everything • You just need to implement context awareness somehow, and track resources
  • 35. Media resource brokering • A step above Plain load balancing • You have N Janus instances available • You allocate users based on logic AND context • Orchestration needed, here • You need to know which Janus instances are available... • ... and which one is doing what • Logic will differ depending on the context • Before allocating users, you allocate the context itself (e.g., a conference room) • Users are then sent wherever their context belongs to • Unlike Plain load balancing, can be used for everything • You just need to implement context awareness somehow, and track resources
  • 36. Media resource brokering • A step above Plain load balancing • You have N Janus instances available • You allocate users based on logic AND context • Orchestration needed, here • You need to know which Janus instances are available... • ... and which one is doing what • Logic will differ depending on the context • Before allocating users, you allocate the context itself (e.g., a conference room) • Users are then sent wherever their context belongs to • Unlike Plain load balancing, can be used for everything • You just need to implement context awareness somehow, and track resources
  • 37. Media resource brokering • A step above Plain load balancing • You have N Janus instances available • You allocate users based on logic AND context • Orchestration needed, here • You need to know which Janus instances are available... • ... and which one is doing what • Logic will differ depending on the context • Before allocating users, you allocate the context itself (e.g., a conference room) • Users are then sent wherever their context belongs to • Unlike Plain load balancing, can be used for everything • You just need to implement context awareness somehow, and track resources
  • 38. Media resource brokering use case • Will work nicely with all plugins, if you manage the context • Context may give more info to SIP balancing logic • Conference rooms and Streaming mountpoints can be associated to instances • Broadcasting with Streaming plugin... • ... if MRB knows Janus X hosts mountpoint Y, it can send users there • Conference rooms with AudioBridge and/or VideoRoom... • New rooms can be “deployed” on a specific instance • Attempts to join room Y can be sent to Janus instance responsible for it • Won’t help much when the same resource needs to be scaled, though • e.g., many small rooms vs. one very large room • For that, some different approach is needed
  • 39. Media resource brokering use case • Will work nicely with all plugins, if you manage the context • Context may give more info to SIP balancing logic • Conference rooms and Streaming mountpoints can be associated to instances • Broadcasting with Streaming plugin... • ... if MRB knows Janus X hosts mountpoint Y, it can send users there • Conference rooms with AudioBridge and/or VideoRoom... • New rooms can be “deployed” on a specific instance • Attempts to join room Y can be sent to Janus instance responsible for it • Won’t help much when the same resource needs to be scaled, though • e.g., many small rooms vs. one very large room • For that, some different approach is needed
  • 40. Media resource brokering use case • Will work nicely with all plugins, if you manage the context • Context may give more info to SIP balancing logic • Conference rooms and Streaming mountpoints can be associated to instances • Broadcasting with Streaming plugin... • ... if MRB knows Janus X hosts mountpoint Y, it can send users there • Conference rooms with AudioBridge and/or VideoRoom... • New rooms can be “deployed” on a specific instance • Attempts to join room Y can be sent to Janus instance responsible for it • Won’t help much when the same resource needs to be scaled, though • e.g., many small rooms vs. one very large room • For that, some different approach is needed
  • 41. Media resource brokering use case • Will work nicely with all plugins, if you manage the context • Context may give more info to SIP balancing logic • Conference rooms and Streaming mountpoints can be associated to instances • Broadcasting with Streaming plugin... • ... if MRB knows Janus X hosts mountpoint Y, it can send users there • Conference rooms with AudioBridge and/or VideoRoom... • New rooms can be “deployed” on a specific instance • Attempts to join room Y can be sent to Janus instance responsible for it • Won’t help much when the same resource needs to be scaled, though • e.g., many small rooms vs. one very large room • For that, some different approach is needed
  • 46. Sharing the “burden” • A bit different from Brokering described before • You have N Janus instances available • You use one or more of them to serve the same context • Again, orchestration needed here too • You need to know which Janus instances are available... • ... and which one is serving which “subset” of the resource • Logic will differ depending on the resource • You identify how you can “split” the resource (unrelated parts) • Users are then sent where the resource “subset” is allocated • Less flexible than Balancing and Brokering, and more specific • Can greatly help optimize delivery scenarios, though, depending on the context
  • 47. Sharing the “burden” • A bit different from Brokering described before • You have N Janus instances available • You use one or more of them to serve the same context • Again, orchestration needed here too • You need to know which Janus instances are available... • ... and which one is serving which “subset” of the resource • Logic will differ depending on the resource • You identify how you can “split” the resource (unrelated parts) • Users are then sent where the resource “subset” is allocated • Less flexible than Balancing and Brokering, and more specific • Can greatly help optimize delivery scenarios, though, depending on the context
  • 48. Sharing the “burden” • A bit different from Brokering described before • You have N Janus instances available • You use one or more of them to serve the same context • Again, orchestration needed here too • You need to know which Janus instances are available... • ... and which one is serving which “subset” of the resource • Logic will differ depending on the resource • You identify how you can “split” the resource (unrelated parts) • Users are then sent where the resource “subset” is allocated • Less flexible than Balancing and Brokering, and more specific • Can greatly help optimize delivery scenarios, though, depending on the context
  • 49. Sharing the “burden” • A bit different from Brokering described before • You have N Janus instances available • You use one or more of them to serve the same context • Again, orchestration needed here too • You need to know which Janus instances are available... • ... and which one is serving which “subset” of the resource • Logic will differ depending on the resource • You identify how you can “split” the resource (unrelated parts) • Users are then sent where the resource “subset” is allocated • Less flexible than Balancing and Brokering, and more specific • Can greatly help optimize delivery scenarios, though, depending on the context
  • 50. Sharing the “burden” use case • A typical use case is larger conferences • Many active participants, with many viewers • The first step is identifying the resources, and how they’re related • Publishers will send media: they don’t “depend” on each other • Subscribers only receive media: they depend on a specific publisher • Publishers can be the “subset”, here • A large conference room becomes N 1-to-many smaller broadcasts • Each publisher→subscribers distribution is allocated separately • Controlling application makes sure that viewer picks streams from the right place • Bob from Janus1, Alice from Janus2, Tom from Janus3, Jim from Janus2, ...
  • 51. Sharing the “burden” use case • A typical use case is larger conferences • Many active participants, with many viewers • The first step is identifying the resources, and how they’re related • Publishers will send media: they don’t “depend” on each other • Subscribers only receive media: they depend on a specific publisher • Publishers can be the “subset”, here • A large conference room becomes N 1-to-many smaller broadcasts • Each publisher→subscribers distribution is allocated separately • Controlling application makes sure that viewer picks streams from the right place • Bob from Janus1, Alice from Janus2, Tom from Janus3, Jim from Janus2, ...
  • 52. Sharing the “burden” use case • A typical use case is larger conferences • Many active participants, with many viewers • The first step is identifying the resources, and how they’re related • Publishers will send media: they don’t “depend” on each other • Subscribers only receive media: they depend on a specific publisher • Publishers can be the “subset”, here • A large conference room becomes N 1-to-many smaller broadcasts • Each publisher→subscribers distribution is allocated separately • Controlling application makes sure that viewer picks streams from the right place • Bob from Janus1, Alice from Janus2, Tom from Janus3, Jim from Janus2, ...
  • 53. Sharing the “burden” use case • A typical use case is larger conferences • Many active participants, with many viewers • The first step is identifying the resources, and how they’re related • Publishers will send media: they don’t “depend” on each other • Subscribers only receive media: they depend on a specific publisher • Publishers can be the “subset”, here • A large conference room becomes N 1-to-many smaller broadcasts • Each publisher→subscribers distribution is allocated separately • Controlling application makes sure that viewer picks streams from the right place • Bob from Janus1, Alice from Janus2, Tom from Janus3, Jim from Janus2, ...
  • 59. RTP forwarding • All strategies so far assume related streams stay together • In smaller rooms, publishers and subscribers are all on the same server • In larger rooms, only the publisher and its subscribers are on the same server • No scenario where this relationship is broken • Apart from SIP and Streaming, but those are different (legacy interop) • How can streams from different servers interact? • Janus plugins don’t talk to each other... • ... and neither do different Janus instances! RTP forwarding A way to relay RTP behind the curtains, without WebRTC • e.g., relay VideoRoom publisher’s media to a Streaming mountpoint
  • 60. RTP forwarding • All strategies so far assume related streams stay together • In smaller rooms, publishers and subscribers are all on the same server • In larger rooms, only the publisher and its subscribers are on the same server • No scenario where this relationship is broken • Apart from SIP and Streaming, but those are different (legacy interop) • How can streams from different servers interact? • Janus plugins don’t talk to each other... • ... and neither do different Janus instances! RTP forwarding A way to relay RTP behind the curtains, without WebRTC • e.g., relay VideoRoom publisher’s media to a Streaming mountpoint
  • 61. RTP forwarding • All strategies so far assume related streams stay together • In smaller rooms, publishers and subscribers are all on the same server • In larger rooms, only the publisher and its subscribers are on the same server • No scenario where this relationship is broken • Apart from SIP and Streaming, but those are different (legacy interop) • How can streams from different servers interact? • Janus plugins don’t talk to each other... • ... and neither do different Janus instances! RTP forwarding A way to relay RTP behind the curtains, without WebRTC • e.g., relay VideoRoom publisher’s media to a Streaming mountpoint
  • 62. RTP forwarding • All strategies so far assume related streams stay together • In smaller rooms, publishers and subscribers are all on the same server • In larger rooms, only the publisher and its subscribers are on the same server • No scenario where this relationship is broken • Apart from SIP and Streaming, but those are different (legacy interop) • How can streams from different servers interact? • Janus plugins don’t talk to each other... • ... and neither do different Janus instances! RTP forwarding A way to relay RTP behind the curtains, without WebRTC • e.g., relay VideoRoom publisher’s media to a Streaming mountpoint
  • 65. While “plain” RTP, and not WebRTC? • Why not use WebRTC to “move” media around? • WebRTC uses RTP too, after all, and has a lot of useful stuff • Orchestrated properly, you can have one Janus see another Janus as a WebRTC user • Many reasons why we went for “plain” RTP, actually 1 Recipient may not be WebRTC compliant (e.g., FFmpeg script) 2 A lot of existing tools support RTP (and other things) natively 3 You may not need an encrypted stream (although RTP forwarders can do SRTP) 4 You may need to “feed” many recipients at the same time 5 Plain RTP is simpler to distribute in different topologies 6 You can take advantage of multicast networks easily 7 More in general, WebRTC has too much overhead for that
  • 66. While “plain” RTP, and not WebRTC? • Why not use WebRTC to “move” media around? • WebRTC uses RTP too, after all, and has a lot of useful stuff • Orchestrated properly, you can have one Janus see another Janus as a WebRTC user • Many reasons why we went for “plain” RTP, actually 1 Recipient may not be WebRTC compliant (e.g., FFmpeg script) 2 A lot of existing tools support RTP (and other things) natively 3 You may not need an encrypted stream (although RTP forwarders can do SRTP) 4 You may need to “feed” many recipients at the same time 5 Plain RTP is simpler to distribute in different topologies 6 You can take advantage of multicast networks easily 7 More in general, WebRTC has too much overhead for that
  • 67. While “plain” RTP, and not WebRTC? • Why not use WebRTC to “move” media around? • WebRTC uses RTP too, after all, and has a lot of useful stuff • Orchestrated properly, you can have one Janus see another Janus as a WebRTC user • Many reasons why we went for “plain” RTP, actually 1 Recipient may not be WebRTC compliant (e.g., FFmpeg script) 2 A lot of existing tools support RTP (and other things) natively 3 You may not need an encrypted stream (although RTP forwarders can do SRTP) 4 You may need to “feed” many recipients at the same time 5 Plain RTP is simpler to distribute in different topologies 6 You can take advantage of multicast networks easily 7 More in general, WebRTC has too much overhead for that
  • 68. While “plain” RTP, and not WebRTC? • Why not use WebRTC to “move” media around? • WebRTC uses RTP too, after all, and has a lot of useful stuff • Orchestrated properly, you can have one Janus see another Janus as a WebRTC user • Many reasons why we went for “plain” RTP, actually 1 Recipient may not be WebRTC compliant (e.g., FFmpeg script) 2 A lot of existing tools support RTP (and other things) natively 3 You may not need an encrypted stream (although RTP forwarders can do SRTP) 4 You may need to “feed” many recipients at the same time 5 Plain RTP is simpler to distribute in different topologies 6 You can take advantage of multicast networks easily 7 More in general, WebRTC has too much overhead for that
  • 69. While “plain” RTP, and not WebRTC? • Why not use WebRTC to “move” media around? • WebRTC uses RTP too, after all, and has a lot of useful stuff • Orchestrated properly, you can have one Janus see another Janus as a WebRTC user • Many reasons why we went for “plain” RTP, actually 1 Recipient may not be WebRTC compliant (e.g., FFmpeg script) 2 A lot of existing tools support RTP (and other things) natively 3 You may not need an encrypted stream (although RTP forwarders can do SRTP) 4 You may need to “feed” many recipients at the same time 5 Plain RTP is simpler to distribute in different topologies 6 You can take advantage of multicast networks easily 7 More in general, WebRTC has too much overhead for that
  • 70. While “plain” RTP, and not WebRTC? • Why not use WebRTC to “move” media around? • WebRTC uses RTP too, after all, and has a lot of useful stuff • Orchestrated properly, you can have one Janus see another Janus as a WebRTC user • Many reasons why we went for “plain” RTP, actually 1 Recipient may not be WebRTC compliant (e.g., FFmpeg script) 2 A lot of existing tools support RTP (and other things) natively 3 You may not need an encrypted stream (although RTP forwarders can do SRTP) 4 You may need to “feed” many recipients at the same time 5 Plain RTP is simpler to distribute in different topologies 6 You can take advantage of multicast networks easily 7 More in general, WebRTC has too much overhead for that
  • 71. While “plain” RTP, and not WebRTC? • Why not use WebRTC to “move” media around? • WebRTC uses RTP too, after all, and has a lot of useful stuff • Orchestrated properly, you can have one Janus see another Janus as a WebRTC user • Many reasons why we went for “plain” RTP, actually 1 Recipient may not be WebRTC compliant (e.g., FFmpeg script) 2 A lot of existing tools support RTP (and other things) natively 3 You may not need an encrypted stream (although RTP forwarders can do SRTP) 4 You may need to “feed” many recipients at the same time 5 Plain RTP is simpler to distribute in different topologies 6 You can take advantage of multicast networks easily 7 More in general, WebRTC has too much overhead for that
  • 72. While “plain” RTP, and not WebRTC? • Why not use WebRTC to “move” media around? • WebRTC uses RTP too, after all, and has a lot of useful stuff • Orchestrated properly, you can have one Janus see another Janus as a WebRTC user • Many reasons why we went for “plain” RTP, actually 1 Recipient may not be WebRTC compliant (e.g., FFmpeg script) 2 A lot of existing tools support RTP (and other things) natively 3 You may not need an encrypted stream (although RTP forwarders can do SRTP) 4 You may need to “feed” many recipients at the same time 5 Plain RTP is simpler to distribute in different topologies 6 You can take advantage of multicast networks easily 7 More in general, WebRTC has too much overhead for that
  • 73. While “plain” RTP, and not WebRTC? • Why not use WebRTC to “move” media around? • WebRTC uses RTP too, after all, and has a lot of useful stuff • Orchestrated properly, you can have one Janus see another Janus as a WebRTC user • Many reasons why we went for “plain” RTP, actually 1 Recipient may not be WebRTC compliant (e.g., FFmpeg script) 2 A lot of existing tools support RTP (and other things) natively 3 You may not need an encrypted stream (although RTP forwarders can do SRTP) 4 You may need to “feed” many recipients at the same time 5 Plain RTP is simpler to distribute in different topologies 6 You can take advantage of multicast networks easily 7 More in general, WebRTC has too much overhead for that
  • 74. A specific scenario: broadcasting • Tree topology with several levels • Broadcaster is at the root • Intermediate levels are relayers (RTP trunks) • Attendees attached at edge nodes (WebRTC) • Waterfalls and Valves • Only one flow between related nodes • Different encodings can be different flows • Number of relay levels can vary • No levels → Broadcaster feeding edge nodes directly • 1-N levels → distribution network (unicast/simulcast) SOLEIL Streaming Of Large Scale Events over Internet cLouds
  • 75. A specific scenario: broadcasting • Tree topology with several levels • Broadcaster is at the root • Intermediate levels are relayers (RTP trunks) • Attendees attached at edge nodes (WebRTC) • Waterfalls and Valves • Only one flow between related nodes • Different encodings can be different flows • Number of relay levels can vary • No levels → Broadcaster feeding edge nodes directly • 1-N levels → distribution network (unicast/simulcast) SOLEIL Streaming Of Large Scale Events over Internet cLouds
  • 76. A specific scenario: broadcasting • Tree topology with several levels • Broadcaster is at the root • Intermediate levels are relayers (RTP trunks) • Attendees attached at edge nodes (WebRTC) • Waterfalls and Valves • Only one flow between related nodes • Different encodings can be different flows • Number of relay levels can vary • No levels → Broadcaster feeding edge nodes directly • 1-N levels → distribution network (unicast/simulcast) SOLEIL Streaming Of Large Scale Events over Internet cLouds
  • 77. A specific scenario: broadcasting • Tree topology with several levels • Broadcaster is at the root • Intermediate levels are relayers (RTP trunks) • Attendees attached at edge nodes (WebRTC) • Waterfalls and Valves • Only one flow between related nodes • Different encodings can be different flows • Number of relay levels can vary • No levels → Broadcaster feeding edge nodes directly • 1-N levels → distribution network (unicast/simulcast) SOLEIL Streaming Of Large Scale Events over Internet cLouds
  • 78. SOLEIL architecture: a simple overview
  • 79. SOLEIL architecture: a simple overview
  • 80. Another scenario: cascaded conferencing • Multiple VideoRoom instances “feeding” each other • Publisher on Janus X → relayed on other Janus instances too • Users can subscribe even when not on Janus X • Can be used for scaling purposes • Potential audience of publisher goes beyond capabilities of single Janus instance • Broadcasting seen before applied to conferencing, basically • Very interesting for geographic access to rooms too, though • Users always contact Janus closest to them • Behind the scenes, the Janus instances exchange media for all publishers • Typically, intra- and inter-datacenter network speed > Users network speed
  • 81. Another scenario: cascaded conferencing • Multiple VideoRoom instances “feeding” each other • Publisher on Janus X → relayed on other Janus instances too • Users can subscribe even when not on Janus X • Can be used for scaling purposes • Potential audience of publisher goes beyond capabilities of single Janus instance • Broadcasting seen before applied to conferencing, basically • Very interesting for geographic access to rooms too, though • Users always contact Janus closest to them • Behind the scenes, the Janus instances exchange media for all publishers • Typically, intra- and inter-datacenter network speed > Users network speed
  • 82. Another scenario: cascaded conferencing • Multiple VideoRoom instances “feeding” each other • Publisher on Janus X → relayed on other Janus instances too • Users can subscribe even when not on Janus X • Can be used for scaling purposes • Potential audience of publisher goes beyond capabilities of single Janus instance • Broadcasting seen before applied to conferencing, basically • Very interesting for geographic access to rooms too, though • Users always contact Janus closest to them • Behind the scenes, the Janus instances exchange media for all publishers • Typically, intra- and inter-datacenter network speed > Users network speed
  • 85. A few words on nuts and bolts • We use Docker A LOT in our deployments • Even though Janus can deal with NATs, we do prefer it to have a public IP • Host networking makes it tricky to place more instances on the same machine • Pipework: assign a dedicated IP address to a container https://github.com/jpetazzo/pipework • Docker native macvlan network driver also allows you to assign custom IPs to containers. We’ll move to it sooner or later... • Several people (including us) using Janus in clustered environments (Docker Swarm, Kubernetes, ...) • Auto-scaling by spawning new replicas as needed • Live monitoring of machines’ resources (e.g., CPU, # connections, bandwidth) drives the deployment process
  • 86. A few words on nuts and bolts • We use Docker A LOT in our deployments • Even though Janus can deal with NATs, we do prefer it to have a public IP • Host networking makes it tricky to place more instances on the same machine • Pipework: assign a dedicated IP address to a container https://github.com/jpetazzo/pipework • Docker native macvlan network driver also allows you to assign custom IPs to containers. We’ll move to it sooner or later... • Several people (including us) using Janus in clustered environments (Docker Swarm, Kubernetes, ...) • Auto-scaling by spawning new replicas as needed • Live monitoring of machines’ resources (e.g., CPU, # connections, bandwidth) drives the deployment process
  • 87. A few words on nuts and bolts • We use Docker A LOT in our deployments • Even though Janus can deal with NATs, we do prefer it to have a public IP • Host networking makes it tricky to place more instances on the same machine • Pipework: assign a dedicated IP address to a container https://github.com/jpetazzo/pipework • Docker native macvlan network driver also allows you to assign custom IPs to containers. We’ll move to it sooner or later... • Several people (including us) using Janus in clustered environments (Docker Swarm, Kubernetes, ...) • Auto-scaling by spawning new replicas as needed • Live monitoring of machines’ resources (e.g., CPU, # connections, bandwidth) drives the deployment process
  • 90. Thanks! Questions? Comments? Contacts • https://twitter.com/elminiero • https://twitter.com/meetecho • http://www.meetecho.com