Hi,

On 2015年08月24日 17:13, Daniel Herrmann wrote:
> Hi Iwase,
> 
> thank you very much for your answer.
> 
> NXActionResubmitTable sounds promising, I will give it a try.
> 
> This however leaves one problem to me: Lets say I have a group with 4
> buckets, one of them is selected based on some kind of hashing. If I use
> NXActionResubmitTable to resubmit this to a table, how can I distinguish
> which bucket has forwarded the packet?
> 
> My first idea was to add four different metadata values and match on the
> metadata in the next table, bit adding metadata is an instruction as well.
> 
> In the Nicria extended actions, I have found no action which would match
> my need. The only other Idea I currently have is to create four
> different tables, and add another step of indirection. Something like
> 
> Table 0: match in port and prefix, go to Group Table (Group n)
> Group n: 4 buckets, select one, go to table 2, 3, 4, or 5
> Tables 2-5: match prefix again, add different metadata, for example
> ("13" in table 2, "14" in table 3, and so on) and all go to table 10

First, why do you need to use GroupTable?

I think setting MPLS tag based on in_port and prefix and forwarding it
can be done with only FlowTable.

e.g.)
 Table 0: match in_port and prefix, write metadata and go to Table 1.
 Table 1: match metadata, modify packet and go to Table 2.
 Table 2: match metadata, push and set MPLS tags and go to Table 3.
 Table 3: match metadata or MPLS tags, output packet.


> 
> There I have to add a variable stack (min 1, max 3) of MPLS headers. As
> far as I know, only one MPLS header can be pushed per table. Matchin on
> each of those tables is done using the metadata set before. Hence:
> 
> Table 10: add MPLS header + tag, if done output else goto table 11
> Table 11: add MPLS header + tag, if done output else goto table 12
> Table 12: add MPLS header + tag, output

With Open vSwitch, multiple MPLS tags can be pushed per table.

e.g.) I used ofctl_rest.py
$ curl -X POST -d '{
>     "dpid": "1",
>     "match":{
>         "in_port":1
>     },
>     "actions":[
>         {
>             "type": "PUSH_MPLS",
>             "ethertype": 34887
>         },
>         {
>             "type": "SET_FIELD",
>             "field": "mpls_label",
>             "value": 3
>         },
>         {
>             "type": "PUSH_MPLS",
>             "ethertype": 34887
>         },
>         {
>             "type": "SET_FIELD",
>             "field": "mpls_label",
>             "value": 5
>         },
>         {
>             "type": "PUSH_MPLS",
>             "ethertype": 34887
>         },
>         {
>             "type": "SET_FIELD",
>             "field": "mpls_label",
>             "value": 7
>         },
>         {
>             "port":2,
>             "type":"OUTPUT"
>         }
>     ]
>  }' http://localhost:8080/stats/flowentry/add
$ 
$ curl -X GET http://localhost:8080/stats/flow/1 | jq .
{
  "1": [
    {
      "match": {
        "in_port": 1
      },
      "flags": 0,
      "table_id": 0,
      "duration_sec": 0,
      "priority": 0,
      "actions": [
        "PUSH_MPLS:34887",
        "SET_FIELD: {mpls_label:3}",
        "PUSH_MPLS:34887",
        "SET_FIELD: {mpls_label:5}",
        "PUSH_MPLS:34887",
        "SET_FIELD: {mpls_label:7}",
        "OUTPUT:2"
      ],
      "idle_timeout": 0,
      "cookie": 0,
      "packet_count": 0,
      "hard_timeout": 0,
      "byte_count": 0,
      "length": 160,
      "duration_nsec": 1.2e+07
    }
  ]
}


> 
> I think that should work, but if there was an action to add metadata,
> this would remove the need for tables 2 - 5.

As far as I know, WRITE_METADATA Instruction can not be used in GroupTable.
So I think you should use FlowTable to write metadata.


Thanks,
Iwase

> 
> Thanks and best regards
> Daniel
> 
> On 24.08.2015 02:27, Yusuke Iwase wrote:
>> Hi,
>>
>> On 2015年08月23日 00:38, Daniel Herrmann wrote:
>>> Hi,
>>>
>>> I am using Ryu and OVS in order to set up some tests. I need to do the
>>> following:
>>>
>>> Table 0 matches on some factors such as IP addresses and so on and
>>> forwards the processing to a specific group ID.
>>>
>>> Based on the group result I need to add multiple MPLS headers. As I
>>> cannot push multiple headers in one table, I am using Table 10 - 12 to
>>> push MPLS headers.
>>>
>>> The basic idea now is:
>>>
>>> Match on Table 0 and forward to group table. There, n Buckets are
>>> present, let us say 4 buckets. Each bucket should assign one metadata
>>> value (for example 1-4) and go to table 10 for further processing. Based
>>> on the metadata, tables 10 - 12 add the required label stack and finally
>>> output the packet on the right port.
>>>
>>> My understanding of OFPGroupMod however is, that it takes actions as
>>> argument. Adding metadata and going to another table however is an
>>> instruction.
>>
>> As you say, OpenFlow Spec does not allow GoToTable instruction in GroupTable,
>> only actions are permitted.
>>
>> But if you use OVS, NXActionResubmitTable, which is Nicira Extended Action,
>> maybe available in GroupTable.
>>   https://github.com/osrg/ryu/blob/master/ryu/ofproto/nx_actions.py#L383
>>
>> Thanks,
>> Iwase
>>
>>>
>>> Do you have any idea how to solve this?
>>>
>>> VG
>>> Daniel
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> Ryu-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>>
> 

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to