Learning OVS (open vswitch) using mininet — Part 2

In the last article we have seen how to create a default topology and some useful commands to get familiar with mininet. In this article we will create other topologies using mininet.

By default, mininet is creating two hosts and one switch.

Case 1 : Creating topology using four hosts and one switch.

root@mininet-vm:~# mn –topo=single,4
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3 h4
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1) (h3, s1) (h4, s1)
*** Configuring hosts
h1 h2 h3 h4
*** Starting controller
c0
*** Starting 1 switches
s1 …
*** Starting CLI:

a) Let’s check the ovs status. We can see that four interfaces are created on OVS.

mininet> sh ovs-vsctl show
0b8ed0aa-67ac-4405-af13-70249a7e8a96
Bridge “s1”
Controller “ptcp:6634”
Controller “tcp:127.0.0.1:6633”
is_connected: true
fail_mode: secure
Port “s1”
Interface “s1”
type: internal
Port “s1-eth3”
Interface “s1-eth3”
Port “s1-eth2”
Interface “s1-eth2”
Port “s1-eth1”
Interface “s1-eth1”
Port “s1-eth4”
Interface “s1-eth4”
ovs_version: “2.0.2”

b) Checking the number of nodes and ip address information.

mininet> nodes
available nodes are:
c0 h1 h2 h3 h4 s1
mininet> dump
<Host h1: h1-eth0:10.0.0.1 pid=2698>
<Host h2: h2-eth0:10.0.0.2 pid=2701>
<Host h3: h3-eth0:10.0.0.3 pid=2703>
<Host h4: h4-eth0:10.0.0.4 pid=2705>
<OVSSwitch s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None,s1-eth3:None,s1-eth4:None pid=2710>
<Controller c0: 127.0.0.1:6633 pid=2691>

Case 2 : Creating linear topology with 4 nodes. Here we can see that four hosts and same number of switches are created.

root@mininet-vm:~# mn –topo=linear,4
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3 h4
*** Adding switches:
s1 s2 s3 s4
*** Adding links:
(h1, s1) (h2, s2) (h3, s3) (h4, s4) (s2, s1) (s3, s2) (s4, s3)
*** Configuring hosts
h1 h2 h3 h4
*** Starting controller
c0
*** Starting 4 switches
s1 s2 s3 s4 …
*** Starting CLI:

a) Checking the status OVS using below command we can see that four bridges are created.

mininet> sh ovs-vsctl show
0b8ed0aa-67ac-4405-af13-70249a7e8a96
Bridge “s3”
Controller “ptcp:6636”
Controller “tcp:127.0.0.1:6633”
fail_mode: secure
Port “s3”
Interface “s3”
type: internal
Port “s3-eth1”
Interface “s3-eth1”
Port “s3-eth2”
Interface “s3-eth2”
Port “s3-eth3”
Interface “s3-eth3”
Bridge “s2”
Controller “ptcp:6635”
Controller “tcp:127.0.0.1:6633”
fail_mode: secure
Port “s2”
Interface “s2”
type: internal
Port “s2-eth3”
Interface “s2-eth3”
Port “s2-eth1”
Interface “s2-eth1”
Port “s2-eth2”
Interface “s2-eth2”
Bridge “s4”
Controller “ptcp:6637”
Controller “tcp:127.0.0.1:6633”
fail_mode: secure
Port “s4-eth1”
Interface “s4-eth1”
Port “s4”
Interface “s4”
type: internal
Port “s4-eth2”
Interface “s4-eth2”
Bridge “s1”
Controller “ptcp:6634”
Controller “tcp:127.0.0.1:6633”
fail_mode: secure
Port “s1-eth2”
Interface “s1-eth2”
Port “s1”
Interface “s1”
type: internal
Port “s1-eth1”
Interface “s1-eth1”
ovs_version: “2.0.2”

b) Checking the number of nodes and IP information.

mininet> nodes
available nodes are:
c0 h1 h2 h3 h4 s1 s2 s3 s4

mininet> dump
<Host h1: h1-eth0:10.0.0.1 pid=2986>
<Host h2: h2-eth0:10.0.0.2 pid=2989>
<Host h3: h3-eth0:10.0.0.3 pid=2991>
<Host h4: h4-eth0:10.0.0.4 pid=2993>
<OVSSwitch s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None pid=2998>
<OVSSwitch s2: lo:127.0.0.1,s2-eth1:None,s2-eth2:None,s2-eth3:None pid=3001>
<OVSSwitch s3: lo:127.0.0.1,s3-eth1:None,s3-eth2:None,s3-eth3:None pid=3004>
<OVSSwitch s4: lo:127.0.0.1,s4-eth1:None,s4-eth2:None pid=3007>
<Controller c0: 127.0.0.1:6633 pid=2979>

Case 3 : Creating tree topology here it’s creating four hosts and three switches.

root@mininet-vm:~# mn –topo=tree,2,2
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3 h4
*** Adding switches:
s1 s2 s3
*** Adding links:
(s1, s2) (s1, s3) (s2, h1) (s2, h2) (s3, h3) (s3, h4)
*** Configuring hosts
h1 h2 h3 h4
*** Starting controller
c0
*** Starting 3 switches
s1 s2 s3 …
*** Starting CLI:

a) Checking the status of open vswitch.

mininet> sh ovs-vsctl show
0b8ed0aa-67ac-4405-af13-70249a7e8a96
Bridge “s2”
Controller “ptcp:6635”
Controller “tcp:127.0.0.1:6633”
is_connected: true
fail_mode: secure
Port “s2”
Interface “s2”
type: internal
Port “s2-eth1”
Interface “s2-eth1”
Port “s2-eth3”
Interface “s2-eth3”
Port “s2-eth2”
Interface “s2-eth2”
Bridge “s1”
Controller “tcp:127.0.0.1:6633”
is_connected: true
Controller “ptcp:6634”
fail_mode: secure
Port “s1-eth2”
Interface “s1-eth2”
Port “s1-eth1”
Interface “s1-eth1”
Port “s1”
Interface “s1”
type: internal
Bridge “s3”
Controller “tcp:127.0.0.1:6633”
is_connected: true
Controller “ptcp:6636”
fail_mode: secure
Port “s3-eth3”
Interface “s3-eth3”
Port “s3-eth1”
Interface “s3-eth1”
Port “s3”
Interface “s3”
type: internal
Port “s3-eth2”
Interface “s3-eth2”
ovs_version: “2.0.2”

b) Checking the number of nodes and ip information.

mininet> nodes
available nodes are:
c0 h1 h2 h3 h4 s1 s2 s3
mininet> dump
<Host h1: h1-eth0:10.0.0.1 pid=3478>
<Host h2: h2-eth0:10.0.0.2 pid=3481>
<Host h3: h3-eth0:10.0.0.3 pid=3483>
<Host h4: h4-eth0:10.0.0.4 pid=3485>
<OVSSwitch s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None pid=3490>
<OVSSwitch s2: lo:127.0.0.1,s2-eth1:None,s2-eth2:None,s2-eth3:None pid=3493>
<OVSSwitch s3: lo:127.0.0.1,s3-eth1:None,s3-eth2:None,s3-eth3:None pid=3496>
<Controller c0: 127.0.0.1:6633 pid=3471>

In my next article I will show how to use custom options while creating a topology.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s