0

I have tried to use OVSBridge in ryu.lib.ovs.bridge to implement QoS but it doesn't work as I expected.

Here is a link that includes a method to implement QoS from the controller.

  • Here is my app code:
from ryu.base import app_manager
from ryu.cfg import CONF
from ryu.lib.ovs.bridge import OVSBridge
from ryu.ofproto import ofproto_v1_3
from ryu.controller.handler import (MAIN_DISPATCHER, set_ev_cls)
from ryu.topology import event
OVSDB_ADDR = 'tcp:127.0.0.1:6632'
class SimpleApp(app_manager.RyuApp):
 OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
 def __init__(self, *args, **kwargs):
 super(SimpleApp, self).__init__(*args, **kwargs)
 @set_ev_cls(event.EventSwitchEnter)
 def mymethod(self, ev):
 self.logger.info(f'Called mymethod')
 ovs_bridge = OVSBridge(CONF, datapath_id=1, ovsdb_addr=OVSDB_ADDR)
 ovs_bridge.set_qos('enp0s8',type='linux-htb',max_rate='500000000')
  • Command (you can see by the naming of my app that I think there may be a bug in the Ryu code):
(ryu-env) ryu@controller:~/venvs/ryu-env$ ryu-manager ryu.qos_bug_example
  • Console output:
loading app ryu.qos_bug_example
loading app ryu.topology.switches
loading app ryu.controller.ofp_handler
instantiating app ryu.qos_bug_example of SimpleApp
instantiating app ryu.topology.switches of Switches
instantiating app ryu.controller.ofp_handler of OFPHandler
Called mymethod
  • Exception message and trace:
SimpleApp: Exception occurred during handler processing. Backtrace from offending handler [mymethod] servicing event [EventSwitchEnter] follows.
Traceback (most recent call last):
 File "/home/ryu/venvs/ryu-env/ryu/ryu/base/app_manager.py", line 290, in _event_loop
 handler(ev)
 File "/home/ryu/venvs/ryu-env/ryu/ryu/qos_bug_example.py", line 20, in mymethod
 ovs_bridge.set_qos('enp0s8',type='linux-htb',max_rate='500000000')
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/bridge.py", line 536, in set_qos
 self.run_command([command_qos, command_queue])
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/bridge.py", line 137, in run_command
 self.vsctl.run_command(commands, self.timeout, self.exception)
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/vsctl.py", line 1300, in run_command
 self._run_command(commands)
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/vsctl.py", line 1280, in _run_command
 self._do_main(commands)
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/vsctl.py", line 1186, in _do_main
 if self._do_vsctl(idl_, commands):
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/vsctl.py", line 1121, in _do_vsctl
 command._run(ctx, command)
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/vsctl.py", line 1936, in _cmd_set_qos
 result = self._set_qos(ctx, port_name, type, max_rate)
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/vsctl.py", line 1929, in _set_qos
 ovsrec_qos = ctx.set_qos(vsctl_port, type, max_rate)
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/vsctl.py", line 522, in set_qos
 self.set_column(ovsrec_qos, 'other_config', value_json)
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/vsctl.py", line 828, in set_column
 datum = self._pre_mod_column(ovsrec_row, column, value_json)
 File "/home/ryu/venvs/ryu-env/ryu/ryu/lib/ovs/vsctl.py", line 824, in _pre_mod_column
 return datum.to_python(ovs.db.idl._uuid_to_row)
AttributeError: module 'ovs.db.idl' has no attribute '_uuid_to_row'

Clearly, the ovs.db.idl module does not have an attribute _uuid_to_row.

What changes can I make to my script to implement QoS from the controller?

It's probably worth noting that I have already tried to use ryu.app.rest_qos.py but that's not what I'm asking about here.

Thanks

asked Apr 20, 2023 at 22:44

1 Answer 1

0

The trace identified an error in the file /ryu/ryu/lib/ovs/vsctl.py at line 824:

return datum.to_python(ovs.db.idl._uuid_to_row)

It's a bug.

For anyone interested, the answer to this question is to replace ovs.db.idl with ovsrec_row, so the line would like like this:

return datum.to_python(ovsrec_row._uuid_to_row)

I can see that Ryu is not maintained at the moment and the mailing list is not functioning, so I'm not really sure what to do with this fix other than to leave it here.

answered Apr 21, 2023 at 12:38
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.