SlideShare a Scribd company logo
4
Most read
8
Most read
9
Most read
Docker Networking
@MadhuVenugopal
@mrjana
Control-plane & Data-plane
•Docker Networking
•Features
•Control plane & Data plane
•Deep Dive
•Control plane
•Data plane
•Q & A
Agenda
Docker Networking
1.7 1.8 1.9 1.10 1.11
- Libnetwork
- CNM
- Migrated Bridge, host,
none drivers to CNM
- Overlay Driver
- 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
Networking planes
Management plane
Control plane
Data plane
UX, CLI, REST-API, SNMP, …
Distributed (OSPF, BGP, Gossip-based), Centralized(OpenFlow, OVSDB)
User/Operator/Tools managing Network Infrastructure
Signaling between network entities to exchange reachability states
Actual movement of application data packets
IPTables, IPVS, OVS-DP, DPDK, BPF, Routing Tables, …
Docker networking planes
Management plane
Control plane
Data plane
Network-Scoped Gossip, Service-Discovery, Encryption key distribution
Docker network UX, APIs and Network mgmt plugins
Network plugins and built-in drivers
Bridge, Overlay, macvlan, ipvlan, host, all other plugins…
Libnetwork core & swarmkit allocator
Deep Dive - Control Plane
Control plane components
• Centralized resources and policies
• De-centralized events
Centralized resources and policies
Manager
Network
Create
Orchestrator
Allocator
Scheduler
Dispatcher
Service
Create
Task
Create
Task
Dispatch
Task
Dispatch
Gossip
Worker1 Worker2
Engine
Libnetwork
Engine
Libnetwork
• Resources and policies are defined
centrally
• Networks are a definition of policy
• Central resource allocation (IP
Subnets, Addresses, VNIs)
• Can mutate state as long as
managers are available
• State is learned through de-
centralized dissemination of
events
• Gossip based protocol
• Fast convergence
• Highly scalable
• Continues to function even if all
managers are Down
De-centralized events
Swarm Scope Gossip
W1
W2
W3
W1
W5
W4
Network Scope Gossip
Network Scope Gossip
• Completely de-centralized discovery of cluster nodes
• Cluster membership is discovered using an implementation of Scalable
Weakly-consistent Infection-style Process Group Membership Protocol
(SWIM)
• Two kinds of cluster membership:
• Swarm level
• Network level
• Sequentially consistent state dissemination ordered by a lamport clock
• Single writer at a record/entry level
• Convergence time roughly has a O(logn) asymptotic time complexity
Gossip in detail
Failure detection
Node A
Periodic probe node
based on
randomized round
robin
Node BXRandom node fails
to ack
Random
Node C
Random
Node D
Random
Node E
Suspect Node
B
Suspect
Timeout Dead
Node B 9 More
nodes
receive
rebroadcast
Rebroadcast
Entire cluster
receives
rebroadcast
Rebroadcast
State dissemination
Node A
Broadcast state
change to unto 3
nodes which
participate in the
network that this
entry belongs to
Random
Node C
Random
Node D
Random
Node E
9 More
nodes
receive
rebroadcast
Rebroadcast
Entire cluster
receives
rebroadcast
Rebroadcast
Accept state update only if
entry’s lamport time is greater
than the lamport time of
existing entry
Random
Node F
Periodic bulk sync of the
entire state for a single
network to a random node
participating in that
network
Deep Dive - Data Plane
Overlay driver
Overlay Networking Under the Hood
• Virtual eXtensible Local Area Network(VXLAN) data transport
• L2 Network over an L3 network ( overlay )
• RFC7348
• Host as VXLAN Tunnel End Point (VTEP)
• Point-to-Multi-Point Tunnels
• Proxy-ARP
Overlay Networking Under the Hood
• A Linux Bridge per Subnet per Overlay Network per Host
• A VXLAN interface per Subnet per Overlay Network per Host
• 1 Linux Bridge per Host for default traffic (docker_gwbridge)
• Lazy creation ( Only if container is attached to network)
Overlay Networking Under the Hood
C1
C2
C3
C5
C4
br0
Veth
Veth
Veth
Host NIC
VXLAN
Host NIC
br0
Veth
Veth
VXLAN
Docker Host 1 Docker Host 2
Linux Kernel NetFilter dataflow
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 - 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
• 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
8080->80
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 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
iptables NAT table
PREROUTING
Redirect -> target-port
Q&A

