SlideShare una empresa de Scribd logo
1 de 35
Page1 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Networking in Containers
Attila Kanto
Page2 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Agenda
• How networking works in Docker
• Container Network Model
• Networking plugin
Page3 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Containers
• Isolate and package applications
• Resources (CPU, memory, IO)
• Namespaces (pid, users, network, uts, mnt )
• Storage (device mapper, overlayfs, aufs, btrfs)
• Security (capabilities)
Page4 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Network
• UTS namespace
• isolate hostname
• Network namespace
• network interface(s)
• loopback device
• routing table
• iptable rules
Page5 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Basic networking overview
5
Page6 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Networking without Docker
eth0
iptables
route
Page7 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Networking without Docker
 ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
ether 33:83:5a:44:50:ff txqueuelen 0 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
Page8 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Networking without Docker
 ifconfig
eth0:
inet 192.168.1.100
ether 33:83:5a:44:50:ff
OSI Layers (1 – 4)
Page9 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Networking without Docker
 route -n
Destination Gateway Genmask Iface
0.0.0.0 192.168.1.1 0.0.0.0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 eth0
 iptables -t nat -L
target prot opt source destination
Page10 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Networking without Docker
eth0
iptables
route
192.168.1.0/24 -> eth0
0.0.0.0 -> 192.168.1.1 (eth0)
192.168.1.100
Page11 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Networking with Docker
11
Page12 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Install Docker
eth0
iptables
MASQUERADE 172.17.0.0/16
route
192.168.1.0/24 -> eth0
0.0.0.0 -> 192.168.1.1 (eth0)
172.17.0.0/16 -> docker0
192.168.1.100 172.17.0.1
docker0
Page13 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Run container / bridged networking
• Docker0 bridge
• already there, created during install
• Network namespace
• container netns needs to be created
• Veth pair
• created during the creation of container
• connects two network namespaces
• External communication
• Only through Network Address Translation (NAT)
Page14 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Run container / bridged networking / 8080 -> 9090
eth0
iptables
MASQUERADE 172.17.0.0/16
DNAT dpt:9090 to:172.17.0.2:8080
route
192.168.1.0/24 -> eth0
0.0.0.0 -> 192.168.1.1 (eth0)
172.17.0.0/16 -> docker0
192.168.1.100 172.17.0.1
docker0
container1ns
eth0vxx
veth
172.17.0.2
route
SRC DST
Client Port 9090
Client IP 192.168.1.100
Client MAC MAC of eth0
SRC DST
Client Port 8080
Client IP 172.17.0.2
SRC DST
Client Port 8080
Client IP 172.17.0.2
MAC of docker0 MAC of eth0
Page15 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Overlay networking with Docker
15
Page16 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Run container / overlay networking
• Bridges
• docker_gwbridge created if does not exist
• br0 in a “hidden” namespace associated with the overlay network
• Network namespace
• container netns needs to be created
• Veth pairs
• connects br0 and and eth0 of container
• connects docker_gwbridge and eth1 of container
• External communication
• Through Network Address Translation (NAT)
• Through VXLAN (other container using the same overlay network)
Page17 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Install Docker (again)
eth0
iptables
MASQUERADE 172.17.0.0/16
route
192.168.1.0/24 -> eth0
0.0.0.0 -> 192.168.1.1 (eth0)
172.17.0.0/16 -> docker0
192.168.1.100 172.17.0.1
docker0
Page18 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Run container / overlay networking
eth0
iptables
route
192.168.1.100
172.18.0.1
docker_gw
container1ns
eth1vxx
veth
172.18.0.2
172.17.0.1
docker0
ns
br0 eth0vyy
veth
10.10.10.210.10.10.1
VXLAN
route
Page19 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Software-defined networking (SDN)
• Separation control and data plane of network
• Control plane
• makes decisions about where traffic is sent
• Data plane
• forward traffic to the selected destination
Page20 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Data Plane (in Docker overlay)
• Virtual Extensible LAN (VXLAN)
• overlay technology
• encapsulates L2 frames as UDP packets
• VTEP – VXLAN Tunnel End Point
• originator and/or terminator of VXLAN tunnel
• VNI – VXLAN Network Identifier
• part of the VXLAN Header
• similar to VLAN ID
Page21 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Data Plane (in Docker overlay)
• Container sends a packet
• ARP (neighbor) table is checked for destination container IP -> MAC
interface mapping
• L2 FDB (forwarding database) is checked to determine IP of destination
VTEP for destination MAC on source VTEP
• packet is encapsulated for destination VTEP with configured VNI and sent
to destination
• destination VTEP de-capsulates the packet
• inner packet is received by the destination container
Page22 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Network Control Plane (in Docker overlay)
Page23 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Container Network Model
23
Page24 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Container Network Model (CNM)
• Sandbox
• holds the config of a container's network stack (DNS, routing, etc.)
• multiple endpoints from multiple networks
• Linux Network Namespace / FreeBSD Jail
• Network
• Group Endpoints that are able to communicate with each-other directly
• Linux Bridge / VXLAN
• Endpoint
• joins Sandbox to Network
• veth pair / ovs patch port
Page25 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Docker libnetwork
• Docker’s networking library
• Implements CNM
• Built-in drivers (in process)
• Network drivers (bridge, overlay)
• IPAM drivers
• Plugin mechanism (off process)
• External Network drivers (Calico, Midonet, my own driver)
• External IPAM drivers
Page26 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Libnetwork plugins
• Implemented using libnetwork’s remote driver
• Running off-process (not in Docker daemon)
• HTTP POSTs with JSON payload
• KV store API not exposed
• can be implemented in any programming language
• KV store
• KV url / credentials needs to be passed in init time
• Can be deployed as container
Page27 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Network plugin API (Network)
• CreateNetwork
• DeleteNetwork
Page28 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Network plugin API (Endpoint)
• CreateEndpoint
• DeleteEndpoint
Page29 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Network plugin API (Join)
• Join
• Join (resp)
Page30 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Floating IP network driver
• Containers on same L2 network
• Connected with Open vSwitch
• IP Address Management
• libnetwork built-in IPAM driver is used
• Externally addressable IP / container
• no Network Address Translation
• no port collision
• extremely fast
• scalability 
Page31 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Run container / floating driver
iptables
route
192.168.1.100
container1ns
172.17.0.1
docker0
floating_bridge
eth0
192.168.10.2
eth1 veth2veth1
container2ns
eth0
192.168.10.3
veth veth
eth0
Page32 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Demo
32
Page33 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
How to use it in Hadoop world
• Using multiple networks
• overlay to create internal network
• floating for exposing servers
Data Node
Data Node
Data Node
Ambari
Master Node
Data Node
Data Node
Data Node
Master Node
Edge Node
OverlayFloating
Page34 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Takeaways
• Since 1.9 Docker networking has improved
• Easy to write a plugin that does certain things better
• Multiple networks can be used by the same container
• Not everybody is happy with it
• Kubernetes http://blog.kubernetes.io/2016/01/why-Kubernetes-doesnt-use-libnetwork.html
• Mesos https://issues.apache.org/jira/browse/MESOS-3828
Page35 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
We are hiring!
35

