SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
Docker Networking Deep Dive
@MadhuVenugopal
online meetup 08/24/2016
• What is libnetwork
• CNM
• 1.12 Features
• Multihost networking
• Secured Control plane & Data plane
• Service Discovery
• Native Loadbalacing
• Routing Mesh
• Demo
Agenda
Overview
It is not just a driver interface
• Docker networking fabric
• Defines Container Networking Model
• Provides builtin IP address management
• Provides native multi-host networking
• Provides native Service Discovery and Load Balancing
• Allows for extensions by the ecosystem via plugins
What is libnetwork?
Design Philosophy
• Users First:
• Application Developers
• IT/Network Ops
• Plugin API Design
• Batteries Included but Swappable
Docker Networking
1.7 1.8 1.9 1.10 1.11
- Libnetwork
- CNM
- Migrated Bridge, host,
none drivers to CNM
- Multihost Networking
- Network Plugins
- IPAM Plugins
- Network UX/API
Service Discovery

(using /etc/hosts)
Distributed DNS
- Aliases
- DNS Round Robin LB
1.12
- Load Balancing
- Encrypted Control and
data plane
- Routing Mesh
- Built-in Swarm-mode
networking
Container Networking Model
• Endpoint
• Network
• Sandbox
• Drivers & Plugins
https://github.com/docker/libnetwork/blob/master/docs/design.md
Network driver overview
Use-case1
Default Bridge Network
(docker0)
eth0 eth0 eth0
docker0 docker0 docker0
C1
eth0 eth0
C2
eth0
C3 C1
eth0 eth0
C2
eth0
C3 C1
eth0 eth0
C2
eth0
C3
ToR switch / Hypervisor switch / …
iptables : 

NAT / port-mapping
iptables : 

NAT / port-mapping
iptables : 

NAT / port-mapping
Use-case2
User-Defined Bridge Network
Host1 : 

$ docker network create -d bridge -o com.docker.network.bridge.name=brnet brnet

$ docker run --net=brnet -it busybox ifconfig
eth0
brnet
172.18.0.1
ToR switch / Hypervisor switch / …
eth0
C1
Host1
eth0
C2
eth0
C3
iptables : 

NAT / port-mapping
eth0
brnet
172.18.0.1
eth0
C4
Host2
eth0
C5
eth0
C6
iptables : 

NAT / port-mapping
eth0
brnet
172.18.0.1
eth0
C7
Host3
eth0
C8
eth0
C9
iptables : 

NAT / port-mapping
Host2 : 

$ docker network create -d bridge -o com.docker.network.bridge.name=brnet brnet

$ docker run --net=brnet -it busybox ifconfig
Host3 : 

$ docker network create -d bridge -o com.docker.network.bridge.name=brnet brnet

$ docker run --net=brnet -it busybox ifconfig
Use-case3
Bridge Network plumbed to underlay with built-in IPAM

(no NAT / Port-mapping)
Host1 : 

$ docker network create -d bridge --subnet=192.168.57.0/24 --ip-range=192.168.57.32/28 --gateway=192.168.57.11 --aux-address
DefaultGatewayIPv4=192.168.57.1 -o com.docker.network.bridge.name=brnet brnet
$ brctl addif brnet eth2

$ docker run --net=brnet -it busybox ifconfig
Host2 :
$ docker network create -d bridge --subnet=192.168.57.0/24 --ip-range=192.168.57.64/28 --gateway=192.168.57.12 --aux-address
DefaultGatewayIPv4=192.168.57.1 -o com.docker.network.bridge.name=brnet brnet

$ brctl addif brnet eth2

$ docker run --net=brnet -it busybox ifconfig
Host3 :
$ docker network create -d bridge --subnet=192.168.57.0/24 --ip-range=192.168.57.128/28 --gateway=192.168.57.13 --aux-address
DefaultGatewayIPv4=192.168.57.1 -o com.docker.network.bridge.name=brnet brnet
$ brctl addif brnet eth2

$ docker run --net=brnet -it busybox ifconfig
eth2

192.168.57.11
brnet
192.168.57.11
ToR switch / Hypervisor switch / Virtual-box host-only / … (Gateway : 192.168.57.1)
eth0
C1
Host1
eth0
C2
eth0
C3
eth2

192.168.57.12
brnet
192.168.57.12
eth0
C4
eth0
C5
eth0
C6
eth2

192.168.57.13
brnet
192.168.57.13
eth0
C7
eth0
C8
eth0
C9
Host2 Host3
Use-case4
Docker Overlay Network
eth0
C1
eth1 eth1 eth1
ToR switch / Hypervisor switch / …
docker0docker_gwbridge
eth0
eth1 eth1 eth1
docker0docker_gwbridge
eth0
eth1 eth1 eth1
docker0docker_gwbridge
ov-net1 ov-net1 ov-net1
VXLAN-VNI 100 VXLAN-VNI 100
eth0 eth0 eth0 eth0 eth0 eth0 eth0 eth0 eth0
VXLAN-VNI 100
iptables : 

