Hi, Carlos Please confirm that you've reinstalled Ryu after applying the patch. $ pip uninstall Ryu $ pip install -r tools/pip-requires $ python setup.py install
After reinstallation, it should work fine. If this does not work, could you send me your application? Thanks, Fujimoto On 2017年10月18日 09:22, Carlos Ferreira wrote:
Hello again, Fujimoto, I have tried your patch in a clean Python3 virtualenv, and the issue still remains. Although my code properly setups the OF Switch, the log still shows the "unknown barrier xid" message. Is it supposed to be like this? Thank you for your support! Carlos Ferreira On 17 October 2017 at 02:36, Fujimoto Satoshi <[email protected]> wrote:Hi, Carlos I've submitted a patch which enables to send a single OFPBarrierRequest: [PATCH] app/ofctl: Enable to send single BarrierRequest https://sourceforge.net/p/ryu/mailman/message/36079164/ With this, you can make a waiting point as follows: for ofp_port in ports: if 0 <= ofp_port.port_no < ofp.OFPP_MAX: datapath.send_msg( ofp_parser.OFPPortMod( datapath=datapath, port_no=ofp_port.port_no, hw_addr=ofp_port.hw_addr, config=ofp.OFPPC_PORT_DOWN, mask=ofp.OFPPC_PORT_DOWN, advertise=0 ) ) api.send_msg(myRyuApp, ofp_parser.OFPBarrierRequest(datapath), reply_cls=ofp_parser.OFPBarrierReply) Could you try with this patch? Thanks, Fujimoto On 2017年10月16日 19:10, Carlos Ferreira wrote: Thank you for your support Fujimoto I wanted to send an OFPBarrierRequest because my intention was to have a point where my Python code waits. For example, I wanted to send messages to the switch to disable all ports, and in the end, I send the BarrierRequest to ensure that all ports are down before continuing. This is my current code: # Stage 1 -> Disable all switching ports for ofp_port in ports: if 0 <= ofp_port.port_no < ofp.OFPP_MAX: datapath.send_msg( ofp_parser.OFPPortMod( datapath=datapath, port_no=ofp_port.port_no, hw_addr=ofp_port.hw_addr, config=ofp.OFPPC_PORT_DOWN, mask=ofp.OFPPC_PORT_DOWN, advertise=0 ) ) ctrl_send_msg(ofp_parser.OFPBarrierRequest(datapath), reply_cls=ofp_parser.OFPBarrierReply) Am I doing this right? Carlos Ferreira On 16 October 2017 at 03:19, Fujimoto Satoshi <[email protected]> wrote: Hi, Carlos I think you've called api.send_msg() correctly, however, when you call api.send_msg(), the controller sends an OFPBarrierRequest in this function: https://github.com/osrg/ryu/blob/master/ryu/app/ofctl/service.py#L141-L142 After this, the controller will receive an OFPBarrierReply and inspect it in this function: https://github.com/osrg/ryu/blob/master/ryu/app/ofctl/service.py#L145 This function will be called when it received OFPBarrierReplies. So, api.send_msg(myRyuApp, ofp_parser.OFPBarrierRequest(datapath),reply_cls=ofp_parser.OFPBarrierReply) this will sends two OFPBarrierRequests, and the controller will receive two replies. Then, the controller will mistake which packet should be inspected, and error occurs. In the other words, I think you don't need to make and send an OFPBarrierRequest by yourself, because api.send_msg() will take care of the consistency of message order by using OFPBarrierRequests. Or, is there a reason why you have to manage it? Thanks, Fujimoto On 2017年10月14日 02:15, Carlos Ferreira wrote: Update: I noticed that the call to api.send_msg with a Barrier Message wasn't blocking at all. It was blocking in the next call for an OFPFlowMod. But I still receive the "unknown barrier xid 103043043" at the logs. What is going on? Is my application really waiting for the Barrier Message Reply before advancing? Carlos On 13 October 2017 at 17:12, Carlos Ferreira <[email protected]> wrote: Hello I'm trying to use the Ryu synchrounous API to send and wait for the execution of a Barrier message. I'm using the same implementation presented in: http://ryu.readthedocs.io/en/latest/app/ofctl.html#ryu.app.ofctl.api.send_msg For some reason unknown to me, calling "api.send_msg(myRyuApp, ofp_parser.OFPBarrierRequest(datapath), reply_cls=ofp_parser.OFPBarrierReply)" will lock and not return, while at the console, a "unknown barrier xid 103043043" will be printed. Am I calling api.send_msg correctly? Thank you for the assistance Carlos Ferreira ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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
------------------------------------------------------------------------------ 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
