Action

An action is a policy decision on what should happen to a packet. OpenFlow uses actions either direction in matches or in instructions; both of which are used in flow modifications.

Action Structure

There are 13 action types in version 1.0

Action Structure

Field Name Bits Byte Ordering Constraints
type 16 MSBF in 0x0000..0x000b, 0xffff
length 16 MSBF ≥ 4

Action Payload

Type Name Type Value Field Name Bits Byte Ordering Constraints
Output 0x0000 type 16 MSBF = 0x0000
length 16 MSBF = 0x0008
port 16 MSBF in 0x0000..0xffef
max_len 16 MSBF none
SetVLANVID 0x0001 type 16 MSBF = 0x0001
length 16 MSBF = 0x0008
vlan_vid 16 MSBF none
pad 16 - none
SetVLANPCP 0x0002 type 16 MSBF = 0x0002
length 16 MSBF = 0x0008
vlan_pc 8 - none
pad 24 - none
StripVLAN 0x0003 type 16 MSBF = 0x0003
length 16 MSBF = 0x0004
SetDLSrc 0x0004 type 16 MSBF = 0x0004
length 16 MSBF = 0x000f
SetDLSrc 48 MSBF none
pad 48 - none
SetDLDst 0x0005 type 16 MSBF = 0x0005
length 16 MSBF = 0x000f
SetDLSrc 48 MSBF none
pad 48 - none
SetNWSrc 0x0006 type 16 MSBF = 0x0006
length 16 MSBF = 0x0008
nw_addr 32 MSBF none
SetNWDst 0x0007 type 16 MSBF = 0x0007
length 16 MSBF = 0x0008
nw_addr 32 MSBF none
SetNWTos 0x0008 type 16 MSBF = 0x0008
length 16 MSBF = 0x0008
nw_tos 8 MSBF none
pad 24 - none
SetTPSrc 0x0009 type 16 MSBF = 0x0009
length 16 MSBF = 0x0008
port 16 MSBF in 0x000..0xffef
pad 16 - none
SetTPDst 0x000a type 16 MSBF = 0x000a
length 16 MSBF = 0x0008
port 16 MSBF in 0x000..0xffef
pad 16 - none
Enqueue 0x000b type 16 MSBF = 0x000b
length 16 MSBF = 0x000f
port 16 MSBF in 0x000..0xffef
pad 48 - none
queue_id 32 MSBF none
Vendor 0xffff type 16 MSBF = 0xffff
length 16 MSBF = 0x0008
vendor 32 MSBF none

References

OpenFlow Switch Specification 1.0.0, pages 21-24

Action Structure

This version adds X types: group, set_queue, set_mpls_label, set_mpls_tc, set_mpls_ttl, dec_nw_ttl, set_tp_src, set_tp_dst, copy_ttl_outwards, copy_ttl_inwards, push_vlan, push_mpls, pop_vlan, pop_mpls.

Action Structure

Field Name Bits Byte Ordering Constraints
type 16 MSBF in 0x0000..0x0018, 0xffff
length 16 MSBF ≥ 4

Action Payload

