+ All Categories
Home > Software > WUG #013 How to learn OpenVNets usage from its integration test

WUG #013 How to learn OpenVNets usage from its integration test

Date post: 22-Jan-2018
Category:
Upload: axsh-co-ltd
View: 557 times
Download: 2 times
Share this document with a friend
46
Transcript
Page 1: WUG #013 How to learn OpenVNets usage from its integration test
Page 2: WUG #013 How to learn OpenVNets usage from its integration test

What do we do at Axsh?

● Virtualization● Infrastructure as a Service (IaaS)● Software Defined Networking (SDN)● DevOps, Continuous Integration/Delivery● Free open source software

Page 3: WUG #013 How to learn OpenVNets usage from its integration test

Our two main FOSS projects

● Wakame-vdc

Full featured IaaS solution

(virtual data center)

● OpenVNet

Full featured SDN solution

(virtual network)

● http://axsh.jp

Page 4: WUG #013 How to learn OpenVNets usage from its integration test

What is OpenVNet

● Software defined networking (SDN)● Free open source software● Written in Ruby

● http://axsh.jp/openvnet/● https://github.com/axsh/openvnet

Page 5: WUG #013 How to learn OpenVNets usage from its integration test

Agenda

● Quick introduction to SDN● Simple OpenVNet demo● Detailed look at integration test

● Goal:Learn how to set up advanced OpenVNet environments by reading the integration test

Page 6: WUG #013 How to learn OpenVNets usage from its integration test

The concept of SDN

● First look at vitualization

Hardware

Operating SystemVS

Physical machine

Hardware

Operating System Operating System

Hypervisor

Virtual machines

Page 7: WUG #013 How to learn OpenVNets usage from its integration test

SDN with OpenVNet

Hypervisor host Hypervisor host Hypervisor hostPhysicalNetwork

Virtual(softwaredefined)Network

VM VM VM VM VM VM

NAT DNS DHCP Routers Switches Firewalls

Page 8: WUG #013 How to learn OpenVNets usage from its integration test

The concept of SDN

● A physical network

NIC NIC NIC NIC NIC NIC

172.16.90.0/24

172.16.91.0/24

Router

Page 9: WUG #013 How to learn OpenVNets usage from its integration test

The concept of SDN

● A physical network

NIC NIC NIC NIC NIC NIC

Switch Switch

Switch Switch

Router

Page 10: WUG #013 How to learn OpenVNets usage from its integration test

The concept of SDN

● A virtual network

NIC NIC NIC NIC NIC NIC

Switch Switch

Switch Switch

Router

Page 11: WUG #013 How to learn OpenVNets usage from its integration test

The concept of SDN

● Create any network without changing hardware

NIC NIC NIC NIC NIC NIC

Switch Switch

Switch Switch

Router

Virtual network: 10.100.0.0/24

Page 12: WUG #013 How to learn OpenVNets usage from its integration test

The concept of SDN

● Create any network without changing hardware

NIC NIC NIC NIC NIC NIC

Switch Switch

Switch Switch

Router

Virtual network: 10.100.0.0/24 Virtual network: 192.168.100.0/24

Page 13: WUG #013 How to learn OpenVNets usage from its integration test

The concept of SDN

● Create any network without changing hardware

NIC NIC NIC NIC NIC NIC

Switch Switch

Switch Switch

Router

Virtual network: 172.16.0.0/16

Virtual network: 10.100.0.0/24

Page 14: WUG #013 How to learn OpenVNets usage from its integration test

The concept of SDN● How is this magic possible?● Because OpenVNet controls the switches

(using OpenFlow)

NIC NIC NIC NIC NIC NIC

Switch Switch

Switch Switch

RouterOpenVNet OpenVNet

OpenVNet

Page 15: WUG #013 How to learn OpenVNets usage from its integration test

OpenVNet's inner workings

User laptop

Hypervisor Host

Open vSwitchVNA

VM VM VM VM VM

Vnctl

Web (REST) API

HTTP

Database Vnmgr

VNet Edge

Other networks

Physical network

Page 16: WUG #013 How to learn OpenVNets usage from its integration test

A quick demo

● Try it yourself http://openvnet.org/installation/

Vnctl

WebAPI

Vnmgr

VNA Open vSwitch

VM (inst1)VM (inst1) VM (inst2)Database

Page 17: WUG #013 How to learn OpenVNets usage from its integration test

Demo: 1 network

● http://openvnet.org/creating-virtual-networks/single-network/

VM (inst1)VM (inst1) VM (inst2)

10.100.0.0/24

10.100.0.10 10.100.0.11

Page 18: WUG #013 How to learn OpenVNets usage from its integration test

Demo 2: DHCP server

● http://openvnet.org/creating-virtual-networks/single-network-dhcp/● DHCP is simulated by OpenVNet

VM (inst1)VM (inst1) VM (inst2)

