Merge "Uploaded ASCII Documents for ODL-SDNi"
[docs.git] / manuals / user-guide / src / main / asciidoc / openflowplugin / odl-ofp-end-to-end-flows.adoc
1 [[instructions]]
2 ===== Instructions
3
4 [[learn-end-to-end-for-inventory]]
5 ====== Learn End to End for Inventory
6 <<odl-ofp-end-to-end-inventory_introduction-introduction,End to End Inventory>>
7
8 [[check-inventory]]
9 ====== Check inventory
10
11 * Run mininet with support for OF 1.3 as described in
12 <<odl-ofp-end-to-end-inventory_introduction-introduction,End to End Inventory>>
13 * Make sure you see the openflow:1 node come up as described in
14 <<odl-ofp-end-to-end-inventory_introduction-introduction,End to End Inventory>>
15
16 [[flow-strategy]]
17 ====== Flow Strategy
18
19 Current way to flush a flow to switch looks like this:
20
21 1.  Create MD-SAL modeled flow and commit it into dataStore using two
22 phase commit https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:FAQ[MD-SAL FAQ]
23 2.  FRM gets notified and invokes corresponding rpc (addFlow) on
24 particular service provider (if suitable provider for given node
25 registered)
26 3.  The provider (plugin in this case) transforms MD-SAL modeled flow
27 into OF-API modeled flow
28 4.  OF-API modeled flow is then flushed into OFLibrary
29 5.  OFLibrary encodes flow into particular version of wire protocol and
30 sends it to particular switch
31 6.  Check on mininet side if flow is set
32
33 [[push-your-flow]]
34 ====== Push your flow
35
36 * With PostMan:
37 ** Set headers:
38 *** Content-Type: application/xml   
39 *** Accept: application/xml
40 *** Authentication
41 ** Use URL: "http://<controller IP>:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1"
42 ** PUT
43 ** Use Body:
44
45 [source,xml]
46 ---------------------------------------------------------
47 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
48 <flow xmlns="urn:opendaylight:flow:inventory">
49     <priority>2</priority>
50     <flow-name>Foo</flow-name>
51     <match>
52         <ethernet-match>
53             <ethernet-type>
54                 <type>2048</type>
55             </ethernet-type>
56         </ethernet-match>
57         <ipv4-destination>10.0.10.2/24</ipv4-destination>
58     </match>
59     <id>1</id>
60     <table_id>0</table_id>
61     <instructions>
62         <instruction>
63             <order>0</order>
64             <apply-actions>
65                 <action>
66                    <order>0</order>
67                    <dec-nw-ttl/>
68                 </action>
69             </apply-actions>
70         </instruction>
71     </instructions>
72 </flow>
73 ---------------------------------------------------------
74
75 **Note*: If you want to try a different flow id or a different table,
76 make sure the URL and the body stay in sync. For example, if you wanted
77 to try: table 2 flow 20 you'd change the URL to: 
78
79 "http://<controller
80 IP>:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/flow/20"
81
82 but you would also need to update the 20 and 2 in the body of the XML.
83
84 Other caveat, we have a known bug with updates, so please only write to
85 a given flow id and table id on a given node once at this time until we
86 resolve it. Or you can use the DELETE method with the same URL in
87 PostMan to delete the flow information on switch and controller cache.
88
89 [[check-for-your-flow-on-the-switch]]
90 ====== Check for your flow on the switch
91
92 * See your flow on your mininet:
93
94 -----------------------------------------------------------------------------------------------------------------------------------------------------------------
95 mininet@mininet-vm:~$ sudo ovs-ofctl -O OpenFlow13 dump-flows s1
96 OFPST_FLOW reply (OF1.3) (xid=0x2):
97 cookie=0x0, duration=7.325s, table=0, n_packets=0, n_bytes=0, idle_timeout=300, hard_timeout=600, send_flow_rem priority=2,ip,nw_dst=10.0.10.0/24 actions=dec_ttl
98 -----------------------------------------------------------------------------------------------------------------------------------------------------------------
99
100 If you want to see the above information from the mininet prompt - use
101 "sh" instead of "sudo" i.e. use "sh ovs-ofctl -O OpenFlow13 dump-flows
102 s1".
103
104 [[check-for-your-flow-in-the-controller-config-via-restconf]]
105 ====== Check for your flow in the controller config via RESTCONF
106
107 * See your configured flow in POSTMAN with
108 ** URL http://<controller
109 IP>:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/
110 ** GET
111 ** You no longer need to set Accept header
112
113 Return Response:
114
115 [source,json]
116 ---------------
117 {
118   "flow-node-inventory:table": [
119     {
120       "flow-node-inventory:id": 0,
121       "flow-node-inventory:flow": [
122         {
123           "flow-node-inventory:priority": 1,
124           "flow-node-inventory:id": "10b1a23c-5299-4f7b-83d6-563bab472754",
125           "flow-node-inventory:table_id": 0,
126           "flow-node-inventory:hard-timeout": 0,
127           "flow-node-inventory:idle-timeout": 0,
128           "flow-node-inventory:instructions": {
129             "flow-node-inventory:instruction": [
130               {
131                 "flow-node-inventory:apply-actions": {
132                   "flow-node-inventory:action": [
133                     {
134                       "flow-node-inventory:output-action": {
135                         "flow-node-inventory:output-node-connector": "openflow:1:1"
136                       },
137                       "flow-node-inventory:order": 0
138                     }
139                   ]
140                 },
141                 "flow-node-inventory:order": 0
142               }
143             ]
144           },
145           "flow-node-inventory:match": {
146             "flow-node-inventory:ethernet-match": {
147               "flow-node-inventory:ethernet-type": {
148                 "flow-node-inventory:type": 2048
149               }
150             },
151             "flow-node-inventory:ipv4-destination": "10.0.0.2"
152           },
153           "flow-node-inventory:cookie": 0
154         },
155         {
156           "flow-node-inventory:priority": 1,
157           "flow-node-inventory:id": "020bf359-1299-4da6-b4f7-368bd83b5841",
158           "flow-node-inventory:table_id": 0,
159           "flow-node-inventory:hard-timeout": 0,
160           "flow-node-inventory:idle-timeout": 0,
161           "flow-node-inventory:instructions": {
162             "flow-node-inventory:instruction": [
163               {
164                 "flow-node-inventory:apply-actions": {
165                   "flow-node-inventory:action": [
166                     {
167                       "flow-node-inventory:output-action": {
168                         "flow-node-inventory:output-node-connector": "openflow:1:1"
169                       },
170                       "flow-node-inventory:order": 0
171                     }
172                   ]
173                 },
174                 "flow-node-inventory:order": 0
175               }
176             ]
177           },
178           "flow-node-inventory:match": {
179             "flow-node-inventory:ethernet-match": {
180               "flow-node-inventory:ethernet-type": {
181                 "flow-node-inventory:type": 2048
182               }
183             },
184             "flow-node-inventory:ipv4-destination": "10.0.0.1"
185           },
186           "flow-node-inventory:cookie": 0
187         },
188         {
189           "flow-node-inventory:priority": 1,
190           "flow-node-inventory:id": "42172bfc-9142-4a92-9e90-ee62529b1e85",
191           "flow-node-inventory:table_id": 0,
192           "flow-node-inventory:hard-timeout": 0,
193           "flow-node-inventory:idle-timeout": 0,
194           "flow-node-inventory:instructions": {
195             "flow-node-inventory:instruction": [
196               {
197                 "flow-node-inventory:apply-actions": {
198                   "flow-node-inventory:action": [
199                     {
200                       "flow-node-inventory:output-action": {
201                         "flow-node-inventory:output-node-connector": "openflow:1:1"
202                       },
203                       "flow-node-inventory:order": 0
204                     }
205                   ]
206                 },
207                 "flow-node-inventory:order": 0
208               }
209             ]
210           },
211           "flow-node-inventory:match": {
212             "flow-node-inventory:ethernet-match": {
213               "flow-node-inventory:ethernet-type": {
214                 "flow-node-inventory:type": 2048
215               }
216             },
217             "flow-node-inventory:ipv4-destination": "10.0.0.3"
218           },
219           "flow-node-inventory:cookie": 0
220         },
221         {
222           "flow-node-inventory:priority": 1,
223           "flow-node-inventory:id": "99bf566e-89f3-4c6f-ae9e-e26012ceb1e4",
224           "flow-node-inventory:table_id": 0,
225           "flow-node-inventory:hard-timeout": 0,
226           "flow-node-inventory:idle-timeout": 0,
227           "flow-node-inventory:instructions": {
228             "flow-node-inventory:instruction": [
229               {
230                 "flow-node-inventory:apply-actions": {
231                   "flow-node-inventory:action": [
232                     {
233                       "flow-node-inventory:output-action": {
234                         "flow-node-inventory:output-node-connector": "openflow:1:1"
235                       },
236                       "flow-node-inventory:order": 0
237                     }
238                   ]
239                 },
240                 "flow-node-inventory:order": 0
241               }
242             ]
243           },
244           "flow-node-inventory:match": {
245             "flow-node-inventory:ethernet-match": {
246               "flow-node-inventory:ethernet-type": {
247                 "flow-node-inventory:type": 2048
248               }
249             },
250             "flow-node-inventory:ipv4-destination": "10.0.0.4"
251           },
252           "flow-node-inventory:cookie": 0
253         },
254         {
255           "flow-node-inventory:priority": 1,
256           "flow-node-inventory:id": "019dcc2e-5b4f-44f0-90cc-de490294b862",
257           "flow-node-inventory:table_id": 0,
258           "flow-node-inventory:hard-timeout": 0,
259           "flow-node-inventory:idle-timeout": 0,
260           "flow-node-inventory:instructions": {
261             "flow-node-inventory:instruction": [
262               {
263                 "flow-node-inventory:apply-actions": {
264                   "flow-node-inventory:action": [
265                     {
266                       "flow-node-inventory:output-action": {
267                         "flow-node-inventory:output-node-connector": "openflow:1:2"
268                       },
269                       "flow-node-inventory:order": 0
270                     }
271                   ]
272                 },
273                 "flow-node-inventory:order": 0
274               }
275             ]
276           },
277           "flow-node-inventory:match": {
278             "flow-node-inventory:ethernet-match": {
279               "flow-node-inventory:ethernet-type": {
280                 "flow-node-inventory:type": 2048
281               }
282             },
283             "flow-node-inventory:ipv4-destination": "10.0.0.5"
284           },
285           "flow-node-inventory:cookie": 0
286         },
287         {
288           "flow-node-inventory:priority": 1,
289           "flow-node-inventory:id": "968cf81e-3f16-42f1-8b16-d01ff719c63c",
290           "flow-node-inventory:table_id": 0,
291           "flow-node-inventory:hard-timeout": 0,
292           "flow-node-inventory:idle-timeout": 0,
293           "flow-node-inventory:instructions": {
294             "flow-node-inventory:instruction": [
295               {
296                 "flow-node-inventory:apply-actions": {
297                   "flow-node-inventory:action": [
298                     {
299                       "flow-node-inventory:output-action": {
300                         "flow-node-inventory:output-node-connector": "openflow:1:2"
301                       },
302                       "flow-node-inventory:order": 0
303                     }
304                   ]
305                 },
306                 "flow-node-inventory:order": 0
307               }
308             ]
309           },
310           "flow-node-inventory:match": {
311             "flow-node-inventory:ethernet-match": {
312               "flow-node-inventory:ethernet-type": {
313                 "flow-node-inventory:type": 2048
314               }
315             },
316             "flow-node-inventory:ipv4-destination": "10.0.0.8"
317           },
318           "flow-node-inventory:cookie": 0
319         },
320         {
321           "flow-node-inventory:priority": 1,
322           "flow-node-inventory:id": "1c14ea3c-9dcc-4434-b566-7e99033ea252",
323           "flow-node-inventory:table_id": 0,
324           "flow-node-inventory:hard-timeout": 0,
325           "flow-node-inventory:idle-timeout": 0,
326           "flow-node-inventory:instructions": {
327             "flow-node-inventory:instruction": [
328               {
329                 "flow-node-inventory:apply-actions": {
330                   "flow-node-inventory:action": [
331                     {
332                       "flow-node-inventory:output-action": {
333                         "flow-node-inventory:output-node-connector": "openflow:1:2"
334                       },
335                       "flow-node-inventory:order": 0
336                     }
337                   ]
338                 },
339                 "flow-node-inventory:order": 0
340               }
341             ]
342           },
343           "flow-node-inventory:match": {
344             "flow-node-inventory:ethernet-match": {
345               "flow-node-inventory:ethernet-type": {
346                 "flow-node-inventory:type": 2048
347               }
348             },
349             "flow-node-inventory:ipv4-destination": "10.0.0.6"
350           },
351           "flow-node-inventory:cookie": 0
352         },
353         {
354           "flow-node-inventory:priority": 1,
355           "flow-node-inventory:id": "ed9deeb2-be8f-4b84-bcd8-9d12049383d6",
356           "flow-node-inventory:table_id": 0,
357           "flow-node-inventory:hard-timeout": 0,
358           "flow-node-inventory:idle-timeout": 0,
359           "flow-node-inventory:instructions": {
360             "flow-node-inventory:instruction": [
361               {
362                 "flow-node-inventory:apply-actions": {
363                   "flow-node-inventory:action": [
364                     {
365                       "flow-node-inventory:output-action": {
366                         "flow-node-inventory:output-node-connector": "openflow:1:2"
367                       },
368                       "flow-node-inventory:order": 0
369                     }
370                   ]
371                 },
372                 "flow-node-inventory:order": 0
373               }
374             ]
375           },
376           "flow-node-inventory:match": {
377             "flow-node-inventory:ethernet-match": {
378               "flow-node-inventory:ethernet-type": {
379                 "flow-node-inventory:type": 2048
380               }
381             },
382             "flow-node-inventory:ipv4-destination": "10.0.0.7"
383           },
384           "flow-node-inventory:cookie": 0
385         }
386       ]
387     }
388   ]
389 }
390
391
392 ---------------
393
394 [[look-for-your-flow-stats-in-the-controller-operational-data-via-restconf]]
395 ====== Look for your flow stats in the controller operational data via
396 RESTCONF
397
398 * See your operational flow stats in POSTMAN with
399 ** URL "http://<controller
400 IP>:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/"
401 ** GET
402
403 Return Response:
404
405 [source,json]
406 ---------------------
407
408 {
409   "flow-node-inventory:table": [
410     {
411       "flow-node-inventory:id": 0,
412       "flow-node-inventory:flow": [
413         {
414           "flow-node-inventory:id": "10b1a23c-5299-4f7b-83d6-563bab472754",
415           "opendaylight-flow-statistics:flow-statistics": {
416             "opendaylight-flow-statistics:cookie": 0,
417             "opendaylight-flow-statistics:duration": {
418               "opendaylight-flow-statistics:nanosecond": 886000000,
419               "opendaylight-flow-statistics:second": 2707
420             },
421             "opendaylight-flow-statistics:hard-timeout": 0,
422             "opendaylight-flow-statistics:byte-count": 784,
423             "opendaylight-flow-statistics:match": {
424               "opendaylight-flow-statistics:ethernet-match": {
425                 "opendaylight-flow-statistics:ethernet-type": {
426                   "opendaylight-flow-statistics:type": 2048
427                 }
428               },
429               "opendaylight-flow-statistics:ipv4-destination": "10.0.0.2/32"
430             },
431             "opendaylight-flow-statistics:priority": 1,
432             "opendaylight-flow-statistics:packet-count": 8,
433             "opendaylight-flow-statistics:table_id": 0,
434             "opendaylight-flow-statistics:idle-timeout": 0,
435             "opendaylight-flow-statistics:instructions": {
436               "opendaylight-flow-statistics:instruction": [
437                 {
438                   "opendaylight-flow-statistics:order": 0,
439                   "opendaylight-flow-statistics:apply-actions": {
440                     "opendaylight-flow-statistics:action": [
441                       {
442                         "opendaylight-flow-statistics:order": 0,
443                         "opendaylight-flow-statistics:output-action": {
444                           "opendaylight-flow-statistics:output-node-connector": "1",
445                           "opendaylight-flow-statistics:max-length": 0
446                         }
447                       }
448                     ]
449                   }
450                 }
451               ]
452             }
453           }
454         },
455         {
456           "flow-node-inventory:id": "020bf359-1299-4da6-b4f7-368bd83b5841",
457           "opendaylight-flow-statistics:flow-statistics": {
458             "opendaylight-flow-statistics:cookie": 0,
459             "opendaylight-flow-statistics:duration": {
460               "opendaylight-flow-statistics:nanosecond": 826000000,
461               "opendaylight-flow-statistics:second": 2711
462             },
463             "opendaylight-flow-statistics:hard-timeout": 0,
464             "opendaylight-flow-statistics:byte-count": 1568,
465             "opendaylight-flow-statistics:match": {
466               "opendaylight-flow-statistics:ethernet-match": {
467                 "opendaylight-flow-statistics:ethernet-type": {
468                   "opendaylight-flow-statistics:type": 2048
469                 }
470               },
471               "opendaylight-flow-statistics:ipv4-destination": "10.0.0.1/32"
472             },
473             "opendaylight-flow-statistics:priority": 1,
474             "opendaylight-flow-statistics:packet-count": 16,
475             "opendaylight-flow-statistics:table_id": 0,
476             "opendaylight-flow-statistics:idle-timeout": 0,
477             "opendaylight-flow-statistics:instructions": {
478               "opendaylight-flow-statistics:instruction": [
479                 {
480                   "opendaylight-flow-statistics:order": 0,
481                   "opendaylight-flow-statistics:apply-actions": {
482                     "opendaylight-flow-statistics:action": [
483                       {
484                         "opendaylight-flow-statistics:order": 0,
485                         "opendaylight-flow-statistics:output-action": {
486                           "opendaylight-flow-statistics:output-node-connector": "1",
487                           "opendaylight-flow-statistics:max-length": 0
488                         }
489                       }
490                     ]
491                   }
492                 }
493               ]
494             }
495           }
496         },
497         {
498           "flow-node-inventory:id": "42172bfc-9142-4a92-9e90-ee62529b1e85",
499           "opendaylight-flow-statistics:flow-statistics": {
500             "opendaylight-flow-statistics:cookie": 0,
501             "opendaylight-flow-statistics:duration": {
502               "opendaylight-flow-statistics:nanosecond": 548000000,
503               "opendaylight-flow-statistics:second": 2708
504             },
505             "opendaylight-flow-statistics:hard-timeout": 0,
506             "opendaylight-flow-statistics:byte-count": 784,
507             "opendaylight-flow-statistics:match": {
508               "opendaylight-flow-statistics:ethernet-match": {
509                 "opendaylight-flow-statistics:ethernet-type": {
510                   "opendaylight-flow-statistics:type": 2048
511                 }
512               },
513               "opendaylight-flow-statistics:ipv4-destination": "10.0.0.3/32"
514             },
515             "opendaylight-flow-statistics:priority": 1,
516             "opendaylight-flow-statistics:packet-count": 8,
517             "opendaylight-flow-statistics:table_id": 0,
518             "opendaylight-flow-statistics:idle-timeout": 0,
519             "opendaylight-flow-statistics:instructions": {
520               "opendaylight-flow-statistics:instruction": [
521                 {
522                   "opendaylight-flow-statistics:order": 0,
523                   "opendaylight-flow-statistics:apply-actions": {
524                     "opendaylight-flow-statistics:action": [
525                       {
526                         "opendaylight-flow-statistics:order": 0,
527                         "opendaylight-flow-statistics:output-action": {
528                           "opendaylight-flow-statistics:output-node-connector": "1",
529                           "opendaylight-flow-statistics:max-length": 0
530                         }
531                       }
532                     ]
533                   }
534                 }
535               ]
536             }
537           }
538         },
539         {
540           "flow-node-inventory:id": "99bf566e-89f3-4c6f-ae9e-e26012ceb1e4",
541           "opendaylight-flow-statistics:flow-statistics": {
542             "opendaylight-flow-statistics:cookie": 0,
543             "opendaylight-flow-statistics:duration": {
544               "opendaylight-flow-statistics:nanosecond": 296000000,
545               "opendaylight-flow-statistics:second": 2710
546             },
547             "opendaylight-flow-statistics:hard-timeout": 0,
548             "opendaylight-flow-statistics:byte-count": 1274,
549             "opendaylight-flow-statistics:match": {
550               "opendaylight-flow-statistics:ethernet-match": {
551                 "opendaylight-flow-statistics:ethernet-type": {
552                   "opendaylight-flow-statistics:type": 2048
553                 }
554               },
555               "opendaylight-flow-statistics:ipv4-destination": "10.0.0.4/32"
556             },
557             "opendaylight-flow-statistics:priority": 1,
558             "opendaylight-flow-statistics:packet-count": 13,
559             "opendaylight-flow-statistics:table_id": 0,
560             "opendaylight-flow-statistics:idle-timeout": 0,
561             "opendaylight-flow-statistics:instructions": {
562               "opendaylight-flow-statistics:instruction": [
563                 {
564                   "opendaylight-flow-statistics:order": 0,
565                   "opendaylight-flow-statistics:apply-actions": {
566                     "opendaylight-flow-statistics:action": [
567                       {
568                         "opendaylight-flow-statistics:order": 0,
569                         "opendaylight-flow-statistics:output-action": {
570                           "opendaylight-flow-statistics:output-node-connector": "1",
571                           "opendaylight-flow-statistics:max-length": 0
572                         }
573                       }
574                     ]
575                   }
576                 }
577               ]
578             }
579           }
580         },
581         {
582           "flow-node-inventory:id": "019dcc2e-5b4f-44f0-90cc-de490294b862",
583           "opendaylight-flow-statistics:flow-statistics": {
584             "opendaylight-flow-statistics:cookie": 0,
585             "opendaylight-flow-statistics:duration": {
586               "opendaylight-flow-statistics:nanosecond": 392000000,
587               "opendaylight-flow-statistics:second": 2711
588             },
589             "opendaylight-flow-statistics:hard-timeout": 0,
590             "opendaylight-flow-statistics:byte-count": 1470,
591             "opendaylight-flow-statistics:match": {
592               "opendaylight-flow-statistics:ethernet-match": {
593                 "opendaylight-flow-statistics:ethernet-type": {
594                   "opendaylight-flow-statistics:type": 2048
595                 }
596               },
597               "opendaylight-flow-statistics:ipv4-destination": "10.0.0.5/32"
598             },
599             "opendaylight-flow-statistics:priority": 1,
600             "opendaylight-flow-statistics:packet-count": 15,
601             "opendaylight-flow-statistics:table_id": 0,
602             "opendaylight-flow-statistics:idle-timeout": 0,
603             "opendaylight-flow-statistics:instructions": {
604               "opendaylight-flow-statistics:instruction": [
605                 {
606                   "opendaylight-flow-statistics:order": 0,
607                   "opendaylight-flow-statistics:apply-actions": {
608                     "opendaylight-flow-statistics:action": [
609                       {
610                         "opendaylight-flow-statistics:order": 0,
611                         "opendaylight-flow-statistics:output-action": {
612                           "opendaylight-flow-statistics:output-node-connector": "2",
613                           "opendaylight-flow-statistics:max-length": 0
614                         }
615                       }
616                     ]
617                   }
618                 }
619               ]
620             }
621           }
622         },
623         {
624           "flow-node-inventory:id": "968cf81e-3f16-42f1-8b16-d01ff719c63c",
625           "opendaylight-flow-statistics:flow-statistics": {
626             "opendaylight-flow-statistics:cookie": 0,
627             "opendaylight-flow-statistics:duration": {
628               "opendaylight-flow-statistics:nanosecond": 344000000,
629               "opendaylight-flow-statistics:second": 2707
630             },
631             "opendaylight-flow-statistics:hard-timeout": 0,
632             "opendaylight-flow-statistics:byte-count": 784,
633             "opendaylight-flow-statistics:match": {
634               "opendaylight-flow-statistics:ethernet-match": {
635                 "opendaylight-flow-statistics:ethernet-type": {
636                   "opendaylight-flow-statistics:type": 2048
637                 }
638               },
639               "opendaylight-flow-statistics:ipv4-destination": "10.0.0.8/32"
640             },
641             "opendaylight-flow-statistics:priority": 1,
642             "opendaylight-flow-statistics:packet-count": 8,
643             "opendaylight-flow-statistics:table_id": 0,
644             "opendaylight-flow-statistics:idle-timeout": 0,
645             "opendaylight-flow-statistics:instructions": {
646               "opendaylight-flow-statistics:instruction": [
647                 {
648                   "opendaylight-flow-statistics:order": 0,
649                   "opendaylight-flow-statistics:apply-actions": {
650                     "opendaylight-flow-statistics:action": [
651                       {
652                         "opendaylight-flow-statistics:order": 0,
653                         "opendaylight-flow-statistics:output-action": {
654                           "opendaylight-flow-statistics:output-node-connector": "2",
655                           "opendaylight-flow-statistics:max-length": 0
656                         }
657                       }
658                     ]
659                   }
660                 }
661               ]
662             }
663           }
664         },
665         {
666           "flow-node-inventory:id": "ed9deeb2-be8f-4b84-bcd8-9d12049383d6",
667           "opendaylight-flow-statistics:flow-statistics": {
668             "opendaylight-flow-statistics:cookie": 0,
669             "opendaylight-flow-statistics:duration": {
670               "opendaylight-flow-statistics:nanosecond": 577000000,
671               "opendaylight-flow-statistics:second": 2706
672             },
673             "opendaylight-flow-statistics:hard-timeout": 0,
674             "opendaylight-flow-statistics:byte-count": 784,
675             "opendaylight-flow-statistics:match": {
676               "opendaylight-flow-statistics:ethernet-match": {
677                 "opendaylight-flow-statistics:ethernet-type": {
678                   "opendaylight-flow-statistics:type": 2048
679                 }
680               },
681               "opendaylight-flow-statistics:ipv4-destination": "10.0.0.7/32"
682             },
683             "opendaylight-flow-statistics:priority": 1,
684             "opendaylight-flow-statistics:packet-count": 8,
685             "opendaylight-flow-statistics:table_id": 0,
686             "opendaylight-flow-statistics:idle-timeout": 0,
687             "opendaylight-flow-statistics:instructions": {
688               "opendaylight-flow-statistics:instruction": [
689                 {
690                   "opendaylight-flow-statistics:order": 0,
691                   "opendaylight-flow-statistics:apply-actions": {
692                     "opendaylight-flow-statistics:action": [
693                       {
694                         "opendaylight-flow-statistics:order": 0,
695                         "opendaylight-flow-statistics:output-action": {
696                           "opendaylight-flow-statistics:output-node-connector": "2",
697                           "opendaylight-flow-statistics:max-length": 0
698                         }
699                       }
700                     ]
701                   }
702                 }
703               ]
704             }
705           }
706         },
707         {
708           "flow-node-inventory:id": "1c14ea3c-9dcc-4434-b566-7e99033ea252",
709           "opendaylight-flow-statistics:flow-statistics": {
710             "opendaylight-flow-statistics:cookie": 0,
711             "opendaylight-flow-statistics:duration": {
712               "opendaylight-flow-statistics:nanosecond": 659000000,
713               "opendaylight-flow-statistics:second": 2705
714             },
715             "opendaylight-flow-statistics:hard-timeout": 0,
716             "opendaylight-flow-statistics:byte-count": 784,
717             "opendaylight-flow-statistics:match": {
718               "opendaylight-flow-statistics:ethernet-match": {
719                 "opendaylight-flow-statistics:ethernet-type": {
720                   "opendaylight-flow-statistics:type": 2048
721                 }
722               },
723               "opendaylight-flow-statistics:ipv4-destination": "10.0.0.6/32"
724             },
725             "opendaylight-flow-statistics:priority": 1,
726             "opendaylight-flow-statistics:packet-count": 8,
727             "opendaylight-flow-statistics:table_id": 0,
728             "opendaylight-flow-statistics:idle-timeout": 0,
729             "opendaylight-flow-statistics:instructions": {
730               "opendaylight-flow-statistics:instruction": [
731                 {
732                   "opendaylight-flow-statistics:order": 0,
733                   "opendaylight-flow-statistics:apply-actions": {
734                     "opendaylight-flow-statistics:action": [
735                       {
736                         "opendaylight-flow-statistics:order": 0,
737                         "opendaylight-flow-statistics:output-action": {
738                           "opendaylight-flow-statistics:output-node-connector": "2",
739                           "opendaylight-flow-statistics:max-length": 0
740                         }
741                       }
742                     ]
743                   }
744                 }
745               ]
746             }
747           }
748         }
749       ],
750       "opendaylight-flow-table-statistics:flow-table-statistics": {
751         "opendaylight-flow-table-statistics:active-flows": 8,
752         "opendaylight-flow-table-statistics:packets-matched": 97683,
753         "opendaylight-flow-table-statistics:packets-looked-up": 101772
754       }
755     }
756   ]
757 }
758
759 ---------------------
760
761 [[discovering-and-testing-new-flow-types]]
762 ===== Discovering and testing new Flow Types
763
764 Currently, the openflowplugin has a test-provider that allows you to
765 push various flows through the system from the OSGI command line. Once
766 those flows have been pushed through, you can see them as examples and
767 then use them to see in the config what a particular flow example looks
768 like.
769
770 [[using-addmdflow]]
771 ====== Using addMDFlow
772
773 From the
774
775 --------------------------------------------------------------------------------------------------------------------
776 cd openflowplugin/distribution/base/target/distributions-openflowplugin-base-0.0.1-SNAPSHOT-osgipackage/opendaylight
777 ./run.sh
778 --------------------------------------------------------------------------------------------------------------------
779
780 Point your mininet at the controller as described above.
781
782 once you can see your node (probably openflow:1 if you've been following
783 along) in the inventory, at the OSGI command line try running:
784
785 -----------------------
786 addMDFlow openflow:1 f#
787 -----------------------
788
789 Where # is a number between 1 and 80. This will create one of 80
790 possible flows. You can go confirm they were created on the switch.
791
792 Once you've done that, use
793
794 * GET
795 * Accept: application/xml
796 * URL:
797 "http://192.168.195.157:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/"
798
799 To see a full listing of the flows in table 2 (where they will be put).
800 If you want to see a particular flow, look at
801
802 * URL:
803 "http://192.168.195.157:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/flow/#"
804
805 Where # is 123 + the f# you used. So for example, for f22, your url
806 would be
807
808 * URL:
809 "http://192.168.195.157:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/flow/145"
810
811 Note: You may have to trim out some of the sections like that contain
812 bitfields and binary types that are not correctly modeled.
813
814 Note: Before attempting to PUT a flow you have created via addMDFlow,
815 please change its URL and body to, for example, use table 1 instead of
816 table 2 or another Flow Id, so you don't collide.
817
818 Note: There are several test command providers and the one handling
819 flows is *OpenflowpluginTestCommandProvider*. Methods, which can be use
820 as *commands in OSGI-console* have prefix '_'.
821
822 [[example-flows]]
823 ===== Example Flows
824
825 Examples for XML for various flow matches, instructions & actions can be
826 found in following section
827 <<odl-ofp-example-flows_overview,here>>