Skip to content

Commit

Permalink
ofproto: Allow the use of the OpenFlow 1.4 protocol
Browse files Browse the repository at this point in the history
This defines the version number for OpenFlow 1.4 so that the switch
can actually use it. The ovsdb schema is also modified.

Signed-off-by: Alexandru Copot <[email protected]>
Cc: Daniel Baluta <[email protected]>
[[email protected] adjusted code in cases where 1.3 and 1.4 are the same]
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
ketotek authored and blp committed Mar 23, 2014
1 parent 3226021 commit c37c038
Show file tree
Hide file tree
Showing 16 changed files with 152 additions and 47 deletions.
6 changes: 6 additions & 0 deletions DESIGN
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ OpenFlow 1.3 makes these changes:
The table for 1.3 is the same as the one shown above for 1.2.


OpenFlow 1.4
------------

OpenFlow 1.4 does not change flow_mod semantics.


OFPT_PACKET_IN
==============

Expand Down
34 changes: 18 additions & 16 deletions FAQ
Original file line number Diff line number Diff line change
Expand Up @@ -1090,20 +1090,23 @@ Using OpenFlow (Manually or Via Controller)

Q: What versions of OpenFlow does Open vSwitch support?

A: Open vSwitch 1.9 and earlier support only OpenFlow 1.0 (plus
extensions that bring in many of the features from later versions
of OpenFlow).
A: The following table lists the versions of OpenFlow supported by
each version of Open vSwitch:

Open vSwitch 1.10 and later have experimental support for OpenFlow
1.2 and 1.3. On these versions of Open vSwitch, the following
command enables OpenFlow 1.0, 1.2, and 1.3 on bridge br0:
Open vSwitch OF1.0 OF1.1 OF1.2 OF1.3 OF1.4
=============== ===== ===== ===== ===== =====
1.9 and earlier yes --- --- --- ---
1.10 yes --- [*] [*] ---
1.11 yes --- [*] [*] ---
2.0 yes [*] [*] [*] ---
2.1 yes [*] [*] [*] ---
2.2 yes [*] [*] [*] [*]

ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow12,OpenFlow13
[*] Supported, with one or more missing features.

Open vSwitch version 2.0 and later will have experimental support
for OpenFlow 1.1, 1.2, and 1.3. On these versions of Open vSwitch,
the following command enables OpenFlow 1.0, 1.1, 1.2, and 1.3 on
bridge br0:
Because of missing features, OpenFlow 1.1, 1.2, 1.3, and 1.4 must
be enabled manually. The following command enables OpenFlow 1.0,
1.1, 1.2, and 1.3 on bridge br0:

ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13

Expand All @@ -1112,11 +1115,10 @@ A: Open vSwitch 1.9 and earlier support only OpenFlow 1.0 (plus

ovs-ofctl -O OpenFlow13 dump-flows br0

Support for OpenFlow 1.1, 1.2, and 1.3 is still incomplete. Work
to be done is tracked in OPENFLOW-1.1+ in the Open vSwitch sources
(also via http://openvswitch.org/development/openflow-1-x-plan/).
When support for a given OpenFlow version is solidly implemented,
Open vSwitch will enable that version by default.
OPENFLOW-1.1+ in the Open vSwitch source tree tracks support for
OpenFlow 1.1 and later features. When support for a given OpenFlow
version is solidly implemented, Open vSwitch will enable that
version by default.

Q: Does Open vSwitch support MPLS?

Expand Down
2 changes: 1 addition & 1 deletion OPENFLOW-1.1+
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OpenFlow 1.1+ support in Open vSwitch
=====================================

Open vSwitch support for OpenFlow 1.1, 1.2, and 1.3 is a work in
Open vSwitch support for OpenFlow 1.1 and beyond is a work in
progress. This file describes the work still to be done.

The Plan
Expand Down
3 changes: 2 additions & 1 deletion build-aux/extract-ofp-errors
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ macros = {}
version_map = {"1.0": 0x01,
"1.1": 0x02,
"1.2": 0x03,
"1.3": 0x04}
"1.3": 0x04,
"1.4": 0x05}
version_reverse_map = dict((v, k) for (k, v) in version_map.iteritems())

token = None
Expand Down
8 changes: 4 additions & 4 deletions build-aux/extract-ofp-msgs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ version_map = {"1.0": (OFP10_VERSION, OFP10_VERSION),
"1.2": (OFP12_VERSION, OFP12_VERSION),
"1.3": (OFP13_VERSION, OFP13_VERSION),
"1.4": (OFP14_VERSION, OFP14_VERSION),
"1.0+": (OFP10_VERSION, OFP13_VERSION),
"1.1+": (OFP11_VERSION, OFP13_VERSION),
"1.2+": (OFP12_VERSION, OFP13_VERSION),
"1.3+": (OFP13_VERSION, OFP13_VERSION),
"1.0+": (OFP10_VERSION, OFP14_VERSION),
"1.1+": (OFP11_VERSION, OFP14_VERSION),
"1.2+": (OFP12_VERSION, OFP14_VERSION),
"1.3+": (OFP13_VERSION, OFP14_VERSION),
"1.4+": (OFP14_VERSION, OFP14_VERSION),
"1.0-1.1": (OFP10_VERSION, OFP11_VERSION),
"1.0-1.2": (OFP10_VERSION, OFP12_VERSION),
Expand Down
4 changes: 2 additions & 2 deletions include/openflow/openflow-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ enum ofp_version {
OFP10_VERSION = 0x01,
OFP11_VERSION = 0x02,
OFP12_VERSION = 0x03,
OFP13_VERSION = 0x04
OFP13_VERSION = 0x04,
OFP14_VERSION = 0x05

/* When we add real support for these versions, add them to the enum so
* that we get compiler warnings everywhere we might forget to provide
* support. Until then, keep them as macros to avoid those warnings. */
#define OFP14_VERSION 0x05
#define OFP15_VERSION 0x06
};

Expand Down
2 changes: 2 additions & 0 deletions lib/ofp-errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ ofperr_domain_from_version(enum ofp_version version)
return &ofperr_of12;
case OFP13_VERSION:
return &ofperr_of13;
case OFP14_VERSION:
return &ofperr_of14;
default:
return NULL;
}
Expand Down
5 changes: 5 additions & 0 deletions lib/ofp-msgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ ofp_is_stat_request(enum ofp_version version, uint8_t type)
case OFP11_VERSION:
case OFP12_VERSION:
case OFP13_VERSION:
case OFP14_VERSION:
return type == OFPT11_STATS_REQUEST;
}