10.100.0.0/24

10.100.0.10 10.100.0.11

DHCP

10.100.0.100

Page 19: WUG #013 How to learn OpenVNets usage from its integration test

Demo 3: Two virtual networks

● http://openvnet.org/creating-virtual-networks/two-networks/

VM (inst1)VM (inst1)

172.16.0.10

DHCP

172.16.0.100

172.16.0.0/24

VM (inst1)VM (inst2)

192.168.100.10

DHCP

192.168.100.100

192.168.100.0/24

Page 20: WUG #013 How to learn OpenVNets usage from its integration test

Demo 4: Router

● http://openvnet.org/creating-virtual-networks/two-networks-router/● Like DHCP, routers are simulated

VM (inst1)VM (inst1)

172.16.0.10

DHCP

172.16.0.100

172.16.0.0/24

VM (inst1)VM (inst2)

192.168.100.10

DHCP

192.168.100.100

192.168.100.0/24

172.16.0.1

192.168.100.1

Page 21: WUG #013 How to learn OpenVNets usage from its integration test

The integration test

● Shows how to set up OpenVNet on multiple hosts

● Included in the OpenVNet source code● https://github.com/axsh/openvnet

● OpenVNet's physical and virtual network setup is integration_test/dataset directory.

● Test scenarios are in the integration_test/lib/vnspec/spec directory.

Page 22: WUG #013 How to learn OpenVNets usage from its integration test

The test code

● The yaml files get translated to vnctl commands

datapaths:

- uuid: dp-1 node_id: vna1 display_name: node1 dpid: "0x0000aaaaaaaaaaaa"

vnctl datapaths add --uuid "dp-1" --node_id "vna1" --display_name "node1" --dpid "0x0000aaaaaaaaaaaa"

Becomes

Page 23: WUG #013 How to learn OpenVNets usage from its integration test

The Integration Test

Page 24: WUG #013 How to learn OpenVNets usage from its integration test

The Integration Test

Page 25: WUG #013 How to learn OpenVNets usage from its integration test

Let's take it step by step

● OpenVNet's simplest physical network● Two VMs in 1 host● This allows us to test many scenarios already

Itest1

VNAWebAPI

Database

Vnmgr

Open vSwitch

VM 1 VM 2

Page 26: WUG #013 How to learn OpenVNets usage from its integration test

Add one host

● Test scenarios with multiple VNA on multiple hosts

● The red network is for OpenVNet's internal communication

Itest1

VNAWebAPI

Database

Vnmgr

Open vSwitch

VM 1 VM 2

Itest2

VNA Open vSwitch

VM 3 VM 4

Eth0 Eth0Eth1 Eth1

Page 27: WUG #013 How to learn OpenVNets usage from its integration test

Add another host in another subnet

● Test scenarios with multiple VNA/hosts on multiple subnets

Itest1

VNAWebAPI

Database

Vnmgr

Open vSwitch

VM 1 VM 2

Eth0Eth1

Itest2

VNA Open vSwitch

VM 3 VM 4

Eth0Eth1

Itest3

VNA Open vSwitch

VM 5 VM 6

Eth0Eth1

Page 28: WUG #013 How to learn OpenVNets usage from its integration test

A quick review

● Remember this whole setup is OpenVNet's physical network

● This topology will never change over the course of the tests

● We can create any virtual network topology we want using VM 1 ~ VM 6

Page 29: WUG #013 How to learn OpenVNets usage from its integration test

One more thing we need

● We can now test everything except VNet Edge

● VNet Edge connects non-OpenVNet managed networks to virtual networks

Page 30: WUG #013 How to learn OpenVNets usage from its integration test

Add VNet Edge● Simulate non-OpenVNet (Legacy) network using Legacy1 VM

Itest1

VNAWebAPI

Database

Vnmgr

Open vSwitch

VM 1 VM 2

Eth0Eth1

Itest2

VNA Open vSwitch

VM 3 VM 4

Eth0Eth1

Itest3

VNA Open vSwitch

VM 5 VM 6

Eth0Eth1

Itest-Edge

Eth1VNA

Open vSwitch

Eth0 Eth2

Legacy1

Eth0

Page 31: WUG #013 How to learn OpenVNets usage from its integration test

We're done

● We can now test all of OpenVNet's features

● We run this entire environment in one host

● That means we use nested virtualization

Page 32: WUG #013 How to learn OpenVNets usage from its integration test

Host (server or laptop)

Nested VMs

Itest1

VNAWebAPI

Database

Vnmgr

Open vSwitch

VM 1 VM 2

Eth0Eth1

Itest2

VNA Open vSwitch

VM 3 VM 4

Eth0Eth1

Itest3

VNA Open vSwitch

VM 5 VM 6

Eth0Eth1

Itest-Edge

Eth1VNA

Open vSwitch

Eth0 Eth2

Legacy1

Eth0

