SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Janus & Docker:
friends or foe?
Alessandro Amirante
@alexamirante
Outline
● Microservices & Docker
● Janus as a microservice: issues and takeaways
○ Docker networking explained
● Examples of Docker-based complex architectures
○ IETF RPS
○ Recordings production
2
Applications transformation
3
Microservices
4
Docker
● Open source platform for developing,
shipping and running applications using
container virtualization technology
● De-facto standard container technology
● Containers share the same OS kernel
● Avoid replicating (virtualizing) guest OS,
RAM, CPUs, ...
● Containers are isolated from each
other, but can share resources
○ File system volumes
○ Networks
○ … 5
Janus® WebRTC server
6
®
Deployment experience
7
Deploying Janus
● Bare metal
● Virtual Machines
● Docker containers
● Cloud instances
● A mix of the above
8
Containers deployment strategies
● Most WebRTC failures are network-related
● Different networking modes are available
for containers
○ Host
○ NAT
○ Dedicated IP
● Choosing the most appropriate one is the
main challenge
● Spoiler alert: dedicated IP addresses for the
win!
9
Docker networking
10
● The Container Networking Model (CNM)
specifies the networking architecture
for containers technology
○ Sandboxes
○ Endpoints
○ Networks
● Libnetwork
○ Docker’s native implementation of the CNM
○ Leverages the Linux kernel implementation
of the network stack
○ 4 built-in network drivers: host, bridge,
overlay, macvlan
● Docker networking can be tricky!
Network drivers: host
● Containers use the network stack of the host machine
○ No namespaces
○ All host ifaces can be directly used by the container
● Easiest networking mode
● Network ports conflicts need to be avoided
● Limits the number of containers running on the same host
● Auto-scaling is difficult
11
Network drivers: bridge
● Docker’s default network mode
● Implements NAT functionality
● Containers on the same bridge network communicate over LAN
● Containers on different bridge networks need routing
● Port mapping needed for reachability from the outside
○ Conflicts need to be avoided
12
Docker NAT functionality (1/2)
● Docker’s NAT behavior appears to be address independent
(at a first glance)
○ Port Restricted Cone NAT
○ Check out the Janus recently enhanced test_stun feature
● In a dev environment, using the bridge driver is quite a
common choice
● ICE set up expected to succeed thanks to peer reflexive
candidates
● ICE randomly failed :(
○ The Streaming plugin was mostly affected by such failures
○ EchoTest plugin not affected
○ VideoRoom plugin only affected for subscribers 13
Docker NAT functionality (2/2)
● Turned out to depend on which party sends the JSEP offer
○ Browser offers, Janus answers → ICE succeeds
○ Janus offers, browser answers → ICE fails
● Tracked down this behavior to libnetfilter, upon which
Docker’s libnetwork is based
● The Docker NAT is not address independent!
○ It sometimes acts like a symmetric NAT
14
ICE failure example
15
ICE failure example
16
ICE success example
17
ICE success example
18
ICE success example
19
ICE success example
20
Takeaways
● Docker networking can be tricky when dealing with ICE
● Host networking limits the number of containers running on the same host
● Ports mapping is not ideal when you want to scale a service up/down as needed
● NATed networks should be fine in a controlled environment, but…
● … things get weird when the browser is also behind a NAT
○ Firefox multiprocess has a built in UDP packet filter
● The new obfuscation of host candidates through mDNS makes things even
worse!
○ Chrome and Safari already there, Firefox coming soon
● Dedicated IP addresses to containers for the win!
○ Macvlan
○ Pipework 21
Macvlan
● Docker built-in network driver
● Allows a single (host) physical
iface to have multiple MAC and
IP addresses to assign to
containers
● No need for port publishing
22
Pipework
● Tool for connecting together containers in arbitrarily complex scenarios
● https://github.com/jpetazzo/pipework
● Allows to create a new network interface inside a container and set
networking parameters (IP address, netmask, gateway, ...)
○ This new interface becomes the default one for the container
23
$ pipework <hostinterface> [-i containerinterface] <guest>
<ipaddr>/<subnet>[@default_gateway] [macaddr][@vlan]
$ pipework <hostinterface> [-i containerinterface] <guest>
dhcp [macaddr][@vlan]
● If you want to use both IPv4 and IPV6, the IPv6 interface has to be
created first
● The whole IETF Remote Participation Service is based upon Docker
● The NOC team deploys bare metal servers at meeting venues
● Four VMs running on different servers are dedicated to the remote participation
service
● VMs host a bunch of Docker containers
○ Janus
○ Asterisk
○ Tomcat 1 instance of the Meetecho RPS
○ Redis + Node.js (containers share the network stack and have public IPv4 and IPv6 addresses)
○ Nginx
● Eight instances of the Meetecho RPS (one per room)
○ Split on two different VMs
○ A third VM is left idle for failover → containers migration if needed
● Other containers (stats, auth service, TURN, …) running on the fourth VM
Example: IETF Remote Participation
24
Melter: a Docker Swarm cluster
for recordings production
25
Janus recording functionality
26
● Janus records individual contributions into MJR files
● MJRs can be converted into Opus/Wave/WebM/MP4 playable
files via the janus-pp-rec tool shipped with Janus
● Individual contributions can be merged together into a single
audio/video file
○ Timing information need to be taken into account to properly sync
media
○ Other info might be needed as well, e.g., time of the first keyframe
written into the MJR
Meetecho Melter
● A solution for converting MJR files into videos according to a
given layout
● Leverages the MLT Multimedia Framework
○ https://www.mltframework.org/
● Post-processing and encoding happen on a cluster of
machines hosting Docker containers
○ Initially implemented with CoreOS
○ Moved to Docker native Swarm mode
27
Docker Swarm
● Cluster management and orchestration embedded in Docker engine
● Docker engine = swarm node
○ Manager(s)
■ Maintain cluster state through Raft consensus
■ Schedule services
■ Serve the swarm HTTP API
○ Worker(s)
■ Run containers scheduled by managers
● Fault tolerance
○ Containers are re-scheduled if a node
fails
○ The cluster can tolerate up to (N-1)/2
managers failing 28
● Leverage a number of bare metal servers as swarm nodes
● Set the maximum number of containers per node according to nodes’ specs
● Schedule containers according to the above limits
● Solution: exploit Docker networks and the swarm scheduler in a “hacky” way
Challenges
29
Swarm-scoped Macvlan network
● On each swarm node create a network configuration
○ The network will have a limited number of IP addresses available (via subnetting)
○ The --aux-address option excludes an IP address from the usable ones
○ Must define non-overlapping ranges of addresses among all nodes
● On the Swarm manager, create a swarm-scoped network from the
defined config
30
$ docker network create --config-only --subnet
192.168.100.0/24 --ip-range 192.168.100.0/29 --gateway
192.168.100.254 --aux-address "a=192.168.100.1" --aux-address
"b=192.168.100.2" meltnet-config
$ docker network create --config-from meltnet-config --scope
swarm -d macvlan meltnet
Swarm-scoped Macvlan network
● The manager spawns containers on
the swarm from a docker stack
descriptor
● Each container is plumbed into the
meltnet network
● If a node runs out of IP addresses,
new containers will not be allocated
there until one becomes available
again
● Containers also leverage the NFS
volume driver to read/write to a
shared Network Attached Storage 31
Output
32
Thank you!
Questions?
33

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
 
Open vSwitch Introduction
Open vSwitch IntroductionOpen vSwitch Introduction
Open vSwitch Introduction
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDP
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
An SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environmentsAn SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environments
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Building a redundant CloudStack management cluster - Vladimir Melnik
Building a redundant CloudStack management cluster - Vladimir MelnikBuilding a redundant CloudStack management cluster - Vladimir Melnik
Building a redundant CloudStack management cluster - Vladimir Melnik
 
Implementing BGP Flowspec at IP transit network
Implementing BGP Flowspec at IP transit networkImplementing BGP Flowspec at IP transit network
Implementing BGP Flowspec at IP transit network
 
ISP Load Balancing with Mikrotik ECMP
ISP Load Balancing with Mikrotik ECMPISP Load Balancing with Mikrotik ECMP
ISP Load Balancing with Mikrotik ECMP
 
Deploying IPv6 on OpenStack
Deploying IPv6 on OpenStackDeploying IPv6 on OpenStack
Deploying IPv6 on OpenStack
 
Service Function Chaining with SRv6
Service Function Chaining with SRv6Service Function Chaining with SRv6
Service Function Chaining with SRv6
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDPDockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
 
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
 
Kolla talk at OpenStack Summit 2017 in Sydney
Kolla talk at OpenStack Summit 2017 in SydneyKolla talk at OpenStack Summit 2017 in Sydney
Kolla talk at OpenStack Summit 2017 in Sydney
 
Meetup 23 - 02 - OVN - The future of networking in OpenStack
Meetup 23 - 02 - OVN - The future of networking in OpenStackMeetup 23 - 02 - OVN - The future of networking in OpenStack
Meetup 23 - 02 - OVN - The future of networking in OpenStack
 
How to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratchHow to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratch
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Dive
 
NATS Streaming - an alternative to Apache Kafka?
NATS Streaming - an alternative to Apache Kafka?NATS Streaming - an alternative to Apache Kafka?
NATS Streaming - an alternative to Apache Kafka?
 
VXLAN Integration with CloudStack Advanced Zone
VXLAN Integration with CloudStack Advanced ZoneVXLAN Integration with CloudStack Advanced Zone
VXLAN Integration with CloudStack Advanced Zone
 

Similar a Janus & docker: friends or foe

LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software Delivery
Docker, Inc.
 
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
Juraj Hantak
 

Similar a Janus & docker: friends or foe (20)

Building a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerBuilding a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in docker
 
Docker Networking : 0 to 60mph slides
Docker Networking : 0 to 60mph slidesDocker Networking : 0 to 60mph slides
Docker Networking : 0 to 60mph slides
 
Docker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingDocker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental Networking
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
 
Containerization & Docker - Under the Hood
Containerization & Docker - Under the HoodContainerization & Docker - Under the Hood
Containerization & Docker - Under the Hood
 
Swarm: Native Docker Clustering
Swarm: Native Docker ClusteringSwarm: Native Docker Clustering
Swarm: Native Docker Clustering
 
Network Design patters with Docker
Network Design patters with DockerNetwork Design patters with Docker
Network Design patters with Docker
 
Coredns nodecache - A highly-available Node-cache DNS server
Coredns nodecache - A highly-available Node-cache DNS serverCoredns nodecache - A highly-available Node-cache DNS server
Coredns nodecache - A highly-available Node-cache DNS server
 
Talk on PHP Day Uruguay about Docker
Talk on PHP Day Uruguay about DockerTalk on PHP Day Uruguay about Docker
Talk on PHP Day Uruguay about Docker
 
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020
 
Kubernetes from scratch at veepee sysadmins days 2019
Kubernetes from scratch at veepee   sysadmins days 2019Kubernetes from scratch at veepee   sysadmins days 2019
Kubernetes from scratch at veepee sysadmins days 2019
 
Neutron Network Namespaces and IPtables--A Technical Deep Dive
Neutron Network Namespaces and IPtables--A Technical Deep DiveNeutron Network Namespaces and IPtables--A Technical Deep Dive
Neutron Network Namespaces and IPtables--A Technical Deep Dive
 
Networking in Openstack - Neutron 101
Networking in Openstack - Neutron 101Networking in Openstack - Neutron 101
Networking in Openstack - Neutron 101
 
Conatiner Networking with MidoNet
Conatiner Networking with MidoNetConatiner Networking with MidoNet
Conatiner Networking with MidoNet
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013
 
LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software Delivery
 
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
 
Comparison of existing cni plugins for kubernetes
Comparison of existing cni plugins for kubernetesComparison of existing cni plugins for kubernetes
Comparison of existing cni plugins for kubernetes
 
To Russia with Love: Deploying Kubernetes in Exotic Locations On Prem
To Russia with Love: Deploying Kubernetes in Exotic Locations On PremTo Russia with Love: Deploying Kubernetes in Exotic Locations On Prem
To Russia with Love: Deploying Kubernetes in Exotic Locations On Prem
 

Último

Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
Kayode Fayemi
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Hung Le
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
ZurliaSoop
 

Último (20)

Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINESBIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
 
Introduction to Artificial intelligence.
Introduction to Artificial intelligence.Introduction to Artificial intelligence.
Introduction to Artificial intelligence.
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
Ready Set Go Children Sermon about Mark 16:15-20
Ready Set Go Children Sermon about Mark 16:15-20Ready Set Go Children Sermon about Mark 16:15-20
Ready Set Go Children Sermon about Mark 16:15-20
 
Call Girls Near The Byke Suraj Plaza Mumbai »¡¡ 07506202331¡¡« R.K. Mumbai
Call Girls Near The Byke Suraj Plaza Mumbai »¡¡ 07506202331¡¡« R.K. MumbaiCall Girls Near The Byke Suraj Plaza Mumbai »¡¡ 07506202331¡¡« R.K. Mumbai
Call Girls Near The Byke Suraj Plaza Mumbai »¡¡ 07506202331¡¡« R.K. Mumbai
 
Lions New Portal from Narsimha Raju Dichpally 320D.pptx
Lions New Portal from Narsimha Raju Dichpally 320D.pptxLions New Portal from Narsimha Raju Dichpally 320D.pptx
Lions New Portal from Narsimha Raju Dichpally 320D.pptx
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
 
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptxBEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
 
Zone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptxZone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptx
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
History of Morena Moshoeshoe birth death
History of Morena Moshoeshoe birth deathHistory of Morena Moshoeshoe birth death
History of Morena Moshoeshoe birth death
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
 
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait Cityin kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
 

Janus & docker: friends or foe

  • 1. Janus & Docker: friends or foe? Alessandro Amirante @alexamirante
  • 2. Outline ● Microservices & Docker ● Janus as a microservice: issues and takeaways ○ Docker networking explained ● Examples of Docker-based complex architectures ○ IETF RPS ○ Recordings production 2
  • 5. Docker ● Open source platform for developing, shipping and running applications using container virtualization technology ● De-facto standard container technology ● Containers share the same OS kernel ● Avoid replicating (virtualizing) guest OS, RAM, CPUs, ... ● Containers are isolated from each other, but can share resources ○ File system volumes ○ Networks ○ … 5
  • 8. Deploying Janus ● Bare metal ● Virtual Machines ● Docker containers ● Cloud instances ● A mix of the above 8
  • 9. Containers deployment strategies ● Most WebRTC failures are network-related ● Different networking modes are available for containers ○ Host ○ NAT ○ Dedicated IP ● Choosing the most appropriate one is the main challenge ● Spoiler alert: dedicated IP addresses for the win! 9
  • 10. Docker networking 10 ● The Container Networking Model (CNM) specifies the networking architecture for containers technology ○ Sandboxes ○ Endpoints ○ Networks ● Libnetwork ○ Docker’s native implementation of the CNM ○ Leverages the Linux kernel implementation of the network stack ○ 4 built-in network drivers: host, bridge, overlay, macvlan ● Docker networking can be tricky!
  • 11. Network drivers: host ● Containers use the network stack of the host machine ○ No namespaces ○ All host ifaces can be directly used by the container ● Easiest networking mode ● Network ports conflicts need to be avoided ● Limits the number of containers running on the same host ● Auto-scaling is difficult 11
  • 12. Network drivers: bridge ● Docker’s default network mode ● Implements NAT functionality ● Containers on the same bridge network communicate over LAN ● Containers on different bridge networks need routing ● Port mapping needed for reachability from the outside ○ Conflicts need to be avoided 12
  • 13. Docker NAT functionality (1/2) ● Docker’s NAT behavior appears to be address independent (at a first glance) ○ Port Restricted Cone NAT ○ Check out the Janus recently enhanced test_stun feature ● In a dev environment, using the bridge driver is quite a common choice ● ICE set up expected to succeed thanks to peer reflexive candidates ● ICE randomly failed :( ○ The Streaming plugin was mostly affected by such failures ○ EchoTest plugin not affected ○ VideoRoom plugin only affected for subscribers 13
  • 14. Docker NAT functionality (2/2) ● Turned out to depend on which party sends the JSEP offer ○ Browser offers, Janus answers → ICE succeeds ○ Janus offers, browser answers → ICE fails ● Tracked down this behavior to libnetfilter, upon which Docker’s libnetwork is based ● The Docker NAT is not address independent! ○ It sometimes acts like a symmetric NAT 14
  • 21. Takeaways ● Docker networking can be tricky when dealing with ICE ● Host networking limits the number of containers running on the same host ● Ports mapping is not ideal when you want to scale a service up/down as needed ● NATed networks should be fine in a controlled environment, but… ● … things get weird when the browser is also behind a NAT ○ Firefox multiprocess has a built in UDP packet filter ● The new obfuscation of host candidates through mDNS makes things even worse! ○ Chrome and Safari already there, Firefox coming soon ● Dedicated IP addresses to containers for the win! ○ Macvlan ○ Pipework 21
  • 22. Macvlan ● Docker built-in network driver ● Allows a single (host) physical iface to have multiple MAC and IP addresses to assign to containers ● No need for port publishing 22
  • 23. Pipework ● Tool for connecting together containers in arbitrarily complex scenarios ● https://github.com/jpetazzo/pipework ● Allows to create a new network interface inside a container and set networking parameters (IP address, netmask, gateway, ...) ○ This new interface becomes the default one for the container 23 $ pipework <hostinterface> [-i containerinterface] <guest> <ipaddr>/<subnet>[@default_gateway] [macaddr][@vlan] $ pipework <hostinterface> [-i containerinterface] <guest> dhcp [macaddr][@vlan] ● If you want to use both IPv4 and IPV6, the IPv6 interface has to be created first
  • 24. ● The whole IETF Remote Participation Service is based upon Docker ● The NOC team deploys bare metal servers at meeting venues ● Four VMs running on different servers are dedicated to the remote participation service ● VMs host a bunch of Docker containers ○ Janus ○ Asterisk ○ Tomcat 1 instance of the Meetecho RPS ○ Redis + Node.js (containers share the network stack and have public IPv4 and IPv6 addresses) ○ Nginx ● Eight instances of the Meetecho RPS (one per room) ○ Split on two different VMs ○ A third VM is left idle for failover → containers migration if needed ● Other containers (stats, auth service, TURN, …) running on the fourth VM Example: IETF Remote Participation 24
  • 25. Melter: a Docker Swarm cluster for recordings production 25
  • 26. Janus recording functionality 26 ● Janus records individual contributions into MJR files ● MJRs can be converted into Opus/Wave/WebM/MP4 playable files via the janus-pp-rec tool shipped with Janus ● Individual contributions can be merged together into a single audio/video file ○ Timing information need to be taken into account to properly sync media ○ Other info might be needed as well, e.g., time of the first keyframe written into the MJR
  • 27. Meetecho Melter ● A solution for converting MJR files into videos according to a given layout ● Leverages the MLT Multimedia Framework ○ https://www.mltframework.org/ ● Post-processing and encoding happen on a cluster of machines hosting Docker containers ○ Initially implemented with CoreOS ○ Moved to Docker native Swarm mode 27
  • 28. Docker Swarm ● Cluster management and orchestration embedded in Docker engine ● Docker engine = swarm node ○ Manager(s) ■ Maintain cluster state through Raft consensus ■ Schedule services ■ Serve the swarm HTTP API ○ Worker(s) ■ Run containers scheduled by managers ● Fault tolerance ○ Containers are re-scheduled if a node fails ○ The cluster can tolerate up to (N-1)/2 managers failing 28
  • 29. ● Leverage a number of bare metal servers as swarm nodes ● Set the maximum number of containers per node according to nodes’ specs ● Schedule containers according to the above limits ● Solution: exploit Docker networks and the swarm scheduler in a “hacky” way Challenges 29
  • 30. Swarm-scoped Macvlan network ● On each swarm node create a network configuration ○ The network will have a limited number of IP addresses available (via subnetting) ○ The --aux-address option excludes an IP address from the usable ones ○ Must define non-overlapping ranges of addresses among all nodes ● On the Swarm manager, create a swarm-scoped network from the defined config 30 $ docker network create --config-only --subnet 192.168.100.0/24 --ip-range 192.168.100.0/29 --gateway 192.168.100.254 --aux-address "a=192.168.100.1" --aux-address "b=192.168.100.2" meltnet-config $ docker network create --config-from meltnet-config --scope swarm -d macvlan meltnet
  • 31. Swarm-scoped Macvlan network ● The manager spawns containers on the swarm from a docker stack descriptor ● Each container is plumbed into the meltnet network ● If a node runs out of IP addresses, new containers will not be allocated there until one becomes available again ● Containers also leverage the NFS volume driver to read/write to a shared Network Attached Storage 31