SlideShare a Scribd company logo
1 of 16
Download to read offline
Docker Networking 
Intro Meetup 
Sriram Natarajan 
Dhananjay Sampath
Agenda 
Introduction to Container Networking 
Docker + OpenvSwitch demo 
Hands on Tutorial instructions
Docker Networking 101 
eth0 
docker0 
172.17.42.1 
Container1 Container2 
eth0 eth0 
vethAQI2T veth01qe
Docker Bridge options 
--net=bridge 
--net=host 
--net=container:NAME_or_ID 
--net=none
--net=None
Port Mapping 
eth0 
docker0 
172.17.42.1:49514 
Container1 Container2 
eth0:5000 eth0 
vethAQI2T veth01qe 
-P flag
Internet Communication 
eth0 
docker0 
172.17.42.1 
internet 
Container1 Container2 
eth0 eth0 
vethAQI2T veth01qe 
ip_forward = 1
Inter Container Communication 
Container2 
eth0 
vethAQI2T veth01qe 
docker0 
Container1 
--icc=true
Linking of Containers 
● Name the container using --name option 
● Link container using --link name:alias 
db 
eth0 
vethAQI2T veth01qe 
docker0 
web
Hands on setup instructions 
Containet Source Code: https://bitbucket.org/snrism/containet 
Instructions: README part of the source code.
Connecting docker containers in 2 hosts 
Container 1 Container 2 
172.17.0.4 172.17.0.5 
docker0 
Container 3 Container 4 
172.17.0.4 172.17.0.5 
docker0 
172.17.42.1 172.17.42.1 
Host 1 Host 2 
eth1 eth1 
10.0.0.3 10.0.0.4 
IP Address Conflicts…
Configuring container IP addresses 
Container 1 Container 2 
172.18.42.10 172.18.42.11 
docker0 
Container 3 Container 4 
172.18.42.12 172.18.42.13 
docker0 
172.18.42.1 172.18.42.2 
Host 1 Host 2 
eth1 eth1 
10.0.0.3 10.0.0.4 
Start a container w/o using docker's default network config: docker run -d --net=none -t -i ubuntu /bin/bash 
Record the Container ID that just started: docker ps 
Configure IP addresses on eth0: ./start-container.sh <container-id> <ip-addr>
Experiment 1 
Connect hosts via OVS (docker bridge + OVS) 
Container 1 Container 2 
172.18.42.10 172.18.42.11 
docker0 
Container 3 Container 4 
172.18.42.12 172.18.42.13 
docker0 
br0 
(ovs) gre0 
br0 
g r e 0 (ovs) 
172.18.42.1 172.18.42.2 
Host 1 Host 2 
eth1 eth1 
10.0.0.3 10.0.0.4 
Setup GRE Tunnel: ./ovs-tunnel-setup.sh 
Setup IPTables for containers to reach other hosts: ./iptables.sh 
Start a container w/o using docker's default network config: docker run -d --net=none -t -i ubuntu /bin/bash 
Record the Container ID that just started: docker ps 
Configure IP addresses on eth0: ./start-container.sh <container-id> <ip-addr>
Experiment 2 
Connect hosts via OVS (direct OVS) 
Container 1 Container 2 Container 3 Container 4 
br0 
(ovs) gre0 
br0 
g r e 0 (ovs) 
Host 1 Host 2 
eth1 eth1 
10.0.0.3 10.0.0.4 
Start a container w/o using docker's default network config: docker run -d --net=none -t -i ubuntu /bin/bash 
Record the Container ID that just started: docker ps 
Configure eth1 and attach to OVS: ./connect-container.sh <container-id> <ip-addr>
Experiment 3 
Connect hosts via OVS (direct OVS) 
Use VLAN tags to segregate containers 
Container 1 Container 2 Container 3 Container 4 
br0 
(ovs) gre0 
br0 
g r e 0 (ovs) 
Host 1 Host 2 
eth1 eth1 
Start a container w/o usi1n0g.0 d.0o.3cker's default network config: docker run -d1 0--.n0.e0t.4=none -t -i ubuntu /bin/bash 
Record the Container ID that just started: docker ps 
Configure eth1 and attach to OVS: ./connect-container.sh <container-id> <ip-addr> <vlan-tag>
Advanced Tools 
Open Source Tools Description 
Pipework 
https://github.com/jpetazzo/pipework 
Better configuration capabilities. 
Works well with LXC and docker 
Weave 
https://github.com/zettio/weave 
Simplifies connecting containers across multiple hosts. 
Lorispack 
https://github.com/lorispack/loris 
Heterogeneous options to connect containers across hosts 
Kubernetes 
https://github. 
com/GoogleCloudPlatform/kubernetes 
Container cluster manager 
Flannel 
https://github.com/coreos/flannel 
Overlay network that gives subnet for each machine with kubernetes 
Openstack Icehouse – Orchestrate docker containers via heat templates