= HOST = VM = VM in VM

Page 33: WUG #013 How to learn OpenVNets usage from its integration test

Building this environment

● The build scripts are available on github

● https://github.com/axsh/wakame-ci-cluster/tree/master/kvm-guests/90-vteskins

● These scripts build the environment but do not run any test code

Page 34: WUG #013 How to learn OpenVNets usage from its integration test

Physical network setup

● OpenVNet needs to be made aware of the physical network layout

● This is the same for every test scenario

● integration_test/dataset/base.yml+base_dp.yml OR base_topology.yml

Page 35: WUG #013 How to learn OpenVNets usage from its integration test

base_dp Vs. base_tp

● A datapath roughly means a single Open vSwitch

● OpenVNet uses internal datapath_network structures to keep track of which network is on which datapath.

Open vSwitch = datapath

Page 36: WUG #013 How to learn OpenVNets usage from its integration test

base_dp Vs. base_tp

● Topology is a new feature that generates datapath_networks automatically

● base_dp sets datapath_networks manually

● base_tp uses Topology

● Which one to use depends on the test scenario

Page 37: WUG #013 How to learn OpenVNets usage from its integration test

Other yaml files are test scenarios

● simple.yml is the simplest scenario with manual datapath_network

● simple_tp.yml is the same scenario with Topology

Page 38: WUG #013 How to learn OpenVNets usage from its integration test

simple.yml / simple_tp.yml

Itest1

VNAWebAPI

Database

Vnmgr

Open vSwitch

VM 1 VM 2

Eth0Eth1

Itest2

VNA Open vSwitch

VM 3 VM 4

Eth0Eth1

Itest3

VNA Open vSwitch

VM 5 VM 6

Eth0Eth1

Itest-Edge

Eth1

VNA

Open vSwitch

Eth0 Eth2

Legacy1

Eth0DHCP

nw-vnet1

DHCP

nw-vnet2

Page 39: WUG #013 How to learn OpenVNets usage from its integration test

simple.yml / simple_tp.yml

VM 1 VM 2 VM 3 VM 4 VM 5 VM 6

DHCP

nw-vnet1 (10.101.0.0/24)

DHCP

nw-vnet2 (10.101.0.0/24)

● Both networks can have the same IP addresses

Page 40: WUG #013 How to learn OpenVNets usage from its integration test

Itest1

VNAWebAPI

Database

Vnmgr

Open vSwitch

VM 1 VM 2

Eth0Eth1

Itest2

VNA Open vSwitch

VM 3 VM 4

Eth0Eth1

Itest3

VNA Open vSwitch

VM 5 VM 6

Eth0Eth1

Itest-Edge

Eth1

VNA

Open vSwitch

Eth0 Eth2

Legacy1

Eth0

router_v2v / router_v2v_tp

VM 1 VM 2 VM 3 VM 4 VM 5 VM 6

DHCP

nw-vnet1

DHCP

nw-vnet2

Page 41: WUG #013 How to learn OpenVNets usage from its integration test

router_v2v / router_v2v_tp

VM 1 VM 2 VM 3 VM 4 VM 5 VM 6

DHCP

nw-vnet1 (10.101.0.0/24)

DHCP

nw-vnet2 (10.102.0.0/24)

● Two networks with a router● IP addresses can't be the same with

a router between networks

Page 42: WUG #013 How to learn OpenVNets usage from its integration test

Service.yml

VM 1 VM 2 VM 3 VM 4 VM 5 VM 6

DHCP

nw-vnet1 (10.101.0.0/24)

DHCP

nw-vnet2 (10.101.0.0/24)

● Adds DNS service

DNS

DNS

Page 43: WUG #013 How to learn OpenVNets usage from its integration test

Other scenarios

● edge.yml: L2 connectivity between virtual network and non-OpenVNet managed network

● event.ymlChanging virtual network layout on the fly

● secg.yml / secg_reference.ymlSecurity groups and connection tracking

● edge_esxi.ymlDeprecated esxi support

Page 44: WUG #013 How to learn OpenVNets usage from its integration test

Other scenarios

● filter.ymlSimple firewall rules

● router_p2v.ymlRouting between virtual and physical networks

● WanEdgeNAT and routing to global network

Page 45: WUG #013 How to learn OpenVNets usage from its integration test

OpenVNet feature list

● Two protocols to support virtual networking.

- **MAC2MAC** (Axsh original protocol for physical L2 tunneling)

- **GRE** (protocol for L3 tunneling)● Simulated DHCP service● Simulated DNS service● L3 routing between virtual networks.● Single hop L3 routing between physical and virtual networks.● Firewall● Connection tracking● Integration with Wakame-vdc.● VNet Edge feature (connect virtual and physical networks)

Page 46: WUG #013 How to learn OpenVNets usage from its integration test

Thank you for listeninghttp://axsh.jp


Recommended