Más contenido relacionado

La actualidad más candente

CI/CD with Rancher CLI + Jenkins
CI/CD with Rancher CLI + JenkinsCI/CD with Rancher CLI + Jenkins
CI/CD with Rancher CLI + JenkinsGo Chiba
 
Containers orchestrators: Docker vs. Kubernetes
Containers orchestrators: Docker vs. KubernetesContainers orchestrators: Docker vs. Kubernetes
Containers orchestrators: Docker vs. KubernetesDmitry Lazarenko
 
An introduction to Apache Thrift
An introduction to Apache ThriftAn introduction to Apache Thrift
An introduction to Apache ThriftMike Frampton
 
Terraform Tips and Tricks - LAOUC 2022
Terraform Tips and Tricks - LAOUC 2022Terraform Tips and Tricks - LAOUC 2022
Terraform Tips and Tricks - LAOUC 2022Nelson Calero
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionPeng Xiao
 
Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...
Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...
Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...Raphaël PINSON
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondKubeAcademy
 
Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3NGINX, Inc.
 
DTW18 - code08 - Everything You Need To Know About Storage with Kubernetes
DTW18 - code08 - Everything You Need To Know About Storage with KubernetesDTW18 - code08 - Everything You Need To Know About Storage with Kubernetes
DTW18 - code08 - Everything You Need To Know About Storage with KubernetesKendrick Coleman
 
쿠버네티스 기반 PaaS 솔루션 - Playce Kube를 소개합니다.
쿠버네티스 기반 PaaS 솔루션 - Playce Kube를 소개합니다.쿠버네티스 기반 PaaS 솔루션 - Playce Kube를 소개합니다.
쿠버네티스 기반 PaaS 솔루션 - Playce Kube를 소개합니다.Open Source Consulting
 
