Hello, List,
thanks for the rapid feedback.
After plugging strategic logger code at the suggested files' lines, I am
still unable to spot the problem.
That is:
- OVS switch is indeed successful in establishing a connection to
the remote manager.
- I still get the wrong logger message at Ryu console. Who is
receiving the connection? Why I do not catch the event?
The following is the OVS configuration:
ovsdb-server --remote=tcp:193.168.168.1:6640
--pidfile --detach --no-chdir
ovs-vsctl init
ovs-vswitchd --pidfile --detach --no-chdir
-------------------------------------------------------
Next, I paste the log information output to the screen from OVS:
2016-10-17T18:49:15Z|00002|reconnect|INFO|tcp:193.168.168.1:6640:
connecting...
2016-10-17T18:49:15Z|00003|reconnect|INFO|tcp:193.168.168.1:6640: connected
------------------------------------------------------
As with the previous thread message, I get a the following from Ryu (@
193.168.168.1):
loading app ovsdb_example.py
loading app ryu.services.protocols.ovsdb.manager
instantiating app ovsdb_example.py of MyApp
instantiating app ryu.services.protocols.ovsdb.manager of OVSDB
BRICK OVSDB
PROVIDES EventReadRequest TO {'OVSDB': set([])}
PROVIDES EventNewOVSDBConnection TO {'MyApp': set([])}
PROVIDES EventModifyRequest TO {'OVSDB': set([])}
CONSUMES EventReadRequest
CONSUMES EventModifyRequest
BRICK MyApp
CONSUMES EventNewOVSDBConnection
Listening on 0.0.0.0:6640 for clients
New connection from 193.168.168.106:46874
-----------------------------------------------------
It does not seem to be rejecting or dropping the connection,
nevertheless I do not catch the event with the OVSDB manager library
code provided in the documentation. Any ideas?
Thanks again,
Luis.
On 20/10/16 07:44, Jason Kölker wrote:
On Wed, Oct 19, 2016 at 2:35 PM, Luis Sanabria-Russo <[email protected]> wrote:
Hello List,
after going through the archives, and doing many combinations with the
"OVSDB" keyword in Google, I felt defeated, and finally decided to query
your collective wisdom, :).
I've reviewed many questions asking for a quick explanation on how to use
the OVSDB Manager library, or how to send OVSDB commands to an OVS switch.
Nevertheless, I could not omit the fact that the example provided in the
documentation does not even catch the "EventNewOVSDBConnection" event.
Further, it does not even include ryu.controller.handler for handling the
event.
So my question is: how can I log OVS devices trying to connect to the remote
manager (Ryu)? (I'm assuming that the configuration of bridges and ports can
be quickly derived from the example)
Right now I have been able to run the following (short) application:
---------------------------------------------
import uuid
from ryu.base import app_manager
from ryu.controller.handler import set_ev_cls
from ryu.services.protocols.ovsdb import api as ovsdb
from ryu.services.protocols.ovsdb import event as ovsdb_event
class MyApp(app_manager.RyuApp):
@set_ev_cls(ovsdb_event.EventNewOVSDBConnection)
def handle_new_ovsdb_connection(self, ev):
system_id = ev.system_id
self.logger.info('New OVSDB connection from system id %s',
systemd_id)
---------------------------------------------
Nevertheless, as shown next, the logger.info output do not correspond to
MyApp class, in fact, modifying the log message at
/ryu/services/protocols/ovsdb/manager.py (line 93 inside _accept method)
does not change the output of the log message:
----------------------------------------------
loading app ovsdb_example.py
loading app ryu.services.protocols.ovsdb.manager
instantiating app ovsdb_example.py of MyApp
instantiating app ryu.services.protocols.ovsdb.manager of OVSDB
BRICK OVSDB
PROVIDES EventNewOVSDBConnection TO {'MyApp': set([])}
PROVIDES EventModifyRequest TO {'OVSDB': set([])}
PROVIDES EventReadRequest TO {'OVSDB': set([])}
CONSUMES EventModifyRequest
CONSUMES EventReadRequest
BRICK MyApp
CONSUMES EventNewOVSDBConnection
Listening on 0.0.0.0:6640 for clients
New connection from 193.168.168.106:38156
----------------------------------------------
Any ideas?
Thanks in advance for the help,
There are two possibilities here, either the schema was not found [0]
or the system_id [1] was not found. Either case will cause the OVSDB
client application to terminate and the event not to fire [2].
Happy Hacking!
7-11
[0]
https://github.com/osrg/ryu/blob/master/ryu/services/protocols/ovsdb/client.py#L291
[1]
https://github.com/osrg/ryu/blob/master/ryu/services/protocols/ovsdb/client.py#L323
[2]
https://github.com/osrg/ryu/blob/master/ryu/services/protocols/ovsdb/manager.py#L146
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel
--
*Luis Sanabria-Russo*
Researcher
Communications Technologies Division
Centre Tecnològic de Telecomunicacions de Catalunya - CTTC
www.cttc.es <http://www.cttc.es/>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel