mininet


An Instant Virtual Network on your Laptop (or other PC)

1. Download/Get Started With Mininet

Option 2: Native Installation from Source

$ git clone git://github.com/mininet/mininet
$ cd mininet
$ git tag   # list available versions
$ git checkout -b 2.2.2rc1 2.2.2rc1 # or whatever version you wish to install
$ cd ..
$ mininet/util/install.sh -a

2. Mininet Usage

  • $ preceeds Linux commands that should be typed at the shell prompt

  • mininet> preceeds Mininet commands that should be typed at Mininet’s CLI,

  • # preceeds Linux commands that are typed at a root shell prompt

$ sudo bash
# mn --help
# mn
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1)
*** Configuring hosts
h1 h2
*** Starting controller
c0
*** Starting 1 switches
s1 ...
*** Starting CLI:
mininet> nodes
available nodes are:
c0 h1 h2 s1
mininet> pingall
*** Ping: testing ping reachability
h1 -> h2
h2 -> h1
*** Results: 0% dropped (2/2 received)
mininet> h1 ping h2
mininet> h1 ping s1
mininet> h1 ifconfig
mininet> s1 ifconfig
mininet> exit
*** Stopping 1 controllers
c0
*** Stopping 2 links
..
*** Stopping 1 switches
s1
*** Stopping 2 hosts
h1 h2
*** Done

3. Mininet connect to OpenDaylight

# mn --controller=remote,ip=192.168.250.8 --topo=tree,1,3 --mac
*** Creating network
*** Adding controller
Unable to contact the remote controller at 192.168.250.8:6653
Unable to contact the remote controller at 192.168.250.8:6633
Setting remote controller to 192.168.250.8:6653
*** Adding hosts:
h1 h2 h3
*** Adding switches:
s1
*** Adding links:
(s1, h1) (s1, h2) (s1, h3)
*** Configuring hosts
h1 h2 h3
*** Starting controller
c0
*** Starting 1 switches
s1 ...
*** Starting CLI:

mininet> net
h1 h1-eth0:s1-eth1
h2 h2-eth0:s1-eth2
h3 h3-eth0:s1-eth3
s1 lo:  s1-eth1:h1-eth0 s1-eth2:h2-eth0 s1-eth3:h3-eth0
c0

mininet> links
s1-eth1<->h1-eth0 (OK OK)
s1-eth2<->h2-eth0 (OK OK)
s1-eth3<->h3-eth0 (OK OK)

mininet> dpctl dump-flows

mininet> dump

Last updated