More Related Content

ODP
Introduction to Ansible
PDF
IT Automation with Ansible
PDF
Automation with ansible
PDF
Common issues with Apache Kafka® Producer
PPTX
Message Broker System and RabbitMQ
PDF
Apache Kafka Architecture & Fundamentals Explained
PPTX
A visual introduction to Apache Kafka
PDF
Fundamentals of Apache Kafka
Introduction to Ansible
IT Automation with Ansible
Automation with ansible
Common issues with Apache Kafka® Producer
Message Broker System and RabbitMQ
Apache Kafka Architecture & Fundamentals Explained
A visual introduction to Apache Kafka
Fundamentals of Apache Kafka

What's hot (20)

PPTX
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
PDF
ksqlDB로 실시간 데이터 변환 및 스트림 처리
PDF
Kubernetes - introduction
PDF
Linux Container Technology 101
PDF
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
PPTX
Kafka presentation
PPTX
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
PDF
Introduction to the Disruptor
PDF
Ansible - Hands on Training
PPTX
Automating with Ansible
PDF
Getting started with Ansible
PPTX
Zookeeper 활용 nifi clustering
PPTX
Introduction to Apache Kafka
PPTX
Apache Kafka at LinkedIn
PDF
Ansible - Introduction
PPTX
PDF
DevOps with Ansible
PDF
Apache Kafka Introduction
PDF
Improving fault tolerance and scaling out in Kafka Streams with Bill Bejeck |...
PDF
Kafka Deep Dive
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
ksqlDB로 실시간 데이터 변환 및 스트림 처리
Kubernetes - introduction
Linux Container Technology 101
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kafka presentation
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
Introduction to the Disruptor
Ansible - Hands on Training
Automating with Ansible
Getting started with Ansible
Zookeeper 활용 nifi clustering
Introduction to Apache Kafka
Apache Kafka at LinkedIn
Ansible - Introduction
DevOps with Ansible
Apache Kafka Introduction
Improving fault tolerance and scaling out in Kafka Streams with Bill Bejeck |...
Kafka Deep Dive
Ad

Viewers also liked (20)

PDF
Docker Networking Deep Dive
PDF
containerd and CRI
PPTX
Docker 101 - Nov 2016
PPTX
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
PPTX
Docker Online Meetup: Announcing Docker CE + EE
PPTX
Prometheus design and philosophy
PPTX
Containerd - core container runtime component
PDF
Persistent storage tailored for containers
PPTX
Docker networking Tutorial 101
PDF
Driving containerd operations with gRPC
PPTX
Docker Roadshow 2016
PDF
Online Meetup: What's new in docker 1.13.0
PPTX
Docker networking basics & coupling with Software Defined Networks
PDF
Heart of the SwarmKit: Store, Topology & Object Model
PDF
Unikernels: the rise of the library hypervisor in MirageOS
PDF
'The History of Metrics According to me' by Stephen Day
PDF
Talking TUF: Securing Software Distribution
PDF
Docker Online Meetup: Infrakit update and Q&A
PDF
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...
PPTX
Orchestrating Least Privilege by Diogo Monica
Docker Networking Deep Dive
containerd and CRI
Docker 101 - Nov 2016
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker Online Meetup: Announcing Docker CE + EE
Prometheus design and philosophy
Containerd - core container runtime component
Persistent storage tailored for containers
Docker networking Tutorial 101
Driving containerd operations with gRPC
Docker Roadshow 2016
Online Meetup: What's new in docker 1.13.0
Docker networking basics & coupling with Software Defined Networks
Heart of the SwarmKit: Store, Topology & Object Model
Unikernels: the rise of the library hypervisor in MirageOS
'The History of Metrics According to me' by Stephen Day
Talking TUF: Securing Software Distribution
Docker Online Meetup: Infrakit update and Q&A
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...
Orchestrating Least Privilege by Diogo Monica
Ad

Similar to Docker Networking: Control plane and Data plane (20)

