Skip to content

Commit

Permalink
Initial OpenFlow 1.3 support
Browse files Browse the repository at this point in the history
Initial OpenFlow 1.3 support with new include/openflow/openflow-1.3.h.
Most of the messages that differ from 1.2 are implemented. OFPT_SET_ASYNC
is implemented via NX_SET_ASYNC_CONFIG, other new message types are yet to
be implemented. Stats replies that add duration fields are implemented at
encode/decode level only. Test cases for implemented features are included.
Remaining FIXME:s should not cause runtime aborts. Make check comes out
clean.

Signed-off-by: Jarno Rajahalme <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
Jarno Rajahalme authored and blp committed Nov 27, 2012
1 parent 6ed3b86 commit 2e1ae20
Show file tree
Hide file tree
Showing 27 changed files with 1,414 additions and 149 deletions.
21 changes: 14 additions & 7 deletions build-aux/extract-ofp-errors
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def extract_ofp_errors(filenames):
names = []
domain = {}
reverse = {}
for domain_name in ("OF1.0", "OF1.1", "OF1.2", "NX1.0", "NX1.1"):
for domain_name in ("OF1.0", "OF1.1", "OF1.2", "OF1.3",
"NX1.0", "NX1.1", "NX1.2", "NX1.3"):
domain[domain_name] = {}
reverse[domain_name] = {}

Expand Down Expand Up @@ -225,17 +226,22 @@ def extract_ofp_errors(filenames):
else:
code = None

target_map = {"OF1.0+": ("OF1.0", "OF1.1", "OF1.2"),
"OF1.1+": ("OF1.1", "OF1.2"),
"OF1.2+": ("OF1.2",),
target_map = {"OF1.0+": ("OF1.0", "OF1.1", "OF1.2", "OF1.3"),
"OF1.1+": ("OF1.1", "OF1.2", "OF1.3"),
"OF1.2+": ("OF1.2", "OF1.3"),
"OF1.3+": ("OF1.3",),
"OF1.0": ("OF1.0",),
"OF1.1": ("OF1.1",),
"OF1.2": ("OF1.2",),
"NX1.0+": ("OF1.0", "OF1.1", "OF1.2"),
"OF1.3": ("OF1.3",),
"NX1.0+": ("OF1.0", "OF1.1", "OF1.2", "OF1.3"),
"NX1.1+": ("OF1.1", "OF1.2", "OF1.3"),
"NX1.2+": ("OF1.2", "OF1.3"),
"NX1.3+": ("OF1.3",),
"NX1.0": ("OF1.0",),
"NX1.1": ("OF1.1",),
"NX1.1+": ("OF1.1",),
"NX1.2": ("OF1.2",)}
"NX1.2": ("OF1.2",),
"NX1.3": ("OF1.3",)}
if targets not in target_map:
fatal("%s: unknown error domain" % targets)
if targets.startswith('NX') and code < 0x100:
Expand Down Expand Up @@ -369,6 +375,7 @@ static const struct ofperr_domain %s = {
output_domain(reverse["OF1.0"], "ofperr_of10", "OpenFlow 1.0", 0x01)
output_domain(reverse["OF1.1"], "ofperr_of11", "OpenFlow 1.1", 0x02)
output_domain(reverse["OF1.2"], "ofperr_of12", "OpenFlow 1.2", 0x03)
output_domain(reverse["OF1.3"], "ofperr_of13", "OpenFlow 1.3", 0x04)

if __name__ == '__main__':
if '--help' in sys.argv:
Expand Down
1 change: 1 addition & 0 deletions build-aux/extract-ofp-msgs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ version_map = {"1.0": (OFP10_VERSION, OFP10_VERSION),
"1.3+": (OFP13_VERSION, OFP13_VERSION),
"1.0-1.1": (OFP10_VERSION, OFP11_VERSION),
"1.0-1.2": (OFP10_VERSION, OFP12_VERSION),
"1.1-1.2": (OFP11_VERSION, OFP12_VERSION),
"<all>": (0x01, 0xff)}

def get_line():
Expand Down
1 change: 1 addition & 0 deletions include/openflow/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ noinst_HEADERS += \
include/openflow/openflow-1.0.h \
include/openflow/openflow-1.1.h \
include/openflow/openflow-1.2.h \
include/openflow/openflow-1.3.h \
include/openflow/openflow-common.h \
include/openflow/openflow.h

Expand Down
2 changes: 2 additions & 0 deletions include/openflow/openflow-1.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ enum ofp_config_flags {
OFPC_FRAG_NX_MATCH = 3, /* Make first fragments available for matching. */
OFPC_FRAG_MASK = 3,

/* OFPC_INVALID_TTL_TO_CONTROLLER is deprecated in OpenFlow 1.3 */

/* TTL processing - applicable for IP and MPLS packets. */
OFPC_INVALID_TTL_TO_CONTROLLER = 1 << 2, /* Send packets with invalid TTL
to the controller. */
Expand Down
4 changes: 3 additions & 1 deletion include/openflow/openflow-1.1.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ struct ofp11_port {
ovs_be32 curr_speed; /* Current port bitrate in kbps. */
ovs_be32 max_speed; /* Max port bitrate in kbps */
};
OFP_ASSERT(sizeof(struct ofp11_port) == 64);

/* Modify behavior of the physical port */
struct ofp11_port_mod {
Expand Down Expand Up @@ -588,7 +589,8 @@ struct ofp11_flow_stats {
when this is not an exact-match entry. */
ovs_be16 idle_timeout; /* Number of seconds idle before expiration. */
ovs_be16 hard_timeout; /* Number of seconds before expiration. */
uint8_t pad2[6]; /* Align to 64-bits. */
ovs_be16 flags; /* OF 1.3: Set of OFPFF*. */
uint8_t pad2[4]; /* Align to 64-bits. */
ovs_be64 cookie; /* Opaque controller-issued identifier. */
ovs_be64 packet_count; /* Number of packets in flow. */
ovs_be64 byte_count; /* Number of bytes in flow. */
Expand Down
25 changes: 25 additions & 0 deletions include/openflow/openflow-1.2.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ enum oxm12_ofb_match_fields {
OFPXMT12_OFB_IPV6_ND_TLL, /* Target link-layer for ND. */
OFPXMT12_OFB_MPLS_LABEL, /* MPLS label. */
OFPXMT12_OFB_MPLS_TC, /* MPLS TC. */
/* Following added in OpenFlow 1.3 */
OFPXMT12_OFB_MPLS_BOS, /* MPLS BoS bit. */
OFPXMT12_OFB_PBB_ISID, /* PBB I-SID. */
OFPXMT12_OFB_TUNNEL_ID, /* Logical Port Metadata */
OFPXMT12_OFB_IPV6_EXTHDR, /* IPv6 Extension Header pseudo-field */

/* End Marker */
OFPXMT12_OFB_MAX,
Expand Down Expand Up @@ -172,6 +177,13 @@ enum oxm12_ofb_match_fields {
#define OXM_OF_IPV6_ND_TLL OXM_HEADER (OFPXMT12_OFB_IPV6_ND_TLL, 6)
#define OXM_OF_MPLS_LABEL OXM_HEADER (OFPXMT12_OFB_MPLS_LABEL, 4)
#define OXM_OF_MPLS_TC OXM_HEADER (OFPXMT12_OFB_MPLS_TC, 1)
#define OXM_OF_MPLS_BOS OXM_HEADER (OFPXMT12_OFB_MPLS_BOS, 1)
#define OXM_OF_PBB_ISID OXM_HEADER (OFPXMT12_OFB_PBB_ISID, 4)
#define OXM_OF_PBB_ISID_W OXM_HEADER_W (OFPXMT12_OFB_PBB_ISID, 4)
#define OXM_OF_TUNNEL_ID OXM_HEADER (OFPXMT12_OFB_TUNNEL_ID, 8)
#define OXM_OF_TUNNEL_ID_W OXM_HEADER_W (OFPXMT12_OFB_TUNNEL_ID, 8)
#define OXM_OF_IPV6_EXTHDR OXM_HEADER (OFPXMT12_OFB_IPV6_EXTHDR, 2)
#define OXM_OF_IPV6_EXTHDR_W OXM_HEADER_W (OFPXMT12_OFB_IPV6_EXTHDR, 2)

/* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate
* special conditions.
Expand All @@ -181,6 +193,19 @@ enum ofp12_vlan_id {
OFPVID12_NONE = 0x0000, /* No VLAN id was set. */
};

/* Bit definitions for IPv6 Extension Header pseudo-field. */
enum ofp12_ipv6exthdr_flags {
OFPIEH12_NONEXT = 1 << 0, /* "No next header" encountered. */
OFPIEH12_ESP = 1 << 1, /* Encrypted Sec Payload header present. */
OFPIEH12_AUTH = 1 << 2, /* Authentication header present. */
OFPIEH12_DEST = 1 << 3, /* 1 or 2 dest headers present. */
OFPIEH12_FRAG = 1 << 4, /* Fragment header present. */
OFPIEH12_ROUTER = 1 << 5, /* Router header present. */
OFPIEH12_HOP = 1 << 6, /* Hop-by-hop header present. */
OFPIEH12_UNREP = 1 << 7, /* Unexpected repeats encountered. */
OFPIEH12_UNSEQ = 1 << 8 /* Unexpected sequencing encountered. */
};

/* Header for OXM experimenter match fields. */
struct ofp12_oxm_experimenter_header {
ovs_be32 oxm_header; /* oxm_class = OFPXMC_EXPERIMENTER */
Expand Down
Loading

0 comments on commit 2e1ae20

Please sign in to comment.