coscup sdn workshop - mininet

Post on 16-Feb-2017

94 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Mininethwchiu@cs.nctu.edu.tw

About Me

Hwchiu (邱渣)在 synology 當小小研替NSL @ NCTU

主要研究OpenvSwitch

Floodlight

Mininet

Floodlight Contributor

Architecture

Third-module

Outline

SDN againIntroduction to MininetMininet basic operationCustom Topology

SDN Brief

SDN Brief

SDN Brief

SDN Brief

SDN Advantage Example

Mininet Introduction

What

Why

Where

How

What

Mininet is a network emulator

Mininet creates a realistic virtual network, running real kernel, switch and application code, on a single machine (VM, cloud or native) - mininet.org

What (Cond’t)

Switch

Switch

Switch

Switch

Switch

Switch

Switch

Switch

Switch Switch

What (Cond’t)

What (Cond’t)

Switch

Switch

Switch

Switch

Switch

Switch

Switch

Switch

Switch Switch

Why

DeveloperTesting Controller

Testing Network Application

Testing before deploy

Compare to the real environmentFlexible

Scalable

Low Cost

Prove of Concept

Where

Official Page http://mininet.org

Githubhttps://github.com/mininet/mininet

How

Linux Server

Host

Switch

Host

How (Cont’d)

Linux Network Namespace

A network namespace is logically another copy of the network stack, with its own routes, firewall rules and network devices.

Network isolation.

How (Cont’d) - NS

Linux Server

ns-host1 ns-host2

ns-switch

How (Cont’d) - NIC

Linux Server

ns-host1 ns-host2

ns-switch

eth0 eth0

eth0 eth1

How (Cont’d) - veth

Linux Server

ns-host1 ns-host2

ns-switch

eth0 eth0

eth0 eth1

Mininet Basic Operation

OperationController

Topology

Information

MethodCommand Line

Python Script

Operation

Start upsudo mn

Clean upSudo mn -c

Controller

Connect to the controllermn --controller=<type>,,ip=<ip>,port=<port>

Type: osvc, default, remote ...etc

mn --controller=remote, ip=127.0.0.1,port=6653

Topology

Default TopologyOne switch + two hosts.

sudo mn

Host

Switch

Host

Topology (Cont’d)

mininet> net

mininet> nodes

Topology (Cont’d)

mininet> dumps

Topology (Cont’d)

Default topologysingle

One switch + <number> hosts.

mn --topo=single,5

Host

Switch

HostHost HostHost

Topology (Cont’d)

Default topologylinear

n * (switch + host)

mn --topo=linear,2

Host

Switch

Host Host

SwitchSwitch

Topology (Cont’d)

Default topologytree

Binary Tree.

mn --topo=tree,2

Host

Switch

Host HostHost

Switch

Switch

Node command

<node> <command>Mininet > h1 ifconfig

Mininet > s0 ifconfig

Mininet > h1 ps

Mininet > h1 ping h2

Mininet > h1 iperf -s &

Custom Topology

Write the custom mininet script (custom.py)

sudo python custom.py

ExampleLeaf-spine.py

Tutorial

https://github.com/mininet/mininet/wiki/Introduction-to-Mininet

Custom Topology

Get Mininet Instancenet = Mininet()

Add switchname=”s0”

sw = net.addSwitch(name)

Add hostname=”h0”

host = net.addHost(name)

Add Linknet.addLink(sw, host) <<<< instance of switch/host

Q&A

top related