SDN Controller Programming Guide

35
private OpenflowMessage createEchoRequest(byte[] timestamp) {
OfmMutableEchoRequest echo = (OfmMutableEchoRequest)
MessageFactory.create(PV, MessageType.ECHO_REQUEST);
echo.data(timestamp);
return echo.toImmutable();
}
private long retrieveTimestamp(OpenflowMessage reply) {
OfmEchoReply echo = (OfmEchoReply) reply;
return ByteUtils.getLong(echo.getData(), 0);
}
Packet Sequencer
PACKET_IN messages are handled by the controller with the Packet Sequencer module. The design
of this module provides an orderly, deterministic, yet flexible, scheme for allowing code running on
the controller to register for participation in the handling of PACKET_IN messages. An application
wishing to participate will implement the SequencedPacketListener (SPL) interface.
The following figure illustrates the relationship between the Sequencer and the SPLs participating
in the processing chain:
Figure 18 Packet-In Processing
The Roles proide three broad bands of participation with the processing of PACKET_IN messages:
An ADVISOR may analyze and provide additional metadata about the packet (attached as
“hintsfor listeners further downstream), but does not contribute directly to the formation of
the PACKET_OUT message.