An Intro To Mininet: TELE4642: Week5
An Intro To Mininet: TELE4642: Week5
An Intro To Mininet: TELE4642: Week5
TELE4642: Week5
Types of Network Testbeds
n Platforms for Network/Systems Teaching
h1 (10.0.0.1) s1 h2 (10.0.0.2)
h1 (10.0.0.1) s1 h2 (10.0.0.2)
sudo bash # Connect switch ports to OVS
# Create host namespaces ovs-vsctl add-port s1 s1-eth1
ip netns add h1 ovs-vsctl add-port s1 s1-eth2
ip netns add h2 ovs-vsctl show
# Create switch # Set up OpenFlow controller
ovs-vsctl add-br s1 ovs-vsctl set-controller s1 tcp:127.0.0.1
# Create links ovs-controller ptcp: &
ip link add h1-eth0 type veth peer name s1-eth1 ovs-vsctl show
ip link add h2-eth0 type veth peer name s1-eth2 # Configure network
ip link show ip netns exec h1 ifconfig h1-eth0 10.1
# Move host ports into namespaces ip netns exec h1 ifconfig lo up
ip link set h1-eth0 netns h1 ip netns exec h2 ifconfig h2-eth0 10.2
ip link set h2-eth0 netns h2 ip netns exec h1 ifconfig lo up
ip netns exec h1 ip link show ifconfig s1-eth1 up
ip netns exec h2 ip link show ifconfig s1-eth2 up
# Test network
ip netns exec h1 ping -c1 10.2
h1 (10.0.0.1) s1 h2 (10.0.0.2)
h1 = net.addHost( 'h1' )
h2 = net.addHost( 'h2' )
s1 = net.addSwitch( 's1' )
c0 = net.addController( 'c0' )
net.addLink( h1, s1 )
net.addLink( h2, s1 )
net.start()
CLI( net )
q Abstraction
n Host: emulated as an OS level process
n Switch: emulated by using software-based switch
q E.g., Open vSwitch, SoftSwitch
n Display links
mininet> net
q Link variations
$ sudo mn -link tc,bw=[bandwidth],delay=[delay_in_millisecond]
q Python Interpreter
n Print accessible local variables
$ py locals()
n Execute a method through invoking mininet API
$ py [mininet_name_space].[method]
n MiniEdit
q A GUI application which
eases the Mininet
topology generation
q Either save the
topology or export as a
Mininet python script
n Visual Network
Description (VND)
q A GUI tool which allows
automate creation of
Mininet and OpenFlow
controller scripts
h1 h2 p1 acquire Controller h1 h2 p1
route
insert
flow
1 2 1 2
Route #1
0 1 2 1 3 0
switch2 switch3
3 2
Route #2
switch4
Northbound API
n ryu.app.ofctl_rest
q http://ryu.readthedocs.io/en/latest/app/ofctl_rest.html
http://osrg.github.io/ryu-book/en/html/
n Procedures
q Start Ryu controller with Simple Switch 1.3 application
n http://sdnhub.org/tutorials/openflow-1-3/
Network Performance
5-24
Lab2: Fat-Tree Topology Generation
Network Performance
5-25
Useful resources
n http://sdnhub.org/resources/
n http://mininet.org/walkthrough/
Network Performance
5-26