NAT / port-mapping
iptables : 

NAT / port-mapping
iptables : 

NAT / port-mapping
Docker overlay networking
C2 C3 C4 C5 C6 C7 C8 C9
Use-case5
Plumbed to underlay vlan with built-in IPAM
macvlan driver (& experimental ipvlan)
https://github.com/docker/docker/blob/master/experimental/vlan-networks.md
# vlan 10 (eth0.10)
$ docker network create -d macvlan —subnet=10.1.10.0/24 —
gateway=10.1.10.1 -o parent=eth0.10 mcvlan10
$ docker run --net=mcvlan10 -it --rm alpine /bin/sh
# vlan 20 (eth0.20)
$ docker network create -d macvlan —subnet=10.1.20.0/24 —
gateway=10.1.20.1 -o parent=eth0.20 mcvlan20
$ docker run --net=mcvlan20 -it --rm alpine /bin/sh
# vlan 30 (eth0.30)
$ docker network create -d macvlan —subnet=10.1.30.0/24 —
gateway=10.1.30.1 -o parent=eth0.30 mcvlan30
$ docker run --net=mcvlan30 -it --rm alpine /bin/sh
Docker 1.12 Networking
New features in 1.12 swarm mode
CNM
Routing
Mesh
Multi-host
Networking
without external
k/v store
Service
Discovery
Secure

Data-Plane
Secure

Control-Plane
Load

Balancing
• Cluster aware
• De-centralized control
plane
• Highly scalable
Swarm-mode Multi-host networking
Manager
Network
Create
Orchestrator
Allocator
Scheduler
Dispatcher
Service
Create
Task
Create
Task
Dispatch
Task
Dispatch
Gossip
Worker1 Worker2
Engine
Libnetwork
Engine
Libnetwork
• VXLAN based data path
• No external key-value store
• Central resource allocation
• Improved performance
• Highly scalable
• Gossip based protocol
• Network scoped
• Fast convergence
• Secure by default
• periodic key rotations
• swarm native key-exchange
• Gossips control messages
• Routing-states
• Service-discovery
• Plugin-data
• Highly scalable
Secured network control plane
Cluster Scope Gossip
W1
W2
W3
W1
W5
W4
Network Scope Gossip
Network Scope Gossip
• Available as an option during
overlay network creation
• Uses kernel IPSec modules
• On-demand tunnel setup
• Swarm native key-exchange
• Periodic key rotations
Secure dataplane
Worker1
Worker2
Worker3
secure
network
secure
network
IPSec Tunnel
IPSec Tunnel
IPSec Tunnel
secure
network
secure
network
non-
secure
network
non-
secure
network
Open UDP traffic
• Provided by embedded DNS
• Highly available
• Uses Network Control Plane to learn state
• Can be used to discover both tasks and
services
Service Discovery
engine
DNS Server
DNS Resolver DNS Resolver
DNS requests
• Internal & Ingress load-balancing
• Supports VIP & DNS-RR
• Highly available
• Uses Network Control Plane to learn state
• Minimal Overhead
Load balancer
Task1
ServiceA
Task2
ServiceA
Task3
ServiceA
Client1 Client2
VIP LB VIP LB
• Builtin routing mesh for edge routing
• Worker nodes themselves participate in
ingress routing mesh
• All worker nodes accept connection
requests on PublishedPort
• Port translation happens at the worker
node
• Same internal load balancing mechanism
used to load balance external requests
Routing mesh
External
Loadbalancer
(optional)
Task1
ServiceA Task1
ServiceA
Task1
ServiceA
Worker1 Worker2
Ingress Network
8080 8080
VIP LB VIP LB
8080->80 8080->80
Routing Mesh
• Operator reserves a swarm-
wide ingress port (8080) for
myapp
• Every node listens on 8080
• Container-aware routing mesh
can transparently reroute traffic
from Worker3 to a node that is
running container
• Built in load balancing into the
Engine
• DNS-based service discovery
Worker 1
:8080
Manager
User accesses
myapp.com:8080:8080
Worker 2
:8080
Worker 3
:8080
frontend frontend
$ docker service create --replicas 3 --name frontend --network mynet
--publish 8080:80/tcp frontend_image:latest
frontend
Routing Mesh: Published Ports
• Operator reserves a swarm-
wide ingress port (8080) for
myapp
• Every node listens on 8080
• Container-aware routing mesh
can transparently reroute traffic
from Worker3 to a node that is
running container
• Built in load balancing into the
Engine
• DNS-based service discovery
Worker 1
:8080
Manager
User accesses
myapp.com:8080:8080
Worker 2
:8080
Worker 3
:8080
frontend frontend
$ docker service create --replicas 3 --name frontend --network mynet
--publish 8080:80/tcp frontend_image:latest
frontend
Deep Dive
Service , Port-Publish & Network
iptables
eth0 Host1
default_gwbridge
ingress-sbox
eth1
ingress-overlay-bridge
Ingress- Network
eth0
vxlan tunnel to host2 - vni-100vxlan tunnel to host3 - vni-100
eth0
Container-sbox
eth1
eth2
mynet
mynet-br vxlan tunnel to host2 - vni-101
docker service create —name=test —network=mynet -p 8080:80 —replicas=2 xxx
iptables
ipvs
iptables
ipvs
Host1: 8080
DNS Resolver
daemon embedded 