More Related Content

What's hot

Docker network Present in VietNam DockerDay 2015
Docker network Present in VietNam DockerDay 2015Docker network Present in VietNam DockerDay 2015
Docker network Present in VietNam DockerDay 2015
Van Phuc
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
Sim Janghoon
 

What's hot (19)

Docker Networking
Docker NetworkingDocker Networking
Docker Networking
 
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 networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
 
Single Host Docker Networking
Single Host Docker NetworkingSingle Host Docker Networking
Single Host Docker Networking
 
Understanding docker networking
Understanding docker networkingUnderstanding docker networking
Understanding docker networking
 
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
 
Docker 1.12 networking deep dive
Docker 1.12 networking deep diveDocker 1.12 networking deep dive
Docker 1.12 networking deep dive
 
Docker Network Overview and legacy "--link"
Docker Network Overview and legacy "--link"Docker Network Overview and legacy "--link"
Docker Network Overview and legacy "--link"
 
Docker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingDocker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental Networking
 
Docker network Present in VietNam DockerDay 2015
Docker network Present in VietNam DockerDay 2015Docker network Present in VietNam DockerDay 2015
Docker network Present in VietNam DockerDay 2015
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
 
Deep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksDeep dive in Docker Overlay Networks
Deep dive in Docker Overlay Networks
 
Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA
 
Designing scalable Docker networks
Designing scalable Docker networksDesigning scalable Docker networks
Designing scalable Docker networks
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
Docker Meetup: Docker Networking 1.11, by Madhu VenugopalDocker Meetup: Docker Networking 1.11, by Madhu Venugopal
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
 
Docker networking
Docker networkingDocker networking
Docker networking
 
OVS-NFV Tutorial
OVS-NFV TutorialOVS-NFV Tutorial
OVS-NFV Tutorial
 
Building a network emulator with Docker and Open vSwitch
Building a network emulator with Docker and Open vSwitchBuilding a network emulator with Docker and Open vSwitch
Building a network emulator with Docker and Open vSwitch
 

Similar to Docker-OVS

Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks Tutorial
Cohesive Networks
 
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
KubeAcademy
 

Similar to Docker-OVS (20)

Docker Networking Meetup - Intro to Docker Networking
Docker Networking Meetup - Intro to Docker NetworkingDocker Networking Meetup - Intro to Docker Networking
Docker Networking Meetup - Intro to Docker Networking
 
Deep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay NetworksDeep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay Networks
 
Docker Meetup: Docker Networking 1.11 with Madhu Venugopal
Docker Meetup: Docker Networking 1.11 with Madhu VenugopalDocker Meetup: Docker Networking 1.11 with Madhu Venugopal
Docker Meetup: Docker Networking 1.11 with Madhu Venugopal
 
Docker 1.11 Meetup: Networking Showcase
Docker 1.11 Meetup: Networking ShowcaseDocker 1.11 Meetup: Networking Showcase
Docker 1.11 Meetup: Networking Showcase
 
Chris Swan at Container.Camp: Docker networking
Chris Swan at Container.Camp: Docker networkingChris Swan at Container.Camp: Docker networking
Chris Swan at Container.Camp: Docker networking
 
Docker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUGDocker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUG
 
Deep Dive in Docker Overlay Networks - Laurent Bernaille - Architect, D2SI
Deep Dive in Docker Overlay Networks - Laurent Bernaille - Architect, D2SIDeep Dive in Docker Overlay Networks - Laurent Bernaille - Architect, D2SI
Deep Dive in Docker Overlay Networks - Laurent Bernaille - Architect, D2SI
 
Deeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay NetworksDeeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay Networks
 
Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks Tutorial
 
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
 
Kubernetes networking-made-easy-with-open-v switch
Kubernetes networking-made-easy-with-open-v switchKubernetes networking-made-easy-with-open-v switch
Kubernetes networking-made-easy-with-open-v switch
 
Docker Setting for Static IP allocation
Docker Setting for Static IP allocationDocker Setting for Static IP allocation
Docker Setting for Static IP allocation
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1
 
How to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratchHow to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratch
 
Deeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksDeeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay Networks
 
Kubernetes networking
Kubernetes networkingKubernetes networking
Kubernetes networking
 
Dockerffm meetup 20150113_networking
Dockerffm meetup 20150113_networkingDockerffm meetup 20150113_networking
Dockerffm meetup 20150113_networking
 
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)
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with Kubernetes
 
