Merge "OPNFLWPLUG-993 ct_clear is not supported in Openflowplugin"
[openflowplugin.git] / docs / specs / bundle-reconciliation.rst
1 .. contents:: Table of Contents
2    :depth: 3
3
4 ==============================
5 Openflow Bundle Reconciliation
6 ==============================
7
8 `Bundle Reconciliation Review <https://git.opendaylight.org/gerrit/#/c/60520/>`__
9
10 This spec addresses following enhancement in Openflowplugin module:
11
12 Addition of new reconciliation mechanism in openflowplugin using openflow bundles.
13
14 Bundle reconciliation will be supported from OVS2.6 and above.
15
16 Problem description
17 ===================
18 Current reconciliation mechanism exists in FRM will read the config inventory data and push all the groups and flows
19 via group and flow add messages and this mechanism is having the following limitations,
20
21 1. Group add during reconcilation will fail with GROUP_ALREADY_EXISTS error
22 2. Stale flows won't be removed from openflow switch after reconciliation. This leads to stale flow aggregation after
23    every controller version upgarde.
24 3. Datapath traffic will get impacted as the flows will get replaced during reconciliation window.
25
26
27 Bundle Reconciliation
28 ---------------------
29
30 Reconciliation using openflow bundles will overcome all the above mentioned limitations. Mainly there will be minimal
31 or no datapath traffic hit.
32
33 Bundle Concepts
34 ---------------
35
36 A bundle is a sequence of OpenFlow requests from the controller that is applied as a single OpenFlow operation.
37 The first goal of bundles is to group related state changes on a switch so that all changes are applied together
38 or that none of them is applied. The second goal is to better synchronise changes across a set of OpenFlow switches,
39 bundles can be prepared and pre-validated on each switch and applied at the same time.
40
41 A bundle is specified as all controllers messages encoded with the same bundle_id on a specific controller connection.
42 Messages part of the bundle are encapsulated in a Bundle Add message, the payload of the Bundle Add message is
43 formatted like a regular OpenFlow messages and has the same semantic. The messages part of a bundle are pre-validated
44 as they are stored in the bundle, minimising the risk of errors when the bundle is applied. The applications of the
45 message included in the Bundle Add message is postponed to when the bundle is committed.
46
47 A switch is not required to accept arbitrary messages in a bundle, a switch may not accept some message types in
48 bundles, and a switch may not allow all combinations of message types to be bundled together. For example, a switch
49 should not allow to embed a bundle message within a Bundle Add message. At a minimum, a switch must be able to
50 support a bundle of multiple flow-mods and port-mods in any order.
51
52 When a bundle is opened, modifications are saved into a temporary staging area without taking effect. When the bundle
53 is committed, the changes in the staging area are applied to the state (e.g. tables) used by the switch. If an error
54 occurs in one modification, no change is applied to the state.
55
56 Use Cases
57 ---------
58
59 a. Reconciliation using openflow bundles when controller restarts
60
61 b. Reconciliation using openflow bundles when openflow switch restarts
62
63 Proposed change
64 ---------------
65 Bundle reconciliation will be supported by ovs2.6 and above version or any openflow switch with bundles support.
66
67 Bundle reconciliation will be disabled by default and user has to manually enable it when needed by making a
68 configuration change. New configuration parameter will be introduced in openflowplugin.cfg to support the same.
69
70 .. code-block:: none
71    :caption: openflowplugin.cfg
72
73    #
74    # Bundle reconciliation can be enabled by making this flag to true.
75    # By default bundle reconciliation is disabled and reconciliation happens
76    # via normal flow/group mods.
77    # NOTE: This option will be effective with disable_reconciliation=false.
78    #
79    # bundle-based-reconciliation-enabled=false
80
81 By default bundle-based-reconciliation-enabled flag will be kept as false, which means reconciliation will happen via
82 flow/group mod commands.
83
84 Following steps will be executed in order to achieve bundle reconciliation,
85
86 1. Send open bundle message to the openflow switch
87 2. Send delete all flows bundle message
88 3. Send delete all groups bundle message
89 4. Read flows and groups from config inventory
90 5. Push groups via bundle message
91 6. Push flows via bundle message
92 7. Send commit bundle message to the openflow switch
93
94 Pipeline changes
95 ----------------
96 None
97
98 Yang changes
99 ------------
100
101 Below yang changes will be done in order to provide configuration support for bundle-based-reconciliation-enabled field.
102
103 .. code-block:: none
104    :caption: forwardingrules-manager-config.yang
105
106    leaf bundle-based-reconciliation-enabled {
107         type boolean;
108         default false;
109    }
110
111 Configuration impact
112 --------------------
113 None
114
115 Clustering considerations
116 -------------------------
117 None
118
119 Other Infra considerations
120 --------------------------
121 None
122
123 Security considerations
124 -----------------------
125 None
126
127 Scale and Performance Impact
128 ----------------------------
129 Unknown
130
131 Targeted Release
132 ----------------
133 Oxygen
134
135 Alternatives
136 ------------
137 None
138
139 Usage
140 =====
141 No external rpc/api will be provided. The implementation is internal to openflowplugin.
142
143 User can enable bundles reconciliation by changing the value to true in openflowplugin.cfg
144
145 .. code-block:: none
146    :caption: openflowplugin.cfg
147
148    #
149    # Bundle reconciliation can be enabled by making this flag to true.
150    # By default bundle reconciliation is disabled and reconciliation happens
151    # via normal flow/group mods.
152    # NOTE: This option will be effective with disable_reconciliation=false.
153    #
154    bundle-based-reconciliation-enabled=true
155
156 REST API
157 --------
158 No new REST API is being added.
159
160 CLI
161 ---
162 No new CLI being added.
163
164 Implementation
165 ==============
166 Assignee(s)
167 -----------
168 Primary assignee:
169   Arunprakash D <d.arunprakash@ericsson.com>
170
171 Other contributors:
172   Sunil Kumar G <sunil.g.kumar@ericsson.com>
173
174   Suja T <suja.t@ericsson.com>
175
176 Work Items
177 ----------
178 * Implementation of bundle reconciliation
179 * Addition of configuration flag to enable/disable bundle reconciliation
180
181 Dependencies
182 ============
183 No new dependencies.
184
185 Testing
186 =======
187 Unit Tests
188 ----------
189 #. Verify bundle reconciliation for controller restart
190 #. Verify bundle reconciliation for openflow switch restart
191
192 CSIT
193 ----
194 CSIT test cases will be added in future
195
196 Documentation Impact
197 ====================
198 None
199
200 References
201 ==========
202 [1] https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Bundles_extension_support
203
204 [2] https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Bundles_usage