DNS server

service -> VIP
Day in life of a packet - IPTables & IPVS
Day in life of a packet - Routing Mesh & Ingress LB
iptables NAT table

DOCKER-INGRESS
DNAT : Published-Port -> ingress-sbox
eth0 Host1
default_gwbridge
ingress-sboxeth1
iptables NAT table

PREROUTING
Redirect -> service-port
iptables MANGLE table

PREROUTING
MARK : Published-Port -> <fw-mark-id>
IPVS
Match <fw-mark-id> -> Masq
{RR across container-IPs)
ingress-overlay-bridge
Ingress- Network
eth0
iptables NAT table

DOCKER-INGRESS
DNAT : Published-Port -> ingress-sbox
eth0 Host2
default_gwbridge
ingress-sbox
eth1
ingress-overlay-bridge
eth0
vxlan tunnel with vni
Ingress- Network
eth0
Container-sbox
(backs a task/
service)
eth1
Day in life of a packet - Internal LB
eth0 Host1
container-sbox

(service1)
eth1
iptables MANGLE table

OUTPUT
MARK : VIP -> <fw-mark-id>
IPVS
Match <fw-mark-id> -> Masq
{RR across container-IPs)
mynet-overlay-bridge
mynet
eth2
Host2
mynet-overlay-bridgevxlan tunnel with vni
mynet
eth2
Container-sbox
(service2)
Application looks up service2
(using embedded-DNS @ 127.0.0.11)
DNS Resolver
daemon embedded DNS server

service2 -> VIP2
vxlan tunnel with vni
Thank you!

Más contenido relacionado

La actualidad más candente

Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101LorisPack Project
 
Libnetwork update at Moby summit June 2017
Libnetwork update at Moby summit June 2017Libnetwork update at Moby summit June 2017
Libnetwork update at Moby summit June 2017Docker, Inc.
 
Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA Docker, Inc.
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking OverviewSreenivas Makam
 
DockerDay2015: Docker Networking
DockerDay2015: Docker NetworkingDockerDay2015: Docker Networking
DockerDay2015: Docker NetworkingDocker-Hanoi
 
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22Ajeet Singh Raina
 
DCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep diveDCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep diveMadhu Venugopal
 
Docker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMDocker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMNeependra Khare
 
Open stack networking vlan, gre
Open stack networking   vlan, greOpen stack networking   vlan, gre
Open stack networking vlan, greSim Janghoon
 
Docker Online Meetup #22: Docker Networking
Docker Online Meetup #22: Docker NetworkingDocker Online Meetup #22: Docker Networking
Docker Online Meetup #22: Docker NetworkingDocker, Inc.
 
Docker Networking : 0 to 60mph slides
Docker Networking : 0 to 60mph slidesDocker Networking : 0 to 60mph slides
Docker Networking : 0 to 60mph slidesDocker, Inc.
 
Unikernels: the rise of the library hypervisor in MirageOS
Unikernels: the rise of the library hypervisor in MirageOSUnikernels: the rise of the library hypervisor in MirageOS
Unikernels: the rise of the library hypervisor in MirageOSDocker, Inc.
 
Docker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan DriversDocker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan DriversBrent Salisbury
 
Global Operations with Docker Enterprise
Global Operations with Docker EnterpriseGlobal Operations with Docker Enterprise
Global Operations with Docker EnterpriseNicola Kabar
 
Understanding docker networking
Understanding docker networkingUnderstanding docker networking
Understanding docker networkingLorenzo Fontana
 

La actualidad más candente (18)

Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
 
Libnetwork update at Moby summit June 2017
Libnetwork update at Moby summit June 2017Libnetwork update at Moby summit June 2017
Libnetwork update at Moby summit June 2017
 
macvlan and ipvlan
macvlan and ipvlanmacvlan and ipvlan
macvlan and ipvlan
 
Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking Overview
 
