[ovs-dev] Adding NoviFlow experimenters to OVS.

yann bourdeau yann.bourdeau at noviflow.com
Wed Oct 11 16:35:05 UTC 2017


Hi Ben,

	I was able to add successfully an experimenter flow to OVS(It is missing the matching on the packet). I have two questions:

1- Is it normal that the experimenter OXM is not shown on dump-flows (I think it is normal from what I have understood from the code)?
root at yannb-virtual-machine:/home/yannb/src/ovs# ovs-ofctl13 dump-flows br0
 cookie=0xa, duration=89.874s, table=2, n_packets=0, n_bytes=0, send_flow_rem priority=2 actions=drop

2- The experimenter OXM field I need to implements are of variable length (both payload and mask to match on the payload of the packet). Can I create a new type that is variable length? Can I base my code on tunnnelMD type?

Here is the structure if you are interested:
struct oxm_fields {
uint16_t oxm_class; /* Match class OFPXMC_EXPERIMENTER 0xffff */
uint oxm_field:7; /* Match field within the class NOVI_OXM_UDP_PAYLOAD 0b0000001 */
uint oxm_hasmask:1; /* Set if OXM includes a bitmask in payload (wildcard match tables only) */
uint8_t oxm_length; /* Length of OXM payload */
uint32_t experimenter; /* NoviFlow experimenter ID 0xff000002 */
uint8_t payload[1-32] /* 1-32 payload bytes to be matched on*/
uint8_t mask [0-32] /* Optional mask present if oxm_hasmask bit is set in the header */
};

Thanks,
Yann
> Le 6 oct. 2017 à 01:56, Ben Pfaff <blp at ovn.org> a écrit :
> 
> The build-aux changes are just to add support for recognizing the OXM
> experimenter extension.  You still need to actually implement the
> fields.
> 
> On Wed, Oct 04, 2017 at 05:54:52PM -0400, yann bourdeau wrote:
>> Hi Ben,
>> 
>> 	I have looked at the python code to do it in build-aux. However what I want to add is an OXM that match on UDP payload not on an existing field. From what I understand I can’t do it from all the source in build-aux or am I mistaken?
>> 
>> 	Here is the documentation:
>> 
>> Finally flow entries using the match field defined above can be loaded in the switch using the
>> OFPT_FLOW_MOD message including the following ofp_match as one of the fields to match
>> struct ofp_match {
>> uint16_t type; /* ofp_match_type OFPMT_OXM 0x0001 */
>> uint16_t length; /* Length of ofp_match (excluding padding) */
>> uint8_t oxm_fields[0]; /* 0 or more OXM match fields */
>> uint8_t pad[]; /* Exactly ((length + 7)/8*8 – length)
>> (between 0 and 7) bytes of all-zero bytes */
>> };
>> where one of the oxm_fields is
>> struct oxm_fields {
>> uint16_t oxm_class; /* Match class OFPXMC_EXPERIMENTER 0xffff */
>> uint oxm_field:7; /* Match field within the class NOVI_OXM_UDP_PAYLOAD 0b0000001 */
>> uint oxm_hasmask:1; /* Set if OXM includes a bitmask in payload (wildcard match tables only) */
>> uint8_t oxm_length; /* Length of OXM payload */
>> uint32_t experimenter; /* NoviFlow experimenter ID 0xff000002 */
>> uint8_t payload[1-32] /* 1-32 payload bytes to be matched on*/
>> uint8_t mask [0-32] /* Optional mask present if oxm_hasmask bit is set in the header */
>> };
>> 
>> 
>> The offset is set by the following experimenter message:
>> 
>> struct ofp_experimenter_msg {
>> uint32_t experimenter; /* NoviFlow experimenter ID 0xff000002 */
>> uint8_t customer; /* Customer ID 0xff */
>> uint8_t reserved; /* Reserved for future use 0x00 */
>> uint16_t novi_msg_type; /* NoviFlow message type NOVI_MSG_UDP_PAYLOAD 0x0000 */
>> uint8_t table_id; /* Table number */
>> uint8_t payload_size; /* Number of bytes N to be match on (1-32) */
>> uint16_t payload_offset; /* Starting position X in the UDP payload (0-maxudpmatch)
>> where maxudpmatch=14 for the NoviSwitch 1000 Series,
>> 44 for the NoviSwitch 21100 and
>> 48 for the other NoviSwitch 2000 Series */
>> };
>> 
>> I suppose I will need to modify some C code to do it. I have spent some time at looking at the C code this afternoon. I’m starting to get how it works but I’m not there yet.
>> 
>> Thanks,
>> 
>> Yann
>> 
>>> Le 4 oct. 2017 à 14:07, Ben Pfaff <blp at ovn.org> a écrit :
>>> 
>>> For fields, you should just have to add an entry to OXM_CLASSES in
>>> build-aux/extract-ofp-fields.  For actions, vendor_map in
>>> build-aux/extract-ofp-actions.
>>> 
>>> On Wed, Oct 04, 2017 at 12:45:46PM -0400, yann bourdeau wrote:
>>>> Hi Ben,
>>>> 
>>>> 	Thanks for the commit revision. It will help. However, do you have the same for match field and action? Otherwise I will just dig in and try to understand.
>>>> 
>>>> Thanks,
>>>> Yann
>>>> 
>>>> 
>>>>> Le 4 oct. 2017 à 12:32, Ben Pfaff <blp at ovn.org> a écrit :
>>>>> 
>>>>> On Wed, Oct 04, 2017 at 12:13:03PM -0400, yann bourdeau wrote:
>>>>>> Hi all,
>>>>>> 
>>>>>> 	I was wondering if there was a good tutorial on how to add experimenters message, match fields and actions to OVS. I have found a little bit of info at the end of the page there: https://github.com/openvswitch/ovs/blob/7169d4fdc8e564331c7a5ad910bc1d99cb413712/FAQ.rst#development <https://github.com/openvswitch/ovs/blob/7169d4fdc8e564331c7a5ad910bc1d99cb413712/FAQ.rst#development>. It is quite brief.
>>>>>> 
>>>>>> 	I have used OVS in the past but never developed for it.
>>>>> 
>>>>> Adding a new kind of experimenter message shouldn't be much work.  You
>>>>> can look at commit 9021969654dda "extract-ofp-msg: Add ONF extension
>>>>> support" for an example.
>>>> 
>>>> 
>> 
>> 




More information about the dev mailing list