Introduction to CNI (Container Network Interface)
Introduction to CNI (Container Network Interface)Introduction to CNI (Container Network Interface)
Introduction to CNI (Container Network Interface)
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 

Docker-OVS

  • 1. Docker Networking Intro Meetup Sriram Natarajan Dhananjay Sampath
  • 2. Agenda Introduction to Container Networking Docker + OpenvSwitch demo Hands on Tutorial instructions
  • 3. Docker Networking 101 eth0 docker0 172.17.42.1 Container1 Container2 eth0 eth0 vethAQI2T veth01qe
  • 4. Docker Bridge options --net=bridge --net=host --net=container:NAME_or_ID --net=none
  • 6. Port Mapping eth0 docker0 172.17.42.1:49514 Container1 Container2 eth0:5000 eth0 vethAQI2T veth01qe -P flag
  • 7. Internet Communication eth0 docker0 172.17.42.1 internet Container1 Container2 eth0 eth0 vethAQI2T veth01qe ip_forward = 1
  • 8. Inter Container Communication Container2 eth0 vethAQI2T veth01qe docker0 Container1 --icc=true
  • 9. Linking of Containers ● Name the container using --name option ● Link container using --link name:alias db eth0 vethAQI2T veth01qe docker0 web
  • 10. Hands on setup instructions Containet Source Code: https://bitbucket.org/snrism/containet Instructions: README part of the source code.
  • 11. Connecting docker containers in 2 hosts Container 1 Container 2 172.17.0.4 172.17.0.5 docker0 Container 3 Container 4 172.17.0.4 172.17.0.5 docker0 172.17.42.1 172.17.42.1 Host 1 Host 2 eth1 eth1 10.0.0.3 10.0.0.4 IP Address Conflicts…
  • 12. Configuring container IP addresses Container 1 Container 2 172.18.42.10 172.18.42.11 docker0 Container 3 Container 4 172.18.42.12 172.18.42.13 docker0 172.18.42.1 172.18.42.2 Host 1 Host 2 eth1 eth1 10.0.0.3 10.0.0.4 Start a container w/o using docker's default network config: docker run -d --net=none -t -i ubuntu /bin/bash Record the Container ID that just started: docker ps Configure IP addresses on eth0: ./start-container.sh <container-id> <ip-addr>
  • 13. Experiment 1 Connect hosts via OVS (docker bridge + OVS) Container 1 Container 2 172.18.42.10 172.18.42.11 docker0 Container 3 Container 4 172.18.42.12 172.18.42.13 docker0 br0 (ovs) gre0 br0 g r e 0 (ovs) 172.18.42.1 172.18.42.2 Host 1 Host 2 eth1 eth1 10.0.0.3 10.0.0.4 Setup GRE Tunnel: ./ovs-tunnel-setup.sh Setup IPTables for containers to reach other hosts: ./iptables.sh Start a container w/o using docker's default network config: docker run -d --net=none -t -i ubuntu /bin/bash Record the Container ID that just started: docker ps Configure IP addresses on eth0: ./start-container.sh <container-id> <ip-addr>
  • 14. Experiment 2 Connect hosts via OVS (direct OVS) Container 1 Container 2 Container 3 Container 4 br0 (ovs) gre0 br0 g r e 0 (ovs) Host 1 Host 2 eth1 eth1 10.0.0.3 10.0.0.4 Start a container w/o using docker's default network config: docker run -d --net=none -t -i ubuntu /bin/bash Record the Container ID that just started: docker ps Configure eth1 and attach to OVS: ./connect-container.sh <container-id> <ip-addr>
  • 15. Experiment 3 Connect hosts via OVS (direct OVS) Use VLAN tags to segregate containers Container 1 Container 2 Container 3 Container 4 br0 (ovs) gre0 br0 g r e 0 (ovs) Host 1 Host 2 eth1 eth1 Start a container w/o usi1n0g.0 d.0o.3cker's default network config: docker run -d1 0--.n0.e0t.4=none -t -i ubuntu /bin/bash Record the Container ID that just started: docker ps Configure eth1 and attach to OVS: ./connect-container.sh <container-id> <ip-addr> <vlan-tag>
  • 16. Advanced Tools Open Source Tools Description Pipework https://github.com/jpetazzo/pipework Better configuration capabilities. Works well with LXC and docker Weave https://github.com/zettio/weave Simplifies connecting containers across multiple hosts. Lorispack https://github.com/lorispack/loris Heterogeneous options to connect containers across hosts Kubernetes https://github. com/GoogleCloudPlatform/kubernetes Container cluster manager Flannel https://github.com/coreos/flannel Overlay network that gives subnet for each machine with kubernetes Openstack Icehouse – Orchestrate docker containers via heat templates