Specialize {Add,Remove,Update}Flow implementations
[openflowplugin.git] / docs / specs / device-connection-rate-limiter.rst
1 .. contents:: Table of Contents
2       :depth: 3
3
4 ==============================
5 Device Connection Rate Limiter
6 ==============================
7
8 `Device Connection Rate Limiter Reviews <https://git.opendaylight.org/gerrit/#/c/70157>`__
9
10 When many openflow devices try to connect at the same time, this feature helps to reduce load on ODL controller, by
11 limiting the number of devices connecting per minute.
12
13 Before starting the contoller, user should uncomment and configure ``device-connection-rate-limit-per-min`` property
14 value in ``openflowplugin.cfg`` file for limiting the number of device connections.
15
16
17 Problem Description
18 ===================
19 When many openflow devices try to connect to the ODL controller via openflowplugin at the same time, controller gets
20 overloaded by processing too many device connection requests, port information, switch feature information and supported
21 statistics. Due to which controller gets overwhelmed, that can result in device disconnection and message drops. Hence
22 this can largely impact the performance of the controller.
23
24 Device connection rate limiter is intended to overcome this problem by limiting the number of openflow devices
25 connecting to the ODL controller, there by reducing the load on the controller. Due to which only configured number of
26 devices will be able to connect to the ODL controller per minute. The remaining devices which are not able to get the
27 permit, will be disconnected. The disconnected devices will keep on trying to connect and will be succeeded in
28 subsequent retries, when they acquire the permit as per rate limiter logic.
29
30 Use Cases
31 ---------
32 1. By default device connection rate limiter feature will be disabled. So there will be no effect on the rate at which
33    openflow devices connect to the ODL controller.
34
35 2. The property can be uncommented and set to any non-zero positive value in openflowplugin.cfg file, then those many
36    number of openflow devices are allowed to connect to the ODL controller in a minute.
37
38 Proposed Change
39 ===============
40 1. Device connection rate limiter service is created as part of blueprint container initialization for
41    openflowplugin-impl module.
42
43 2. Rate limiter service is created using Ratelimiter entity/class of Google's concurrency framework. ConnectionManager
44    will be creating rate limiter service and HandshakeManager will be holding the reference to the rate limiter service.
45
46 3. Based on the value of device-connection-rate-limit-per-min property present in openflowplugin.cfg file, the rate
47    limiter value is decided. If the value is zero, then the rate limiting functionality will be disabled or else the
48    functionality will be enabled by allowing specified number of permits per minute.
49
50 4. At the openflow handshake phase after fetching the device features, if the rate limiter is enabled then an attempt
51    will be made to acquire a connection permit for the openflow device. If device is able to get the permit, then the
52    handshake process will be continued or else the device will be rejected to connect to the ODL controller. Then a
53    disconnection event will be sent to the openflow device. The device will be succeeded to connect in subsequent
54    retries.
55
56 5. As device-connection-rate-limit-per-min is a static property, any change in the property value will be effective only
57    when the ODL controller is started with changed value.
58
59 Command Line Interface (CLI)
60 ============================
61 None.
62
63 Other Changes
64 =============
65
66 Pipeline changes
67 ----------------
68 None.
69
70 Yang changes
71 ------------
72 openflow-provider-config.yang file is modified to define the rate limiter property.
73
74 .. code-block:: none
75    :caption: openflow-provider-config.yang
76
77    leaf device-connection-rate-limit-per-min {
78         type uint16;
79         default 0;
80    }
81
82 Configuration impact
83 --------------------
84 New property ``device-connection-rate-limit-per-min`` added to openflowplugin.cfg file.
85
86 .. code-block:: none
87    :caption: openflowplugin.cfg
88
89    # To limit the number of datapath nodes to be connected to the controller instance
90    # per minute. When the default value of zero is set, then the device connection rate
91    # limiter will be disabled. If it is set to any value, then only those many
92    # number of datapath nodes are allowed to connect to the controller in a minute
93    #
94    # device-connection-rate-limit-per-min=0
95
96 Clustering considerations
97 -------------------------
98 The device connection rate limiter service will be per controller basis even if controllers are connected in a clustered
99 environment.
100
101 Other Infra considerations
102 --------------------------
103 N.A.
104
105 Security considerations
106 -----------------------
107 None.
108
109 Scale and Performance Impact
110 ----------------------------
111 As this feature will control the rate at which the openflow devices connect to the ODL controller, it will improve the
112 performance of controller by reducing the load in connection request processing during controller/cluster reboot.
113
114 Targeted Release
115 ----------------
116 Fluorine.
117
118 Alternatives
119 ------------
120 N.A.
121
122 Usage
123 =====
124
125 Features to Install
126 -------------------
127 included with common openflowplugin features.
128
129 REST API
130 --------
131 None
132
133 CLI
134 ---
135 None
136
137 Implementation
138 ==============
139
140 Assignee(s)
141 -----------
142 Primary assignee:
143  - Somashekhar Javalagi(somashekhar.manohara.javalagi@ericsson.com)
144
145 Other contributors:
146  - Gobinath Suganthan (gobinath@ericsson.com)
147
148
149 Work Items
150 ----------
151 N.A.
152
153 Dependencies
154 ============
155 This doesn't add any new dependencies.
156
157
158 Testing
159 =======
160 1. Verifying the number of openflow device connections to the ODL controller without doing any modification to the
161    openflowplugin.cfg file.
162 2. Verifying the rate at which the openflow devices connecting to the ODL controller in case if the property is having
163    any non-zero positive value, with many devices trying to connect at the same time.
164
165 Unit Tests
166 ----------
167 None added newly.
168
169 Integration Tests
170 -----------------
171 None
172
173 CSIT
174 ----
175 None
176
177 Documentation Impact
178 ====================
179
180 References
181 ==========
182