DockerDay2015: Docker Networking
DockerDay2015: Docker NetworkingDockerDay2015: Docker Networking
DockerDay2015: Docker Networking
 
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22
 
DCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep diveDCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep dive
 
Docker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMDocker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBM
 
Open stack networking vlan, gre
Open stack networking   vlan, greOpen stack networking   vlan, gre
Open stack networking vlan, gre
 
Docker Online Meetup #22: Docker Networking
Docker Online Meetup #22: Docker NetworkingDocker Online Meetup #22: Docker Networking
Docker Online Meetup #22: Docker Networking
 
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
Docker networkingDocker networking
Docker networking
 
Unikernels: the rise of the library hypervisor in MirageOS
Unikernels: the rise of the library hypervisor in MirageOSUnikernels: the rise of the library hypervisor in MirageOS
Unikernels: the rise of the library hypervisor in MirageOS
 
Docker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan DriversDocker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan Drivers
 
Global Operations with Docker Enterprise
Global Operations with Docker EnterpriseGlobal Operations with Docker Enterprise
Global Operations with Docker Enterprise
 
Understanding docker networking
Understanding docker networkingUnderstanding docker networking
Understanding docker networking
 
Docker network
Docker networkDocker network
Docker network
 

Destacado

Docker Networking Deep Dive
Docker Networking Deep DiveDocker Networking Deep Dive
Docker Networking Deep DiveDocker, Inc.
 
Docker Networking (Libnetwork) - Lakshman Kumar
Docker Networking (Libnetwork) - Lakshman KumarDocker Networking (Libnetwork) - Lakshman Kumar
Docker Networking (Libnetwork) - Lakshman KumarNeependra Khare
 
Kernel load-balancing for Docker containers using IPVS
Kernel load-balancing for Docker containers using IPVSKernel load-balancing for Docker containers using IPVS
Kernel load-balancing for Docker containers using IPVSDocker, Inc.
 
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker, Inc.
 
pipework - Advanced Docker Networking
pipework - Advanced Docker Networkingpipework - Advanced Docker Networking
pipework - Advanced Docker Networkingsaba syake
 
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016Philipp Garbe
 
Pipework: Software-Defined Network for Containers and Docker
Pipework: Software-Defined Network for Containers and DockerPipework: Software-Defined Network for Containers and Docker
Pipework: Software-Defined Network for Containers and DockerJérôme Petazzoni
 
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 NetworkingSreenivas Makam
 
Operational Buddhism: Building Reliable Services From Unreliable Components -...
Operational Buddhism: Building Reliable Services From Unreliable Components -...Operational Buddhism: Building Reliable Services From Unreliable Components -...
Operational Buddhism: Building Reliable Services From Unreliable Components -...Ernie Souhrada
 
DPC 2016 - 53 Minutes or Less - Architecting For Failure
DPC 2016 - 53 Minutes or Less - Architecting For FailureDPC 2016 - 53 Minutes or Less - Architecting For Failure
DPC 2016 - 53 Minutes or Less - Architecting For Failurebenwaine
 
Building a network emulator with Docker and Open vSwitch
Building a network emulator with Docker and Open vSwitchBuilding a network emulator with Docker and Open vSwitch
Building a network emulator with Docker and Open vSwitchGoran Cetusic
 
Distributed Systems Theory for Mere Mortals
Distributed Systems Theory for Mere MortalsDistributed Systems Theory for Mere Mortals
Distributed Systems Theory for Mere MortalsEnsar Basri Kahveci
 
Introduction to Docker by Adrian Mouat
Introduction to Docker by Adrian MouatIntroduction to Docker by Adrian Mouat
Introduction to Docker by Adrian MouatContainer Solutions
 
Networking in virtual machines
Networking in virtual machinesNetworking in virtual machines
Networking in virtual machinesLINE+
 
Virtualbox step by step guide
Virtualbox step by step guideVirtualbox step by step guide
Virtualbox step by step guideHock Leng PUAH
 
Docker-OVS
Docker-OVSDocker-OVS
Docker-OVSsnrism
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introductionrajdeep
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriDocker, Inc.
 

Destacado (20)

Docker Networking Deep Dive
Docker Networking Deep DiveDocker Networking Deep Dive
Docker Networking Deep Dive
 
Docker Networking (Libnetwork) - Lakshman Kumar
Docker Networking (Libnetwork) - Lakshman KumarDocker Networking (Libnetwork) - Lakshman Kumar
Docker Networking (Libnetwork) - Lakshman Kumar
 
Kernel load-balancing for Docker containers using IPVS
Kernel load-balancing for Docker containers using IPVSKernel load-balancing for Docker containers using IPVS
Kernel load-balancing for Docker containers using IPVS
 
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
 