Expand All @@ -283,6 +284,7 @@ ofp_is_stat_reply(enum ofp_version version, uint8_t type)
case OFP11_VERSION:
case OFP12_VERSION:
case OFP13_VERSION:
case OFP14_VERSION:
return type == OFPT11_STATS_REPLY;
}

Expand Down Expand Up @@ -322,6 +324,7 @@ ofphdrs_len(const struct ofphdrs *hdrs)
case OFP11_VERSION:
case OFP12_VERSION:
case OFP13_VERSION:
case OFP14_VERSION:
if (hdrs->type == OFPT11_STATS_REQUEST ||
hdrs->type == OFPT11_STATS_REPLY) {
return (hdrs->stat == OFPST_VENDOR
Expand Down Expand Up @@ -753,6 +756,7 @@ ofpraw_stats_request_to_reply(enum ofpraw raw, uint8_t version)
case OFP11_VERSION:
case OFP12_VERSION:
case OFP13_VERSION:
case OFP14_VERSION:
ovs_assert(hdrs.type == OFPT11_STATS_REQUEST);
hdrs.type = OFPT11_STATS_REPLY;
break;
Expand Down Expand Up @@ -939,6 +943,7 @@ ofpmp_flags__(const struct ofp_header *oh)
case OFP11_VERSION:
case OFP12_VERSION:
case OFP13_VERSION:
case OFP14_VERSION:
return &((struct ofp11_stats_msg *) oh)->flags;
default:
OVS_NOT_REACHED();
Expand Down
4 changes: 2 additions & 2 deletions lib/ofp-msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ enum ofpraw {
OFPRAW_OFPST11_TABLE_REPLY,
/* OFPST 1.2 (3): struct ofp12_table_stats[]. */
OFPRAW_OFPST12_TABLE_REPLY,
/* OFPST 1.3 (3): struct ofp13_table_stats[]. */
/* OFPST 1.3+ (3): struct ofp13_table_stats[]. */
OFPRAW_OFPST13_TABLE_REPLY,

/* OFPST 1.0 (4): struct ofp10_port_stats_request. */
Expand Down Expand Up @@ -310,7 +310,7 @@ enum ofpraw {

/* OFPST 1.1-1.2 (6): uint8_t[8][]. */
OFPRAW_OFPST11_GROUP_REPLY,
/* OFPST 1.3 (6): uint8_t[8][]. */
/* OFPST 1.3+ (6): uint8_t[8][]. */
OFPRAW_OFPST13_GROUP_REPLY,

/* OFPST 1.1+ (7): void. */
Expand Down
2 changes: 2 additions & 0 deletions lib/ofp-print.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ ofp_print_switch_features(struct ds *string, const struct ofp_header *oh)
case OFP12_VERSION:
break;
case OFP13_VERSION:
case OFP14_VERSION:
return; /* no ports in ofp13_switch_features */
default:
OVS_NOT_REACHED();
Expand Down Expand Up @@ -1790,6 +1791,7 @@ ofp_print_ofpst_table_reply(struct ds *string, const struct ofp_header *oh,
int verbosity)
{
switch ((enum ofp_version)oh->version) {
case OFP14_VERSION:
case OFP13_VERSION:
ofp_print_ofpst_table_reply13(string, oh, verbosity);
break;
Expand Down
Loading

0 comments on commit c37c038

Please sign in to comment.