Type Name Type Value Field Name Bits Byte Ordering Constraints
Output 0x0000 type 16 MSBF = 0x0000
length 16 MSBF = 0x000f
port 32 MSBF in 0x00000000..0xffffffef
max_len 16 MSBF none
pad 48 - none
SetVLANVID 0x0001 type 16 MSBF = 0x0001
length 16 MSBF = 0x0008
vlan_vid 16 MSBF none
pad 16 - none
SetVLANPCP 0x0002 type 16 MSBF = 0x0002
length 16 MSBF = 0x0008
vlan_pc 8 MSBF none
pad 24 - none
SetDLSrc 0x0003 type 16 MSBF = 0x0003
length 16 MSBF = 0x000f
SetDLSrc 48 MSBF none
pad 48 - none
SetDLDst 0x0004 type 16 MSBF = 0x0004
length 16 MSBF = 0x000f
SetDLSrc 48 MSBF none
pad 48 - none
SetNWSrc 0x0005 type 16 MSBF = 0x0005
length 16 MSBF = 0x0008
nw_addr 32 MSBF none
SetNWDst 0x0006 type 16 MSBF = 0x0006
length 16 MSBF = 0x0008
nw_addr 32 MSBF none
SetNWTos 0x0007 type 16 MSBF = 0x0007
length 16 MSBF = 0x0008
nw_tos 8 MSBF none
pad 24 - none
SetNWECN 0x0008 type 16 MSBF = 0x0008
length 16 MSBF = 0x0008
nw_ecen 8 MSBF none
pad 24 - none
SetTPSrc 0x0009 type 16 MSBF = 0x0009
length 16 MSBF = 0x0008
port 16 MSBF in 0x000..0xffef
pad 16 - none
SetTPDst 0x000a type 16 MSBF = 0x000a
length 16 MSBF = 0x0008
port 16 MSBF 0x000...0xffef
pad 16 - none
CopyTTLOut 0x000b type 16 MSBF = 0x000b
length 16 MSBF = 0x0004
CopyTTLIn 0x000c type 16 MSBF = 0x000c
length 16 MSBF = 0x0004
SetMPLSLabel 0x000d type 16 MSBF = 0x000d
length 16 MSBF = 0x0008
mpls_label 32 MSBF none
SetMPLSTC 0x000e type 16 MSBF = 0x000e
length 16 MSBF = 0x0008
mpls_tc 8 MSBF none
pad 24 - none
SetMPLSTTL 0x000f type 16 MSBF = 0x000f
length 16 MSBF = 0x0008
mpls_ttl 8 MSBF none
pad 24 - none
DecMPLSTTL 0x0010 type 16 MSBF = 0x0010
length 16 MSBF = 0x0004
PushVLAN 0x0011 type 16 MSBF = 0x0011
length 16 MSBF = 0x0008
ethertype 16 MSBF none
pad 16 - none
PopVLAN 0x0012 type 16 MSBF = 0x0012
length 16 MSBF = 0x0004
PushMPLS 0x0013 type 16 MSBF = 0x0013
length 16 MSBF = 0x0008
mpls 16 MSBF none
pad 16 - none
PopMPLS 0x0014 type 16 MSBF = 0x0014
length 16 MSBF = 0x0004
SetQueue 0x0015 type 16 MSBF = 0x0015
length 16 MSBF = 0x0008
queue_id 32 MSBF none
Group 0x0016 type 16 MSBF = 0x0016
length 16 MSBF = 0x0008
group_id 32 MSBF none
SetNWTTL 0x0017 type 16 MSBF = 0x0017
length 16 MSBF = 0x0008
ttl 8 MSBF none
pad 24 - none
DecNWTTL 0x0018 type 16 MSBF = 0x0018
length 16 MSBF = 0x0004
Experimenter 0xffff type 16 MSBF = 0xffff
length 16 MSBF = 0x0008
Experimenter 32 MSBF none

References

OpenFlow Switch Specification 1.1, pages 31-36

Action Structure

This version drastically simplifies some of the types with the new type SetField. The SetField defines its own header and using OXM TLV as the mechanism to carry the source value.

Action Structure

Field Name Bits Byte Ordering Constraints
type 16 MSBF = 0x0000, in 0x000b..0x0019, = 0xffff
length 16 MSBF ≥ 4

Action Payload

Type Name Type Value Field Name Bits Byte Ordering Constraints
Output 0x0000 type 16 MSBF = 0x0000
length 16 MSBF = 0x000f
port 32 MSBF in 0x00000000..0xffffffef
max_len 16 MSBF none
pad 48 - none
CopyTTLOut 0x000b type 16 MSBF = 0x000b
length 16 MSBF = 0x0004
CopyTTLIn 0x000c type 16 MSBF = 0x000c
length 16 MSBF = 0x0004
SetMPLSTTL 0x000f type 16 MSBF = 0x000f
length 16 MSBF = 0x0008
mpls_ttl 8 MSBF none
pad 24 - none
DecMPLSTTL 0x0010 type 16 MSBF = 0x0010
length 16 MSBF = 0x0004
PushVLAN 0x0011 type 16 MSBF = 0x0011
length 16 MSBF = 0x0008
ethertype 16 MSBF none
pad 16 - none
PopVLAN 0x0012 type 16 MSBF = 0x0012
length 16 MSBF = 0x0004
PushMPLS 0x0013 type 16 MSBF = 0x0013
length 16 MSBF = 0x0008
mpls 16 MSBF none
pad 16 - none
PopMPLS 0x0014 type 16 MSBF = 0x0014
length 16 MSBF = 0x0004
SetQueue 0x0015 type 16 MSBF = 0x0015
length 16 MSBF = 0x0008
queue_id 32 MSBF none
Group 0x0016 type 16 MSBF = 0x0016
length 16 MSBF = 0x0008
group_id 32 MSBF none
SetNWTTL 0x0017 type 16 MSBF = 0x0017
length 16 MSBF = 0x0008
ttl 8 MSBF none
pad 24 - none
DecNWTTL 0x0018 type 16 MSBF = 0x0018
length 16 MSBF = 0x0004
SetField 0x0019 type 16 MSBF = 0x0019
length 16 MSBF ≥ 8
OXM TLV ≥ 32 MSBF OXM TLV
Experimenter 0xffff type 16 MSBF = 0xffff
length 16 MSBF = 0x0008
Experimenter 32 MSBF none

