Thank you Iwase for the clear description.
The code worked.

Regards,
Shivani.

On Tue, Nov 21, 2017 at 1:22 PM, Iwase Yusuke <iwase.yusu...@gmail.com>
wrote:

> Hi Shivani,
>
> Sorry for the delay.
>
> I sniffed the OpenFlow messages which the "ovs-ofctl" command sent.
>
> The "ovs-ofctl" command seems to send the OFPGC_ADD message with
> "command_bucket_id=ofproto.OFPG_BUCKET_ALL" when you invoked:
>   $ ovs-ofctl -O openflow15 add-group br_test
> group_id=3,type=all,bucket=output:2
>
> But, Ryu will send the OFPGC_ADD message with "command_bucket_id=0" (by
> the default),
> so the first OFPGC_ADD message from Ryu will fail and also fail the
> following OFPGC_INSERT_BUCKET
> message.
>
> I guess we need to specify "command_bucket_id=ofproto.OFPG_BUCKET_ALL" to
> send the OFPGC_ADD
> message, and then send the OFPGC_INSERT_BUCKET message after that.
>
> Example:
>
>         buckets = [
>             parser.OFPBucket(
>                 bucket_id=0,
>                 actions=[parser.OFPActionOutput(1)],
>             ),
>             parser.OFPBucket(
>                 bucket_id=1,
>                 actions=[parser.OFPActionOutput(2)],
>             ),
>         ]
>         req = parser.OFPGroupMod(
>             datapath,
>             command=ofproto.OFPFC_ADD,
>             type_=ofproto.OFPGT_SELECT,
>             group_id=1,
>             command_bucket_id=ofproto.OFPG_BUCKET_ALL,
>             buckets=buckets)
>         datapath.send_msg(req)
>
>         match = parser.OFPMatch(in_port=3)
>         actions = [parser.OFPActionGroup(1)]
>         self.add_flow(datapath, 0, match, actions)
>
>         buckets = [
>             parser.OFPBucket(
>                 bucket_id=2,
>                 actions=[parser.OFPActionOutput(3)],
>             ),
>         ]
>         req = parser.OFPGroupMod(
>             datapath,
>             command=ofproto.OFPGC_INSERT_BUCKET,
>             type_=ofproto.OFPGT_SELECT,
>             group_id=1,
>             command_bucket_id=ofproto.OFPG_BUCKET_LAST,
>             buckets=buckets)
>         datapath.send_msg(req)
>
>
> Hmmm... I think it better to change the default value of
> "command_bucket_id" to "OFPG_BUCKET_ALL".
>
> Thanks,
> Iwase
>
> On 2017年11月17日 17:32, shivani dommeti wrote:
>
>> Hi Iwase Yusuke,
>>
>> Thank you for responding.
>>
>> I have tried the way suggested
>>
>> command_bucket_id= ofp.OFPG_BUCKET_LAST
>>
>> i still see an issue, when i see the logs i get the following error :
>>
>> 2017-11-17T08:21:19.080Z|07049|fail_open|WARN|No longer in fail-open mode
>> 2017-11-17T08:21:27.219Z|07050|ofp_util|WARN|group command bucket id
>> (4294967294) is out of range
>> 2017-11-17T08:21:27.219Z|07051|connmgr|INFO|br0<->tcp:127.0.0.1:6633 <
>> http://127.0.0.1:6633>: sending OFPGMFC_BAD_BUCKET error reply to
>> OFPT_GROUP_MOD message
>>
>> the OpenFlow version is 1.5.
>>
>> Thanks,
>> Shivani
>>
>>
>>
>>
>> On Thu, Nov 16, 2017 at 12:01 PM, Iwase Yusuke <iwase.yusu...@gmail.com
>> <mailto:iwase.yusu...@gmail.com>> wrote:
>>
>>     Hi Shivani,
>>
>>     You seems to specify "command_bucket_id" field like;
>>        command_bucket_id='last'
>>     but I guess you need to specify one of the following constants for
>> this field.
>>
>>     https://github.com/osrg/ryu/blob/6ec8802a00723758f255dea1a0b
>> e7456bb3e3bb4/ryu/ofproto/ofproto_v1_5.py#L698-L710
>>     <https://github.com/osrg/ryu/blob/6ec8802a00723758f255dea1a0
>> be7456bb3e3bb4/ryu/ofproto/ofproto_v1_5.py#L698-L710>
>>
>>     Example)
>>        command_bucket_id = ofp.OFPG_BUCKET_LAST
>>
>>     Thanks,
>>     Iwase
>>
>>     On 2017年11月14日 20:38, shivani dommeti wrote:
>>
>>         Hi,
>>
>>         I am using OpenFlow Version 1.5 and I have tried to use the
>> Insert_Bucket and Remove_Bucket
>>         commands which are supported in the following version,
>>
>>         On the OVS side i have followed the following steps:
>>
>>
>>
>>         ovs-ofctl -O openflow15 add-group br_test
>> group_id=3,type=all,bucket=output:2
>>
>>         ovs-ofctl -O openflow15 insert-buckets br_test
>>         group_id=3*,command_bucket_id=first,*bucket=bucket_id:1,acti
>> ons=output:1
>>
>>
>>
>>            But when i try insert a bucket from RYU I see following
>>  issues when I am try to set
>>         value for command_bucket_id as 'last/first' in my code:
>>
>>         group_id = 1
>>
>>         command_bucket_id='last'
>>
>>         actions = [parser.OFPActionOutput(2)]
>>
>>         buckets =  [parser.OFPBucket(actions= actions,bucket_id =1)]
>>
>>         req = ofp_parser.OFPGroupMod(datapath, ofp.OFPGC_INSERT_BUCKET,
>> ofp.OFPGT_SELECT, group_id,
>>         command_bucket_id, buckets)
>>
>>         datapath.send_msg(req)
>>
>>
>>         it throws the following error:
>>
>>         When I try to set command_bucket_id value as ‘last’ it throws
>>
>>         File 
>> "/usr/local/lib/python2.7/dist-packages/ryu/app/indentedServer.py",
>> line 136, in
>>         cp_instruction_processor
>>
>>         self.op_group_add(instruction)
>>
>>             File "/usr/local/lib/python2.7/dist
>> -packages/ryu/app/indentedServer.py", line 1099, in
>>         op_group_add
>>
>>         dp_info.send_msg(mod)
>>
>>             File "/usr/local/lib/python2.7/dist
>> -packages/ryu/controller/controller.py", line 347, in
>>         send_msg
>>
>>         msg.serialize()
>>
>>             File "/usr/local/lib/python2.7/dist
>> -packages/ryu/ofproto/ofproto_parser.py", line 270,
>>         in serialize
>>
>>         self._serialize_body()
>>
>>             File "/usr/local/lib/python2.7/dist
>> -packages/ryu/ofproto/ofproto_v1_5_parser.py", line
>>         6181, in _serialize_body
>>
>>         self.bucket_array_len, self.command_bucket_id)
>>
>>             File "/usr/local/lib/python2.7/dist
>> -packages/ryu/lib/pack_utils.py", line 25, in
>>         msg_pack_into
>>
>>         struct.pack_into(fmt, buf, offset, *args)
>>
>>         error: cannot convert argument to integer
>>
>>
>>         When I try to set command_bucket_id value as integer 1 it throws:
>>
>>
>>         group_id = 1
>>
>>         command_bucket_id=1
>>
>>         actions = [parser.OFPActionOutput(2)]
>>
>>         buckets =  [parser.OFPBucket(actions= actions,bucket_id =1)]
>>
>>         req = ofp_parser.OFPGroupMod(datapath, ofp.OFPGC_INSERT_BUCKET,
>> ofp.OFPGT_SELECT, group_id,
>>         command_bucket_id, buckets)
>>
>>         datapath.send_msg(req)
>>
>>
>>         I don't see any error message but the group is not getting added
>> on the OVS if i check the
>>         logs i see the following error:
>>
>>
>>         Error from the logs :
>>
>>         command_bucket_id (1) is out of range
>>
>>         sending OFPGMFC_BAD_BUCKET error reply to OFPT_GROUP_MOD message
>>
>>
>>         Kindly suggest the correction that need to be make to overcome
>> the following issue.
>>
>>         Thanks,
>>
>>         Shivani.
>>
>>
>>
>>         ------------------------------------------------------------
>> ------------------
>>         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
>>         Ryu-devel@lists.sourceforge.net <mailto:Ryu-devel@lists.source
>> forge.net>
>>         https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>         <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
>> Ryu-devel@lists.sourceforge.net
>> 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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to