This paper focuses on the instruction set of the OpenFlow switch specification, which profoundly affects the processing behavior of the packet in switch, starting from the following sections.
1, instructions
Each flow entry contains a series of instructions that are executed on a packet that successfully matches the flow entry, resulting in changes to the header information, Action The update of set or change the processing behavior of pipeline processing. Instructions There are roughly the following types, OpenFlow switch does not need to support all types, but the black type must be supported:
1) Meter meter_id: Forwards the packet directly to the specified Meter processing.
2) Apply-actions action (S): Executes the specified action (s) on the packet immediately, instead of updating the action (s) into the Actions set. These action (s) may modify the information for the packet, which is organized as an action list.
3) Clear-actions: Clears all action (s) from the Actions set immediately.
4)write-actions action (S): Merges the specified action (s) into the current actions set, or if the action of the given type is currently present in the actions set, Then it will overwrite, or join directly.
5) Write-metadata metadata/mask: Writes the specified Metadata value to the current Metadata domain.
6)goto-table next-table-id: Specifies the next flow table in pipeline processing. The Table-id must be larger than the current flow table ID, and the last flow table in pipeline cannot contain this instruction; If only one flow table OpenFlow switch cannot support the directive.
There can be at most one instruction of each type (as listed above) in each flow entry, and these instructins must be executed sequentially in the order listed above. Often in practice, the only limitation is that the Meter instruction must be executed before the apply-actions instruction, clear-actions instruction must be executed before the write-actions command, and goto-table must be placed in the final execution.
A openflow Swtich must reject the flow Entry of instructions that it cannot support and issue a unsupported flow error to the remote Controller. Flow tables may not support every match, every instruction, or every action.
2. Action Set
The action set is associated with each packet and is initially an empty collection, and a flow entry can modify the action set by means of a write-actions or clear-actions instruction, which is set in a different flow Table is passed between, and when a flow entry instructions does not contain goto-table instructions, then the entire pipeline processing will stop at this flow entry, It then starts executing all action (s) in the action set associated with the packet.
Similarly, in an action set, there is at most one of each type of action, and the action type is roughly as follows:
1) Copy TTL inwards: Performs a copy TTL inwards operation on the packet.
2) Pop:pop All the tags in the packet.
3) Push-mpls:push MPLS tag into the packet.
4) Push-pbb:push PBB tag into the packet.
5) Push-vlan:push VLAN tag into the packet.
6) Copy TTL outwards: Performs a copy TTL outwards operation on the packet.
7) Decrement TTL: Reduces the TTL of the packet.
8) Set: Performs the set-fields operation on the packet.
9) QoS: Perform QoS-related operations, such as Set_queue.
Group: Go to the specified group table to continue executing the action (s) in its action bucket.
Output: If no group action is specified, the packet is forwarded to the specified port.
The apply-actions instruction triggers the action (s) in the action set immediately, and the action (s) must be executed sequentially in the order of the list above, regardless of the order in which the action (s) is added to the action set, In addition, the output action must be executed last, and if an action set has both an output action and a group action, then the group action will be executed first, and the output action will be ignored, whereas , if the output action and group action are not present in an action set, the packet will be discarded. If OpenFlow switch is supported, the group action bucket can be executed recursively, that is, the action bucket can continue to specify another group.
3. Action List
Both the Apply-actions directive and the Packet-out message contain an action list in which the action (s) executes sequentially in the order of the list above, and the results of the execution are immediately reflected in the packet information. For example, the action list has two Push-vlan action, then these two VLAN tags will be added to the packet header. If the action list contains an output action, the packet based on the current state is cloned, and the clone is forwarded to the specified port, and if the action list contains a group action, Then the same data packet based on the current state is cloned, and the clone is forwarded to the specified group.
When the apply-actions instruction of the packet completes, pipeline continues to perform subsequent processing on the modified packet, and the action set is not modified because the action list is executed.
4. Actions
OpenFlow switch does not need to support all action types, but the following black types must be supported:
1)Output: The action refers to forwarding a packet to the specified OpenFlow Ports.
2) Set-queue: This action refers to setting a Queue ID for a packet. When a packet is forwarded to a port through the output action, the queue ID determines which queue the packet is placed on to dispatch forwarding, which can be used to implement QoS support.
3)Drop: No action is shown to represent dropped packets, and as an alternative, if there is no output action in the action set of a packet, the packet will be discarded.
4)group: Forwards the packet to the specified group to continue processing.
5) Push-tag/pop-tag:switch should be able to support the following Push-tag/pop-tag operations:
6) Set-fields: Different Set-fields action is uniquely identified by its different field type, which can modify some of the domain information in the header, such as VLAN tag modification.
7) Change-ttl: The action can modify information such as IPv4 Ttl,ipv6 Hop Limit or MPLS TTL in the packet header, as follows:
OpenFlow Switch Learning Note (vi)--instructions and actions