Skip to content

Commit f1e058a

Browse files
author
D Arunprakash
committed
Bug 8902 : Spec for Reconciliation Framework
This spec provides the documentation for Reconciliation framework implementation and usage Change-Id: I10c312d9890effb317a695450d381ee4d6725b60 Signed-off-by: D Arunprakash <[email protected]>
1 parent bb1a0b9 commit f1e058a

File tree

1 file changed

+252
-0
lines changed

1 file changed

+252
-0
lines changed
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
.. contents:: Table of Contents
2+
:depth: 3
3+
4+
=========================
5+
Reconciliation Framework
6+
=========================
7+
8+
https://git.opendaylight.org/gerrit/#/q/topic:bug/8902
9+
10+
This feature aims to overcome the drawbacks of the current reconciliation implementation. As part of this enhancement,
11+
reconciliation framework will be introduced which will coordinate the reconciliation across various applications.
12+
13+
Applications should register themself with reconciliation framework with a specific priority.
14+
Application should decide the priority and the reconciliation framework will use it for executing in an priority.
15+
16+
17+
Problem description
18+
===================
19+
20+
When a switch connected to controller, the current ODL reconciliation implementation pushes all the
21+
table/meters/groups/flows from the inventory configuration datastore to the switch.
22+
23+
When the switch is connected, all the applications including FRM(Forwarding Rules Manager) will receive the node added
24+
DTCN(Data Tree Change Listener) and starts pushing the flows for the openflow switch. FRM reconciliation will read the
25+
data from the config and starts pushing the flows one by one.
26+
In the meantime, applications can react to the node added DTCN change and will start pushing
27+
the flows through the config DS. With this, there is a high chance the application flow can be overwritten by the old
28+
flows by FRM via reconciliation.
29+
30+
With framework, the problem will be avoided by doing the reconciliation for all the registered services including FRM
31+
and then the openflow switch will be submitted to the DS. With this, applications won't receive the node added DTCN until
32+
registered applications are done with reconciliation for the switch.
33+
34+
The current reconciliation mechanism lacks an ordered execution of tasks across multiple applications resulting
35+
in the forwarding plane not correctly reflecting the changes in the control plane.
36+
The issue becomes more prominent in case of multi-application scenarios, resulting in errors.
37+
38+
Use Cases
39+
---------
40+
Priority based/Ordered Coordination of Reconciliation across multiple applications.
41+
42+
Proposed change
43+
===============
44+
1. Reconciliation Framework will be introduced, framework will coordinate the reconciliation across applications.
45+
The Openflow switch won't be advertised to application until Openflow switch is in KNOWN state.
46+
KNOWN state --> controller and switch state should be in sync(reconciliation), once the switch connects.
47+
48+
2. Application participating in reconciliation needs to register with framework.
49+
i) Application can either be FRM, FRS or any other application(s).
50+
ii) Application(s) registering with Reconciliation module is encouraged since:
51+
- Applications would know the right Flows/Groups/Meters which needs to be replayed (Add/Delete/Update).
52+
- FRM / FRS(Forwarding Rules Sync) would not have application view of flows / group, it would blindly
53+
replay the flows / groups.
54+
- Also flows having idle / hard timeout can be gracefully handled by application rather than FRM / FRS.
55+
56+
3. As applications register with reconciliation module
57+
Reconciliation module maintains the numbers of application registered in an order based on the priority.
58+
Applications will be executed in the priority order of higher to lower, 1 - Highest n - lowest
59+
Reconciliation will be triggered as per the priority, applications with same priority will be processed in parallel,
60+
once the higher priority application completed, next priority of applications will be processed.
61+
62+
4. Openflow switch establishes connections with openflowplugin.
63+
Openflow switch sends connection request.
64+
Openflowplugin accepts connection and than establishes the connection.
65+
66+
5. Openflowplugin after establishing the connection with openflow switch, elects the mastership and invokes
67+
reconciliation framework through ReconciliationFrameworkEvent onDevicePrepared.
68+
Before invoking the reconciliation API, all the RPCs are registered with MD-SAL by openflowplugin.
69+
Reconciliation framework will register itself with the MastershipChangeServiceManager.
70+
71+
6. All registered applications would be indicated to start the reconciliation.
72+
DeviceInfo would be passed for the API/Event and it contains all the information needed by application.
73+
74+
8. Application(s) would than fetch the flows / groups for that particular Node, which needs to be replayed.
75+
76+
9. Application(s) would than replay the selected flows / group on to the switch.
77+
78+
10. Application(s) would also wait for error from switch, for pre-defined time.
79+
80+
11. Application(s) would inform the reconciliation status to reconciliation module.
81+
82+
12. Reconciliation framework would co-relate result status from all the applications and decides the final status.
83+
If success, framework will report back DO_NOTHING and in case of failure it will be DISCONNECT.
84+
85+
13. Based on result state, openflowplugin should do the following
86+
On success case, openflowplugin should continue with the openflow switch --> write the switch to the operational datastore.
87+
On failure case, openflowplugin should disconnect the openflow switch.
88+
When the switch reconnects, the same steps will be followed again.
89+
90+
14. When there is a disconnect/mastership change while the reconciliation is going on, openflowplugin should notify the
91+
framework and the framework should halt the current reconciliation.
92+
93+
Implementation Details:
94+
-----------------------
95+
Following new interface will be introduced from Reconciliation framework (RF).
96+
97+
1. ReconciliationManager
98+
2. ReconciliationNotificationListener
99+
100+
1. ReconciliationManager
101+
102+
/* Application who are interested in reconciliation should use this API to register themself to the RF */
103+
/* NotificationRegistration will be return to the registered application, who needs to take of closing the registration */
104+
NotificationRegistration registerService(ReconciliationNotificationListener object);
105+
106+
/* API exposed by RF for get list of registered services
107+
Map<Integer, List<ReconciliationNotificationListener>> getRegisteredServices();
108+
109+
2. ReconciliationNotificationListener
110+
111+
/* This method will be a callback from RF to start the application reconciliation */
112+
ListenableFuture<Boolean> startReconciliation(DeviceInfo deviceInfo);
113+
114+
/* This method will be a callback from RF when openflow switch disconnects during reconcilation */
115+
ListenableFuture<Boolean> endReconciliation(DeviceInfo deviceInfo);
116+
117+
/* Priority of the application */
118+
int getPriority();
119+
120+
/* Name of the application */
121+
String getName();
122+
123+
/* Application's intent when the application's reconciliation fails */
124+
ResultState getResultState();
125+
126+
Priority:
127+
---------
128+
Framework will maintain the list of registered applications in an order based on the priority. Applications having the
129+
same priority will be executed in parallel and once those are done. Next priority applications will be called.
130+
Consider 2 applications, A and B. A is handling of programming groups and flows and B is handling of programming
131+
flows which is dependent of the groups programmed by A. So, B has to register with lower priority than A.
132+
133+
Application don't do any conflict resolution or guarantee any specific order among the application registered at the
134+
same priority level.
135+
136+
Result State - Intent Action:
137+
-----------------------------
138+
When the application fails to reconcile, what is the action that framework should take.
139+
DO_NOTHING - continue with the next reconciliation
140+
DISCONNECT - disconnect the switch (reconciliation will start again once the switch connects back)
141+
142+
Name:
143+
-----
144+
Name of the application who wants to register for reconciliation
145+
146+
ReconciliationNotificationListener:
147+
-----------------------------------
148+
Applications who wants to register should implement ReconciliationNotificationListener interface.
149+
ReconciliationNotificationListener having api's like startReconciliation and endReconciliation
150+
startReconciliation --> applications can take action to trigger reconciliation
151+
endReconciliation --> application can take action to cancel their current reconcile tasks
152+
153+
Command Line Interface (CLI):
154+
-----------------------------
155+
CLI interface will be provided to get all the registered services and their status
156+
List of registered services
157+
Status of each application for respective openflow switch
158+
159+
160+
Pipeline changes
161+
----------------
162+
None.
163+
164+
Yang changes
165+
------------
166+
None
167+
168+
169+
Configuration impact
170+
--------------------
171+
None
172+
173+
Clustering considerations
174+
-------------------------
175+
None
176+
177+
Other Infra considerations
178+
--------------------------
179+
N.A.
180+
181+
Security considerations
182+
-----------------------
183+
None.
184+
185+
Scale and Performance Impact
186+
----------------------------
187+
None.
188+
189+
Targeted Release
190+
----------------
191+
Nitrogen.
192+
193+
Alternatives
194+
------------
195+
N.A.
196+
197+
Usage
198+
=====
199+
200+
Features to Install
201+
-------------------
202+
Will be updated
203+
204+
REST API
205+
--------
206+
207+
CLI
208+
---
209+
210+
Implementation
211+
==============
212+
213+
Assignee(s)
214+
-----------
215+
Primary assignee:
216+
- Prasanna Huddar([email protected])
217+
- Arunprakash D ([email protected])
218+
- Gobinath Suganthan ([email protected])
219+
220+
Other contributors:
221+
222+
223+
Work Items
224+
----------
225+
N.A.
226+
227+
Dependencies
228+
============
229+
This doesn't add any new dependencies.
230+
231+
232+
Testing
233+
=======
234+
Capture details of testing that will need to be added.
235+
236+
Unit Tests
237+
----------
238+
239+
Integration Tests
240+
-----------------
241+
242+
CSIT
243+
----
244+
245+
Documentation Impact
246+
====================
247+
This feature will not require any change in User Guide.
248+
249+
250+
References
251+
==========
252+
[1] https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Reconciliation#Future_Enhancements

0 commit comments

Comments
 (0)