pipework - Advanced Docker Networking
pipework - Advanced Docker Networkingpipework - Advanced Docker Networking
pipework - Advanced Docker Networking
 
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
 
Pipework: Software-Defined Network for Containers and Docker
Pipework: Software-Defined Network for Containers and DockerPipework: Software-Defined Network for Containers and Docker
Pipework: Software-Defined Network for Containers and Docker
 
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
 
Operational Buddhism: Building Reliable Services From Unreliable Components -...
Operational Buddhism: Building Reliable Services From Unreliable Components -...Operational Buddhism: Building Reliable Services From Unreliable Components -...
Operational Buddhism: Building Reliable Services From Unreliable Components -...
 
DPC 2016 - 53 Minutes or Less - Architecting For Failure
DPC 2016 - 53 Minutes or Less - Architecting For FailureDPC 2016 - 53 Minutes or Less - Architecting For Failure
DPC 2016 - 53 Minutes or Less - Architecting For Failure
 
Building a network emulator with Docker and Open vSwitch
Building a network emulator with Docker and Open vSwitchBuilding a network emulator with Docker and Open vSwitch
Building a network emulator with Docker and Open vSwitch
 
Virtualbox networking
Virtualbox networkingVirtualbox networking
Virtualbox networking
 
Docker Networking
Docker NetworkingDocker Networking
Docker Networking
 
Distributed Systems Theory for Mere Mortals
Distributed Systems Theory for Mere MortalsDistributed Systems Theory for Mere Mortals
Distributed Systems Theory for Mere Mortals
 
Introduction to Docker by Adrian Mouat
Introduction to Docker by Adrian MouatIntroduction to Docker by Adrian Mouat
Introduction to Docker by Adrian Mouat
 
Networking in virtual machines
Networking in virtual machinesNetworking in virtual machines
Networking in virtual machines
 
Virtualbox step by step guide
Virtualbox step by step guideVirtualbox step by step guide
Virtualbox step by step guide
 
Docker-OVS
Docker-OVSDocker-OVS
Docker-OVS
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
 

Similar a Docker Networking Deep Dive: Understanding Libnetwork, CNM and New 1.12 Features

Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Ajeet Singh Raina
 
Docker Networking: Control plane and Data plane
Docker Networking: Control plane and Data planeDocker Networking: Control plane and Data plane
Docker Networking: Control plane and Data planeDocker, Inc.
 
What's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
What's New in Docker 1.12 by Mike Goelzer and Andrea LuzzardiWhat's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
What's New in Docker 1.12 by Mike Goelzer and Andrea LuzzardiDocker, Inc.
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiWhat's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiMike Goelzer
 
Docker Meetup: Docker Networking 1.11 with Madhu Venugopal
Docker Meetup: Docker Networking 1.11 with Madhu VenugopalDocker Meetup: Docker Networking 1.11 with Madhu Venugopal
Docker Meetup: Docker Networking 1.11 with Madhu VenugopalDocker, Inc.
 
Docker 1.11 Meetup: Networking Showcase
Docker 1.11 Meetup: Networking ShowcaseDocker 1.11 Meetup: Networking Showcase
Docker 1.11 Meetup: Networking ShowcaseDocker, Inc.
 
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...Guillaume Morini
 
AstriCon 2017 - Docker Swarm & Asterisk
AstriCon 2017  - Docker Swarm & AsteriskAstriCon 2017  - Docker Swarm & Asterisk
AstriCon 2017 - Docker Swarm & AsteriskEvan McGee
 
Private cloud networking_cloudstack_days_austin
Private cloud networking_cloudstack_days_austinPrivate cloud networking_cloudstack_days_austin
Private cloud networking_cloudstack_days_austinChiradeep Vittal
 
Docker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesSreenivas Makam
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresDocker, Inc.
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 PresentationSreenivas Makam
 
Load Balancing 101
Load Balancing 101Load Balancing 101
Load Balancing 101HungWei Chiu
 
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 dockerJorge Juan Mendoza
 
COSCUP 2019 - CDN in an Edge Box
COSCUP 2019 - CDN in an Edge BoxCOSCUP 2019 - CDN in an Edge Box
COSCUP 2019 - CDN in an Edge BoxShihta Kuan
 
Open stackaustinmeetupsept21
Open stackaustinmeetupsept21Open stackaustinmeetupsept21
Open stackaustinmeetupsept21Brent Doncaster
 
Docker HK Meetup - 201707
Docker HK Meetup - 201707Docker HK Meetup - 201707
Docker HK Meetup - 201707Clarence Ho
 
DockerCon EU 2015: Docker Networking Deep Dive
DockerCon EU 2015: Docker Networking Deep DiveDockerCon EU 2015: Docker Networking Deep Dive
DockerCon EU 2015: Docker Networking Deep DiveDocker, Inc.
 

