SDN Controller Programming Guide
188
// The LoggerFactory may be wrapped by a class in charge of providing
// loggers to guarantee loggers are created in a consistent manner
logger = LoggerFactory.getLogger(getClass());
}
...
@Override
public Switch add(Switch device) {
...
logger.info("Device {} added", device);
...
}
...
}
Log entries are stored in the file logs/log.log; see the HP VAN SDN Controller Admin Guide [30]
to get instructions about exporting support logs. If a secure shell (SSH) session is opened to the
controller the log entries may found at /opt/sdn/virgo/serviceability/logs/log.log.
Using OpenFlow
The sample application was described as an application to monitor reachability status of Open
Flow switches. So far no monitor capabilities have been included. The OpenFlow Controller
published by the HP VAN SDN Controller will be used to accomplish such monitoring.
NOTE:
This may not be the best way to monitor reachabilioty status and such monitoring may not concern to
SDN applications but network management applications, however it represents a good example for
interacting with the OpenFlow controller.
The OpenFlow Controller is responsible for accepting and maintaining connections from
OpenFlow-capable devices, and providing basic services to SDN Applications. See OpenFlow on
page 22 for more details. The ControllerService API provides a common facade for consumers to
interact with the OpenFlow Controller. Applications and Services register with the controller as
specific types of listener:
DataPathListener—To receive events about datapath connection.
MessageListener—To receive events about OpenFlow messages received by the controller
from connected datapaths.
SequencedPacketListener—To participate in the processing of Packet-In messages
FlowListener—To receive events about flow.
DataPathListener will be used to monitor connections and thus translate connected devices to
reachable devices. Even though just DataPathListener will be shown here, using the other listeners
is a matter of creating a variation of what is shown.
The following listings illustrate an extract of the implementation of SwitchManager and
SwitchComponent consuming the ControllerService to monitor datapath connections.
SwitchManager.java Subscribing a DataPathListener to the ControllerService: