This project implements OpenFlow 1.0 specification, but with significant deviations and simplifications.
struct ofp_header {
uint8_t version; /* OFP_VERSION. */
uint8_t type; /* One of the OFPT_ constants. */
uint16_t length; /* Length including this ofp_header. */
uint32_t xid; /* Transaction id associated with this packet. */
};struct ofp_header {
uint8_t version = 0;
uint8_t type = 0;
uint16_t length = 0;
uint32_t xid = 0;
};✅ COMPLIANT - Fully RFC-compatible.
struct ofp_switch_features {
struct ofp_header header;
uint64_t datapath_id; /* Datapath unique ID */
uint32_t n_buffers; /* Max packets buffered at once */
uint8_t n_tables; /* Number of tables supported */
uint8_t pad[3]; /* Align to 64-bits */
uint32_t capabilities; /* Bitmap of support capabilities */
uint32_t actions; /* Bitmap of supported actions */
struct ofp_phy_port ports[0]; /* Port definitions */
};class OFP_Features_Reply extends Open_Flow_Message {
string datapath_id; // ❌ ERROR: Should be uint64_t per RFC
uint32_t n_buffers; // ✅ OK
uint8_t n_tables; // ✅ OK
uint32_t capabilities; // ✅ OK
uint32_t reserved; // ❌ ERROR: Should be actions field per RFC
uint32_t ports[]; // ❌ ERROR: Should be ofp_phy_port structs per RFC
}❌ CRITICAL DEVIATIONS:
- datapath_id: Should be uint64_t instead of string
- Missing actions field: Required by RFC
- Simplified ports: Should be full port structures per RFC
struct ofp_packet_in {
struct ofp_header header;
uint32_t buffer_id; /* ID assigned by datapath */
uint16_t total_len; /* Full length of frame */
uint16_t in_port; /* Port on which frame was received */
uint8_t reason; /* Reason packet is being sent */
uint8_t pad;
uint8_t data[0]; /* Ethernet frame */
};class OFP_Packet_In extends Open_Flow_Message {
uint32_t buffer_id; // ✅ OK
uint16_t total_len; // ✅ OK
uint8_t reason; // ✅ OK
oxm_basic_match match; // ❌ ERROR: No match field in RFC
}❌ CRITICAL DEVIATIONS:
- Missing in_port field: Required uint16_t per RFC
- Added match field: Not present in RFC OpenFlow 1.0
- Missing data field: Ethernet frame should be here per RFC
struct ofp_flow_mod {
struct ofp_header header;
struct ofp_match match; /* Fields to match */
uint64_t cookie; /* Opaque controller-issued identifier */
uint16_t command; /* One of OFPFC_* */
uint16_t idle_timeout; /* Idle time before discarding */
uint16_t hard_timeout; /* Max time before discarding */
uint16_t priority; /* Priority level of flow entry */
uint32_t buffer_id; /* Buffered packet to apply to */
uint16_t out_port; /* For OFPFC_DELETE* commands */
uint16_t flags; /* One of OFPFF_* */
struct ofp_action_header actions[0]; /* Actions */
};class OFP_Flow_Mod extends Open_Flow_Message {
uint64_t cookie; // ✅ OK
uint64_t cookie_mask; // ❌ ERROR: OpenFlow 1.3+ field
uint8_t table_id; // ❌ ERROR: OpenFlow 1.1+ field
uint8_t command; // ✅ OK (but type differs)
uint16_t idle_timeout; // ✅ OK
uint16_t hard_timeout; // ✅ OK
uint16_t priority; // ✅ OK
uint32_t buffer_id; // ✅ OK
uint32_t out_port; // ❌ ERROR: Should be uint16_t per RFC
uint32_t out_group; // ❌ ERROR: OpenFlow 1.1+ field
uint16_t flags; // ✅ OK
oxm_basic_match match; // ❌ ERROR: Should be ofp_match per RFC
ofp_action_output actions[]; // ✅ OK (partially)
}❌ CRITICAL DEVIATIONS:
- Later OpenFlow version fields: cookie_mask, table_id, out_group
- Match structure: Should be ofp_match instead of oxm_basic_match
- out_port type: Should be uint16_t instead of uint32_t
struct ofp_match {
uint32_t wildcards; /* Wildcard fields */
uint16_t in_port; /* Input switch port */
uint8_t dl_src[OFP_ETH_ALEN]; /* Ethernet source address */
uint8_t dl_dst[OFP_ETH_ALEN]; /* Ethernet destination address */
uint16_t dl_vlan; /* Input VLAN id */
uint8_t dl_vlan_pcp; /* Input VLAN priority */
uint8_t pad1[1]; /* Align to 64-bits */
uint16_t dl_type; /* Ethernet frame type */
uint8_t nw_tos; /* IP ToS */
uint8_t nw_proto; /* IP protocol or lower 8 bits of ARP opcode */
uint8_t pad2[2]; /* Align to 64-bits */
uint32_t nw_src; /* IP source address */
uint32_t nw_dst; /* IP destination address */
uint16_t tp_src; /* TCP/UDP source port */
uint16_t tp_dst; /* TCP/UDP destination port */
};struct oxm_basic_match {
uint16_t OFB_IN_PORT; // ❌ ERROR: Should be uint16_t in_port per RFC
MacAddress OFB_ETH_SRC; // ✅ OK (but naming convention differs)
MacAddress OFB_ETH_DST; // ✅ OK (but naming convention differs)
uint16_t OFB_ETH_TYPE; // ✅ OK (but naming convention differs)
// ... additional OpenFlow 1.3+ fields
uint32_t wildcards; // ✅ OK
}❌ CRITICAL DEVIATIONS:
- Naming convention: OFB_ prefix instead of RFC field names
- Structure name: Should be ofp_match instead of oxm_basic_match
- Field order: Differs from RFC
- OpenFlow 1.3+ fields: Mixed with 1.0 fields
- HELLO ✅
- FEATURES_REQUEST ✅
- FEATURES_REPLY ✅ (with errors)
- PACKET_IN ✅ (with errors)
- PACKET_OUT ✅
- FLOW_MOD ✅ (with errors)
- ERROR ❌
- ECHO_REQUEST ❌
- ECHO_REPLY ❌
- GET_CONFIG_REQUEST ❌
- GET_CONFIG_REPLY ❌
- SET_CONFIG ❌
- FLOW_REMOVED ❌
- PORT_STATUS ❌
- STATS_REQUEST ❌
- STATS_REPLY ❌
- BARRIER_REQUEST ❌
- BARRIER_REPLY ❌
The implementation mixes features from different OpenFlow versions:
- OpenFlow 1.0: Basic message structure, wildcards
- OpenFlow 1.1+: table_id, out_group fields
- OpenFlow 1.3+: OXM match format, cookie_mask
This creates compatibility issues with standard OpenFlow switches and controllers.
- RFC:
uint64_t datapath_id(64-bit integer) - Implementation:
string datapath_id(string representation) - Impact: Cannot interoperate with standard OpenFlow equipment
- RFC: Various
uint16_tport fields - Implementation: Some fields changed to
uint32_t - Impact: Potential overflow/underflow issues
- Basic OpenFlow communication works
- Main message types implemented
- Good OMNeT++ integration
- Suitable for educational/research purposes
- Version mixing: OpenFlow 1.0, 1.1, 1.3+ fields are mixed
- Datapath ID: String instead of uint64_t
- Match structure: Not RFC-compliant
- Missing fields: Several mandatory RFC fields missing
- Type mismatches: uint16_t vs uint32_t issues
- Missing messages: Many standard OpenFlow messages not implemented
This project is suitable for educational/research purposes but not compatible with real OpenFlow environments using standard switches and controllers.
To achieve RFC compliance, the following changes would be needed:
- Fix datapath_id to use uint64_t
- Implement proper ofp_match structure
- Remove OpenFlow 1.3+ fields from 1.0 implementation
- Add missing mandatory RFC messages
- Fix data type mismatches
- Implement proper port structure handling
Generated: January 2025
OpenFlow Version Analyzed: 1.0
Implementation Framework: OMNeT++