Similar a Docker Networking Deep Dive: Understanding Libnetwork, CNM and New 1.12 Features (20)

Demystfying container-networking
Demystfying container-networkingDemystfying container-networking
Demystfying container-networking
 
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
 
Docker Networking: Control plane and Data plane
Docker Networking: Control plane and Data planeDocker Networking: Control plane and Data plane
Docker Networking: Control plane and Data plane
 
What's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
What's New in Docker 1.12 by Mike Goelzer and Andrea LuzzardiWhat's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
What's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea LuzzardiWhat's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
 
Docker Meetup: Docker Networking 1.11 with Madhu Venugopal
Docker Meetup: Docker Networking 1.11 with Madhu VenugopalDocker Meetup: Docker Networking 1.11 with Madhu Venugopal
Docker Meetup: Docker Networking 1.11 with Madhu Venugopal
 
Docker 1.11 Meetup: Networking Showcase
Docker 1.11 Meetup: Networking ShowcaseDocker 1.11 Meetup: Networking Showcase
Docker 1.11 Meetup: Networking Showcase
 
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
 
AstriCon 2017 - Docker Swarm & Asterisk
AstriCon 2017  - Docker Swarm & AsteriskAstriCon 2017  - Docker Swarm & Asterisk
AstriCon 2017 - Docker Swarm & Asterisk
 
Private cloud networking_cloudstack_days_austin
Private cloud networking_cloudstack_days_austinPrivate cloud networking_cloudstack_days_austin
Private cloud networking_cloudstack_days_austin
 
Docker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting Techniques
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 Presentation
 
Load Balancing 101
Load Balancing 101Load Balancing 101
Load Balancing 101
 
OpenStack Quantum
OpenStack QuantumOpenStack Quantum
OpenStack Quantum
 
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
 
COSCUP 2019 - CDN in an Edge Box
COSCUP 2019 - CDN in an Edge BoxCOSCUP 2019 - CDN in an Edge Box
COSCUP 2019 - CDN in an Edge Box
 
Open stackaustinmeetupsept21
Open stackaustinmeetupsept21Open stackaustinmeetupsept21
Open stackaustinmeetupsept21
 
Docker HK Meetup - 201707
Docker HK Meetup - 201707Docker HK Meetup - 201707
Docker HK Meetup - 201707
 
DockerCon EU 2015: Docker Networking Deep Dive
DockerCon EU 2015: Docker Networking Deep DiveDockerCon EU 2015: Docker Networking Deep Dive
DockerCon EU 2015: Docker Networking Deep Dive
 

