Merge branch 'mainstream'
[sliver-openvswitch.git] / OPENFLOW-1.1+
1                 OpenFlow 1.1+ support in Open vSwitch
2                 =====================================
3
4 Open vSwitch support for OpenFlow 1.1, 1.2, and 1.3 is a work in
5 progress.  This file describes the work still to be done.
6
7 The Plan
8 --------
9
10 OpenFlow version support is not a build-time option.  A single build
11 of Open vSwitch must be able to handle all supported versions of
12 OpenFlow.  Ideally, even at runtime it should be able to support all
13 protocol versions at the same time on different OpenFlow bridges (and
14 perhaps even on the same bridge).
15
16 At the same time, it would be a shame to litter the core of the OVS
17 code with lots of ugly code concerned with the details of various
18 OpenFlow protocol versions.
19
20 The primary approach to compatibility is to abstract most of the
21 details of the differences from the core code, by adding a protocol
22 layer that translates between OF1.x and a slightly higher-level
23 abstract representation.  The core of this approach is the many struct
24 ofputil_* structures in lib/ofp-util.h.
25
26 As a consequence of this approach, OVS cannot use OpenFlow protocol
27 definitions that closely resemble those in the OpenFlow specification,
28 because openflow.h in different versions of the OpenFlow specification
29 defines the same identifier with different values.  Instead,
30 openflow-common.h contains definitions that are common to all the
31 specifications and separate protocol version-specific headers contain
32 protocol-specific definitions renamed so as not to conflict,
33 e.g. OFPAT10_ENQUEUE and OFPAT11_ENQUEUE for the OpenFlow 1.0 and 1.1
34 values for OFPAT_ENQUEUE.  Generally, in cases of conflict, the
35 protocol layer will define a more abstract OFPUTIL_* or struct
36 ofputil_*.
37
38 Here are the current approaches in a few tricky areas:
39
40     * Port numbering.  OpenFlow 1.0 has 16-bit port numbers and later
41       OpenFlow versions have 32-bit port numbers.  For now, OVS
42       support for later protocol versions requires all port numbers to
43       fall into the 16-bit range, translating the reserved OFPP_* port
44       numbers.
45
46     * Actions.  OpenFlow 1.0 and later versions have very different
47       ideas of actions.  OVS reconciles by translating all the
48       versions' actions (and instructions) to and from a common
49       internal representation.
50
51 OpenFlow 1.1
52 ------------
53
54 The list of remaining work items for OpenFlow 1.1 is below.  It is
55 probably incomplete.
56
57     * Implement Write-Actions instruction.
58       [required for 1.1+]
59
60     * The new in_phy_port field in OFPT_PACKET_IN needs some kind of
61       implementation.  It has a sensible interpretation for tunnels
62       but in general the physical port is not in the datapath for OVS
63       so the value is not necessarily meaningful.  We might have to
64       just fix it as the same as in_port.
65       [required for OF1.1; optional for OF1.2+]
66
67     * OFPT_TABLE_MOD message.  This is new in OF1.1, so we need to
68       implement it.  It should be implemented so that the default OVS
69       behavior does not change.
70       [required for OF1.1 and OF1.2]
71
72     * Flow table stats (OFPST_TABLE).
73
74         * Reference count (active entries)
75           [implemented]
76           [required for OF1.1 and OF1.2]
77
78         * Packet Lookups
79           [required for OF1.1; optional for OF1.2]
80
81         * Packet Matches
82           [required for OF1.1; optional for OF1.2]
83
84     * MPLS.  Simon Horman maintains a patch series that adds this
85       feature.  This is partially merged.
86       [optional for OF1.1+]
87
88     * Match and set double-tagged VLANs (QinQ).  This requires kernel
89       work for reasonable performance.
90       [optional for OF1.1+]
91
92     * VLANs tagged with 88a8 Ethertype.  This requires kernel work for
93       reasonable performance.
94       [required for OF1.1+]
95
96     * Groups.
97
98         * Type all
99           [required for OF1.1+]
100
101         * Type select
102           [optional for OF1.1+]
103
104         * Type indirect
105           [required for OF1.1+]
106
107         * Type fast failover
108           [optional for OF1.1+]
109
110         * Statistics
111           [optional for OF1.1+]
112
113 OpenFlow 1.2
114 ------------
115
116 OpenFlow 1.2 support requires OpenFlow 1.1 as a prerequisite, plus the
117 following additional work.  (This is based on the change log at the
118 end of the OF1.2 spec.  I didn't compare the specs carefully yet.)
119
120     * OFPT_FLOW_MOD:
121
122         * New flag OFPFF_RESET_COUNTS.
123           [required for OF1.2+]
124
125         * Add ability to delete flow in all tables.
126           [required for OF1.2+]
127
128         * Update DESIGN to describe OF1.2 behavior also.
129           [required for OF1.2+]
130
131 OpenFlow 1.3
132 ------------
133
134 OpenFlow 1.3 support requires OpenFlow 1.2 as a prerequisite, plus the
135 following additional work.  (This is based on the change log at the
136 end of the OF1.3 spec, reusing most of the section titles directly.  I
137 didn't compare the specs carefully yet.)
138
139     * Send errors for unsupported multipart requests.
140       [required for OF1.3+]
141
142     * Add support for multipart requests.
143       [optional for OF1.3+]
144
145     * Add OFPMP_TABLE_FEATURES statistics.
146       [optional for OF1.3+]
147
148     * More flexible table miss support.
149       [required for OF1.3+]
150
151     * IPv6 extension header handling support.  Fully implementing this
152       requires kernel support.  This likely will take some careful and
153       probably time-consuming design work.  The actual coding, once
154       that is all done, is probably 2 or 3 days work.
155       [optional for OF1.3+]
156
157     * Per-flow meters.  Similar to IPv6 extension headers in kernel
158       and design requirements.  Might be politically difficult to add
159       directly to the kernel module, since its functionality overlaps
160       with tc.  Ideally, therefore, we could implement these somehow
161       with tc, but I haven't investigated whether that makes sense.
162       [optional for OF1.3+]
163
164     * Per-connection event filtering.  OF1.3 adopted Open vSwitch's
165       existing design for this feature so implementation should be
166       easy.
167       [required for OF1.3+]
168
169     * Auxiliary connections.  An implementation in generic code might
170       be a week's worth of work.  The value of an implementation in
171       generic code is questionable, though, since much of the benefit
172       of axuiliary connections is supposed to be to take advantage of
173       hardware support.  (We could make the kernel module somehow
174       send packets across the auxiliary connections directly, for
175       some kind of "hardware" support, if we judged it useful enough.)
176       [optional for OF1.3+]
177
178     * MPLS BoS matching.  (Included in Simon's MPLS series?)
179       [optional for OF1.3+]
180
181     * Provider Backbone Bridge tagging.  I don't plan to implement
182       this (but we'd accept an implementation).
183       [optional for OF1.3+]
184
185     * Rework tag order.  I'm not sure whether we need to do anything
186       for this. Part of MPLS patchset by Simon Horman.
187       [required for v1.3+]
188
189     * On-demand flow counters.  I think this might be a real
190       optimization in some cases for the software switch.
191       [optional for OF1.3+]
192
193     * Duration Statistics
194       - New for Per Port, Per Queue, Per Group
195       [required for v1.3+]
196
197 How to contribute
198 -----------------
199
200 If you plan to contribute code for a feature, please let everyone know
201 on ovs-dev before you start work.  This will help avoid duplicating
202 work.
203
204 Please consider the following:
205
206     * Testing.  Please test your code.
207
208     * Unit tests.  Please consider writing some.  The tests directory
209       has many examples that you can use as a starting point.
210
211     * ovs-ofctl.  If you add a feature that is useful for some
212       ovs-ofctl command then you should add support for it there.
213
214     * Documentation.  If you add a user-visible feature, then you
215       should document it in the appropriate manpage and mention it in
216       NEWS as well.
217
218     * Coding style (see the CodingStyle file at the top of the source
219       tree).
220
221     * The patch submission guidelines (see SubmittingPatches).  I
222       recommend using "git send-email", which automatically follows a
223       lot of those guidelines.
224
225 Bug Reporting
226 -------------
227
228 Please report problems to bugs@openvswitch.org.