Merge "Added FlowConfigBlaster 'Floodlight Edition' - flow config blaster that uses...
[integration/test.git] / test / tools / odl-mdsal-clustering-tests / clustering-performance-test / README
1 OpenDaylight Performance Test Suite
2 ===================================
3
4 The performance tests in this suite use ODL's RESTCONF API to add/delete
5 flows into/from ODL's configuration data store. The test suite is meant for
6 manual performance testing, where a user can tests different ways/scale to
7 add and delete flows.
8
9 The test suite contains the following scripts:
10
11 - inventory_crawler.py: 
12   Retrieves all nodes from either the config or operational data store
13   and prints a flow summary to the console. Depending on the print level
14   specified in a command line option, the summary can shows the overall
15   number of flows in the network, the number of flows in each node, or 
16   detailed data for each flow
17
18 - flow_config_blaster.py:
19   Adds and deletes ("blasts") flows into ODL's config space. Command line
20   options control the number of "blaster" threads, the number of blast 
21   cycles, the number of flows blasted in each cycle by each thread, etc. 
22   flow_config_blaster.py provides the FlowConfigBlaster class that is 
23   reusable in other tests, such as in flow_add_delete_test.py
24
25 - flow_config_blaster_fle.py:
26   "FlowConfigBlaster Floodlight Edition" - the same as flow_config_blaster,
27   but for the Floodlight controller.
28
29 - config_cleanup.py:
30   Cleans up the config data store by deleting the entire inventory.
31
32 - flow_add_delete_test.py:
33   Adds/deletes ("blasts") flows into ODL's config space. Similar to the 
34   flow_config_blaster (in fact, flow_config_blaster is used in this test),
35   but has more advanced handling of the add/delete cycles. The test 
36   executes in three steps:
37   1. The specified number of flows is added in the 'add cycle' (uses
38      flow_config_blaster to blast flows)
39   2. The network is polled for flow statistics from the network 
40      (using the inventory_crawler) to make sure that all flows have been 
41      properly programmed into the network and stats can properly read them
42   3. The flows are deleted in the flow cycle (either in 'bulk' using the 
43      config_cleanup script or one by one using the flow_config_blaster) 
44
45
46
47 The Inventory Crawler:
48 ======================
49 To see the command line options, type:
50 > ./inventory_crawler --help
51
52 usage: inventory_crawler.py [-h] [--odlhost ODLHOST] [--odlport ODLPORT]
53                             [--plevel PLEVEL]
54                             [--datastore {operational,config}] [--no-auth]
55                             [--auth] [--debug]
56
57 optional arguments:
58   -h, --help            show this help message and exit
59   --odlhost ODLHOST     host where odl controller is running (default is
60                         127.0.0.1)
61   --odlport ODLPORT     port on which odl's RESTCONF is listening (default is
62                         8181)
63   --plevel PLEVEL       Print Level: 0 - Summary (stats only); 1 - Node names;
64                         2 - Node details;3 - Flow details
65   --datastore {operational,config}
66                         Which data store to crawl; default operational
67   --no-auth             Do not use authenticated access to REST (default)
68   --auth                Use authenticated access to REST (username: 'admin',
69                         password: 'admin').
70   --debug               List nodes that have not provided proper statistics
71                         data
72
73 Examples:
74 ---------
75 To show a summary of all flows shown in the network, type:
76 > ./inventory_crawler.py --plevel=1 --auth
77
78 NOTE: REST authentication is turned by default in ODL Helium. To use 
79 authenticated REST, you have to specify the '--auth' switch in the command
80 line.
81
82 To show a summary of all flows shown in the config data store, type:
83 > ./inventory_crawler.py --plevel=1 --datastore=config --auth
84
85
86
87 The Flow Config Blaster:
88 ========================
89 To see the command line options, type:
90   > ./flow_config_blaster.py --help
91
92 usage: flow_config_blaster.py [-h] [--host HOST] [--port PORT]
93                               [--cycles CYCLES] [--threads THREADS]
94                               [--flows FLOWS] [--nodes NODES] [--delay DELAY]
95                               [--delete] [--no-delete] [--auth]
96                               [--startflow STARTFLOW] [--file FILE]
97
98 Flow programming performance test: First adds and then deletes flows into the
99 config tree, as specified by optional parameters.
100
101 optional arguments:
102   -h, --help            show this help message and exit
103   --host HOST           Host where odl controller is running (default is
104                         127.0.0.1)
105   --port PORT           Port on which odl's RESTCONF is listening (default is
106                         8181)
107   --cycles CYCLES       Number of flow add/delete cycles; default 1. Both Flow
108                         Adds and Flow Deletes are performed in cycles.
109                         <THREADS> worker threads are started in each cycle and
110                         the cycle ends when all threads finish. Another cycle
111                         is started when the previous cycle finished.
112   --threads THREADS     Number of request worker threads to start in each
113                         cycle; default=1. Each thread will add/delete <FLOWS>
114                         flows.
115   --flows FLOWS         Number of flows that will be added/deleted by each
116                         worker thread in each cycle; default 10
117   --nodes NODES         Number of nodes if mininet is not connected;
118                         default=16. If mininet is connected, flows will be
119                         evenly distributed (programmed) into connected nodes.
120   --delay DELAY         Time (in seconds) to wait between the add and delete
121                         cycles; default=0
122   --delete              Delete all added flows one by one, benchmark delete
123                         performance.
124   --no-delete           Do not perform the delete cycle.
125   --auth                Use the ODL default username/password 'admin'/'admin'
126                         to authenticate access to REST; default: no
127                         authentication
128   --startflow STARTFLOW
129                         The starting Flow ID; default=0
130   --file FILE           File from which to read the JSON flow template;
131                         default: no file, use a built in template.
132
133 NOTE: The 'startflow' command line parameter is used with multiple 
134 flow_config_blasters blasting flows at the same ODL instance. With Python's
135 GIL any given blaster can not use more than one CPU even when multiple blaster 
136 threads are specified. Therefore, multiple blaster processes must be used to
137 test ODL's performance limits. The 'startflow' parameter gives each blaster 
138 process its own flow id space so that each injects unique flows into ODL's
139 config data store.
140
141 NOTE: You don't have to be connected to mininet (or another openflow network,
142 for that matter) to use this script. If ODL is connected to an openflow 
143 network, flow_config_blaster will evenly distribute flows across the network.
144 If ODL is not connected to a network, flows are only stored in the config 
145 data store (i.e. nodes that may connect at some point in the future are in 
146 effect "preconfigured"). The not-connected mode can be used to test the 
147 performance of the data store and the REST subsystems. The 'nodes' parameter
148 determines how many nodes are used in the non-connected mode.
149
150 Examples:
151 ---------
152 To put 5000 flows into ODL running on the same node as the script type:
153    > ./flow_config_blaster.py --flows=5000 --auth --no-delete
154
155 To use 5 threads to put 5000 flows into ODL running on the same node as 
156 the script type:
157    > ./flow_config_blaster.py --threads=5 --flows=1000 --auth --no-delete
158
159    NOTE: each thread will put 1000 flows, and all 5 threads will work 
160    simultaneously.
161
162 To first put and then delete 5000 flows into ODL running on the same node
163 as the script type:
164    > ./flow_config_blaster.py --flows=5000 --auth
165
166 To use 5 threads to first put and then delete 5000 flows into ODL running 
167 on the same node as the script type:
168    > ./flow_config_blaster.py --threads=5 --flows=1000 --auth
169   
170  NOTE: 5 threads are used to both add and delete flows
171
172 To use 5 threads to first put and then delete 5000 flows into ODL in 10 
173 add/delete cycles type:
174    > ./flow_config_blaster.py --threads=5 --flows=100 --cycles=10 --auth
175
176    NOTE: 5 threads are used to both add and delete flows. 
177
178    NOTE: Both Add and Delete are performed in 10 cycles. 5 worker threads 
179    are started in each cycle and the cycle ends when all threads finish. 
180    Cycles are useful to determine performance degradation with increasing
181    number of flows in the datastore and in the network.
182
183 To  put and then delete 1000 flows with nicira match and action extensions,
184 type:
185    >./flow_config_blaster.py --flows=1000 --auth --file=./nicira-ext-all.json
186
187    NOTE: json for flow adds will be taken from the file 'nicira-ext-all.json'
188
189
190
191 The Config Cleanup
192 ==================
193 To see the command line options, type:
194   > ./config_cleanup.py --help
195
196 usage: config_cleanup.py [-h] [--odlhost ODLHOST] [--odlport ODLPORT]
197                          [--no-auth] [--auth]
198
199 Cleans up the config space
200
201 optional arguments:
202   -h, --help         show this help message and exit
203   --odlhost ODLHOST  host where odl controller is running (default is
204                      127.0.0.1)
205   --odlport ODLPORT  port on which odl's RESTCONF is listening (default is
206                      8181)
207   --no-auth          Do not use authenticated access to REST (default)
208   --auth             Use authenticated access to REST (username: 'admin',
209                      password: 'admin').
210
211
212
213 The Flow Add/Delete Test
214 ========================
215 To see the command line options, type:
216   >./flow_add_delete_test.py --help
217
218 usage: flow_add_delete_test.py [-h] [--host HOST] [--port PORT]
219                                [--flows FLOWS] [--cycles CYCLES]
220                                [--threads THREADS] [--nodes NODES]
221                                [--delay DELAY] [--timeout TIMEOUT] [--delete]
222                                [--bulk-delete] [--auth]
223                                [--startflow STARTFLOW]
224
225 Flow programming performance test: First adds and then deletes flows into the
226 config tree, as specified by optional parameters.
227
228 optional arguments:
229   -h, --help            show this help message and exit
230   --host HOST           Host where odl controller is running (default is
231                         127.0.0.1)
232   --port PORT           Port on which odl's RESTCONF is listening (default is
233                         8181)
234   --cycles CYCLES       Number of flow add/delete cycles; default 1. Both Flow
235                         Adds and Flow Deletes are performed in cycles.
236                         <THREADS> worker threads are started in each cycle and
237                         the cycle ends when all threads finish. Another cycle
238                         is started when the previous cycle finished.
239   --threads THREADS     Number of request worker threads to start in each
240                         cycle; default=1. Each thread will add/delete <FLOWS>
241                         flows.
242   --flows FLOWS         Number of flows that will be added/deleted by each
243                         worker thread in each cycle; default 10
244   --nodes NODES         Number of nodes if mininet is not connected;
245                         default=16. If mininet is connected, flows will be
246                         evenly distributed (programmed) into connected nodes.
247   --delay DELAY         Time (seconds) to between inventory polls when waiting
248                         for stats to catch up; default=1
249   --timeout TIMEOUT     The maximum time (seconds) to wait between the add and
250                         delete cycles; default=100
251   --delete              Delete all added flows one by one, benchmark delete
252                         performance.
253   --bulk-delete         Delete all flows in bulk; default=False
254   --auth                Use authenticated access to REST (username: 'admin',
255                         password: 'admin'); default=False
256   --startflow STARTFLOW
257                         The starting Flow ID; default=0
258   --file FILE           File from which to read the JSON flow template;
259                         default: no file, use a built in template.
260
261 Examples:
262 ---------
263 To put 5000 flows into ODL, then wait for stats to catch up and then delete
264 the flows in bulk (using config_cleanup):
265    > ./flow_add_delete_test.py --flows=5000 --auth --no-delete --bulk-delete