Defining a custom match field

To use the customizable matches feature, the SDN controller first needs to create an OpenFlow table wherein it needs to define what these customizable fields will match on. The table can match on standard OpenFlow OXM match fields along with the customizable match fields. To create an OpenFlow pipeline with such tables, the controller sends an OFPMP_TABLE_FEATURES multipart request to the switch with a body that defines what the pipeline should look like.

OFPTFPT_MATCH is the table feature property type that needs to be set to tell the switch which match fields the SDN controller wants to match on for a given table. OFPTFPT_MATCH is an array of OXM headers of packet fields that will be matched on the table.

To define a customizable match field, the OXM header in the OFPTFPT_MATCH should look like the following:

0

1

2

3

4

5

6

7

OXM_CLASS

OXM_FIELD

OXM_LEN

EXPERIMENTER_ID

START_TYPE

OFFSET

NUM_BYTES

   
OXM_CLASS

This needs to be OFPXMC_EXPERIMENTER (0xffff).

OXM_FIELD

This should be one of the new OXM fields that have been defined for this purpose. It can take one of the following values:

  • CUSTOM_MATCH_ONE = 5

  • CUSTOM_MATCH_TWO = 6

  • CUSTOM_MATCH_THREE = 7

  • CUSTOM_MATCH_FOUR = 8

OXM_LEN

The length of the experimenter header excluding the OXM header.

EXPERIMENTER ID

The HPE VENDOR ID.

START TYPE

This field specifies where in the packet to look for the data. It can have one of the following values:

  • L2_START = 1 /* Look from L2 header */

  • L3_START = 2 /* Look from L3 header */

  • L4_START = 3 /* Look from L4 header */

OFFSET

This field defines the byte offset from the ‘START TYPE’ where the match field will start.

NUM_BYTES

This field defines the number of bytes to match from the ‘OFFSET’.

The following table shows an example to define a custom match field to match on TCP sequence number. All the data has to be in Network Byte Order.

0

1

2

3

4

5

6

7

0xffff (OFPXMC_EXPERIMENTER)

0x05(OXM_FIELD)

0x0a(OXM_LEN)

0x00002481 (HP VENDOR ID)

0x0003 (Start at L4)

0x0004 (at 4 bytes offset)

0x0004 (match 4 bytes)