Multiple Controller Connections
Each controller can have one of the following roles:
- Equal: The controller has full access to the switch. It receives all the asynchronous messages from the switch and sends commands to modify the state of the switch (add or delete flows).
- Slave: The controller has a read-only access to the switch. It does not receive the asynchronous messages (apart from port status). It does not execute commands that modify the state of the switch: packet-out, flow-mod, group-mod, port-mod, or table-mod. The switch must reply with an OFPT_ERROR message if it receives one of those commands from a Slave controller. Other controller-to-switch messages are processed normally.
- Master: The controller has full access to the switch as in the Equal role. When the controller changes its role to Master, the switch changes the other controller in the Master role to the Slave role. The role change does not affect controllers with the Equal role.
A switch can be simultaneously connected to multiple controllers in the Equal role, multiple controllers in the Slave role, and, at most, one controller in the Master role. Each controller can communicate its role to the switch by way of an OFPT_ROLE_REQUEST message. This message can be used by the controller to set and query the role of its channel with the switch.
To detect the out-of-order messages during a Master-to-Slave transition, the OFPT_ROLE_REQUEST message contains a 64-bit generation ID, filed by sequence number, that identifies the mastership view. The controllers coordinate the assignment of generation IDs. The generation ID is a monotonically increasing counter. A new (larger) value is assigned each time the mastership view changes; that is, when a new Master is designated. The generation ID value wraps around once the maximum value has been reached.
device(config)# show openflow controller ------------------------------------------------------------------------ Contlr Mode TCP/SSL IP-address Port Status Role ------------------------------------------------------------------------ 1 (Equal) passive TCP 0.0.0.0 6633 TCP_LISTENING 2 (Master) active TCP 10.25.128.179 6633 OPENFLOW_ESABLISHED 3 (Slave) active TCP 10.25.128.177 6633 OPENFLOW_ESABLISHED 3 (Equal) active TCP 10.25.128.165 6633 OPENFLOW_ESABLISHED