OXM TLV Constraints

Class Name Class Value Field Name Field Length Field Value Hasmask Dependencies
nxm_0 0x0000 - - - - -
nxm_1 0x0001 - - - - -
OpenFlowBasic 0x8000 in_port 32 0x00 0 none
in_phy_port 32 0x01 0 in_port
metadata 64 0x02 0 none
128 0x02 1 none
eth_dst 48 0x03 0 none
96 0x03 1 none
eth_src 48 0x04 0 none
96 0x04 1 none
eth_type 16 0x05 0 none
vlan_vid 13 0x06 0 none
26 0x06 1 none
vlan_pcp 3 0x07 0 vlan_vid != none
ip_dscp 6 0x08 0 eth_type = 0x0800 || 0x86dd
ip_ecn 2 0x09 0 eth_type = 0x0800 || 0x86dd
ip_proto 8 0x0a 0 eth_type = 0x0800 || 0x86dd
ipv4_src 32 0x0b 0 eth_type = 0x0800
64 0x0b 1 eth_type = 0x0800
ipv4_dst 32 0x0c 0 eth_type = 0x0800
64 0x0c 1 eth_type = 0x0800
tcp_src 16 0x0d 0 ip_proto = 6
tcp_dst 16 0x0e 0 ip_proto = 6
udp_src 16 0x0f 0 ip_proto = 17
udp_dst 16 0x10 0 ip_proto = 17
sctp_src 16 0x11 0 ip_proto = 132
sctp_dst 16 0x12 0 ip_proto = 132
icmpv4_type 8 0x13 0 ip_proto = 1
icmpv4_code 8 0x14 0 ip_proto = 1
arp_op 16 0x15 0 eth_type = 0x0806
arp_spa 32 0x16 0 eth_type = 0x0806
64 0x16 1 eth_type = 0x0806
arp_tpa 32 0x17 0 eth_type = 0x0806
64 0x17 1 eth_type = 0x0806
arp_sha 48 0x18 0 eth_type = 0x0806
96 0x18 1 eth_type = 0x0806
arp_tha 48 0x19 0 eth_type = 0x0806
96 0x19 1 eth_type = 0x0806
ipv6_src 128 0x1a 0 eth_type = 0x86dd
256 0x1a 1 eth_type = 0x86dd
ipv6_dst 128 0x1b 0 eth_type = 0x86dd
256 0x1b 1 eth_type = 0x86dd
ipv6_flabel 20 0x1c 0 eth_type = 0x86dd
40 0x1c 1 eth_type = 0x86dd
icmpv6_type 8 0x1d 0 ip_proto = 58
icmpv6_code 8 0x1e 0 ip_proto = 58
ipv6_nd_target 128 0x1f 0 icmpv6_type = 135||136
ipv6_nd_sll 48 0x20 0 icmpv6_type = 135
ipv6_nd_tll 48 0x21 0 icmpv6_type = 136
mpls_label 20 0x22 0 eth_type = 0x8847||0x8848
mpls_tc 3 0x23 0 eth_type = 0x8847||0x8848
experimenter 0xffff - - - - -

References

OpenFlow Switch Specification 1.2, pages 39-43

Action Structure

This version add two new types: push/pop_PBB. push_PBB uses the same structure as push_VLAN/MPLS, while pop_PBB is just an empty header.

Action Structure

Field Name Bits Byte Ordering Constraints
type 16 MSBF = 0x0000, in 0x000b..0x001b, = 0xffff
length 16 MSBF ≥ 4

Action Payload

