. With OpenFlow rules, each packet matches a specified header, the counters are updated, and the appropriate actions taken. If a packet matches multiple flow entries, the entry with the highest priority is chosen. An entry's header fields can contain wildcard values, meaning that it can match any value in the corresponding position. It is a TCAM-like match to flows. The basic set of OpenFlow actions are Match Action Counter Priority Time out When to delete the entry What order to process the rule # of packet/bytes processed by the rule 1. Forward packet to zero or more ports 2. Encapsulate and forward to controller 3. Send to normal processing pipeline 4. Modify fields Switch sport dport Figure 4.7 OpenFlow overview. 4 Software-Defined Networks Principles and Applications forward as default, forward out through a defined interface, deny, forward to a controller, and modify various packet header fields. The messages can be initiated by the controller, by the switch, or by either of them. Controller-to-Switch: - The Send-packet message instructs the switch to send packet out of a specific port on a switch. - The Flow-mod message tells the switch to add/delete/modify flows in the flow table. - The Read-state message is used to collect statistics about flow table, ports, and individual flows. - Features is sent by controller when a switch connects to find out the features supported by a switch. - Configuration is to set and query configuration parameters in the switch. Switch-to-Controller: - The Packet-in message sends all packets that do not have a match- ing rule to controller. - The Flow-removed message is sent whenever a flow rule expires. - The Port-status is sent to the controller whenever a port config- uration or state changes. - The Error is sent whenever an error occurs. Both directions: - Hello message is sent at connection startup stage to bootstrap the devices. - Echo is sent periodically to indicate latency, bandwidth, or liveli- ness of the connection between controller and switches. - Vendor message 