+ All Categories
Home > Technology > Building a network emulator with Docker and Open vSwitch

Building a network emulator with Docker and Open vSwitch

Date post: 08-Apr-2017
Category:
Upload: goran-cetusic
View: 458 times
Download: 0 times
Share this document with a friend
16
Goran Cetušić 1 Building a network emulator with Docker and Open vSwitch
Transcript

Goran Cetušić1

Building a network emulator with Docker and

Open vSwitch

Goran Cetušić2

What do we need?

● Resource isolation● A PC● A link● A switch● A router

Goran Cetušić3

Namespaces

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

Goran Cetušić5

Docker

Goran Cetušić6

FROM debian:jessie

MAINTAINER Goran Cetusic <[email protected]>

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

Goran Cetušić7

OpenvSwitch

Goran Cetušić8

Networking

Goran Cetušić9

Architecture

Goran Cetušić10

Init process

Goran Cetušić11

The zombie problem

Goran Cetušić12

Optimization

Goran Cetušić13

Docker storage drivers

// Slice of drivers that should be used in an order

priority = []string{

"aufs",

"btrfs",

"devicemapper",

"vfs",

"overlayfs",

}

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

Goran Cetušić15

Resources

● https://github.com/imunes/imunes● https://github.com/imunes/vroot-linux● https://hub.docker.com/r/imunes/vroot

Goran Cetušić16

Questions?


Recommended