Juraci Paixão Kröhling - All you need to know about OpenTelemetry
Juraci Paixão Kröhling - All you need to know about OpenTelemetryJuraci Paixão Kröhling - All you need to know about OpenTelemetry
Juraci Paixão Kröhling - All you need to know about OpenTelemetryJuliano Costa
 
Integrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetesIntegrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetesClaus Ibsen
 
Overview of kubernetes network functions
Overview of kubernetes network functionsOverview of kubernetes network functions
Overview of kubernetes network functionsHungWei Chiu
 
Under the Hood: Open vSwitch & OpenFlow in XCP & XenServer
Under the Hood: Open vSwitch & OpenFlow in XCP & XenServerUnder the Hood: Open vSwitch & OpenFlow in XCP & XenServer
Under the Hood: Open vSwitch & OpenFlow in XCP & XenServerThe Linux Foundation
 
Alfresco in few points - Search Tutorial
Alfresco in few points - Search TutorialAlfresco in few points - Search Tutorial
Alfresco in few points - Search TutorialPASCAL Jean Marie
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview Krishna-Kumar
 
K8s network policy bypass
K8s network policy bypassK8s network policy bypass
K8s network policy bypassKaizhe Huang
 

La actualidad más candente (20)

CI/CD with Rancher CLI + Jenkins
CI/CD with Rancher CLI + JenkinsCI/CD with Rancher CLI + Jenkins
CI/CD with Rancher CLI + Jenkins
 
Containers orchestrators: Docker vs. Kubernetes
Containers orchestrators: Docker vs. KubernetesContainers orchestrators: Docker vs. Kubernetes
Containers orchestrators: Docker vs. Kubernetes
 
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
 
An introduction to Apache Thrift
An introduction to Apache ThriftAn introduction to Apache Thrift
An introduction to Apache Thrift
 
Terraform Tips and Tricks - LAOUC 2022
Terraform Tips and Tricks - LAOUC 2022Terraform Tips and Tricks - LAOUC 2022
Terraform Tips and Tricks - LAOUC 2022
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Scalable OCR with NiFi and Tesseract
Scalable OCR with NiFi and TesseractScalable OCR with NiFi and Tesseract
Scalable OCR with NiFi and Tesseract
 
Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...
Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...
Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyond
 
Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3
 
DTW18 - code08 - Everything You Need To Know About Storage with Kubernetes
DTW18 - code08 - Everything You Need To Know About Storage with KubernetesDTW18 - code08 - Everything You Need To Know About Storage with Kubernetes
DTW18 - code08 - Everything You Need To Know About Storage with Kubernetes
 
Prometheus monitoring
Prometheus monitoringPrometheus monitoring
Prometheus monitoring
 
쿠버네티스 기반 PaaS 솔루션 - Playce Kube를 소개합니다.
쿠버네티스 기반 PaaS 솔루션 - Playce Kube를 소개합니다.쿠버네티스 기반 PaaS 솔루션 - Playce Kube를 소개합니다.
쿠버네티스 기반 PaaS 솔루션 - Playce Kube를 소개합니다.
 
Juraci Paixão Kröhling - All you need to know about OpenTelemetry
Juraci Paixão Kröhling - All you need to know about OpenTelemetryJuraci Paixão Kröhling - All you need to know about OpenTelemetry
Juraci Paixão Kröhling - All you need to know about OpenTelemetry
 
Integrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetesIntegrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetes
 
Overview of kubernetes network functions
Overview of kubernetes network functionsOverview of kubernetes network functions
Overview of kubernetes network functions
 
Under the Hood: Open vSwitch & OpenFlow in XCP & XenServer
Under the Hood: Open vSwitch & OpenFlow in XCP & XenServerUnder the Hood: Open vSwitch & OpenFlow in XCP & XenServer
Under the Hood: Open vSwitch & OpenFlow in XCP & XenServer
 
Alfresco in few points - Search Tutorial
Alfresco in few points - Search TutorialAlfresco in few points - Search Tutorial
Alfresco in few points - Search Tutorial
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview
 
K8s network policy bypass
K8s network policy bypassK8s network policy bypass
K8s network policy bypass
 

Destacado

Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101LorisPack Project
 
Docker Networking Deep Dive
Docker Networking Deep DiveDocker Networking Deep Dive
Docker Networking Deep DiveDocker, Inc.
 
Docker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksDocker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksAdrien Blind
 
