Hi,

On 2014年11月28日 01:59, Clément Rault wrote:
> Hi,
> 
> Thanks for your answer!
> 
> These commands are what I was looking for yes.
> 
> The watch_group argument is the group that will be used if the port
> being watched (watch_port argument) is down, right?

OpenFlow1.3 Spec describes watch_port/watch_group as follows.

  /* Bucket for use in groups. */
  struct ofp_bucket {
    ...
    uint32_t watch_port;   /* Port whose state affects whether this
                              bucket is live. Only required for fast
                              failover groups. */
    uint32_t watch_group;  /* Group whose state affects whether this
                              bucket is live. Only required for fast
                              failover groups. */
    ...
  }

So, if the watch_port/watch_group is down, a bucket which includes
this port and/or group can NOT be a candidate for forwarding.

> 
> And how could I use mask on vlan tags with these commands?

Currently, the curl command of ofctl_rest.py is not compatible with masked vlan 
tags.
But now, we are making patches to support it.
Please wait for the patches release.

> 
> Like it's done here:
> def test_rule_set_vlan_vid_masked_ff(self, dp):
> vlan_vid = 0x4ef
> mask = 0xfff
> headers = [dp.ofproto.OXM_OF_VLAN_VID, dp.ofproto.OXM_OF_VLAN_VID_W]
> self._set_verify(headers, vlan_vid, mask, True)
> match = dp.ofproto_parser.OFPMatch()
> match.set_vlan_vid_masked(vlan_vid, mask)
> self.add_matches(dp, match)
> (https://github.com/osrg/ryu/blob/master/ryu/tests/integrated/test_add_flow_v12_matches.py)

For your information, set_vlan_vid_masked() is one of old API for OFPMatch.
In new OFPMatch API, you can use it like as follows.

1) Packets with and without a VLAN tag

  - Match class
    match = dp.ofproto_parser.OFPMatch()

  - Packet Matching
    non-VLAN-tagged        MATCH
    VLAN-tagged(vlan_id=3) MATCH
    VLAN-tagged(vlan_id=5) MATCH

2) Only packets without a VLAN tag

  - Match class
    match = dp.ofproto_parser.OFPMatch(vlan_vid=0x0000)

  - Packet Matching
    non-VLAN-tagged        MATCH
    VLAN-tagged(vlan_id=3)   x
    VLAN-tagged(vlan_id=5)   x

3) Only packets with a VLAN tag regardless of its value

  - Match class
    match = dp.ofproto_parser.OFPMatch(vlan_vid=(0x1000, 0x1000))

  - Packet Matching
    non-VLAN-tagged          x
    VLAN-tagged(vlan_id=3) MATCH
    VLAN-tagged(vlan_id=5) MATCH

4) Only packets with VLAN tag and VID equal

  - Match class
    match = dp.ofproto_parser.OFPMatch(vlan_vid=(0x1000 | 3))

  - Packet Matching
    non-VLAN-tagged          x
    VLAN-tagged(vlan_id=3) MATCH
    VLAN-tagged(vlan_id=5)   x


Thanks

> 
> But I would like to do "everything" with the curl syntax.
> 
> Best,
> Clément
> 
> On 25 November 2014 at 09:33, Yusuke Iwase <[email protected]> wrote:
>> Hi,
>>
>> On 2014年11月21日 23:05, Clément Rault wrote:
>>> Hi,
>>>
>>> I'm trying to implement in-band mechanisms and therefore I need to
>>> push the proper tables. At first I thought about programming a ryu
>>> application but since I just wanna push tables it's not the best way
>>> to do I guess? I discovered that it's possible to push tables using
>>> curl and it looks better for what I'm trying to achieve.
>>>
>>> But my problem is that there is really not much about the curl in the
>>> documentation. Where could I find more information?
>>
>> Did you check the ofctl_rest page in the Ryu documentation?
>> This page may be helpful for you.
>>
>>   http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html
>>
>>
>>>
>>> I wanna install group tables of the fast failover type and be able to
>>> decide on the forwarding port depending on the vlan id (with masks).
>>> Do you think that it's possible with curl?
>>
>> I think it's possible.
>> How about this command examples?
>>
>> # Add group entry
>> $ curl -X POST -d '{
>>     "dpid": 1,
>>     "type": "FF",
>>     "group_id": 1,
>>     "buckets": [
>>         {
>>             "watch_port": 1,
>>             "actions": [
>>                 {
>>                     "type": "OUTPUT",
>>                     "port": 1
>>                 }
>>             ]
>>         }
>>     ]
>>  }' http://localhost:8080/stats/groupentry/add
>>
>> # Check group entry
>> $ curl -X GET http://localhost:8080/stats/groupdesc/1
>>
>> # Add flow entry
>> $ curl -X POST -d '{
>>     "dpid": 1,
>>     "match":{
>>         "vlan_vid": 5
>>     },
>>     "actions":[
>>         {
>>             "type":"GROUP",
>>             "group_id": 1
>>         }
>>     ]
>>  }' http://localhost:8080/stats/flowentry/add
>>
>> # Check flow entry
>> $ curl -X GET http://localhost:8080/stats/flow/1
>>
>>
>>
>>>
>>> Best,
>>> Clément
>>>
>>> ------------------------------------------------------------------------------
>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>>> Get technology previously reserved for billion-dollar corporations, FREE
>>> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Ryu-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>>

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to