PDF
Docker 1.12 networking deep dive
PDF
Osnug meetup-tungsten fabric - overview.pptx
PPTX
DCUS17 : Docker networking deep dive
PPTX
Scaling OpenStack Networking Beyond 4000 Nodes with Dragonflow - Eshed Gal-Or...
PPTX
Dragonflow 01 2016 TLV meetup
PDF
Demystfying container-networking
PPT
CloudStack and SDN
PDF
Openstack Networking Internals - first part
PDF
Hungary Usergroup - Midonet overlay programming
PPTX
Harmonia open iris_basic_v0.1
PDF
rtnetlink
PDF
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
PDF
Docker Multihost Networking
PDF
LinuxCon 2015 Stateful NAT with OVS
PDF
2015 FOSDEM - OVS Stateful Services
PDF
Netforce: extending neutron to support routed networks at scale in ebay
PDF
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
PPTX
Open stackaustinmeetupsept21
PPTX
Network and Service Virtualization tutorial at ONUG Spring 2015
PPTX
BRKDCT-2445 Agile OpenStack Networking with Cisco Solutions - Cisco Live! US ...
Docker 1.12 networking deep dive
Osnug meetup-tungsten fabric - overview.pptx
DCUS17 : Docker networking deep dive
Scaling OpenStack Networking Beyond 4000 Nodes with Dragonflow - Eshed Gal-Or...
Dragonflow 01 2016 TLV meetup
Demystfying container-networking
CloudStack and SDN
Openstack Networking Internals - first part
Hungary Usergroup - Midonet overlay programming
Harmonia open iris_basic_v0.1
rtnetlink
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Docker Multihost Networking
LinuxCon 2015 Stateful NAT with OVS
2015 FOSDEM - OVS Stateful Services
Netforce: extending neutron to support routed networks at scale in ebay
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
Open stackaustinmeetupsept21
Network and Service Virtualization tutorial at ONUG Spring 2015
BRKDCT-2445 Agile OpenStack Networking with Cisco Solutions - Cisco Live! US ...

More from Docker, Inc. (20)

PDF
Containerize Your Game Server for the Best Multiplayer Experience
PDF
How to Improve Your Image Builds Using Advance Docker Build
PDF
Build & Deploy Multi-Container Applications to AWS
PDF
Securing Your Containerized Applications with NGINX
PDF
How To Build and Run Node Apps with Docker and Compose
PDF
Hands-on Helm
PDF
Distributed Deep Learning with Docker at Salesforce
PDF
The First 10M Pulls: Building The Official Curl Image for Docker Hub
PDF
Monitoring in a Microservices World
PDF
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
PDF
Predicting Space Weather with Docker
PDF
Become a Docker Power User With Microsoft Visual Studio Code
PDF
How to Use Mirroring and Caching to Optimize your Container Registry
PDF
Monolithic to Microservices + Docker = SDLC on Steroids!
PDF
Kubernetes at Datadog Scale
PDF
Labels, Labels, Labels
PDF
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
PDF
Build & Deploy Multi-Container Applications to AWS
PDF
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
PDF
Developing with Docker for the Arm Architecture
Containerize Your Game Server for the Best Multiplayer Experience
How to Improve Your Image Builds Using Advance Docker Build
Build & Deploy Multi-Container Applications to AWS
Securing Your Containerized Applications with NGINX
How To Build and Run Node Apps with Docker and Compose
Hands-on Helm
Distributed Deep Learning with Docker at Salesforce
The First 10M Pulls: Building The Official Curl Image for Docker Hub
Monitoring in a Microservices World
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
Predicting Space Weather with Docker
Become a Docker Power User With Microsoft Visual Studio Code
How to Use Mirroring and Caching to Optimize your Container Registry
Monolithic to Microservices + Docker = SDLC on Steroids!
Kubernetes at Datadog Scale
Labels, Labels, Labels
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Build & Deploy Multi-Container Applications to AWS
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
Developing with Docker for the Arm Architecture

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
Teaching material agriculture food technology
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Machine Learning_overview_presentation.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Cloud computing and distributed systems.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
Digital-Transformation-Roadmap-for-Companies.pptx
Programs and apps: productivity, graphics, security and other tools
The AUB Centre for AI in Media Proposal.docx
20250228 LYD VKU AI Blended-Learning.pptx
Teaching material agriculture food technology
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectroscopy.pptx food analysis technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
A Presentation on Artificial Intelligence
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Machine Learning_overview_presentation.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?

