SlideShare uma empresa 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

Mais conteúdo relacionado

Mais procurados

Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/NeutronOverview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutronvivekkonnect
 
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpPushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpJames Denton
 
OpenStack Quantum Intro (OS Meetup 3-26-12)
OpenStack Quantum Intro (OS Meetup 3-26-12)OpenStack Quantum Intro (OS Meetup 3-26-12)
OpenStack Quantum Intro (OS Meetup 3-26-12)Dan Wendlandt
 
Kvm and libvirt
Kvm and libvirtKvm and libvirt
Kvm and libvirtplarsen67
 
Open vSwitch Introduction
Open vSwitch IntroductionOpen vSwitch Introduction
Open vSwitch IntroductionHungWei Chiu
 
EBPF and Linux Networking
EBPF and Linux NetworkingEBPF and Linux Networking
EBPF and Linux NetworkingPLUMgrid
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Weaveworks
 
DPDK IPSec Security Gateway Application
DPDK IPSec Security Gateway ApplicationDPDK IPSec Security Gateway Application
DPDK IPSec Security Gateway ApplicationMichelle Holley
 
BGP Unnumbered で遊んでみた
BGP Unnumbered で遊んでみたBGP Unnumbered で遊んでみた
BGP Unnumbered で遊んでみたakira6592
 
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)Kentaro Ebisawa
 
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
 
Large scale overlay networks with ovn: problems and solutions
Large scale overlay networks with ovn: problems and solutionsLarge scale overlay networks with ovn: problems and solutions
Large scale overlay networks with ovn: problems and solutionsHan Zhou
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network InterfacesKernel TLV
 
Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)Wan Leung Wong
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdKohei Tokunaga
 
Dockerと外部ルータを連携させる仕組みを作ってみた
Dockerと外部ルータを連携させる仕組みを作ってみたDockerと外部ルータを連携させる仕組みを作ってみた
Dockerと外部ルータを連携させる仕組みを作ってみたnpsg
 
OpenStack networking
OpenStack networkingOpenStack networking
OpenStack networkingSim Janghoon
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveMichal Rostecki
 
Troubleshooting containerized triple o deployment
Troubleshooting containerized triple o deploymentTroubleshooting containerized triple o deployment
Troubleshooting containerized triple o deploymentSadique Puthen
 

Mais procurados (20)

Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/NeutronOverview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
 
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpPushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
 
OpenStack Quantum Intro (OS Meetup 3-26-12)
OpenStack Quantum Intro (OS Meetup 3-26-12)OpenStack Quantum Intro (OS Meetup 3-26-12)
OpenStack Quantum Intro (OS Meetup 3-26-12)
 
Kvm and libvirt
Kvm and libvirtKvm and libvirt
Kvm and libvirt
 
Open vSwitch Introduction
Open vSwitch IntroductionOpen vSwitch Introduction
Open vSwitch Introduction
 
EBPF and Linux Networking
EBPF and Linux NetworkingEBPF and Linux Networking
EBPF and Linux Networking
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)
 
DPDK IPSec Security Gateway Application
DPDK IPSec Security Gateway ApplicationDPDK IPSec Security Gateway Application
DPDK IPSec Security Gateway Application
 
BGP Unnumbered で遊んでみた
BGP Unnumbered で遊んでみたBGP Unnumbered で遊んでみた
BGP Unnumbered で遊んでみた
 
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
 
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
 
Large scale overlay networks with ovn: problems and solutions
Large scale overlay networks with ovn: problems and solutionsLarge scale overlay networks with ovn: problems and solutions
Large scale overlay networks with ovn: problems and solutions
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
 
Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
 
Dockerと外部ルータを連携させる仕組みを作ってみた
Dockerと外部ルータを連携させる仕組みを作ってみたDockerと外部ルータを連携させる仕組みを作ってみた
Dockerと外部ルータを連携させる仕組みを作ってみた
 
OpenStack networking
OpenStack networkingOpenStack networking
OpenStack networking
 
Rdma 1
Rdma 1Rdma 1
Rdma 1
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep Dive
 
Troubleshooting containerized triple o deployment
Troubleshooting containerized triple o deploymentTroubleshooting containerized triple o deployment
Troubleshooting containerized triple o deployment
 

Destaque

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
 

Destaque (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
 

Semelhante a Networking in Containers: Understanding Docker Network Models

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建澄 吳
 

Semelhante a Networking in Containers: Understanding Docker Network Models (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

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Último (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

Networking in Containers: Understanding Docker Network Models

  • 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 do 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.