faucetsdn / ryu

Ryu component-based software defined networking framework
https://ryu-sdn.org
Apache License 2.0
1.51k stars 1.16k forks source link

Timeout when OF controller is restarting #159

Open ralonsoh opened 3 years ago

ralonsoh commented 3 years ago

Hello:

In OpenStack Neutron, we use a fork of ryu library, os-ken. Recently we have backported two patches related to app/ofctl, when the datapath disconnects:

That solved some issues we had initially when the OF controller is restarting. For example, when we define new OpenFlow protocols.

Error snippet: https://paste.opendev.org/show/810072/

After we set the new OF protocols, the OF controller is restarted. When we try to execute a command, we receive the "unknown dpid" error (a InvalidDatapath exception is thrown) until the new OF controller is registered in "OfctlService._switches".

However, in some cases the OF controller is present and we try to process the message. The message XID should be None, but as you can see in the snippet, the XID has been already set. What I don't know is if this is an old message being processed again and what can we do:

In any case, because of this assertion exception, we never receive a reply and we timeout. I think "OfctlService._handle_send_msg" should handle this possible situation, returning a normal reply or an exception.

Regards.