Docker-OVS
Docker-OVSDocker-OVS
Docker-OVSsnrism
 
Joomla Day Poland 15 - Docker
Joomla Day Poland 15 - DockerJoomla Day Poland 15 - Docker
Joomla Day Poland 15 - DockerLukas Lesniewski
 
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁOAtlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁONetworkedAssets
 
Docker Networking - Boulder Linux Users Group (BLUG)
Docker Networking - Boulder Linux Users Group (BLUG)Docker Networking - Boulder Linux Users Group (BLUG)
Docker Networking - Boulder Linux Users Group (BLUG)Dan Mackin
 
Lessons learned in reaching multi-host container networking
Lessons learned in reaching multi-host container networkingLessons learned in reaching multi-host container networking
Lessons learned in reaching multi-host container networkingTony Georgiev
 
Multi host networking with docker
Multi host networking with dockerMulti host networking with docker
Multi host networking with dockerMyoungSu Shin
 
Docker Networking in OpenStack: What you need to know now
Docker Networking in OpenStack: What you need to know nowDocker Networking in OpenStack: What you need to know now
Docker Networking in OpenStack: What you need to know nowPLUMgrid
 
Docker Networking – Running multi-host applications
Docker Networking – Running multi-host applicationsDocker Networking – Running multi-host applications
Docker Networking – Running multi-host applicationsChristina Rasimus
 
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
 
Single Host Docker Networking
Single Host Docker NetworkingSingle Host Docker Networking
Single Host Docker Networkingallingeek
 
#eventcepcja Networking Izabela Górska (Business Link Warszawa)
#eventcepcja Networking Izabela Górska (Business Link Warszawa)#eventcepcja Networking Izabela Górska (Business Link Warszawa)
#eventcepcja Networking Izabela Górska (Business Link Warszawa)Edyta Kowal
 
Octo talk : docker multi-host networking
Octo talk : docker multi-host networking Octo talk : docker multi-host networking
Octo talk : docker multi-host networking Hervé Leclerc
 
Docker - Containervirtualisierung leichtgemacht
Docker - Containervirtualisierung leichtgemachtDocker - Containervirtualisierung leichtgemacht
Docker - Containervirtualisierung leichtgemachtB1 Systems GmbH
 
Application Delivery Platform Towards Edge Computing - Bukhary Ikhwan
Application Delivery Platform Towards Edge Computing - Bukhary IkhwanApplication Delivery Platform Towards Edge Computing - Bukhary Ikhwan
Application Delivery Platform Towards Edge Computing - Bukhary IkhwanOpenNebula Project
 
Docker Networking
Docker NetworkingDocker Networking
Docker NetworkingWeaveworks
 

Destacado (20)

Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
 
Docker Networking Deep Dive
Docker Networking Deep DiveDocker Networking Deep Dive
Docker Networking Deep Dive
 
Docker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksDocker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined Networks
 
Docker Networking
Docker NetworkingDocker Networking
Docker Networking
 
Docker-OVS
Docker-OVSDocker-OVS
Docker-OVS
 
Joomla Day Poland 15 - Docker
Joomla Day Poland 15 - DockerJoomla Day Poland 15 - Docker
Joomla Day Poland 15 - Docker
 
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁOAtlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
 
Docker Networking - Boulder Linux Users Group (BLUG)
Docker Networking - Boulder Linux Users Group (BLUG)Docker Networking - Boulder Linux Users Group (BLUG)
Docker Networking - Boulder Linux Users Group (BLUG)
 
Lessons learned in reaching multi-host container networking
Lessons learned in reaching multi-host container networkingLessons learned in reaching multi-host container networking
Lessons learned in reaching multi-host container networking
 
Multi host networking with docker
Multi host networking with dockerMulti host networking with docker
Multi host networking with docker
 
Docker Networking in OpenStack: What you need to know now
Docker Networking in OpenStack: What you need to know nowDocker Networking in OpenStack: What you need to know now
Docker Networking in OpenStack: What you need to know now
 
Docker Networking – Running multi-host applications
Docker Networking – Running multi-host applicationsDocker Networking – Running multi-host applications
Docker Networking – Running multi-host applications
 
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
 
Single Host Docker Networking
Single Host Docker NetworkingSingle Host Docker Networking
Single Host Docker Networking
 
Kubernetes integration with ODL
Kubernetes integration with ODLKubernetes integration with ODL
Kubernetes integration with ODL
 
