Book Image

OpenFlow Cookbook

Book Image

OpenFlow Cookbook

Overview of this book

Table of Contents (17 chapters)
16
Index

Adding a new flow entry to the flow table

When the controller wants to program the flow table entry, then they should send a flow entry modification message (OFPT_FLOW_MOD) to the switch. This flow table modification message contains the necessary information required to program the flow table, which includes flow match field, priority, instruction set, timeout, and so on.

Tip

The OFPT_FLOW_MOD message is used for all flow entry operations, such as adding a new flow entry, deleting an existing flow entry, and modifying a flow entry in a flow table.

How to do it...

The message format that should be used by the controller to send the OFPT_FLOW_MOD message is as follows:

/* Flow setup and teardown (controller -> datapath). */
struct ofp_flow_mod {
struct ofp_header header;
uint64_t cookie;        /* Opaque controller-issued identifier. */
uint64_t cookie_mask;   /* Mask used to restrict the cookie bits
                         * that must match when the command is
                         *...