Skip to content

RFProtocol

Joe Stringer edited this page Jul 29, 2013 · 5 revisions

RFProtocol is the format used to share information between RouteFlow components. It is derived from the files rflib/ipc/RFProtocol and rflib/ipc/msgen.py.

Generating RFProtocol code

The RFProtocol file defines the structure for the messages, and the msgen.py script converts this format into the Python and C++ code. To generate the C++ and Python code:

$ cd rflib/ipc; python ./msgen.py RFProtocol

Message Syntax

MessageName
    Type FieldName
    Type FieldName2
    ...

MessageName2
    ...

Valid types

  • bool
  • string
  • i8 - 8-bit integer
  • i32 - 32-bit integer
  • i64 - 64-bit integer
  • mac - 48-bit MAC address
  • ip - IPv4 or IPv6 address
  • match - RouteFlow match structure
  • action - RouteFlow action structure
  • option - RouteFlow option structure
  • match[] - Array of matches
  • action[] - Array of actions
  • option[] - Array of options

Matches, Actions and Options are examples of TLV structures with associated types.

RouteMod

RouteMod is a special kind of message that is meant to abstract away OpenFlow protocol specifics, and provide a higher-level interface for configuring flow tables. Below is the structure:

RouteMod
    i8 mod
    i64 id
    match[] matches
    action[] actions
    option[] options
  • mod is RMT_ADD, RMT_MODIFY or RMT_DELETE, to add, change or remove flow table entries.
  • id is the ID of the destination switch.
  • matches is a list of TLVs to describe what to match on for this entry, eg IPv4 or IPv6 address, transport port, etc.
  • actions is a list of TLVs describing actions to undertake. The most common are to rewrite ethernet addresses or output.
  • options is a list of TLVs describing additional parameters. Currently, this includes the priority, timeouts and controller ID.

TLVs consist of a type, a length and a value. The type is 8-bit, with the highest (MSB) bit indicating whether the TLV is allowed to be ignored. Values <= 127 must be enacted, else the entire message must be ignored. Values >=128 indicate that the TLV may be ignored and the rest of the message carried out. Optional values should also be logged by RFProxy if they are ignored.

When RFMT_IPV4 or RFMT_IPV6 matches are used, we serialise the IP address and prefix back-to-back, in network byte-order. See the header file for more information.