#eventcepcja Networking Izabela Górska (Business Link Warszawa)
#eventcepcja Networking Izabela Górska (Business Link Warszawa)#eventcepcja Networking Izabela Górska (Business Link Warszawa)
#eventcepcja Networking Izabela Górska (Business Link Warszawa)
 
Octo talk : docker multi-host networking
Octo talk : docker multi-host networking Octo talk : docker multi-host networking
Octo talk : docker multi-host networking
 
Docker - Containervirtualisierung leichtgemacht
Docker - Containervirtualisierung leichtgemachtDocker - Containervirtualisierung leichtgemacht
Docker - Containervirtualisierung leichtgemacht
 
Application Delivery Platform Towards Edge Computing - Bukhary Ikhwan
Application Delivery Platform Towards Edge Computing - Bukhary IkhwanApplication Delivery Platform Towards Edge Computing - Bukhary Ikhwan
Application Delivery Platform Towards Edge Computing - Bukhary Ikhwan
 
Docker Networking
Docker NetworkingDocker Networking
Docker Networking
 

Similar a Networking in Docker Containers

NFV Infrastructure Manager with High Performance Software Switch Lagopus
NFV Infrastructure Manager with High Performance Software Switch Lagopus NFV Infrastructure Manager with High Performance Software Switch Lagopus
NFV Infrastructure Manager with High Performance Software Switch Lagopus Hirofumi Ichihara
 
Osnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptxOsnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptxM.Qasim Arham
 
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDNTech Tutorial by Vikram Dham: Let's build MPLS router using SDN
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDNnvirters
 
LinuxConJapan2014_makita_0_MACVLAN.pdf
LinuxConJapan2014_makita_0_MACVLAN.pdfLinuxConJapan2014_makita_0_MACVLAN.pdf
LinuxConJapan2014_makita_0_MACVLAN.pdfDanielHanganu2
 
Support of containerized workloads in ONAP
Support of containerized workloads in ONAPSupport of containerized workloads in ONAP
Support of containerized workloads in ONAPVictor Morales
 
DCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep diveDCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep diveMadhu Venugopal
 
Innovation is back in the transport and network layers
Innovation is back in the transport and network layersInnovation is back in the transport and network layers
Innovation is back in the transport and network layersOlivier Bonaventure
 
Microservices using relocatable Docker containers
Microservices using relocatable Docker containersMicroservices using relocatable Docker containers
Microservices using relocatable Docker containersMauricio Garavaglia
 
Open stackaustinmeetupsept21
Open stackaustinmeetupsept21Open stackaustinmeetupsept21
Open stackaustinmeetupsept21Brent Doncaster
 
End-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoTEnd-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoTBenjamin Cabé
 
BKK16-205 RDK-B IoT
BKK16-205 RDK-B IoTBKK16-205 RDK-B IoT
BKK16-205 RDK-B IoTLinaro
 
FlowER Erlang Openflow Controller
FlowER Erlang Openflow ControllerFlowER Erlang Openflow Controller
FlowER Erlang Openflow ControllerHolger Winkelmann
 
Docker Online Meetup #22: Docker Networking
Docker Online Meetup #22: Docker NetworkingDocker Online Meetup #22: Docker Networking
Docker Online Meetup #22: Docker NetworkingDocker, Inc.
 
Integration and Interoperation of existing Nexus networks into an ACI Archite...
Integration and Interoperation of existing Nexus networks into an ACI Archite...Integration and Interoperation of existing Nexus networks into an ACI Archite...
Integration and Interoperation of existing Nexus networks into an ACI Archite...Cisco Canada
 
Network Multitenancy in Xen-Based Clouds-XPUS13 Vittal
Network Multitenancy in Xen-Based Clouds-XPUS13 VittalNetwork Multitenancy in Xen-Based Clouds-XPUS13 Vittal
Network Multitenancy in Xen-Based Clouds-XPUS13 VittalThe Linux Foundation
 
09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptxKushalSrivastava23
 
Dockerffm meetup 20150113_networking
Dockerffm meetup 20150113_networkingDockerffm meetup 20150113_networking
Dockerffm meetup 20150113_networkingAndreas Schmidt
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker建澄 吳
 

Similar a Networking in Docker Containers (20)

NFV Infrastructure Manager with High Performance Software Switch Lagopus
NFV Infrastructure Manager with High Performance Software Switch Lagopus NFV Infrastructure Manager with High Performance Software Switch Lagopus
NFV Infrastructure Manager with High Performance Software Switch Lagopus
 
Osnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptxOsnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptx
 
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDNTech Tutorial by Vikram Dham: Let's build MPLS router using SDN
Tech Tutorial by Vikram Dham: Let's build MPLS router using SDN
 
LinuxConJapan2014_makita_0_MACVLAN.pdf
LinuxConJapan2014_makita_0_MACVLAN.pdfLinuxConJapan2014_makita_0_MACVLAN.pdf
LinuxConJapan2014_makita_0_MACVLAN.pdf
 
Support of containerized workloads in ONAP
Support of containerized workloads in ONAPSupport of containerized workloads in ONAP
Support of containerized workloads in ONAP
 
DCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep diveDCUS17 : Docker networking deep dive
DCUS17 : Docker networking deep dive
 
Innovation is back in the transport and network layers
Innovation is back in the transport and network layersInnovation is back in the transport and network layers
Innovation is back in the transport and network layers
 
Microservices using relocatable Docker containers
Microservices using relocatable Docker containersMicroservices using relocatable Docker containers
Microservices using relocatable Docker containers
 
Open stackaustinmeetupsept21
Open stackaustinmeetupsept21Open stackaustinmeetupsept21
Open stackaustinmeetupsept21
 
End-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoTEnd-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoT
 
BKK16-205 RDK-B IoT
BKK16-205 RDK-B IoTBKK16-205 RDK-B IoT
BKK16-205 RDK-B IoT
 
Future Internet protocols
Future Internet protocolsFuture Internet protocols
Future Internet protocols
 
FlowER Erlang Openflow Controller
FlowER Erlang Openflow ControllerFlowER Erlang Openflow Controller
FlowER Erlang Openflow Controller
 
Docker Online Meetup #22: Docker Networking
Docker Online Meetup #22: Docker NetworkingDocker Online Meetup #22: Docker Networking
Docker Online Meetup #22: Docker Networking
 
Integration and Interoperation of existing Nexus networks into an ACI Archite...
Integration and Interoperation of existing Nexus networks into an ACI Archite...Integration and Interoperation of existing Nexus networks into an ACI Archite...
Integration and Interoperation of existing Nexus networks into an ACI Archite...
 
Network Multitenancy in Xen-Based Clouds-XPUS13 Vittal
Network Multitenancy in Xen-Based Clouds-XPUS13 VittalNetwork Multitenancy in Xen-Based Clouds-XPUS13 Vittal
Network Multitenancy in Xen-Based Clouds-XPUS13 Vittal
 
09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx
 
Dockerffm meetup 20150113_networking
Dockerffm meetup 20150113_networkingDockerffm meetup 20150113_networking
Dockerffm meetup 20150113_networking
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
 

Último

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 

Último (20)

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 

