Skip to content

Latest commit

 

History

History
274 lines (226 loc) · 8.64 KB

File metadata and controls

274 lines (226 loc) · 8.64 KB

OpenFlow Implementation vs RFC Compliance Analysis

General Observations

This project implements OpenFlow 1.0 specification, but with significant deviations and simplifications.


1. OpenFlow Header (ofp_header)

RFC OpenFlow 1.0:

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. */
};

Implementation:

struct ofp_header {
    uint8_t version = 0;
    uint8_t type = 0;
    uint16_t length = 0;
    uint32_t xid = 0;
};

✅ COMPLIANT - Fully RFC-compatible.


2. Features Reply (OFP_Features_Reply)

RFC OpenFlow 1.0:

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 */
};

Implementation:

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:

  1. datapath_id: Should be uint64_t instead of string
  2. Missing actions field: Required by RFC
  3. Simplified ports: Should be full port structures per RFC

3. Packet In (OFP_Packet_In)

RFC OpenFlow 1.0:

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 */
};

Implementation:

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:

  1. Missing in_port field: Required uint16_t per RFC
  2. Added match field: Not present in RFC OpenFlow 1.0
  3. Missing data field: Ethernet frame should be here per RFC

4. Flow Mod (OFP_Flow_Mod)

RFC OpenFlow 1.0:

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 */
};

Implementation:

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:

  1. Later OpenFlow version fields: cookie_mask, table_id, out_group
  2. Match structure: Should be ofp_match instead of oxm_basic_match
  3. out_port type: Should be uint16_t instead of uint32_t

5. Match Structure

RFC OpenFlow 1.0:

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 */
};

Implementation:

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:

  1. Naming convention: OFB_ prefix instead of RFC field names
  2. Structure name: Should be ofp_match instead of oxm_basic_match
  3. Field order: Differs from RFC
  4. OpenFlow 1.3+ fields: Mixed with 1.0 fields

6. Missing RFC Messages

Implemented messages:

  • HELLO ✅
  • FEATURES_REQUEST ✅
  • FEATURES_REPLY ✅ (with errors)
  • PACKET_IN ✅ (with errors)
  • PACKET_OUT ✅
  • FLOW_MOD ✅ (with errors)

Missing RFC messages:

  • 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 ❌

7. Version Mixing Issues

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.


8. Data Type Issues

Datapath ID Problem:

  • RFC: uint64_t datapath_id (64-bit integer)
  • Implementation: string datapath_id (string representation)
  • Impact: Cannot interoperate with standard OpenFlow equipment

Port Number Issues:

  • RFC: Various uint16_t port fields
  • Implementation: Some fields changed to uint32_t
  • Impact: Potential overflow/underflow issues

Summary

Strengths:

  • Basic OpenFlow communication works
  • Main message types implemented
  • Good OMNeT++ integration
  • Suitable for educational/research purposes

Critical Issues:

  1. Version mixing: OpenFlow 1.0, 1.1, 1.3+ fields are mixed
  2. Datapath ID: String instead of uint64_t
  3. Match structure: Not RFC-compliant
  4. Missing fields: Several mandatory RFC fields missing
  5. Type mismatches: uint16_t vs uint32_t issues
  6. Missing messages: Many standard OpenFlow messages not implemented

Recommendation:

This project is suitable for educational/research purposes but not compatible with real OpenFlow environments using standard switches and controllers.

For Production Use:

To achieve RFC compliance, the following changes would be needed:

  1. Fix datapath_id to use uint64_t
  2. Implement proper ofp_match structure
  3. Remove OpenFlow 1.3+ fields from 1.0 implementation
  4. Add missing mandatory RFC messages
  5. Fix data type mismatches
  6. Implement proper port structure handling

Generated: January 2025
OpenFlow Version Analyzed: 1.0
Implementation Framework: OMNeT++