SlideShare a Scribd company logo
1 of 23
Download to read offline
Docker Networking Meetup #2 - Mountain View
Docker Networking
Weave and Flannel
Dhananjay DJ Sampath
wifi: HD-Guest
pass: hackerdojo
Docker Networking Meetup #2 - Mountain View
Weave
● Weaveworks inc. (previously called Zettio)
● Network plane for Docker continers
● Previously built RabbitMQ
● Recently secured funding lead by Accel Venture
Partners
Docker Networking Meetup #2 - Mountain View
What is Weave?
● Weave allows you to connect docker
containers across multiple hosts together
● It gives you a flat network for your container
environment independent of which host they
are located (AWS, GCE etc.)
Docker Networking Meetup #2 - Mountain View
How do they do it?
Physical
Host
veth 2
veth 1
weave
router
UID UID UID UID UID
MAC MAC MAC MAC MAC
Docker Networking Meetup #2 - Mountain View
Weave Encap
● Router performs batching
● Name, meta-data is used for matching
● Weave peers don’t have to know all mac
addresses (aggregation)
● No ARP explosion
All of this over TCP/IP and
through your firewalls
Docker Networking Meetup #2 - Mountain View
Crypto (NaCl libraries)
● Encrypt data connections both TCP and UDP
● NaCl - Go implementation
● Diffie Hellman to exchange keys between hosts
● User provided password is SHA-256ed and added to the ephemeral
session key
● Prevent basic sniffing, MITM attacks
Docker Networking Meetup #2 - Mountain View
DNS
● Name based look up is available (recent commit)
● Distributed DNS service (like skydns, consul etc)
● Minimal config, Minimal Sync, Minimal app mods
Docker Networking Meetup #2 - Mountain View
Hands on - Basic Weave Topology
HOST 1
$ weave launch
$ C=$(weave run 10.0.1.1/24 -t -i ubuntu)
HOST 2
$ weave launch $HOST1
$ C=$(weave run 10.0.1.2/24 -t -i ubuntu)
Host 1 Host 2
PORT: 6783TCP; UDP
Docker Networking Meetup #2 - Mountain View
Attaching weave to existing containers
Host 1 Host 2
PORT: 6783TCP; UDP
$ C=$(docker run -d -t -i ubuntu)
$ weave attach 10.0.1.1/24 $C
$ weave detach 10.0.1.1/24 $C
C1
C2
Docker Networking Meetup #2 - Mountain View
Services
Host 1 Host 2
PORT: 6783TCP; UDP
$ weave expose 10.0.1.102/24
Service export
$ iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 2211 
-j DNAT --to-destination 10.0.1.1:4422
C1
C2
Docker Networking Meetup #2 - Mountain View
Password based protection
$ weave launch -password wEaVe
Multi-cloud, Multi-hop, Container mobility, Fault tolerance
and DNS are other features.
Docker Networking Meetup #2 - Mountain View
DNS
$ sudo weave launch
$ sudo weave launch-dns 10.1.0.3/16
$ sudo weave run 10.1.1.25/24 -ti -h shell.weave.local debian /bin/bash
$ SHELL2=$(sudo weave run 10.1.1.26/24 -ti -h shell2.weave.local debian
/bin/bash)
$ docker attach $SHELL2
# ping shell
Docker Networking Meetup #2 - Mountain View
Github/Code
https://github.com/zettio/weave#readme
Docker Networking Meetup #2 - Mountain View
Performance
CORE OS - Flannel
Weave - ?
Docker Networking
Tutorial Continued
Srini Seetharaman
srini@lorispack.io
November, 2014
Flannel
•Lightweight OS based on Gentoo Linux
•Has a distributed key-value store at the core
•Read-only rootfs. Writeable /etc
o All services are in containers
CoreOS
•One subnet per machine, like Kubernetes
o Host 1: 10.10.10.0/24
o Host 2: 10.10.11.0/24
•No Docker port-based mapping
•Containers reach each other through IP
Flannel
18
1. Build flannel on each host
2. Set key in etcd for network config
3. Start flannel
Instructions to Run Flannel
20
$ curl -L http://127.0.0.1:4001/v2/keys/coreos.com/network/config
-XPUT -d value='{
"Network": "10.0.0.0/8",
"SubnetLen": 20,
"SubnetMin": "10.10.0.0",
"SubnetMax": "10.99.0.0",
"Backend": {"Type": "udp",
"Port": 7890}}
$ source /run/flannel/subnet.env
$ docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}
• Three CoreOS hosts
Our Setup
21
192.168.2.116192.168.2.112
flannelflannel
bashnginx
192.168.2.119
flannel
bash
•IP address overlap not possible
o VxLAN not used to create container groups
•User-space encapsulation and forwarding
o Potential performance bottleneck
Limitations
22
Docker Networking Meetup #2 - Mountain View
Hackathons
● once every 2 months
● help folks get environments setup, discuss projects and start submitting
bug fixes in the projects
● build out your open source portfolio on github
● connect with Bay Area NVirters, Go-Lang, Python groups to build skills and
hack on the new infrastructure stack !
● Motivation: Cool projects, Free food ! Why not !? :D

More Related Content