Networking in Docker Containers

  • 1. Page1 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Networking in Containers Attila Kanto
  • 2. Page2 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Agenda • How networking works in Docker • Container Network Model • Networking plugin
  • 3. Page3 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Containers • Isolate and package applications • Resources (CPU, memory, IO) • Namespaces (pid, users, network, uts, mnt ) • Storage (device mapper, overlayfs, aufs, btrfs) • Security (capabilities)
  • 4. Page4 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Network • UTS namespace • isolate hostname • Network namespace • network interface(s) • loopback device • routing table • iptable rules
  • 5. Page5 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Basic networking overview 5
  • 6. Page6 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Networking without Docker eth0 iptables route
  • 7. Page7 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Networking without Docker  ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255 ether 33:83:5a:44:50:ff txqueuelen 0 (Ethernet) lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0
  • 8. Page8 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Networking without Docker  ifconfig eth0: inet 192.168.1.100 ether 33:83:5a:44:50:ff OSI Layers (1 – 4)
  • 9. Page9 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Networking without Docker  route -n Destination Gateway Genmask Iface 0.0.0.0 192.168.1.1 0.0.0.0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 eth0  iptables -t nat -L target prot opt source destination
  • 10. Page10 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Networking without Docker eth0 iptables route 192.168.1.0/24 -> eth0 0.0.0.0 -> 192.168.1.1 (eth0) 192.168.1.100
  • 11. Page11 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Networking with Docker 11
  • 12. Page12 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Install Docker eth0 iptables MASQUERADE 172.17.0.0/16 route 192.168.1.0/24 -> eth0 0.0.0.0 -> 192.168.1.1 (eth0) 172.17.0.0/16 -> docker0 192.168.1.100 172.17.0.1 docker0
  • 13. Page13 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Run container / bridged networking • Docker0 bridge • already there, created during install • Network namespace • container netns needs to be created • Veth pair • created during the creation of container • connects two network namespaces • External communication • Only through Network Address Translation (NAT)
  • 14. Page14 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Run container / bridged networking / 8080 -> 9090 eth0 iptables MASQUERADE 172.17.0.0/16 DNAT dpt:9090 to:172.17.0.2:8080 route 192.168.1.0/24 -> eth0 0.0.0.0 -> 192.168.1.1 (eth0) 172.17.0.0/16 -> docker0 192.168.1.100 172.17.0.1 docker0 container1ns eth0vxx veth 172.17.0.2 route SRC DST Client Port 9090 Client IP 192.168.1.100 Client MAC MAC of eth0 SRC DST Client Port 8080 Client IP 172.17.0.2 SRC DST Client Port 8080 Client IP 172.17.0.2 MAC of docker0 MAC of eth0
  • 15. Page15 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Overlay networking with Docker 15
  • 16. Page16 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Run container / overlay networking • Bridges • docker_gwbridge created if does not exist • br0 in a “hidden” namespace associated with the overlay network • Network namespace • container netns needs to be created • Veth pairs • connects br0 and and eth0 of container • connects docker_gwbridge and eth1 of container • External communication • Through Network Address Translation (NAT) • Through VXLAN (other container using the same overlay network)
  • 17. Page17 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Install Docker (again) eth0 iptables MASQUERADE 172.17.0.0/16 route 192.168.1.0/24 -> eth0 0.0.0.0 -> 192.168.1.1 (eth0) 172.17.0.0/16 -> docker0 192.168.1.100 172.17.0.1 docker0
  • 18. Page18 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Run container / overlay networking eth0 iptables route 192.168.1.100 172.18.0.1 docker_gw container1ns eth1vxx veth 172.18.0.2 172.17.0.1 docker0 ns br0 eth0vyy veth 10.10.10.210.10.10.1 VXLAN route
  • 19. Page19 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Software-defined networking (SDN) • Separation control and data plane of network • Control plane • makes decisions about where traffic is sent • Data plane • forward traffic to the selected destination
  • 20. Page20 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Data Plane (in Docker overlay) • Virtual Extensible LAN (VXLAN) • overlay technology • encapsulates L2 frames as UDP packets • VTEP – VXLAN Tunnel End Point • originator and/or terminator of VXLAN tunnel • VNI – VXLAN Network Identifier • part of the VXLAN Header • similar to VLAN ID
  • 21. Page21 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Data Plane (in Docker overlay) • Container sends a packet • ARP (neighbor) table is checked for destination container IP -> MAC interface mapping • L2 FDB (forwarding database) is checked to determine IP of destination VTEP for destination MAC on source VTEP • packet is encapsulated for destination VTEP with configured VNI and sent to destination • destination VTEP de-capsulates the packet • inner packet is received by the destination container
  • 22. Page22 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Network Control Plane (in Docker overlay)
  • 23. Page23 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Container Network Model 23
  • 24. Page24 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Container Network Model (CNM) • Sandbox • holds the config of a container's network stack (DNS, routing, etc.) • multiple endpoints from multiple networks • Linux Network Namespace / FreeBSD Jail • Network • Group Endpoints that are able to communicate with each-other directly • Linux Bridge / VXLAN • Endpoint • joins Sandbox to Network • veth pair / ovs patch port
  • 25. Page25 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Docker libnetwork • Docker’s networking library • Implements CNM • Built-in drivers (in process) • Network drivers (bridge, overlay) • IPAM drivers • Plugin mechanism (off process) • External Network drivers (Calico, Midonet, my own driver) • External IPAM drivers
  • 26. Page26 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Libnetwork plugins • Implemented using libnetwork’s remote driver • Running off-process (not in Docker daemon) • HTTP POSTs with JSON payload • KV store API not exposed • can be implemented in any programming language • KV store • KV url / credentials needs to be passed in init time • Can be deployed as container
  • 27. Page27 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Network plugin API (Network) • CreateNetwork • DeleteNetwork
  • 28. Page28 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Network plugin API (Endpoint) • CreateEndpoint • DeleteEndpoint
  • 29. Page29 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Network plugin API (Join) • Join • Join (resp)
  • 30. Page30 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Floating IP network driver • Containers on same L2 network • Connected with Open vSwitch • IP Address Management • libnetwork built-in IPAM driver is used • Externally addressable IP / container • no Network Address Translation • no port collision • extremely fast • scalability 
  • 31. Page31 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Run container / floating driver iptables route 192.168.1.100 container1ns 172.17.0.1 docker0 floating_bridge eth0 192.168.10.2 eth1 veth2veth1 container2ns eth0 192.168.10.3 veth veth eth0
  • 32. Page32 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Demo 32
  • 33. Page33 © Hortonworks Inc. 2011 – 2015. All Rights Reserved How to use it in Hadoop world • Using multiple networks • overlay to create internal network • floating for exposing servers Data Node Data Node Data Node Ambari Master Node Data Node Data Node Data Node Master Node Edge Node OverlayFloating
  • 34. Page34 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Takeaways • Since 1.9 Docker networking has improved • Easy to write a plugin that does certain things better • Multiple networks can be used by the same container • Not everybody is happy with it • Kubernetes http://blog.kubernetes.io/2016/01/why-Kubernetes-doesnt-use-libnetwork.html • Mesos https://issues.apache.org/jira/browse/MESOS-3828
  • 35. Page35 © Hortonworks Inc. 2011 – 2015. All Rights Reserved We are hiring! 35

