Re: [Ryu-devel] Controlling OVS from Ryu controller

2017-05-07 Thread Fujimoto Satoshi
Hi, Deni Of course, you can modify codes as you want, including bridge.py. And, about the exception you got, the response from OVS may be delayed due to network delay. Please try to extend the timeout, e.g. 2, 3, and so on. Thanks, Fujimoto On 2017年05月03日 23:49, Deni Toruan wrote: Hi Fujimo

Re: [Ryu-devel] Controlling OVS from Ryu controller

2017-05-03 Thread Deni Toruan
Hi Fujimoto san, Thank you for the information. To add the port, I didn't use "run_command()" in bridge.py. To be honest, I didn,t know yet how to use it :). However, to add the port, I was trying to add function (add_port) in bridge.py. The function is very similar to the del_port function. It wa

Re: [Ryu-devel] Controlling OVS from Ryu controller

2017-04-27 Thread Fujimoto Satoshi
Hi, Deni If APIs in bridge.py are not enough to satisfy your demand, you can use "run_command()" in bridge.py. "run_command()" calls functions in vsctl.py. I think you will be able to add/delete bridges by using this function. :) https://github.com/osrg/ryu/blob/master/ryu/lib/ovs/bridge.py#L10

Re: [Ryu-devel] Controlling OVS from Ryu controller

2017-04-27 Thread Deni Toruan
Hi Fujimoto san, Thank you very much for the code. I have ran it and it was working. Thanks, you have saved my days. Btw, I have another questions related to this issue. I do hope you will not mind :) a. When I am trying to add port and add/delete bridge, I did not find any function related to th

Re: [Ryu-devel] Controlling OVS from Ryu controller

2017-04-25 Thread Fujimoto Satoshi
Hi, Deni In your application, I think there is no one which calls "ovs_bridge()". It is better to implement your code in Event Handlers. For example, Features Reply Handler will be called when your application gets the Features Reply message (≒ when the connection to the OVS is established). Fo

Re: [Ryu-devel] Controlling OVS from Ryu controller

2017-04-25 Thread Deni Toruan
Dear Fujimoto san, thank you very much for your information. I have tried to put the code to the file: simple_switch.py (as in attachment), and try to run it in Ryu controller machine. The code is running, how ever, when I checked in the OVS machine (VM IP: 10.0.0.5), there is no changes. The port

Re: [Ryu-devel] Controlling OVS from Ryu controller

2017-04-24 Thread Fujimoto Satoshi
Hi, Deni You can make a connection by instantiating OVSBridge: ovs_bridge = OVSBridge(None, datapath.id, 'tcp:127.0.0.1:6632', timeout=1) And by the following code, for example, you can delete a port: ovs_bridge = OVSBridge(None, datapath.id, 'tcp:127.0.0.1:6632', timeout=1)

Re: [Ryu-devel] Controlling OVS from Ryu controller

2017-04-24 Thread Deni Toruan
Hi Satoshi san, thank you for your kind reply. On Mon, Apr 24, 2017 at 5:07 AM, Fujimoto Satoshi < [email protected]> wrote: > Hi, Deni > > The problem may be caused by that you use "ovsdb_event" and "ovs_vsctl" at > the same time. > If you don't need to monitor the status of OVS, you

Re: [Ryu-devel] Controlling OVS from Ryu controller

2017-04-23 Thread Fujimoto Satoshi
Hi, Deni The problem may be caused by that you use "ovsdb_event" and "ovs_vsctl" at the same time. If you don't need to monitor the status of OVS, you should not use "ovsdb_event". Also, you can use "OVSBridge" to control your OVS. "OVSBridge" calls "ovs_vsctl.VSCtl()" in __init__(), and wrap

[Ryu-devel] Controlling OVS from Ryu controller

2017-04-23 Thread Deni Toruan
Dear all, Currently, I am trying to make a connection between Ryu Controller and OVS, and trying to modify OVS from controller (add bridge, add port, delete port, etc) dynamically. Currently, the OVS and Ryu controller can be connected. They are running in different VM. However, when I try to run