Docker Networking: Control plane and Data plane

  • 2. •Docker Networking •Features •Control plane & Data plane •Deep Dive •Control plane •Data plane •Q & A Agenda
  • 3. Docker Networking 1.7 1.8 1.9 1.10 1.11 - Libnetwork - CNM - Migrated Bridge, host, none drivers to CNM - Overlay Driver - 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
  • 4. Networking planes Management plane Control plane Data plane UX, CLI, REST-API, SNMP, … Distributed (OSPF, BGP, Gossip-based), Centralized(OpenFlow, OVSDB) User/Operator/Tools managing Network Infrastructure Signaling between network entities to exchange reachability states Actual movement of application data packets IPTables, IPVS, OVS-DP, DPDK, BPF, Routing Tables, …
  • 5. Docker networking planes Management plane Control plane Data plane Network-Scoped Gossip, Service-Discovery, Encryption key distribution Docker network UX, APIs and Network mgmt plugins Network plugins and built-in drivers Bridge, Overlay, macvlan, ipvlan, host, all other plugins… Libnetwork core & swarmkit allocator
  • 6. Deep Dive - Control Plane
  • 7. Control plane components • Centralized resources and policies • De-centralized events
  • 8. Centralized resources and policies Manager Network Create Orchestrator Allocator Scheduler Dispatcher Service Create Task Create Task Dispatch Task Dispatch Gossip Worker1 Worker2 Engine Libnetwork Engine Libnetwork • Resources and policies are defined centrally • Networks are a definition of policy • Central resource allocation (IP Subnets, Addresses, VNIs) • Can mutate state as long as managers are available
  • 9. • State is learned through de- centralized dissemination of events • Gossip based protocol • Fast convergence • Highly scalable • Continues to function even if all managers are Down De-centralized events Swarm Scope Gossip W1 W2 W3 W1 W5 W4 Network Scope Gossip Network Scope Gossip
  • 10. • Completely de-centralized discovery of cluster nodes • Cluster membership is discovered using an implementation of Scalable Weakly-consistent Infection-style Process Group Membership Protocol (SWIM) • Two kinds of cluster membership: • Swarm level • Network level • Sequentially consistent state dissemination ordered by a lamport clock • Single writer at a record/entry level • Convergence time roughly has a O(logn) asymptotic time complexity Gossip in detail
  • 11. Failure detection Node A Periodic probe node based on randomized round robin Node BXRandom node fails to ack Random Node C Random Node D Random Node E Suspect Node B Suspect Timeout Dead Node B 9 More nodes receive rebroadcast Rebroadcast Entire cluster receives rebroadcast Rebroadcast
  • 12. State dissemination Node A Broadcast state change to unto 3 nodes which participate in the network that this entry belongs to Random Node C Random Node D Random Node E 9 More nodes receive rebroadcast Rebroadcast Entire cluster receives rebroadcast Rebroadcast Accept state update only if entry’s lamport time is greater than the lamport time of existing entry Random Node F Periodic bulk sync of the entire state for a single network to a random node participating in that network
  • 13. Deep Dive - Data Plane Overlay driver
  • 14. Overlay Networking Under the Hood • Virtual eXtensible Local Area Network(VXLAN) data transport • L2 Network over an L3 network ( overlay ) • RFC7348 • Host as VXLAN Tunnel End Point (VTEP) • Point-to-Multi-Point Tunnels • Proxy-ARP
  • 15. Overlay Networking Under the Hood • A Linux Bridge per Subnet per Overlay Network per Host • A VXLAN interface per Subnet per Overlay Network per Host • 1 Linux Bridge per Host for default traffic (docker_gwbridge) • Lazy creation ( Only if container is attached to network)
  • 16. Overlay Networking Under the Hood C1 C2 C3 C5 C4 br0 Veth Veth Veth Host NIC VXLAN Host NIC br0 Veth Veth VXLAN Docker Host 1 Docker Host 2
  • 18. 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
  • 19. 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
  • 20. • 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 8080->80
  • 21. 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 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 iptables NAT table PREROUTING Redirect -> target-port
  • 22. Q&A