Notas del editor

  1. Containers are application focused, and from high level they are isolate and package apllictaions - Containers can limit resources available for application, cpu share, memory Isolate processes, users, network, etc. this means that containers have processes, users, network stack that is not visible for other containers Filesystem is also separated, every container can have own root fs that is not visible Basic security, lik ecapabilities, e.g. NET_ADMIN This presentation focus is on network
  2. Linux kernel feature, (UNIX Timesharing System, historical reasons Own network stack, achived by using Network Namespace - It is a Linux kernel feature, - Network stack means that it has an own
  3. Linux machine and one erhernet port Routing table And iptable rules What are this: Routing table,, it is a prefix matching table, containing an IP prefixes, if you have a destination IP, matching against this table and from there it can be figured out where to send it out You can think of it as a packet filtering and modification tool. Iptables is a userland tool to modify the tables and rules netfilter module of kernel
  4. Layer 2 ethernet frame Layer 3 ip packet Oversimplification, layer 2 ethernat frame contains source and dest mac address Oversimplification, layer 3 ethernat packet contains source and dest ip address
  5. Routing table table is prefix table, describes that how a layer 3 packet shall be forvarded based on ip address.
  6. Add the information what we have learned
  7. A bridge behaves like a virtual network switch, any real devices (e.g. eth0) and virtual devices (e.g. tap0) can be connected to it. Iptables rule which is related to Network address translation (NAT) This info can be figured out by using the rout ifconfig, iptables Network address translation (NAT) is a methodology of remapping one IP address space into another by modifying network address information in Internet Protocol (IP) datagram packet headers while they are in transit across a traffic routing device.[1]
  8. Docker0 not to much thing is cahnged there Veth pair connection What happens when we run a container and expose the port 8080 to 9090 - Container would like to talk other container connected todocker0 then it goes through bridge
  9. Network address translation (NAT) is a methodology of remapping one IP address space into another by modifying network address information in Internet Protocol (IP) datagram packet headers while they are in transit across a traffic routing device.[1]
  10. An overlay network is a computer network that is built on top of another network. Not a good name in Docker networking, since they created a vxlan based overlay network.
  11. An overlay network is a computer network that is built on top of another network
  12. A bridge behaves like a virtual network switch, any real devices (e.g. eth0) and virtual devices (e.g. tap0) can be connected to it. Iptables rule which is related to Network address translation (NAT) This info can be figured out by using the rout ifconfig, iptables Network address translation (NAT) is a methodology of remapping one IP address space into another by modifying network address information in Internet Protocol (IP) datagram packet headers while they are in transit across a traffic routing device.[1]
  13. Suppose network was alreadt created with docker network create , 10.10.10.0/24 VXLAN, what role does it play? We need to step back a little bit. Ton understand this we need to explain what is SDN, Softer Defined Networking is
  14. Basic concept of Software-defined networking is to Separate control and data plane of network.
  15. Overtlay technology, whcih can be translated that a network teachnology om the top ofanother network Main parts of it.
  16. Few things what are missing from the puzzle
  17. Serf is decentralised solution, for cluster membership, faliure detection, orchestration. Use efficient and lightweight gossip/epidemic protocol is used to communicate with other nodes. Serf can detect node failures and notify the rest of the cluster propagating changes to configuration to relevant nodes.
  18. Undesrand what is the concept, now we can check the implementation details.