Book Image

OpenFlow Cookbook

Book Image

OpenFlow Cookbook

Overview of this book

Table of Contents (17 chapters)
16
Index

Setting the role of a controller's communication channel

The OFPT_ROLE_REQUEST messages are used to change the role of the communication channel. The different controller roles are described in the previous recipe of this chapter. The controller can change its role at any time. The role request message offers a lightweight mechanism to help the controller master election process. Usually, all the controllers in the system require coordination among themselves for the controller election process. Any slave controller or equal controller can elect itself as master.

Tip

The switch cannot change the controller state. The controller state in a switch is always changed due to a request from one of the controllers.

How to do it...

The controller should send the role request in the following format. The switch uses the same message format for sending the reply message back to the controller:

/* Role request and reply message. */
struct ofp_role_request {
struct ofp_header header; /* Type OFPT_ROLE_REQUEST...