Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building a network emulator with Docker and Open vSwitch

A short description of container namespaces, Linux virtual Ethernet interfaces and how to use them in Docker and Open vSwitch to create a self-contained network with hundreds of nodes on a single host machine.

  • Login to see the comments

Building a network emulator with Docker and Open vSwitch

  1. 1. Goran Cetušić 1 Building a network emulator with Docker and Open vSwitch
  2. 2. Goran Cetušić 2 What do we need? ● Resource isolation ● A PC ● A link ● A switch ● A router
  3. 3. Goran Cetušić 3 Namespaces
  4. 4. Goran Cetušić 4 Veth interfaces ● Network pipes – One pipe – Two net interfaces ● Packet flow: – Packet enters one end/interface – Packet exits other end/interface
  5. 5. Goran Cetušić 5 Docker
  6. 6. Goran Cetušić 6 FROM debian:jessie MAINTAINER Goran Cetusic <goran.cetusic@gmail.com> ENV HOME=/root VTYSH_PAGER=more TERM=vt100 PAGER=less ADD . /build RUN /build/prepare.sh && /build/system_services.sh && /build/utilities.sh && /build/cleanup.sh CMD ["/usr/bin/iinit.sh"] Dockerfile
  7. 7. Goran Cetušić 7 OpenvSwitch
  8. 8. Goran Cetušić 8 Networking
  9. 9. Goran Cetušić 9 Architecture
  10. 10. Goran Cetušić 10 Init process
  11. 11. Goran Cetušić 11 The zombie problem
  12. 12. Goran Cetušić 12 Optimization
  13. 13. Goran Cetušić 13 Docker storage drivers // Slice of drivers that should be used in an order priority = []string{ "aufs", "btrfs", "devicemapper", "vfs", "overlayfs", }
  14. 14. Goran Cetušić 14 Tying it together sudo docker run -d --privileged --net='none' gcetusic/vroot sudo docker inspect -f "{{.State.Pid}}" fa41ef950da2 6748 sudo ip link add name hostif type veth peer name guestif sudo ln -s "/proc/6748/ns/net" "/var/run/netns/6748" sudo ip link set guestif netns 6748
  15. 15. Goran Cetušić 15 Resources ● https://github.com/imunes/imunes ● https://github.com/imunes/vroot-linux ● https://hub.docker.com/r/imunes/vroot
  16. 16. Goran Cetušić 16 Questions?

×