7.2 Common Structures
7.2.3 Flow Match Structures
7.2.3.8 Header Match Fields
Headers match fields are match fields matching values extracted from the packet headers. Most header match fields map directly to a specific field in the packet header defined by a datapath protocol. All header match fields have different size, prerequisites and masking capability, as specified in Table 12. If not explicitly specified in the field description, each field type refer the the outermost occurrence of the field in the packet headers.
Field Bits Bytes Mask Pre-requisite Description
OXM_OF_ETH_DST 48 6 Yes None Ethernet destination MAC address. OXM_OF_ETH_SRC 48 6 Yes None Ethernet source MAC address.
OXM_OF_ETH_TYPE 16 2 No None Ethernet type of the OpenFlow packet payload, af- ter VLAN tags.
OXM_OF_VLAN_VID 12+1 2 Yes None VLAN-ID from 802.1Q header. The CFI bit indi- cates the presence of a valid VLAN-ID, see below. OXM_OF_VLAN_PCP 3 1 No VLAN VID!=NONE VLAN-PCP from 802.1Q header.
OXM_OF_IP_DSCP 6 1 No ETH TYPE=0x0800 or ETH TYPE=0x86dd
Diff Serv Code Point (DSCP). Part of the IPv4 ToS field or the IPv6 Traffic Class field.
OXM_OF_IP_ECN 2 1 No ETH TYPE=0x0800 or ETH TYPE=0x86dd
ECN bits of the IP header. Part of the IPv4 ToS field or the IPv6 Traffic Class field.
OXM_OF_IP_PROTO 8 1 No ETH TYPE=0x0800 or ETH TYPE=0x86dd
IPv4 or IPv6 protocol number.
OXM_OF_IPV4_SRC 32 4 Yes ETH TYPE=0x0800 IPv4 source address. Can use subnet mask or ar- bitrary bitmask
OXM_OF_IPV4_DST 32 4 Yes ETH TYPE=0x0800 IPv4 destination address. Can use subnet mask or arbitrary bitmask
OXM_OF_TCP_SRC 16 2 No IP PROTO=6 TCP source port OXM_OF_TCP_DST 16 2 No IP PROTO=6 TCP destination port OXM_OF_UDP_SRC 16 2 No IP PROTO=17 UDP source port OXM_OF_UDP_DST 16 2 No IP PROTO=17 UDP destination port OXM_OF_SCTP_SRC 16 2 No IP PROTO=132 SCTP source port OXM_OF_SCTP_DST 16 2 No IP PROTO=132 SCTP destination port OXM_OF_ICMPV4_TYPE 8 1 No IP PROTO=1 ICMP type
OXM_OF_ICMPV4_CODE 8 1 No IP PROTO=1 ICMP code OXM_OF_ARP_OP 16 2 No ETH TYPE=0x0806 ARP opcode
OXM_OF_ARP_SPA 32 4 Yes ETH TYPE=0x0806 Source IPv4 address in the ARP payload. Can use subnet mask or arbitrary bitmask
OXM_OF_ARP_TPA 32 4 Yes ETH TYPE=0x0806 Target IPv4 address in the ARP payload. Can use subnet mask or arbitrary bitmask
OXM_OF_ARP_SHA 48 6 Yes ETH TYPE=0x0806 Source Ethernet address in the ARP payload. OXM_OF_ARP_THA 48 6 Yes ETH TYPE=0x0806 Target Ethernet address in the ARP payload. OXM_OF_IPV6_SRC 128 16 Yes ETH TYPE=0x86dd IPv6 source address. Can use subnet mask or ar-
bitrary bitmask
OXM_OF_IPV6_DST 128 16 Yes ETH TYPE=0x86dd IPv6 destination address. Can use subnet mask or arbitrary bitmask
OXM_OF_IPV6_FLABEL 20 4 Yes ETH TYPE=0x86dd IPv6 flow label. OXM_OF_ICMPV6_TYPE 8 1 No IP PROTO=58 ICMPv6 type OXM_OF_ICMPV6_CODE 8 1 No IP PROTO=58 ICMPv6 code OXM_OF_IPV6_ND_TARGET 128 16 No ICMPV6 TYPE=135
or
ICMPV6 TYPE=136
The target address in an IPv6 Neighbor Discovery message.
OXM_OF_IPV6_ND_SLL 48 6 No ICMPV6 TYPE=135 The source link-layer address option in an IPv6 Neighbor Discovery message.
OXM_OF_IPV6_ND_TLL 48 6 No ICMPV6 TYPE=136 The target link-layer address option in an IPv6 Neighbor Discovery message.
OXM_OF_MPLS_LABEL 20 4 No ETH TYPE=0x8847 or ETH TYPE=0x8848
The LABEL in the first MPLS shim header. OXM_OF_MPLS_TC 3 1 No ETH TYPE=0x8847 or
ETH TYPE=0x8848
The TC in the first MPLS shim header. OXM_OF_MPLS_BOS 1 1 No ETH TYPE=0x8847 or
ETH TYPE=0x8848
The BoS bit (Bottom of Stack bit) in the first MPLS shim header.
OXM_OF_PBB_ISID 24 3 Yes ETH TYPE=0x88E7 The I-SID in the first PBB service instance tag. OXM_OF_IPV6_EXTHDR 9 2 Yes ETH TYPE=0x86dd IPv6 Extension Header pseudo-field.
Table 12: Header match fields details.
Omitting the OFPXMT_OFB_VLAN_VID field specifies that a flow entry should match packets regardless of whether they contain the corresponding tag. Special values are defined below for the VLAN tag
to allow matching of packets with any tag, independent of the tag’s value, and to support matching packets without a VLAN tag. The special values defined for OFPXMT_OFB_VLAN_VID are:
/* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate * special conditions.
*/
enum ofp_vlan_id {
OFPVID_PRESENT = 0x1000, /* Bit that indicate that a VLAN id is set */ OFPVID_NONE = 0x0000, /* No VLAN id was set. */
};
The OFPXMT_OFB_VLAN_PCP field must be rejected when the OFPXMT_OFB_VLAN_VID field is wildcarded (not present) or when the value of OFPXMT_OFB_VLAN_VID is set to OFPVID_NONE. Table 13 summarizes the combinations of wildcard bits and field values for particular VLAN tag matches.
OXM field oxm value oxm mask Matching packets
absent - - Packets with and without a VLAN tag
present OFPVID_NONE absent Only packets without a VLAN tag
present OFPVID_PRESENT OFPVID_PRESENT Only packets with a VLAN tag regardless of its value
present value | OFPVID_PRESENT absent Only packets with VLAN tag and VID equal value
Table 13: Match combinations for VLAN tags.
The field OXM_OF_IPV6_EXTHDR is a pseudo field that indicates the presence of various IPv6 extension headers in the packet header. The IPv6 extension header bits are combined together in the fields OXM_OF_IPV6_EXTHDR, and those bits can have the following values:
/* Bit definitions for IPv6 Extension Header pseudo-field. */ enum ofp_ipv6exthdr_flags {
OFPIEH_NONEXT = 1 << 0, /* "No next header" encountered. */
OFPIEH_ESP = 1 << 1, /* Encrypted Sec Payload header present. */ OFPIEH_AUTH = 1 << 2, /* Authentication header present. */ OFPIEH_DEST = 1 << 3, /* 1 or 2 dest headers present. */ OFPIEH_FRAG = 1 << 4, /* Fragment header present. */ OFPIEH_ROUTER = 1 << 5, /* Router header present. */ OFPIEH_HOP = 1 << 6, /* Hop-by-hop header present. */ OFPIEH_UNREP = 1 << 7, /* Unexpected repeats encountered. */ OFPIEH_UNSEQ = 1 << 8, /* Unexpected sequencing encountered. */ };
• OFPIEH_HOP is set to 1 if a hop-by-hop IPv6 extension header is present as the first extension header in the packet.
• OFPIEH_ROUTER is set to 1 if a router IPv6 extension header is present. • OFPIEH_FRAG is set to 1 if a fragmentation IPv6 extension header is present.
• OFPIEH_DEST is set to 1 if one or more Destination options IPv6 extension headers are present. It is normal to have either one or two of these in one IPv6 packet (see RFC 2460).
• OFPIEH_ESP is set to 1 if an Encrypted Security Payload IPv6 extension header is present. • OFPIEH_NONEXT is set to 1 if a No Next Header IPv6 extension header is present.
• OFPIEH_UNSEQ is set to 1 if IPv6 extension headers were not in the order preferred (but not required) by RFC 2460.
• OFPIEH_UNREP is set to 1 if more than one of a given IPv6 extension header is unexpectedly encountered. (Two destination options headers may be expected and would not cause this bit to be set.)