SlideShare a Scribd company logo
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

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Server-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineServer-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at Priceline
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 

Featured

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
Kurio // The Social Media Age(ncy)
 

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