Programming a flow with match on custom match field

Once the table with one or more custom match field is created on the switch, the controller can program flows to match on these fields via OFPT_FLOW_MOD message.

The data for the custom field will be embedded as an OXM field within the flow mod request message:

0

1

2

3

4

5

6

7

OXM_CLASS

OXM_FIELD

OXM_LEN

EXPERIMENTER_ID

LENGTH OF MATCH DATA

MATCH DATA

MATCH DATA

MATCH DATA

       
OXM CLASS

This needs to be OFPXMC_EXPERIMENTER (0xffff).

OXM FIELD

This should be the OXM fields for which the data is being defined:

  • CUSTOM_MATCH_ONE = 5

  • CUSTOM_MATCH_TWO = 6

  • CUSTOM_MATCH_THREE = 7

  • CUSTOM_MATCH_FOUR = 8

LENGTH

The length of the experimenter header excluding the OXM header.

EXPERIMENTER ID

The HPE VENDOR ID.

LENGTH OF DATA

This field defines the number of bytes of data to consider as the value for the custom match field in the following 16 bytes of data.

MATCH DATA

This field holds the data to look in the packet in the custom match field. Based on the value defined in the ‘LENGTH OF DATA’ field, only that many bytes are considered relevant from the MSB. The rest of the field needs to be padded with zeros

The following table shows an example of defining a custom match field to match on TCP sequence number with value of 0x12345678. The data has to be in Network Byte Order.

0

1

2

3

4

5

6

7

0xffff (OXM_CLASS)

0x05 (OXM_FIELD)

0x18 (OXM_LEN)

0x00002481(HPE VENDOR ID)

0x00000004 (Length of match data)

0x12345678 (Match data)

0x0000000000000000

0x00000000