Skip to content
okinawaopenlabs edited this page Jul 22, 2015 · 13 revisions

OF-Pache_tutorial_NW構成

This figure shows OF-Patch configuration example.
In this tutorial, we make the same configuration as this figure.

##Set up Virtual Machine and import Virtual Machine Image

VM image that has finished installation of OF-Patch can be found here.

Important:

  • For this VM image, the user name is 'ofpatch' with password 'ofpatch'.
  • This can be import into virtualbox.
    When you import this VM image, "Network" configuration is as follows:

VirtualBox_NIC (Attatched to: Bridge Adapter)

If you install yourself, please refer to following page(not use this VM image).

##Verification

Please connecto to VM via SSH.
Just before, you should final check the following item:

  • Modify config file

sudo vi /var/www/html/ofc/ryu/ctrl/ofp/common/Definition.js

Edit as follows:

var OFPM_URL = "http://<your_ip_address>:18080/ofpm";  

Note:
<your_ip_address> depends on the environment.

  • Run mininet

cd ~/mininet
sudo python mininet_3sw4host_topo.py

In your web browser, go to "http://<your_ip_address>".

GUI_初期状態

This is OF-Patch GUI.
Host and port information that you just registered has been output.

We try to check the flow table of the leaf and spine from mininet.
Not registed anything to the flow table.

mininet> dpctl dump-flows --protocol OpenFlow13
*** spine1 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=33.788s, table=0, n_packets=15, n_bytes=1170, priority=200 actions=drop
*** leaf1 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=33.758s, table=0, n_packets=22, n_bytes=1728, priority=200 actions=drop
*** leaf2 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=33.747s, table=0, n_packets=23, n_bytes=1806, priority=200 actions=drop

Note:
When checking flow table, you must specify "OpenFlow 13".

Try ping from host1 to host4. It does not succeed.

mininet> host1 ping host4
PING 10.0.80.4 (10.0.80.4) 56(84) bytes of data.
From 10.0.80.1 icmp_seq=1 Destination Host Unreachable
From 10.0.80.1 icmp_seq=2 Destination Host Unreachable
From 10.0.80.1 icmp_seq=3 Destination Host Unreachable
^C
--- 10.0.80.4 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4008ms
pipe 3

GUI_接続前

Click each other port you want to connect on the GUI.
You get a confirmation screen, click OK.
After that, click the "commit" button in the upper left.

GUI_接続後

Please make sure that the "Success" is displayed.

Try ping from host1 to host4 again.
It worked this time.

mininet> host1 ping host4
PING 10.0.80.4 (10.0.80.4) 56(84) bytes of data.
From 10.0.80.1 icmp_seq=1 Destination Host Unreachable
From 10.0.80.1 icmp_seq=2 Destination Host Unreachable
From 10.0.80.1 icmp_seq=3 Destination Host Unreachable
64 bytes from 10.0.80.1: icmp_seq=5 ttl=64 time=1.30 ms
64 bytes from 10.0.80.1: icmp_seq=6 ttl=64 time=0.052 ms
64 bytes from 10.0.80.1: icmp_seq=7 ttl=64 time=0.048 ms
64 bytes from 10.0.80.1: icmp_seq=8 ttl=64 time=0.053 ms
64 bytes from 10.0.80.1: icmp_seq=9 ttl=64 time=0.053 ms

Try to check the flow table of the leaf and spine from mininet,
We are able to see flow entry in flow table.

mininet> dpctl dump-flows --protocol OpenFlow13
*** spine1 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=215.439s, table=0, n_packets=6, n_bytes=532, idle_timeout=65535, priority=800,in_port=1,dl_src=00:00:00:00:00:03 actions=output:2
 cookie=0x0, duration=218.126s, table=0, n_packets=3, n_bytes=126, idle_timeout=65535, priority=800,in_port=1,dl_src=00:00:00:00:00:01 actions=output:2
 cookie=0x0, duration=216.891s, table=0, n_packets=7, n_bytes=574, idle_timeout=65535, priority=800,in_port=2,dl_src=00:00:00:00:00:02 actions=output:1
 cookie=0x0, duration=23685.122s, table=0, n_packets=16, n_bytes=1248, priority=200 actions=drop
