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

Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019Lorenzo 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 SimeAlan Quayle
 
Janus @ Meetup Tokyo #12
Janus @ Meetup Tokyo #12Janus @ Meetup Tokyo #12
Janus @ Meetup Tokyo #12Lorenzo Miniero
 
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 minieroGreg Kawere
 
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 2022Lorenzo Miniero
 
Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019Lorenzo Miniero
 
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TShapeBlue
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21Lorenzo Miniero
 
Janus conf19: TUTORIAL: KITE with network-instrumentation
Janus conf19: TUTORIAL: KITE with network-instrumentationJanus conf19: TUTORIAL: KITE with network-instrumentation
Janus conf19: TUTORIAL: KITE with network-instrumentationAlexandre Gouaillard
 
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...Vietnam Open Infrastructure User Group
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceEvan McGee
 
Room 1 - 7 - Lê Quốc Đạt - Upgrading network of Openstack to SDN with Tungste...
Room 1 - 7 - Lê Quốc Đạt - Upgrading network of Openstack to SDN with Tungste...Room 1 - 7 - Lê Quốc Đạt - Upgrading network of Openstack to SDN with Tungste...
Room 1 - 7 - Lê Quốc Đạt - Upgrading network of Openstack to SDN with Tungste...Vietnam Open Infrastructure User Group
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basicsJuraj Hantak
 
pfSense firewall workshop guide
pfSense firewall workshop guidepfSense firewall workshop guide
pfSense firewall workshop guideSopon Tumchota
 
Monitoring kubernetes with prometheus
Monitoring kubernetes with prometheusMonitoring kubernetes with prometheus
Monitoring kubernetes with prometheusBrice Fernandes
 
Introduction to Nexus Repository Manager.pdf
Introduction to Nexus Repository Manager.pdfIntroduction to Nexus Repository Manager.pdf
Introduction to Nexus Repository Manager.pdfKnoldus Inc.
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsJulian Mazzitelli
 
The Journey to the Kubernetes networking.pdf
The Journey to the Kubernetes networking.pdfThe Journey to the Kubernetes networking.pdf
The Journey to the Kubernetes networking.pdfChenYiHuang5
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesBruno Borges
 

What's hot (20)

Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019
 
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 @ Meetup Tokyo #12
Janus @ Meetup Tokyo #12Janus @ Meetup Tokyo #12
Janus @ Meetup Tokyo #12
 
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
 
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
 
Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019
 
Istio on Kubernetes
Istio on KubernetesIstio on Kubernetes
Istio on Kubernetes
 
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21
 
Janus conf19: TUTORIAL: KITE with network-instrumentation
Janus conf19: TUTORIAL: KITE with network-instrumentationJanus conf19: TUTORIAL: KITE with network-instrumentation
Janus conf19: TUTORIAL: KITE with network-instrumentation
 
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
Room 1 - 7 - Lê Quốc Đạt - Upgrading network of Openstack to SDN with Tungste...
Room 1 - 7 - Lê Quốc Đạt - Upgrading network of Openstack to SDN with Tungste...Room 1 - 7 - Lê Quốc Đạt - Upgrading network of Openstack to SDN with Tungste...
Room 1 - 7 - Lê Quốc Đạt - Upgrading network of Openstack to SDN with Tungste...
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
 
pfSense firewall workshop guide
pfSense firewall workshop guidepfSense firewall workshop guide
pfSense firewall workshop guide
 
Monitoring kubernetes with prometheus
Monitoring kubernetes with prometheusMonitoring kubernetes with prometheus
Monitoring kubernetes with prometheus
 
Introduction to Nexus Repository Manager.pdf
Introduction to Nexus Repository Manager.pdfIntroduction to Nexus Repository Manager.pdf
Introduction to Nexus Repository Manager.pdf
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd products
 
The Journey to the Kubernetes networking.pdf
The Journey to the Kubernetes networking.pdfThe Journey to the Kubernetes networking.pdf
The Journey to the Kubernetes networking.pdf
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
 

Similar to Scaling WebRTC applications with Janus

Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Lorenzo Miniero
 
Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020Lorenzo Miniero
 
Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019Lorenzo Miniero
 
Janus workshop @ RTC2019 Beijing
Janus workshop @ RTC2019 BeijingJanus workshop @ RTC2019 Beijing
Janus workshop @ RTC2019 BeijingLorenzo Miniero
 
Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017Lorenzo Miniero
 
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 2024Lorenzo Miniero
 
Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019Lorenzo Miniero
 
WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017Lorenzo Miniero
 
Janus/HOMER/HEPIC @ OpenSIPS18
Janus/HOMER/HEPIC @ OpenSIPS18Janus/HOMER/HEPIC @ OpenSIPS18
Janus/HOMER/HEPIC @ OpenSIPS18Lorenzo Miniero
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?Eduard Tomàs
 
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)Derek Buitenhuis
 
Experiences with Microservices at Tuenti
Experiences with Microservices at TuentiExperiences with Microservices at Tuenti
Experiences with Microservices at TuentiAndrés Viedma Peláez
 
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 2023Lorenzo Miniero
 
Janus/SIP @ OpenSIPS 2017
Janus/SIP @ OpenSIPS 2017Janus/SIP @ OpenSIPS 2017
Janus/SIP @ OpenSIPS 2017Lorenzo Miniero
 
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.pdfOpenStack Foundation
 
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 OpenStackCarl Perry
 
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 LambdaLeon Stigter
 
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...CloudBees
 

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
 
Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017
 
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...
 

More from Lorenzo Miniero

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 ServerLorenzo Miniero
 
WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023Lorenzo Miniero
 
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 2023Lorenzo Miniero
 
Become a rockstar using FOSS!
Become a rockstar using FOSS!Become a rockstar using FOSS!
Become a rockstar using FOSS!Lorenzo Miniero
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022Lorenzo Miniero
 
WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021Lorenzo Miniero
 
JamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceJamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceLorenzo Miniero
 
Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Lorenzo Miniero
 
Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021Lorenzo Miniero
 
Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021Lorenzo Miniero
 
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 MOPSLorenzo Miniero
 
Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020Lorenzo Miniero
 
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 JanusLorenzo Miniero
 
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 JanusLorenzo 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
 
WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021
 
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
 
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

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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, Adobeapidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

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