Último

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Último (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Docker Networking Deep Dive: Understanding Libnetwork, CNM and New 1.12 Features

  • 1. Docker Networking Deep Dive @MadhuVenugopal online meetup 08/24/2016
  • 2. • What is libnetwork • CNM • 1.12 Features • Multihost networking • Secured Control plane & Data plane • Service Discovery • Native Loadbalacing • Routing Mesh • Demo Agenda
  • 4. It is not just a driver interface • Docker networking fabric • Defines Container Networking Model • Provides builtin IP address management • Provides native multi-host networking • Provides native Service Discovery and Load Balancing • Allows for extensions by the ecosystem via plugins What is libnetwork?
  • 5. Design Philosophy • Users First: • Application Developers • IT/Network Ops • Plugin API Design • Batteries Included but Swappable
  • 6. Docker Networking 1.7 1.8 1.9 1.10 1.11 - Libnetwork - CNM - Migrated Bridge, host, none drivers to CNM - Multihost Networking - Network Plugins - IPAM Plugins - Network UX/API Service Discovery
 (using /etc/hosts) Distributed DNS - Aliases - DNS Round Robin LB 1.12 - Load Balancing - Encrypted Control and data plane - Routing Mesh - Built-in Swarm-mode networking
  • 7. Container Networking Model • Endpoint • Network • Sandbox • Drivers & Plugins https://github.com/docker/libnetwork/blob/master/docs/design.md
  • 10. eth0 eth0 eth0 docker0 docker0 docker0 C1 eth0 eth0 C2 eth0 C3 C1 eth0 eth0 C2 eth0 C3 C1 eth0 eth0 C2 eth0 C3 ToR switch / Hypervisor switch / … iptables : 
 NAT / port-mapping iptables : 
 NAT / port-mapping iptables : 
 NAT / port-mapping
  • 12. Host1 : 
 $ docker network create -d bridge -o com.docker.network.bridge.name=brnet brnet
 $ docker run --net=brnet -it busybox ifconfig eth0 brnet 172.18.0.1 ToR switch / Hypervisor switch / … eth0 C1 Host1 eth0 C2 eth0 C3 iptables : 
 NAT / port-mapping eth0 brnet 172.18.0.1 eth0 C4 Host2 eth0 C5 eth0 C6 iptables : 
 NAT / port-mapping eth0 brnet 172.18.0.1 eth0 C7 Host3 eth0 C8 eth0 C9 iptables : 
 NAT / port-mapping Host2 : 
 $ docker network create -d bridge -o com.docker.network.bridge.name=brnet brnet
 $ docker run --net=brnet -it busybox ifconfig Host3 : 
 $ docker network create -d bridge -o com.docker.network.bridge.name=brnet brnet
 $ docker run --net=brnet -it busybox ifconfig
  • 13. Use-case3 Bridge Network plumbed to underlay with built-in IPAM
 (no NAT / Port-mapping)
  • 14. Host1 : 
 $ docker network create -d bridge --subnet=192.168.57.0/24 --ip-range=192.168.57.32/28 --gateway=192.168.57.11 --aux-address DefaultGatewayIPv4=192.168.57.1 -o com.docker.network.bridge.name=brnet brnet $ brctl addif brnet eth2
 $ docker run --net=brnet -it busybox ifconfig Host2 : $ docker network create -d bridge --subnet=192.168.57.0/24 --ip-range=192.168.57.64/28 --gateway=192.168.57.12 --aux-address DefaultGatewayIPv4=192.168.57.1 -o com.docker.network.bridge.name=brnet brnet
 $ brctl addif brnet eth2
 $ docker run --net=brnet -it busybox ifconfig Host3 : $ docker network create -d bridge --subnet=192.168.57.0/24 --ip-range=192.168.57.128/28 --gateway=192.168.57.13 --aux-address DefaultGatewayIPv4=192.168.57.1 -o com.docker.network.bridge.name=brnet brnet $ brctl addif brnet eth2
 $ docker run --net=brnet -it busybox ifconfig eth2
 192.168.57.11 brnet 192.168.57.11 ToR switch / Hypervisor switch / Virtual-box host-only / … (Gateway : 192.168.57.1) eth0 C1 Host1 eth0 C2 eth0 C3 eth2
 192.168.57.12 brnet 192.168.57.12 eth0 C4 eth0 C5 eth0 C6 eth2
 192.168.57.13 brnet 192.168.57.13 eth0 C7 eth0 C8 eth0 C9 Host2 Host3
  • 16. eth0 C1 eth1 eth1 eth1 ToR switch / Hypervisor switch / … docker0docker_gwbridge eth0 eth1 eth1 eth1 docker0docker_gwbridge eth0 eth1 eth1 eth1 docker0docker_gwbridge ov-net1 ov-net1 ov-net1 VXLAN-VNI 100 VXLAN-VNI 100 eth0 eth0 eth0 eth0 eth0 eth0 eth0 eth0 eth0 VXLAN-VNI 100 iptables : 
 NAT / port-mapping iptables : 
 NAT / port-mapping iptables : 
 NAT / port-mapping Docker overlay networking C2 C3 C4 C5 C6 C7 C8 C9
  • 17. Use-case5 Plumbed to underlay vlan with built-in IPAM macvlan driver (& experimental ipvlan) https://github.com/docker/docker/blob/master/experimental/vlan-networks.md
  • 18. # vlan 10 (eth0.10) $ docker network create -d macvlan —subnet=10.1.10.0/24 — gateway=10.1.10.1 -o parent=eth0.10 mcvlan10 $ docker run --net=mcvlan10 -it --rm alpine /bin/sh # vlan 20 (eth0.20) $ docker network create -d macvlan —subnet=10.1.20.0/24 — gateway=10.1.20.1 -o parent=eth0.20 mcvlan20 $ docker run --net=mcvlan20 -it --rm alpine /bin/sh # vlan 30 (eth0.30) $ docker network create -d macvlan —subnet=10.1.30.0/24 — gateway=10.1.30.1 -o parent=eth0.30 mcvlan30 $ docker run --net=mcvlan30 -it --rm alpine /bin/sh
  • 20. New features in 1.12 swarm mode CNM Routing Mesh Multi-host Networking without external k/v store Service Discovery Secure
 Data-Plane Secure
 Control-Plane Load
 Balancing • Cluster aware • De-centralized control plane • Highly scalable
  • 21. Swarm-mode Multi-host networking Manager Network Create Orchestrator Allocator Scheduler Dispatcher Service Create Task Create Task Dispatch Task Dispatch Gossip Worker1 Worker2 Engine Libnetwork Engine Libnetwork • VXLAN based data path • No external key-value store • Central resource allocation • Improved performance • Highly scalable
  • 22. • Gossip based protocol • Network scoped • Fast convergence • Secure by default • periodic key rotations • swarm native key-exchange • Gossips control messages • Routing-states • Service-discovery • Plugin-data • Highly scalable Secured network control plane Cluster Scope Gossip W1 W2 W3 W1 W5 W4 Network Scope Gossip Network Scope Gossip
  • 23. • Available as an option during overlay network creation • Uses kernel IPSec modules • On-demand tunnel setup • Swarm native key-exchange • Periodic key rotations Secure dataplane Worker1 Worker2 Worker3 secure network secure network IPSec Tunnel IPSec Tunnel IPSec Tunnel secure network secure network non- secure network non- secure network Open UDP traffic
  • 24. • Provided by embedded DNS • Highly available • Uses Network Control Plane to learn state • Can be used to discover both tasks and services Service Discovery engine DNS Server DNS Resolver DNS Resolver DNS requests
  • 25. • Internal & Ingress load-balancing • Supports VIP & DNS-RR • Highly available • Uses Network Control Plane to learn state • Minimal Overhead Load balancer Task1 ServiceA Task2 ServiceA Task3 ServiceA Client1 Client2 VIP LB VIP LB
  • 26. • Builtin routing mesh for edge routing • Worker nodes themselves participate in ingress routing mesh • All worker nodes accept connection requests on PublishedPort • Port translation happens at the worker node • Same internal load balancing mechanism used to load balance external requests Routing mesh External Loadbalancer (optional) Task1 ServiceA Task1 ServiceA Task1 ServiceA Worker1 Worker2 Ingress Network 8080 8080 VIP LB VIP LB 8080->80 8080->80
  • 27. Routing Mesh • Operator reserves a swarm- wide ingress port (8080) for myapp • Every node listens on 8080 • Container-aware routing mesh can transparently reroute traffic from Worker3 to a node that is running container • Built in load balancing into the Engine • DNS-based service discovery Worker 1 :8080 Manager User accesses myapp.com:8080:8080 Worker 2 :8080 Worker 3 :8080 frontend frontend $ docker service create --replicas 3 --name frontend --network mynet --publish 8080:80/tcp frontend_image:latest frontend
  • 28. Routing Mesh: Published Ports • Operator reserves a swarm- wide ingress port (8080) for myapp • Every node listens on 8080 • Container-aware routing mesh can transparently reroute traffic from Worker3 to a node that is running container • Built in load balancing into the Engine • DNS-based service discovery Worker 1 :8080 Manager User accesses myapp.com:8080:8080 Worker 2 :8080 Worker 3 :8080 frontend frontend $ docker service create --replicas 3 --name frontend --network mynet --publish 8080:80/tcp frontend_image:latest frontend
  • 30. Service , Port-Publish & Network iptables eth0 Host1 default_gwbridge ingress-sbox eth1 ingress-overlay-bridge Ingress- Network eth0 vxlan tunnel to host2 - vni-100vxlan tunnel to host3 - vni-100 eth0 Container-sbox eth1 eth2 mynet mynet-br vxlan tunnel to host2 - vni-101 docker service create —name=test —network=mynet -p 8080:80 —replicas=2 xxx iptables ipvs iptables ipvs Host1: 8080 DNS Resolver daemon embedded 
 DNS server
 service -> VIP
  • 31. Day in life of a packet - IPTables & IPVS
  • 32. Day in life of a packet - Routing Mesh & Ingress LB iptables NAT table
 DOCKER-INGRESS DNAT : Published-Port -> ingress-sbox eth0 Host1 default_gwbridge ingress-sboxeth1 iptables NAT table
 PREROUTING Redirect -> service-port iptables MANGLE table
 PREROUTING MARK : Published-Port -> <fw-mark-id> IPVS Match <fw-mark-id> -> Masq {RR across container-IPs) ingress-overlay-bridge Ingress- Network eth0 iptables NAT table
 DOCKER-INGRESS DNAT : Published-Port -> ingress-sbox eth0 Host2 default_gwbridge ingress-sbox eth1 ingress-overlay-bridge eth0 vxlan tunnel with vni Ingress- Network eth0 Container-sbox (backs a task/ service) eth1
  • 33. Day in life of a packet - Internal LB eth0 Host1 container-sbox
 (service1) eth1 iptables MANGLE table
 OUTPUT MARK : VIP -> <fw-mark-id> IPVS Match <fw-mark-id> -> Masq {RR across container-IPs) mynet-overlay-bridge mynet eth2 Host2 mynet-overlay-bridgevxlan tunnel with vni mynet eth2 Container-sbox (service2) Application looks up service2 (using embedded-DNS @ 127.0.0.11) DNS Resolver daemon embedded DNS server
 service2 -> VIP2 vxlan tunnel with vni