Book Image

OpenFlow Cookbook

Book Image

OpenFlow Cookbook

Overview of this book

Table of Contents (17 chapters)
16
Index

Sending and processing error message

Error messages are used by both the controller and the switch to notify the problem to other end of the connection. Error messages are typically used by the switch to inform the controller about failure of execution of the request sent from the controller.

How to do it...

Whenever the controller wants to send an error message to the switch, it should create the OFPT_ERROR message, which takes the following message format:

/* OFPT_ERROR: Error message (datapath -> the controller). */
struct ofp_error_msg {
struct ofp_header header;
uint16_t type;
uint16_t code;
uint8_t data[0]; /* Variable-length data. Interpreted based
on the type and code. No padding. */
};
How to do it...

The type indicates the high-level type of the error. The code value is interpreted based on the type. The data value is a piece of variable-length data that is interpreted based on both type and value. The data field should contain an ASCII text string that adds details on why the error occurred....