Type Name Type Value Field Name Bits Byte Ordering Constraints
Output 0x0000 type 16 MSBF = 0x0000
length 16 MSBF = 0x000f
port 32 MSBF in 0x00000000..0xffffffef
max_len 16 MSBF none
pad 48 - none
CopyTTLOut 0x000b type 16 MSBF = 0x000b
length 16 MSBF = 0x0004
CopyTTLIn 0x000c type 16 MSBF = 0x000c
length 16 MSBF = 0x0004
SetMPLSTTL 0x000f type 16 MSBF = 0x000f
length 16 MSBF = 0x0008
mpls_ttl 8 MSBF none
pad 24 - none
DecMPLSTTL 0x0010 type 16 MSBF = 0x0010
length 16 MSBF = 0x0004
PushVLAN 0x0011 type 16 MSBF = 0x0011
length 16 MSBF = 0x0008
ethertype 16 MSBF none
pad 16 - none
PopVLAN 0x0012 type 16 MSBF = 0x0012
length 16 MSBF = 0x0004
PushMPLS 0x0013 type 16 MSBF = 0x0013
length 16 MSBF = 0x0008
mpls 16 MSBF none
pad 16 - none
PopMPLS 0x0014 type 16 MSBF = 0x0014
length 16 MSBF = 0x0004
SetQueue 0x0015 type 16 MSBF = 0x0015
length 16 MSBF = 0x0008
queue_id 32 MSBF none
Group 0x0016 type 16 MSBF = 0x0016
length 16 MSBF = 0x0008
group_id 32 MSBF none
SetNWTTL 0x0017 type 16 MSBF = 0x0017
length 16 MSBF = 0x0008
ttl 8 MSBF none
pad 24 - none
DecNWTTL 0x0018 type 16 MSBF = 0x0018
length 16 MSBF = 0x0004
SetField 0x0019 type 16 MSBF = 0x0019
length 16 MSBF ≥ 8
OXM TLV ≥ 32 MSBF OXM TLV
PushPBB 0x001a type 16 MSBF = 0x001a
length 16 MSBF = 0x0008
ethertype 16 MSBF none
pad 16 - none
PopPBB 0x001b type 16 MSBF = 0x001b
length 16 MSBF = 0x0004
Experimenter 0xffff type 16 MSBF = 0xffff
length 16 MSBF = 0x0008
Experimenter 32 MSBF none

References

OpenFlow Switch Specification 1.3.0, pages 48-51

Action Structure

Two types were added in 1.3: push/pop_PBB. push_PBB uses the same structure as push_VLAN/MPLS, while pop_PBB is just an empty header.

Action Structure

Field Name Bits Byte Ordering Constraints
type 16 MSBF = 0x0000, in 0x000b..0x001b, = 0xffff
length 16 MSBF ≥ 4

Action Payload

Type Name Type Value Field Name Bits Byte Ordering Constraints
Output 0x0000 type 16 MSBF = 0x0000
length 16 MSBF = 0x000f
port 32 MSBF in 0x00000000..0xffffffef
max_len 16 MSBF none
pad 48 - none
CopyTTLOut 0x000b type 16 MSBF = 0x000b
length 16 MSBF = 0x0004
CopyTTLIn 0x000c type 16 MSBF = 0x000c
length 16 MSBF = 0x0004
SetMPLSTTL 0x000f type 16 MSBF = 0x000f
length 16 MSBF = 0x0008
mpls_ttl 8 MSBF none
pad 24 - none
DecMPLSTTL 0x0010 type 16 MSBF = 0x0010
length 16 MSBF = 0x0004
PushVLAN 0x0011 type 16 MSBF = 0x0011
length 16 MSBF = 0x0008
ethertype 16 MSBF none
pad 16 - none
PopVLAN 0x0012 type 16 MSBF = 0x0012
length 16 MSBF = 0x0004
PushMPLS 0x0013 type 16 MSBF = 0x0013
length 16 MSBF = 0x0008
mpls 16 MSBF none
pad 16 - none
PopMPLS 0x0014 type 16 MSBF = 0x0014
length 16 MSBF = 0x0004
SetQueue 0x0015 type 16 MSBF = 0x0015
length 16 MSBF = 0x0008
queue_id 32 MSBF none
Group 0x0016 type 16 MSBF = 0x0016
length 16 MSBF = 0x0008
group_id 32 MSBF none
SetNWTTL 0x0017 type 16 MSBF = 0x0017
length 16 MSBF = 0x0008
ttl 8 MSBF none
pad 24 - none
DecNWTTL 0x0018 type 16 MSBF = 0x0018
length 16 MSBF = 0x0004
SetField 0x0019 type 16 MSBF = 0x0019
length 16 MSBF ≥ 8
OXM TLV ≥ 32 MSBF OXM TLV
PushPBB 0x001a type 16 MSBF = 0x001a
length 16 MSBF = 0x0008
ethertype 16 MSBF none
pad 16 - none
PopPBB 0x001b type 16 MSBF = 0x001b
length 16 MSBF = 0x0004
Experimenter 0xffff type 16 MSBF = 0xffff
length 16 MSBF = 0x0008
Experimenter 32 MSBF none

References

OpenFlow Switch Specification 1.3.0, pages 56-61

Coming soon
This content is under development.

Coming soon
This content is under development.