Recently uploaded

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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 FresherRemote DBA Services
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Docker Networking Meetup - Intro to Weave/Flannel

  • 1. Docker Networking Meetup #2 - Mountain View Docker Networking Weave and Flannel Dhananjay DJ Sampath wifi: HD-Guest pass: hackerdojo
  • 2. Docker Networking Meetup #2 - Mountain View Weave ● Weaveworks inc. (previously called Zettio) ● Network plane for Docker continers ● Previously built RabbitMQ ● Recently secured funding lead by Accel Venture Partners
  • 3. Docker Networking Meetup #2 - Mountain View What is Weave? ● Weave allows you to connect docker containers across multiple hosts together ● It gives you a flat network for your container environment independent of which host they are located (AWS, GCE etc.)
  • 4. Docker Networking Meetup #2 - Mountain View How do they do it? Physical Host veth 2 veth 1 weave router UID UID UID UID UID MAC MAC MAC MAC MAC
  • 5. Docker Networking Meetup #2 - Mountain View Weave Encap ● Router performs batching ● Name, meta-data is used for matching ● Weave peers don’t have to know all mac addresses (aggregation) ● No ARP explosion All of this over TCP/IP and through your firewalls
  • 6. Docker Networking Meetup #2 - Mountain View Crypto (NaCl libraries) ● Encrypt data connections both TCP and UDP ● NaCl - Go implementation ● Diffie Hellman to exchange keys between hosts ● User provided password is SHA-256ed and added to the ephemeral session key ● Prevent basic sniffing, MITM attacks
  • 7. Docker Networking Meetup #2 - Mountain View DNS ● Name based look up is available (recent commit) ● Distributed DNS service (like skydns, consul etc) ● Minimal config, Minimal Sync, Minimal app mods
  • 8. Docker Networking Meetup #2 - Mountain View Hands on - Basic Weave Topology HOST 1 $ weave launch $ C=$(weave run 10.0.1.1/24 -t -i ubuntu) HOST 2 $ weave launch $HOST1 $ C=$(weave run 10.0.1.2/24 -t -i ubuntu) Host 1 Host 2 PORT: 6783TCP; UDP
  • 9. Docker Networking Meetup #2 - Mountain View Attaching weave to existing containers Host 1 Host 2 PORT: 6783TCP; UDP $ C=$(docker run -d -t -i ubuntu) $ weave attach 10.0.1.1/24 $C $ weave detach 10.0.1.1/24 $C C1 C2
  • 10. Docker Networking Meetup #2 - Mountain View Services Host 1 Host 2 PORT: 6783TCP; UDP $ weave expose 10.0.1.102/24 Service export $ iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 2211 -j DNAT --to-destination 10.0.1.1:4422 C1 C2
  • 11. Docker Networking Meetup #2 - Mountain View Password based protection $ weave launch -password wEaVe Multi-cloud, Multi-hop, Container mobility, Fault tolerance and DNS are other features.
  • 12. Docker Networking Meetup #2 - Mountain View DNS $ sudo weave launch $ sudo weave launch-dns 10.1.0.3/16 $ sudo weave run 10.1.1.25/24 -ti -h shell.weave.local debian /bin/bash $ SHELL2=$(sudo weave run 10.1.1.26/24 -ti -h shell2.weave.local debian /bin/bash) $ docker attach $SHELL2 # ping shell
  • 13. Docker Networking Meetup #2 - Mountain View Github/Code https://github.com/zettio/weave#readme
  • 14. Docker Networking Meetup #2 - Mountain View Performance CORE OS - Flannel Weave - ?
  • 15. Docker Networking Tutorial Continued Srini Seetharaman srini@lorispack.io November, 2014
  • 17. •Lightweight OS based on Gentoo Linux •Has a distributed key-value store at the core •Read-only rootfs. Writeable /etc o All services are in containers CoreOS
  • 18. •One subnet per machine, like Kubernetes o Host 1: 10.10.10.0/24 o Host 2: 10.10.11.0/24 •No Docker port-based mapping •Containers reach each other through IP Flannel 18
  • 19.
  • 20. 1. Build flannel on each host 2. Set key in etcd for network config 3. Start flannel Instructions to Run Flannel 20 $ curl -L http://127.0.0.1:4001/v2/keys/coreos.com/network/config -XPUT -d value='{ "Network": "10.0.0.0/8", "SubnetLen": 20, "SubnetMin": "10.10.0.0", "SubnetMax": "10.99.0.0", "Backend": {"Type": "udp", "Port": 7890}} $ source /run/flannel/subnet.env $ docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}
  • 21. • Three CoreOS hosts Our Setup 21 192.168.2.116192.168.2.112 flannelflannel bashnginx 192.168.2.119 flannel bash
  • 22. •IP address overlap not possible o VxLAN not used to create container groups •User-space encapsulation and forwarding o Potential performance bottleneck Limitations 22
  • 23. Docker Networking Meetup #2 - Mountain View Hackathons ● once every 2 months ● help folks get environments setup, discuss projects and start submitting bug fixes in the projects ● build out your open source portfolio on github ● connect with Bay Area NVirters, Go-Lang, Python groups to build skills and hack on the new infrastructure stack ! ● Motivation: Cool projects, Free food ! Why not !? :D