*** leaf1 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=217.334s, table=0, n_packets=7, n_bytes=574, idle_timeout=65535, priority=800,in_port=1,dl_src=00:00:00:00:00:02 actions=set_field:e2:1f:6a:ab:d0:b6->eth_src,set_field:ee:cd:ec:4f:52:ea->eth_dst,output:2
 cookie=0x0, duration=215.231s, table=0, n_packets=6, n_bytes=532, idle_timeout=65535, priority=800,in_port=2,dl_src=ee:cd:ec:4f:52:ea,dl_dst=e2:1f:6a:ab:d0:b6 actions=set_field:00:00:00:00:00:03->eth_src,set_field:ff:ff:ff:ff:ff:fc->eth_dst,output:1
 cookie=0x0, duration=215.826s, table=0, n_packets=0, n_bytes=0, idle_timeout=600, priority=600,in_port=2,dl_src=ee:cd:ec:4f:52:ea,dl_dst=e2:1f:6a:ab:d0:b6 actions=drop
 cookie=0x0, duration=217.973s, table=0, n_packets=3, n_bytes=126, idle_timeout=65535, priority=800,in_port=2,dl_src=ee:cd:ec:4f:52:ea,dl_dst=ff:ff:ff:ff:ff:ff actions=set_field:00:00:00:00:00:01->eth_src,set_field:ff:ff:ff:ff:ff:fe->eth_dst,output:1
 cookie=0x0, duration=218.827s, table=0, n_packets=0, n_bytes=0, idle_timeout=600, priority=600,in_port=2,dl_src=ee:cd:ec:4f:52:ea,dl_dst=ff:ff:ff:ff:ff:ff actions=drop
 cookie=0x0, duration=303.112s, table=0, n_packets=2, n_bytes=140, priority=400,in_port=2 actions=CONTROLLER:65535
 cookie=0x0, duration=23685.092s, table=0, n_packets=21, n_bytes=1638, priority=200 actions=drop
*** leaf2 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=216.544s, table=0, n_packets=7, n_bytes=574, idle_timeout=65535, priority=800,in_port=3,dl_src=e2:1f:6a:ab:d0:b6,dl_dst=ee:cd:ec:4f:52:ea actions=set_field:00:00:00:00:00:02->eth_src,set_field:ff:ff:ff:ff:ff:fd->eth_dst,output:1
 cookie=0x0, duration=217.834s, table=0, n_packets=1, n_bytes=42, idle_timeout=600, priority=600,in_port=3,dl_src=e2:1f:6a:ab:d0:b6,dl_dst=ee:cd:ec:4f:52:ea actions=drop
 cookie=0x0, duration=218.448s, table=0, n_packets=3, n_bytes=126, idle_timeout=65535, priority=800,in_port=1,dl_src=00:00:00:00:00:01 actions=set_field:ee:cd:ec:4f:52:ea->eth_src,set_field:ff:ff:ff:ff:ff:ff->eth_dst,output:3
 cookie=0x0, duration=215.592s, table=0, n_packets=6, n_bytes=532, idle_timeout=65535, priority=800,in_port=1,dl_src=00:00:00:00:00:03 actions=set_field:ee:cd:ec:4f:52:ea->eth_src,set_field:e2:1f:6a:ab:d0:b6->eth_dst,output:3
 cookie=0x0, duration=303.096s, table=0, n_packets=1, n_bytes=42, priority=400,in_port=3 actions=CONTROLLER:65535
 cookie=0x0, duration=23685.077s, table=0, n_packets=22, n_bytes=1728, priority=200 actions=drop

GUI_切断前

In order to cut the connection, click the line connecting the port.
You get a confirmation screen, click OK.
After that, click the "commit" button in the upper left.

If you check the flow, it is off what had been previously registered.

mininet> dpctl dump-flows --protocol OpenFlow13
*** spine1 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):  
 cookie=0x0, duration=23743.468s, table=0, n_packets=16, n_bytes=1248, priority=200 actions=drop
*** leaf1 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=23743.439s, table=0, n_packets=21, n_bytes=1638, priority=200 actions=drop
*** leaf2 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=23743.424s, table=0, n_packets=22, n_bytes=1728, priority=200 actions=drop

Try ping from host1 to host4.
It does not succeed.

mininet> host1 ping host4
PING 10.0.80.4 (10.0.80.4) 56(84) bytes of data.
From 10.0.80.1 icmp_seq=9 Destination Host Unreachable
From 10.0.80.1 icmp_seq=10 Destination Host Unreachable
From 10.0.80.1 icmp_seq=11 Destination Host Unreachable
Clone this wiki locally