adding learn example
[docs.git] / manuals / user-guide / src / main / asciidoc / openflowplugin / odl-ofp-example-flows.adoc
1 [[odl-ofp-example-flows_overview]]
2 ==== Overview
3
4 The flow examples on this page are tested to work with OVS.
5
6 Use, for example, POSTMAN with the following parameters:
7
8 ---------------------------------------------------------------------------------------------------------------------
9 PUT http://<ctrl-addr>:8080/restconf/config/opendaylight-inventory:nodes/node/<Node-id>/table/<Table-#>/flow/<Flow-#>
10
11 - Accept: application/xml
12 - Content-Type: application/xml
13 ---------------------------------------------------------------------------------------------------------------------
14
15 For example:
16
17 -------------------------------------------------------------------------------------------------------
18 PUT http://localhost:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/flow/127
19 -------------------------------------------------------------------------------------------------------
20
21 Make sure that the Table-# and Flow-# in the URL and in the XML match.
22
23 The format of the flow-programming XML is determined by by the grouping
24 'flow' in the opendaylight-flow-types yang model: MISSING LINK.
25
26 [[match-examples]]
27 ==== Match Examples
28
29 The format of the XML that describes OpenFlow matches is determined by
30 the opendaylight-match-types yang model: .
31
32 The RESTCONF documentation for the match-types yang model can be found
33 at
34 https://jenkins.opendaylight.org/controller/job/controller-merge/lastSuccessfulBuild/artifact/opendaylight/md-sal/model/model-flow-base/target/site/models/opendaylight-match-types.html[opendaylight-match-types.html]
35
36 [[ipv4-dest-address]]
37 ===== IPv4 Dest Address
38
39 * Flow=124, Table=2, Priority=2,
40 Instructions=\{Apply_Actions=\{dec_nw_ttl}},
41 match=\{ipv4_destination_address=10.0.1.1/24}
42 * Note that ethernet-type MUST be 2048 (0x800)
43
44 [source,xml]
45 --------------------------------------------------------
46 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
47 <flow xmlns="urn:opendaylight:flow:inventory">
48     <strict>false</strict>
49     <instructions>
50         <instruction>
51             <order>0</order>
52             <apply-actions>
53                 <action>
54                     <order>0</order>
55                     <dec-nw-ttl/>
56                 </action>
57             </apply-actions>
58         </instruction>
59     </instructions>
60     <table_id>2</table_id>
61     <id>124</id>
62     <cookie_mask>255</cookie_mask>
63     <installHw>false</installHw>
64     <match>
65         <ethernet-match>
66             <ethernet-type>
67                 <type>2048</type>
68             </ethernet-type>
69         </ethernet-match>
70         <ipv4-destination>10.0.1.1/24</ipv4-destination>
71     </match>
72     <hard-timeout>12</hard-timeout>
73     <cookie>1</cookie>
74     <idle-timeout>34</idle-timeout>
75     <flow-name>FooXf1</flow-name>
76     <priority>2</priority>
77     <barrier>false</barrier>
78 </flow>
79 --------------------------------------------------------
80
81 [[ethernet-src-address]]
82 ===== Ethernet Src Address
83
84 * Flow=126, Table=2, Priority=2, Instructions=\{Apply_Actions=\{drop}},
85 match=\{ethernet-source=00:00:00:00:00:01}
86
87 [source,xml]
88 ------------------------------------------------------
89 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
90 <flow xmlns="urn:opendaylight:flow:inventory">
91     <strict>false</strict>
92     <instructions>
93         <instruction>
94             <order>0</order>
95             <apply-actions>
96                 <action>
97                     <order>0</order>
98                     <drop-action/>
99                 </action>
100             </apply-actions>
101         </instruction>
102     </instructions>
103     <table_id>2</table_id>
104     <id>126</id>
105     <cookie_mask>255</cookie_mask>
106     <installHw>false</installHw>
107     <match>
108         <ethernet-match>
109             <ethernet-source>
110                 <address>00:00:00:00:00:01</address>
111             </ethernet-source>
112         </ethernet-match>
113     </match>
114     <hard-timeout>12</hard-timeout>
115     <cookie>3</cookie>
116     <idle-timeout>34</idle-timeout>
117     <flow-name>FooXf3</flow-name>
118     <priority>2</priority>
119     <barrier>false</barrier>
120 </flow>
121 ------------------------------------------------------
122
123 [[ethernet-src-dest-addresses-ethernet-type]]
124 ===== Ethernet Src & Dest Addresses, Ethernet Type
125
126 * Flow=127, Table=2, Priority=2, Instructions=\{Apply_Actions=\{drop}},
127 match=\{ethernet-source=00:00:00:00:23:ae,
128 ethernet-destination=ff:ff:ff:ff:ff:ff, ethernet-type=45}
129
130 [source,xml]
131 ------------------------------------------------------
132 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
133 <flow xmlns="urn:opendaylight:flow:inventory">
134     <strict>false</strict>
135     <instructions>
136         <instruction>
137             <order>0</order>
138             <apply-actions>
139                 <action>
140                     <order>0</order>
141                     <dec-mpls-ttl/>
142                 </action>
143             </apply-actions>
144         </instruction>
145     </instructions>
146     <table_id>2</table_id>
147     <id>127</id>
148     <cookie_mask>255</cookie_mask>
149     <installHw>false</installHw>
150     <match>
151         <ethernet-match>
152             <ethernet-type>
153                 <type>45</type>
154             </ethernet-type>
155             <ethernet-destination>
156                 <address>ff:ff:ff:ff:ff:ff</address>
157             </ethernet-destination>
158             <ethernet-source>
159                 <address>00:00:00:00:23:ae</address>
160             </ethernet-source>
161         </ethernet-match>
162     </match>
163     <hard-timeout>12</hard-timeout>
164     <cookie>4</cookie>
165     <idle-timeout>34</idle-timeout>
166     <flow-name>FooXf4</flow-name>
167     <priority>2</priority>
168     <barrier>false</barrier>
169 </flow>
170 ------------------------------------------------------
171
172 [[ethernet-src-dest-addresses-ipv4-src-dest-addresses-input-port]]
173 ===== Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, Input Port
174
175 * Note that ethernet-type MUST be 34887 (0x8847)
176
177 [source,xml]
178 --------------------------------------------------------
179 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
180 <flow xmlns="urn:opendaylight:flow:inventory">
181     <strict>false</strict>
182     <instructions>
183         <instruction>
184             <order>0</order>
185             <apply-actions>
186                 <action>
187                     <order>0</order>
188                     <dec-mpls-ttl/>
189                 </action>
190             </apply-actions>
191         </instruction>
192     </instructions>
193     <table_id>2</table_id>
194     <id>128</id>
195     <cookie_mask>255</cookie_mask>
196     <match>
197         <ethernet-match>
198             <ethernet-type>
199                 <type>34887</type>
200             </ethernet-type>
201             <ethernet-destination>
202                 <address>ff:ff:ff:ff:ff:ff</address>
203             </ethernet-destination>
204             <ethernet-source>
205                 <address>00:00:00:00:23:ae</address>
206             </ethernet-source>
207         </ethernet-match>
208         <ipv4-source>10.1.2.3/24</ipv4-source>
209         <ipv4-destination>20.4.5.6/16</ipv4-destination>
210         <in-port>0</in-port>
211     </match>
212     <hard-timeout>12</hard-timeout>
213     <cookie>5</cookie>
214     <idle-timeout>34</idle-timeout>
215     <flow-name>FooXf5</flow-name>
216     <priority>2</priority>
217     <barrier>false</barrier>
218 </flow>
219 --------------------------------------------------------
220
221 [[ethernet-src-dest-addresses-ipv4-src-dest-addresses-ip-protocol-ip-dscp-ip-ecn-input-port]]
222 ===== Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, IP
223 Protocol #, IP DSCP, IP ECN, Input Port
224
225 * Note that ethernet-type MUST be 2048 (0x800)
226
227 [source,xml]
228 --------------------------------------------------------
229 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
230 <flow xmlns="urn:opendaylight:flow:inventory">
231     <strict>false</strict>
232     <instructions>
233         <instruction>
234             <order>0</order>
235             <apply-actions>
236                 <action>
237                     <order>0</order>
238                     <dec-nw-ttl/>
239                 </action>
240             </apply-actions>
241         </instruction>
242     </instructions>
243     <table_id>2</table_id>
244     <id>130</id>
245     <cookie_mask>255</cookie_mask>
246     <match>
247         <ethernet-match>
248             <ethernet-type>
249                 <type>2048</type>
250             </ethernet-type>
251             <ethernet-destination>
252                 <address>ff:ff:ff:ff:ff:aa</address>
253             </ethernet-destination>
254             <ethernet-source>
255                 <address>00:00:00:11:23:ae</address>
256             </ethernet-source>
257         </ethernet-match>
258         <ipv4-source>10.1.2.3/24</ipv4-source>
259         <ipv4-destination>20.4.5.6/16</ipv4-destination>
260         <ip-match>
261             <ip-protocol>56</ip-protocol>
262             <ip-dscp>15</ip-dscp>
263             <ip-ecn>1</ip-ecn>
264         </ip-match>
265         <in-port>0</in-port>
266     </match>
267     <hard-timeout>12000</hard-timeout>
268     <cookie>7</cookie>
269     <idle-timeout>12000</idle-timeout>
270     <flow-name>FooXf7</flow-name>
271     <priority>2</priority>
272     <barrier>false</barrier>
273 </flow>
274 --------------------------------------------------------
275
276 [[ethernet-src-dest-addresses-ipv4-src-dest-addresses-tcp-src-dest-ports-ip-dscp-ip-ecn-input-port]]
277 ===== Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, TCP Src &
278 Dest Ports, IP DSCP, IP ECN, Input Port
279
280 * Note that ethernet-type MUST be 2048 (0x800)
281 * Note that IP Protocol Type MUST be 6
282
283 [source,xml]
284 -----------------------------------------------------------
285 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
286 <flow xmlns="urn:opendaylight:flow:inventory">
287     <strict>false</strict>
288     <instructions>
289         <instruction>
290             <order>0</order>
291             <apply-actions>
292                 <action>
293                     <order>0</order>
294                     <dec-nw-ttl/>
295                 </action>
296             </apply-actions>
297         </instruction>
298     </instructions>
299     <table_id>2</table_id>
300     <id>131</id>
301     <cookie_mask>255</cookie_mask>
302     <match>
303         <ethernet-match>
304             <ethernet-type>
305                 <type>2048</type>
306             </ethernet-type>
307             <ethernet-destination>
308                 <address>ff:ff:29:01:19:61</address>
309             </ethernet-destination>
310             <ethernet-source>
311                 <address>00:00:00:11:23:ae</address>
312             </ethernet-source>
313         </ethernet-match>
314         <ipv4-source>17.1.2.3/8</ipv4-source>
315         <ipv4-destination>172.168.5.6/16</ipv4-destination>
316         <ip-match>
317             <ip-protocol>6</ip-protocol>
318             <ip-dscp>2</ip-dscp>
319             <ip-ecn>2</ip-ecn>
320         </ip-match>
321         <tcp-source-port>25364</tcp-source-port>
322         <tcp-destination-port>8080</tcp-destination-port>
323         <in-port>0</in-port>
324     </match>
325     <hard-timeout>1200</hard-timeout>
326     <cookie>8</cookie>
327     <idle-timeout>3400</idle-timeout>
328     <flow-name>FooXf8</flow-name>
329     <priority>2</priority>
330     <barrier>false</barrier>
331 </flow>
332 -----------------------------------------------------------
333
334 [[ethernet-src-dest-addresses-ipv4-src-dest-addresses-udp-src-dest-ports-ip-dscp-ip-ecn-input-port]]
335 ===== Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, UDP Src &
336 Dest Ports, IP DSCP, IP ECN, Input Port
337
338 * Note that ethernet-type MUST be 2048 (0x800)
339 * Note that IP Protocol Type MUST be 17
340
341 [source,xml]
342 -----------------------------------------------------------
343 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
344 <flow xmlns="urn:opendaylight:flow:inventory">
345     <strict>false</strict>
346     <instructions>
347         <instruction>
348             <order>0</order>
349             <apply-actions>
350                 <action>
351                     <order>0</order>
352                     <dec-nw-ttl/>
353                 </action>
354             </apply-actions>
355         </instruction>
356     </instructions>
357     <table_id>2</table_id>
358     <id>132</id>
359     <cookie_mask>255</cookie_mask>
360     <match>
361         <ethernet-match>
362             <ethernet-type>
363                 <type>2048</type>
364             </ethernet-type>
365             <ethernet-destination>
366                 <address>20:14:29:01:19:61</address>
367             </ethernet-destination>
368             <ethernet-source>
369                 <address>00:00:00:11:23:ae</address>
370             </ethernet-source>
371         </ethernet-match>
372         <ipv4-source>19.1.2.3/10</ipv4-source>
373         <ipv4-destination>172.168.5.6/18</ipv4-destination>
374         <ip-match>
375             <ip-protocol>17</ip-protocol>
376             <ip-dscp>8</ip-dscp>
377             <ip-ecn>3</ip-ecn>
378         </ip-match>
379         <udp-source-port>25364</udp-source-port>
380         <udp-destination-port>8080</udp-destination-port>
381         <in-port>0</in-port>
382     </match>
383     <hard-timeout>1200</hard-timeout>
384     <cookie>9</cookie>
385     <idle-timeout>3400</idle-timeout>
386     <flow-name>FooXf9</flow-name>
387     <priority>2</priority>
388     <barrier>false</barrier>
389 -----------------------------------------------------------
390
391 [[ethernet-src-dest-addresses-ipv4-src-dest-addresses-icmpv4-type-code-ip-dscp-ip-ecn-input-port]]
392 ===== Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, ICMPv4
393 Type & Code, IP DSCP, IP ECN, Input Port
394
395 * Note that ethernet-type MUST be 2048 (0x800)
396 * Note that IP Protocol Type MUST be 1
397
398 [source,xml]
399 -----------------------------------------------------------
400 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
401 <flow xmlns="urn:opendaylight:flow:inventory">
402     <strict>false</strict>
403     <instructions>
404         <instruction>
405             <order>0</order>
406             <apply-actions>
407                 <action>
408                     <order>0</order>
409                     <dec-nw-ttl/>
410                 </action>
411             </apply-actions>
412         </instruction>
413     </instructions>
414     <table_id>2</table_id>
415     <id>134</id>
416     <cookie_mask>255</cookie_mask>
417     <match>
418         <ethernet-match>
419             <ethernet-type>
420                 <type>2048</type>
421             </ethernet-type>
422             <ethernet-destination>
423                 <address>ff:ff:29:01:19:61</address>
424             </ethernet-destination>
425             <ethernet-source>
426                 <address>00:00:00:11:23:ae</address>
427             </ethernet-source>
428         </ethernet-match>
429         <ipv4-source>17.1.2.3/8</ipv4-source>
430         <ipv4-destination>172.168.5.6/16</ipv4-destination>
431         <ip-match>
432             <ip-protocol>1</ip-protocol>
433             <ip-dscp>27</ip-dscp>
434             <ip-ecn>3</ip-ecn>
435         </ip-match>
436         <icmpv4-match>
437             <icmpv4-type>6</icmpv4-type>
438             <icmpv4-code>3</icmpv4-code>
439         </icmpv4-match>
440         <in-port>0</in-port>
441     </match>
442     <hard-timeout>1200</hard-timeout>
443     <cookie>11</cookie>
444     <idle-timeout>3400</idle-timeout>
445     <flow-name>FooXf11</flow-name>
446     <priority>2</priority>
447 </flow>
448 -----------------------------------------------------------
449
450 [[ethernet-src-dest-addresses-arp-operation-arp-src-target-transport-addresses-arp-src-target-hw-addresses]]
451 ===== Ethernet Src & Dest Addresses, ARP Operation, ARP Src & Target
452 Transport Addresses, ARP Src & Target Hw Addresses
453
454 * Note that ethernet-type MUST be 2054 (0x806)
455
456 [source,xml]
457 --------------------------------------------------------------------------------
458 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
459 <flow xmlns="urn:opendaylight:flow:inventory">
460     <strict>false</strict>
461     <instructions>
462         <instruction>
463             <order>0</order>
464             <apply-actions>
465                 <action>
466                     <order>0</order>
467                     <dec-nw-ttl/>
468                 </action>
469                 <action>
470                     <order>1</order>
471                     <dec-mpls-ttl/>
472                 </action>
473             </apply-actions>
474         </instruction>
475     </instructions>
476     <table_id>2</table_id>
477     <id>137</id>
478     <cookie_mask>255</cookie_mask>
479     <match>
480         <ethernet-match>
481             <ethernet-type>
482                 <type>2054</type>
483             </ethernet-type>
484             <ethernet-destination>
485                 <address>ff:ff:ff:ff:FF:ff</address>
486             </ethernet-destination>
487             <ethernet-source>
488                 <address>00:00:FC:01:23:ae</address>
489             </ethernet-source>
490         </ethernet-match>
491         <arp-op>1</arp-op>
492         <arp-source-transport-address>192.168.4.1</arp-source-transport-address>
493         <arp-target-transport-address>10.21.22.23</arp-target-transport-address>
494         <arp-source-hardware-address>
495             <address>12:34:56:78:98:AB</address>
496         </arp-source-hardware-address>
497         <arp-target-hardware-address>
498             <address>FE:DC:BA:98:76:54</address>
499         </arp-target-hardware-address>
500     </match>
501     <hard-timeout>12</hard-timeout>
502     <cookie>14</cookie>
503     <idle-timeout>34</idle-timeout>
504     <flow-name>FooXf14</flow-name>
505     <priority>2</priority>
506     <barrier>false</barrier>
507 --------------------------------------------------------------------------------
508
509 [[ethernet-src-dest-addresses-ethernet-type-vlan-id-vlan-pcp]]
510 ===== Ethernet Src & Dest Addresses, Ethernet Type, VLAN ID, VLAN PCP
511
512 [source,xml]
513 -------------------------------------------------------
514 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
515 <flow xmlns="urn:opendaylight:flow:inventory">
516     <strict>false</strict>
517     <instructions>
518         <instruction>
519             <order>0</order>
520             <apply-actions>
521                 <action>
522                     <order>0</order>
523                     <dec-nw-ttl/>
524                 </action>
525             </apply-actions>
526         </instruction>
527     </instructions>
528     <table_id>2</table_id>
529     <id>138</id>
530     <cookie_mask>255</cookie_mask>
531     <match>
532         <ethernet-match>
533             <ethernet-type>
534                 <type>2048</type>
535             </ethernet-type>
536             <ethernet-destination>
537                 <address>ff:ff:29:01:19:61</address>
538             </ethernet-destination>
539             <ethernet-source>
540                 <address>00:00:00:11:23:ae</address>
541             </ethernet-source>
542         </ethernet-match>
543         <vlan-match>
544             <vlan-id>
545                 <vlan-id>78</vlan-id>
546                 <vlan-id-present>true</vlan-id-present>
547             </vlan-id>
548             <vlan-pcp>3</vlan-pcp>
549       </vlan-match>
550     </match>
551     <hard-timeout>1200</hard-timeout>
552     <cookie>15</cookie>
553     <idle-timeout>3400</idle-timeout>
554     <flow-name>FooXf15</flow-name>
555     <priority>2</priority>
556     <barrier>false</barrier>
557 </flow>
558 -------------------------------------------------------
559
560 [[ethernet-src-dest-addresses-mpls-label-mpls-tc-mpls-bos]]
561 ===== Ethernet Src & Dest Addresses, MPLS Label, MPLS TC, MPLS BoS
562
563 [source,xml]
564 ------------------------------------------------------
565 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
566 <flow xmlns="urn:opendaylight:flow:inventory">
567     <flow-name>FooXf17</flow-name>
568     <id>140</id>
569     <cookie_mask>255</cookie_mask>
570     <cookie>17</cookie>
571     <hard-timeout>1200</hard-timeout>
572     <idle-timeout>3400</idle-timeout>
573     <priority>2</priority>
574     <table_id>2</table_id>
575     <strict>false</strict>
576     <instructions>
577         <instruction>
578             <order>0</order>
579             <apply-actions>
580                 <action>
581                     <order>0</order>
582                     <dec-nw-ttl/>
583                 </action>
584             </apply-actions>
585         </instruction>
586     </instructions>
587     <match>
588         <ethernet-match>
589             <ethernet-type>
590                 <type>34887</type>
591             </ethernet-type>
592             <ethernet-destination>
593                 <address>ff:ff:29:01:19:61</address>
594             </ethernet-destination>
595             <ethernet-source>
596                 <address>00:00:00:11:23:ae</address>
597             </ethernet-source>
598         </ethernet-match>
599         <protocol-match-fields>
600             <mpls-label>567</mpls-label>
601             <mpls-tc>3</mpls-tc>
602             <mpls-bos>1</mpls-bos>
603         </protocol-match-fields>
604     </match>
605 </flow>
606 ------------------------------------------------------
607
608 [[ipv6-src-dest-addresses]]
609 ===== IPv6 Src & Dest Addresses
610
611 * Note that ethernet-type MUST be 34525
612
613 [source,xml]
614 ------------------------------------------------------------------------------
615 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
616 <flow xmlns="urn:opendaylight:flow:inventory">
617     <strict>false</strict>
618     <flow-name>FooXf18</flow-name>
619     <id>141</id>
620     <cookie_mask>255</cookie_mask>
621     <cookie>18</cookie>
622     <table_id>2</table_id>
623     <priority>2</priority>
624     <hard-timeout>1200</hard-timeout>
625     <idle-timeout>3400</idle-timeout>
626     <installHw>false</installHw>
627     <instructions>
628         <instruction>
629             <order>0</order>
630             <apply-actions>
631                 <action>
632                     <order>0</order>
633                     <dec-nw-ttl/>
634                 </action>
635             </apply-actions>
636         </instruction>
637     </instructions>
638     <match>
639         <ethernet-match>
640             <ethernet-type>
641                 <type>34525</type>
642             </ethernet-type>
643         </ethernet-match>
644         <ipv6-source>fe80::2acf:e9ff:fe21:6431/128</ipv6-source>
645         <ipv6-destination>aabb:1234:2acf:e9ff::fe21:6431/64</ipv6-destination>
646     </match>
647 </flow>
648 ------------------------------------------------------------------------------
649
650 [[metadata]]
651 ===== Metadata
652
653 [source,xml]
654 ------------------------------------------------------
655 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
656 <flow xmlns="urn:opendaylight:flow:inventory">
657     <strict>false</strict>
658     <flow-name>FooXf19</flow-name>
659     <id>142</id>
660     <cookie_mask>255</cookie_mask>
661     <cookie>19</cookie>
662     <table_id>2</table_id>
663     <priority>1</priority>
664     <hard-timeout>1200</hard-timeout>
665     <idle-timeout>3400</idle-timeout>
666     <installHw>false</installHw>
667     <instructions>
668         <instruction>
669             <order>0</order>
670             <apply-actions>
671                 <action>
672                     <order>0</order>
673                     <dec-nw-ttl/>
674                 </action>
675             </apply-actions>
676         </instruction>
677     </instructions>
678     <match>
679         <metadata>
680             <metadata>12345</metadata>
681         </metadata>
682     </match>
683 </flow>
684 ------------------------------------------------------
685
686 [[metadata-metadata-mask]]
687 ===== Metadata, Metadata Mask
688
689 [source,xml]
690 ------------------------------------------------------
691 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
692 <flow xmlns="urn:opendaylight:flow:inventory">
693     <strict>false</strict>
694     <flow-name>FooXf20</flow-name>
695     <id>143</id>
696     <cookie_mask>255</cookie_mask>
697     <cookie>20</cookie>
698     <table_id>2</table_id>
699     <priority>2</priority>
700     <hard-timeout>1200</hard-timeout>
701     <idle-timeout>3400</idle-timeout>
702     <installHw>false</installHw>
703     <instructions>
704         <instruction>
705             <order>0</order>
706             <apply-actions>
707                 <action>
708                     <order>0</order>
709                     <dec-nw-ttl/>
710                 </action>
711             </apply-actions>
712         </instruction>
713     </instructions>
714     <match>
715         <metadata>
716             <metadata>12345</metadata>
717             <metadata-mask>//FF</metadata-mask>
718         </metadata>
719     </match>
720 </flow>
721 ------------------------------------------------------
722
723 [[ipv6-src-dest-addresses-metadata-ip-dscp-ip-ecn-udp-src-dest-ports]]
724 ===== IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, UDP Src & Dest Ports
725
726 * Note that ethernet-type MUST be 34525
727
728 [source,xml]
729 -----------------------------------------------------------------------------
730 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
731 <flow xmlns="urn:opendaylight:flow:inventory">
732     <strict>false</strict>
733     <flow-name>FooXf21</flow-name>
734     <id>144</id>
735     <cookie_mask>255</cookie_mask>
736     <cookie>21</cookie>
737     <table_id>2</table_id>
738     <priority>2</priority>
739     <hard-timeout>1200</hard-timeout>
740     <idle-timeout>3400</idle-timeout>
741     <installHw>false</installHw>
742     <instructions>
743         <instruction>
744             <order>0</order>
745             <apply-actions>
746                 <action>
747                     <order>0</order>
748                     <dec-nw-ttl/>
749                 </action>
750             </apply-actions>
751         </instruction>
752     </instructions>
753     <match>
754         <ethernet-match>
755             <ethernet-type>
756                 <type>34525</type>
757             </ethernet-type>
758         </ethernet-match>
759         <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76</ipv6-source>
760         <ipv6-destination>fe80::2acf:e9ff:fe21:6431/128</ipv6-destination>
761         <metadata>
762             <metadata>12345</metadata>
763         </metadata>
764         <ip-match>
765             <ip-protocol>17</ip-protocol>
766             <ip-dscp>8</ip-dscp>
767             <ip-ecn>3</ip-ecn>
768         </ip-match>
769         <udp-source-port>25364</udp-source-port>
770         <udp-destination-port>8080</udp-destination-port>
771     </match>
772 </flow>
773 -----------------------------------------------------------------------------
774
775 [[ipv6-src-dest-addresses-metadata-ip-dscp-ip-ecn-tcp-src-dest-ports]]
776 ===== IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, TCP Src & Dest Ports
777
778 * Note that ethernet-type MUST be 34525
779 * Note that IP Protocol MUST be 6
780
781 [source,xml]
782 -----------------------------------------------------------------------------
783 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
784 <flow xmlns="urn:opendaylight:flow:inventory">
785     <strict>false</strict>
786     <flow-name>FooXf22</flow-name>
787     <id>145</id>
788     <cookie_mask>255</cookie_mask>
789     <cookie>22</cookie>
790     <table_id>2</table_id>
791     <priority>2</priority>
792     <hard-timeout>1200</hard-timeout>
793     <idle-timeout>3400</idle-timeout>
794     <installHw>false</installHw>
795     <instructions>
796         <instruction>
797             <order>0</order>
798             <apply-actions>
799                 <action>
800                     <order>0</order>
801                     <dec-nw-ttl/>
802                 </action>
803             </apply-actions>
804         </instruction>
805     </instructions>
806     <match>
807         <ethernet-match>
808             <ethernet-type>
809                 <type>34525</type>
810             </ethernet-type>
811         </ethernet-match>
812         <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76</ipv6-source>
813         <ipv6-destination>fe80:2acf:e9ff:fe21::6431/94</ipv6-destination>
814         <metadata>
815             <metadata>12345</metadata>
816         </metadata>
817         <ip-match>
818             <ip-protocol>6</ip-protocol>
819             <ip-dscp>60</ip-dscp>
820             <ip-ecn>3</ip-ecn>
821         </ip-match>
822         <tcp-source-port>183</tcp-source-port>
823         <tcp-destination-port>8080</tcp-destination-port>
824     </match>
825 </flow>
826 -----------------------------------------------------------------------------
827
828 [[ipv6-src-dest-addresses-metadata-ip-dscp-ip-ecn-tcp-src-dest-ports-ipv6-label]]
829 ===== IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, TCP Src & Dest Ports, IPv6 Label
830
831 * Note that ethernet-type MUST be 34525
832 * Note that IP Protocol MUST be 6
833
834 [source,xml]
835 -----------------------------------------------------------------------------
836 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
837 <flow xmlns="urn:opendaylight:flow:inventory">
838     <strict>false</strict>
839     <flow-name>FooXf23</flow-name>
840     <id>146</id>
841     <cookie_mask>255</cookie_mask>
842     <cookie>23</cookie>
843     <table_id>2</table_id>
844     <priority>2</priority>
845     <hard-timeout>1200</hard-timeout>
846     <idle-timeout>3400</idle-timeout>
847     <installHw>false</installHw>
848     <instructions>
849         <instruction>
850             <order>0</order>
851             <apply-actions>
852                 <action>
853                     <order>0</order>
854                     <dec-nw-ttl/>
855                 </action>
856             </apply-actions>
857         </instruction>
858     </instructions>
859     <match>
860         <ethernet-match>
861             <ethernet-type>
862                 <type>34525</type>
863             </ethernet-type>
864         </ethernet-match>
865         <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76</ipv6-source>
866         <ipv6-destination>fe80:2acf:e9ff:fe21::6431/94</ipv6-destination>
867         <metadata>
868             <metadata>12345</metadata>
869         </metadata>
870         <ipv6-label>
871             <ipv6-flabel>33</ipv6-flabel>
872         </ipv6-label>
873         <ip-match>
874             <ip-protocol>6</ip-protocol>
875             <ip-dscp>60</ip-dscp>
876             <ip-ecn>3</ip-ecn>
877         </ip-match>
878         <tcp-source-port>183</tcp-source-port>
879         <tcp-destination-port>8080</tcp-destination-port>
880     </match>
881 </flow>
882 -----------------------------------------------------------------------------
883
884 [[tunnel-id]]
885 ===== Tunnel ID
886
887 [source,xml]
888 ------------------------------------------------------
889 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
890 <flow xmlns="urn:opendaylight:flow:inventory">
891     <strict>false</strict>
892     <flow-name>FooXf24</flow-name>
893     <id>147</id>
894     <cookie_mask>255</cookie_mask>
895     <cookie>24</cookie>
896     <table_id>2</table_id>
897     <priority>2</priority>
898     <hard-timeout>1200</hard-timeout>
899     <idle-timeout>3400</idle-timeout>
900     <installHw>false</installHw>
901     <instructions>
902         <instruction>
903             <order>0</order>
904             <apply-actions>
905                 <action>
906                     <order>0</order>
907                     <dec-nw-ttl/>
908                 </action>
909             </apply-actions>
910         </instruction>
911     </instructions>
912     <match>
913         <tunnel>
914             <tunnel-id>2591</tunnel-id>
915         </tunnel>
916     </match>
917 </flow>
918 ------------------------------------------------------
919
920 [[ipv6-src-dest-addresses-metadata-ip-dscp-ip-ecn-icmpv6-type-code-ipv6-label]]
921 ===== IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, ICMPv6 Type & Code, IPv6 Label
922
923 * Note that ethernet-type MUST be 34525
924 * Note that IP Protocol MUST be 58
925
926 [source,xml]
927 -----------------------------------------------------------------------------
928 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
929 <flow xmlns="urn:opendaylight:flow:inventory">
930     <strict>false</strict>
931     <flow-name>FooXf25</flow-name>
932     <id>148</id>
933     <cookie_mask>255</cookie_mask>
934     <cookie>25</cookie>
935     <table_id>2</table_id>
936     <priority>2</priority>
937     <hard-timeout>1200</hard-timeout>
938     <idle-timeout>3400</idle-timeout>
939     <installHw>false</installHw>
940     <instructions>
941         <instruction>
942             <order>0</order>
943             <apply-actions>
944                 <action>
945                     <order>0</order>
946                     <dec-nw-ttl/>
947                 </action>
948             </apply-actions>
949         </instruction>
950     </instructions>
951     <match>
952         <ethernet-match>
953             <ethernet-type>
954                 <type>34525</type>
955             </ethernet-type>
956         </ethernet-match>
957         <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76</ipv6-source>
958         <ipv6-destination>fe80:2acf:e9ff:fe21::6431/94</ipv6-destination>
959         <metadata>
960             <metadata>12345</metadata>
961         </metadata>
962         <ipv6-label>
963             <ipv6-flabel>33</ipv6-flabel>
964         </ipv6-label>
965         <ip-match>
966             <ip-protocol>58</ip-protocol>
967             <ip-dscp>60</ip-dscp>
968             <ip-ecn>3</ip-ecn>
969         </ip-match>
970         <icmpv6-match>
971             <icmpv6-type>6</icmpv6-type>
972             <icmpv6-code>3</icmpv6-code>
973         </icmpv6-match>
974     </match>
975 </flow>
976 -----------------------------------------------------------------------------
977
978 [[ipv6-src-dest-addresses-metadata-ip-dscp-ip-ecn-tcp-src-dst-ports-ipv6-label-ipv6-ext-header]]
979 ===== IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, TCP Src & Dst Ports, IPv6 Label, IPv6 Ext Header
980
981 * Note that ethernet-type MUST be 34525
982 * Note that IP Protocol MUST be 58
983
984 [source,xml]
985 -----------------------------------------------------------------------------
986 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
987 <flow xmlns="urn:opendaylight:flow:inventory">
988     <strict>false</strict>
989     <flow-name>FooXf27</flow-name>
990     <id>150</id>
991     <cookie_mask>255</cookie_mask>
992     <cookie>27</cookie>
993     <table_id>2</table_id>
994     <priority>2</priority>
995     <hard-timeout>1200</hard-timeout>
996     <idle-timeout>3400</idle-timeout>
997     <installHw>false</installHw>
998     <instructions>
999         <instruction>
1000             <order>0</order>
1001             <apply-actions>
1002                 <action>
1003                     <order>0</order>
1004                     <dec-nw-ttl/>
1005                 </action>
1006             </apply-actions>
1007         </instruction>
1008     </instructions>
1009     <match>
1010         <ethernet-match>
1011             <ethernet-type>
1012                 <type>34525</type>
1013             </ethernet-type>
1014         </ethernet-match>
1015         <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76</ipv6-source>
1016         <ipv6-destination>fe80:2acf:e9ff:fe21::6431/94</ipv6-destination>
1017         <metadata>
1018             <metadata>12345</metadata>
1019         </metadata>
1020         <ipv6-label>
1021             <ipv6-flabel>33</ipv6-flabel>
1022         </ipv6-label>
1023         <ipv6-ext-header>
1024             <ipv6-exthdr>0</ipv6-exthdr>
1025         </ipv6-ext-header>
1026         <ip-match>
1027             <ip-protocol>6</ip-protocol>
1028             <ip-dscp>60</ip-dscp>
1029             <ip-ecn>3</ip-ecn>
1030         </ip-match>
1031         <tcp-source-port>183</tcp-source-port>
1032         <tcp-destination-port>8080</tcp-destination-port>
1033     </match>
1034 </flow>
1035 -----------------------------------------------------------------------------
1036
1037 [[actions]]
1038 ==== Actions
1039
1040 The format of the XML that describes OpenFlow actions is determined by
1041 the opendaylight-action-types yang model: .
1042
1043 The RESTCONF documentation for the match-types yang model can be found
1044 at
1045 https://jenkins.opendaylight.org/controller/job/controller-merge/lastSuccessfulBuild/artifact/opendaylight/md-sal/model/model-flow-base/target/site/models/opendaylight-action-types.html[opendaylight-action-types.html]
1046
1047 [[apply-actions]]
1048 ===== Apply Actions
1049
1050 [[output-to-table]]
1051 ====== Output to TABLE
1052
1053 [source,xml]
1054 -----------------------------------------------------------------------------
1055 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1056 <flow xmlns="urn:opendaylight:flow:inventory">
1057     <strict>false</strict>
1058     <flow-name>FooXf101</flow-name>
1059     <id>256</id>
1060     <cookie_mask>255</cookie_mask>
1061     <cookie>101</cookie>
1062     <table_id>2</table_id>
1063     <priority>2</priority>
1064     <hard-timeout>1200</hard-timeout>
1065     <idle-timeout>3400</idle-timeout>
1066     <installHw>false</installHw>
1067     <instructions>
1068         <instruction>
1069             <order>0</order>
1070             <apply-actions>
1071                 <action>
1072                     <order>0</order>
1073                     <output-action>
1074                         <output-node-connector>TABLE</output-node-connector>
1075                         <max-length>60</max-length>
1076                     </output-action>
1077                 </action>
1078             </apply-actions>
1079         </instruction>
1080     </instructions>
1081     <match>
1082         <ethernet-match>
1083             <ethernet-type>
1084                 <type>34525</type>
1085             </ethernet-type>
1086         </ethernet-match>
1087         <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76</ipv6-source>
1088         <ipv6-destination>fe80:2acf:e9ff:fe21::6431/94</ipv6-destination>
1089         <metadata>
1090             <metadata>12345</metadata>
1091         </metadata>
1092         <ip-match>
1093             <ip-protocol>6</ip-protocol>
1094             <ip-dscp>60</ip-dscp>
1095             <ip-ecn>3</ip-ecn>
1096         </ip-match>
1097         <tcp-source-port>183</tcp-source-port>
1098         <tcp-destination-port>8080</tcp-destination-port>
1099     </match>
1100 </flow>
1101 -----------------------------------------------------------------------------
1102
1103 [[output-to-inport]]
1104 ====== Output to INPORT
1105
1106 [source,xml]
1107 -----------------------------------------------------------------------------
1108 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1109 <flow xmlns="urn:opendaylight:flow:inventory">
1110     <strict>false</strict>
1111     <flow-name>FooXf102</flow-name>
1112     <id>257</id>
1113     <cookie_mask>255</cookie_mask>
1114     <cookie>102</cookie>
1115     <table_id>2</table_id>
1116     <priority>2</priority>
1117     <hard-timeout>1200</hard-timeout>
1118     <idle-timeout>3400</idle-timeout>
1119     <installHw>false</installHw>
1120     <instructions>
1121         <instruction>
1122             <order>0</order>
1123             <apply-actions>
1124                 <action>
1125                     <order>0</order>
1126                     <output-action>
1127                         <output-node-connector>INPORT</output-node-connector>
1128                         <max-length>60</max-length>
1129                     </output-action>
1130                 </action>
1131 7            </apply-actions>
1132         </instruction>
1133     </instructions>
1134     <match>
1135         <ethernet-match>
1136             <ethernet-type>
1137                 <type>2048</type>
1138             </ethernet-type>
1139             <ethernet-destination>
1140                 <address>ff:ff:29:01:19:61</address>
1141             </ethernet-destination>
1142             <ethernet-source>
1143                 <address>00:00:00:11:23:ae</address>
1144             </ethernet-source>
1145         </ethernet-match>
1146         <ipv4-source>17.1.2.3/8</ipv4-source>
1147         <ipv4-destination>172.168.5.6/16</ipv4-destination>
1148         <ip-match>
1149             <ip-protocol>6</ip-protocol>
1150             <ip-dscp>2</ip-dscp>
1151             <ip-ecn>2</ip-ecn>
1152         </ip-match>
1153         <tcp-source-port>25364</tcp-source-port>
1154         <tcp-destination-port>8080</tcp-destination-port>
1155     </match>
1156 </flow>
1157 -----------------------------------------------------------------------------
1158
1159 [[output-to-physical-port]]
1160 ====== Output to Physical Port
1161
1162 [source,xml]
1163 ------------------------------------------------------------------------
1164 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1165 <flow xmlns="urn:opendaylight:flow:inventory">
1166     <strict>false</strict>
1167     <flow-name>FooXf103</flow-name>
1168     <id>258</id>
1169     <cookie_mask>255</cookie_mask>
1170     <cookie>103</cookie>
1171     <table_id>2</table_id>
1172     <priority>2</priority>
1173     <hard-timeout>1200</hard-timeout>
1174     <idle-timeout>3400</idle-timeout>
1175     <installHw>false</installHw>
1176     <instructions>
1177         <instruction>
1178             <order>0</order>
1179             <apply-actions>
1180                 <action>
1181                     <order>0</order>
1182                     <output-action>
1183                         <output-node-connector>1</output-node-connector>
1184                         <max-length>60</max-length>
1185                     </output-action>
1186                 </action>
1187             </apply-actions>
1188         </instruction>
1189     </instructions>
1190     <match>
1191         <ethernet-match>
1192             <ethernet-type>
1193                 <type>2048</type>
1194             </ethernet-type>
1195             <ethernet-destination>
1196                 <address>ff:ff:29:01:19:61</address>
1197             </ethernet-destination>
1198             <ethernet-source>
1199                 <address>00:00:00:11:23:ae</address>
1200             </ethernet-source>
1201         </ethernet-match>
1202         <ipv4-source>17.1.2.3/8</ipv4-source>
1203         <ipv4-destination>172.168.5.6/16</ipv4-destination>
1204         <ip-match>
1205             <ip-protocol>6</ip-protocol>
1206             <ip-dscp>2</ip-dscp>
1207             <ip-ecn>2</ip-ecn>
1208         </ip-match>
1209         <tcp-source-port>25364</tcp-source-port>
1210         <tcp-destination-port>8080</tcp-destination-port>
1211     </match>
1212 </flow>
1213 ------------------------------------------------------------------------
1214
1215 [[output-to-local]]
1216 ====== Output to LOCAL
1217
1218 [source,xml]
1219 -----------------------------------------------------------------------------
1220 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1221 <flow xmlns="urn:opendaylight:flow:inventory">
1222     <strict>false</strict>
1223     <flow-name>FooXf104</flow-name>
1224     <id>259</id>
1225     <cookie_mask>255</cookie_mask>
1226     <cookie>104</cookie>
1227     <table_id>2</table_id>
1228     <priority>2</priority>
1229     <hard-timeout>1200</hard-timeout>
1230     <idle-timeout>3400</idle-timeout>
1231     <installHw>false</installHw>
1232     <instructions>
1233         <instruction>
1234             <order>0</order>
1235             <apply-actions>
1236                 <action>
1237                     <order>0</order>
1238                     <output-action>
1239                         <output-node-connector>LOCAL</output-node-connector>
1240                         <max-length>60</max-length>
1241                     </output-action>
1242                 </action>
1243             </apply-actions>
1244         </instruction>
1245     </instructions>
1246     <match>
1247         <ethernet-match>
1248             <ethernet-type>
1249                 <type>34525</type>
1250             </ethernet-type>
1251         </ethernet-match>
1252         <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76</ipv6-source>
1253         <ipv6-destination>fe80:2acf:e9ff:fe21::6431/94</ipv6-destination>
1254         <metadata>
1255             <metadata>12345</metadata>
1256         </metadata>
1257         <ip-match>
1258             <ip-protocol>6</ip-protocol>
1259             <ip-dscp>60</ip-dscp>
1260             <ip-ecn>3</ip-ecn>
1261         </ip-match>
1262         <tcp-source-port>183</tcp-source-port>
1263         <tcp-destination-port>8080</tcp-destination-port>
1264     </match>
1265 </flow>
1266 -----------------------------------------------------------------------------
1267
1268 [[output-to-normal]]
1269 ====== Output to NORMAL
1270
1271 [source,xml]
1272 -----------------------------------------------------------------------------
1273 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1274 <flow xmlns="urn:opendaylight:flow:inventory">
1275     <strict>false</strict>
1276     <flow-name>FooXf105</flow-name>
1277     <id>260</id>
1278     <cookie_mask>255</cookie_mask>
1279     <cookie>105</cookie>
1280     <table_id>2</table_id>
1281     <priority>2</priority>
1282     <hard-timeout>1200</hard-timeout>
1283     <idle-timeout>3400</idle-timeout>
1284     <installHw>false</installHw>
1285     <instructions>
1286         <instruction>
1287             <order>0</order>
1288             <apply-actions>
1289                 <action>
1290                     <order>0</order>
1291                     <output-action>
1292                         <output-node-connector>NORMAL</output-node-connector>
1293                         <max-length>60</max-length>
1294                     </output-action>
1295                 </action>
1296             </apply-actions>
1297         </instruction>
1298     </instructions>
1299     <match>
1300         <ethernet-match>
1301             <ethernet-type>
1302                 <type>34525</type>
1303             </ethernet-type>
1304         </ethernet-match>
1305         <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/84</ipv6-source>
1306         <ipv6-destination>fe80:2acf:e9ff:fe21::6431/90</ipv6-destination>
1307         <metadata>
1308             <metadata>12345</metadata>
1309         </metadata>
1310         <ip-match>
1311             <ip-protocol>6</ip-protocol>
1312             <ip-dscp>45</ip-dscp>
1313             <ip-ecn>2</ip-ecn>
1314         </ip-match>
1315         <tcp-source-port>20345</tcp-source-port>
1316         <tcp-destination-port>80</tcp-destination-port>
1317     </match>
1318 </flow>
1319 -----------------------------------------------------------------------------
1320
1321 [[output-to-flood]]
1322 ====== Output to FLOOD
1323
1324 [source,xml]
1325 ------------------------------------------------------------------------------
1326 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1327 <flow xmlns="urn:opendaylight:flow:inventory">
1328     <strict>false</strict>
1329     <flow-name>FooXf106</flow-name>
1330     <id>261</id>
1331     <cookie_mask>255</cookie_mask>
1332     <cookie>106</cookie>
1333     <table_id>2</table_id>
1334     <priority>2</priority>
1335     <hard-timeout>1200</hard-timeout>
1336     <idle-timeout>3400</idle-timeout>
1337     <installHw>false</installHw>
1338     <instructions>
1339         <instruction>
1340             <order>0</order>
1341             <apply-actions>
1342                 <action>
1343                     <order>0</order>
1344                     <output-action>
1345                         <output-node-connector>FLOOD</output-node-connector>
1346                         <max-length>60</max-length>
1347                     </output-action>
1348                 </action>
1349             </apply-actions>
1350         </instruction>
1351     </instructions>
1352     <match>
1353         <ethernet-match>
1354             <ethernet-type>
1355                 <type>34525</type>
1356             </ethernet-type>
1357         </ethernet-match>
1358         <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/100</ipv6-source>
1359         <ipv6-destination>fe80:2acf:e9ff:fe21::6431/67</ipv6-destination>
1360         <metadata>
1361             <metadata>12345</metadata>
1362         </metadata>
1363         <ip-match>
1364             <ip-protocol>6</ip-protocol>
1365             <ip-dscp>45</ip-dscp>
1366             <ip-ecn>2</ip-ecn>
1367         </ip-match>
1368         <tcp-source-port>20345</tcp-source-port>
1369         <tcp-destination-port>80</tcp-destination-port>
1370     </match>
1371 </flow>
1372 ------------------------------------------------------------------------------
1373
1374 [[output-to-all]]
1375 ====== Output to ALL
1376
1377 [source,xml]
1378 --------------------------------------------------------------------------
1379 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1380 <flow xmlns="urn:opendaylight:flow:inventory">
1381     <strict>false</strict>
1382     <flow-name>FooXf107</flow-name>
1383     <id>262</id>
1384     <cookie_mask>255</cookie_mask>
1385     <cookie>107</cookie>
1386     <table_id>2</table_id>
1387     <priority>2</priority>
1388     <hard-timeout>1200</hard-timeout>
1389     <idle-timeout>3400</idle-timeout>
1390     <installHw>false</installHw>
1391     <instructions>
1392         <instruction>
1393             <order>0</order>
1394             <apply-actions>
1395                 <action>
1396                     <order>0</order>
1397                     <output-action>
1398                         <output-node-connector>ALL</output-node-connector>
1399                         <max-length>60</max-length>
1400                     </output-action>
1401                 </action>
1402             </apply-actions>
1403         </instruction>
1404     </instructions>
1405     <match>
1406         <ethernet-match>
1407             <ethernet-type>
1408                 <type>2048</type>
1409             </ethernet-type>
1410             <ethernet-destination>
1411                 <address>20:14:29:01:19:61</address>
1412             </ethernet-destination>
1413             <ethernet-source>
1414                 <address>00:00:00:11:23:ae</address>
1415             </ethernet-source>
1416         </ethernet-match>
1417         <ipv4-source>19.1.2.3/10</ipv4-source>
1418         <ipv4-destination>172.168.5.6/18</ipv4-destination>
1419         <ip-match>
1420             <ip-protocol>17</ip-protocol>
1421             <ip-dscp>8</ip-dscp>
1422             <ip-ecn>3</ip-ecn>
1423         </ip-match>
1424         <udp-source-port>25364</udp-source-port>
1425         <udp-destination-port>8080</udp-destination-port>
1426         <in-port>0</in-port>
1427     </match>
1428 </flow>
1429 --------------------------------------------------------------------------
1430
1431 [[output-to-controller]]
1432 ====== Output to CONTROLLER
1433
1434 [source,xml]
1435 ---------------------------------------------------------------------------------
1436 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1437 <flow xmlns="urn:opendaylight:flow:inventory">
1438     <strict>false</strict>
1439     <flow-name>FooXf108</flow-name>
1440     <id>263</id>
1441     <cookie_mask>255</cookie_mask>
1442     <cookie>108</cookie>
1443     <table_id>2</table_id>
1444     <priority>2</priority>
1445     <hard-timeout>1200</hard-timeout>
1446     <idle-timeout>3400</idle-timeout>
1447     <installHw>false</installHw>
1448     <instructions>
1449         <instruction>
1450             <order>0</order>
1451             <apply-actions>
1452                 <action>
1453                     <order>0</order>
1454                     <output-action>
1455                         <output-node-connector>CONTROLLER</output-node-connector>
1456                         <max-length>60</max-length>
1457                     </output-action>
1458                 </action>
1459             </apply-actions>
1460         </instruction>
1461     </instructions>
1462     <match>
1463         <ethernet-match>
1464             <ethernet-type>
1465                 <type>2048</type>
1466             </ethernet-type>
1467             <ethernet-destination>
1468                 <address>20:14:29:01:19:61</address>
1469             </ethernet-destination>
1470             <ethernet-source>
1471                 <address>00:00:00:11:23:ae</address>
1472             </ethernet-source>
1473         </ethernet-match>
1474         <ipv4-source>19.1.2.3/10</ipv4-source>
1475         <ipv4-destination>172.168.5.6/18</ipv4-destination>
1476         <ip-match>
1477             <ip-protocol>17</ip-protocol>
1478             <ip-dscp>8</ip-dscp>
1479             <ip-ecn>3</ip-ecn>
1480         </ip-match>
1481         <udp-source-port>25364</udp-source-port>
1482         <udp-destination-port>8080</udp-destination-port>
1483         <in-port>0</in-port>
1484     </match>
1485 </flow>
1486 ---------------------------------------------------------------------------------
1487
1488 [[output-to-any]]
1489 ====== Output to ANY
1490
1491 [source,xml]
1492 --------------------------------------------------------------------------
1493 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1494 <flow xmlns="urn:opendaylight:flow:inventory">
1495     <strict>false</strict>
1496     <flow-name>FooXf109</flow-name>
1497     <id>264</id>
1498     <cookie_mask>255</cookie_mask>
1499     <cookie>109</cookie>
1500     <table_id>2</table_id>
1501     <priority>2</priority>
1502     <hard-timeout>1200</hard-timeout>
1503     <idle-timeout>3400</idle-timeout>
1504     <installHw>false</installHw>
1505     <instructions>
1506         <instruction>
1507             <order>0</order>
1508             <apply-actions>
1509                 <action>
1510                     <order>0</order>
1511                     <output-action>
1512                         <output-node-connector>ANY</output-node-connector>
1513                         <max-length>60</max-length>
1514                     </output-action>
1515                 </action>
1516             </apply-actions>
1517         </instruction>
1518     </instructions>
1519     <match>
1520         <ethernet-match>
1521             <ethernet-type>
1522                 <type>2048</type>
1523             </ethernet-type>
1524             <ethernet-destination>
1525                 <address>20:14:29:01:19:61</address>
1526             </ethernet-destination>
1527             <ethernet-source>
1528                 <address>00:00:00:11:23:ae</address>
1529             </ethernet-source>
1530         </ethernet-match>
1531         <ipv4-source>19.1.2.3/10</ipv4-source>
1532         <ipv4-destination>172.168.5.6/18</ipv4-destination>
1533         <ip-match>
1534             <ip-protocol>17</ip-protocol>
1535             <ip-dscp>8</ip-dscp>
1536             <ip-ecn>3</ip-ecn>
1537         </ip-match>
1538         <udp-source-port>25364</udp-source-port>
1539         <udp-destination-port>8080</udp-destination-port>
1540         <in-port>0</in-port>
1541     </match>
1542 </flow>
1543 --------------------------------------------------------------------------
1544
1545 [[push-vlan]]
1546 ====== Push VLAN
1547
1548 [source,xml]
1549 -----
1550 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1551 <flow xmlns="urn:opendaylight:flow:inventory">
1552    <strict>false</strict>
1553    <instructions>
1554        <instruction>
1555            <order>0</order>
1556            <apply-actions>
1557               <action>
1558                  <push-vlan-action>
1559                      <ethernet-type>33024</ethernet-type>
1560                  </push-vlan-action>
1561                  <order>0</order>
1562               </action>
1563                <action>
1564                    <set-field>
1565                        <vlan-match>
1566                             <vlan-id>
1567                                 <vlan-id>79</vlan-id>
1568                                 <vlan-id-present>true</vlan-id-present>
1569                             </vlan-id>
1570                        </vlan-match>
1571                    </set-field>
1572                    <order>1</order>
1573                </action>
1574                <action>
1575                    <output-action>
1576                        <output-node-connector>5</output-node-connector>
1577                    </output-action>
1578                    <order>2</order>
1579                </action>
1580            </apply-actions>
1581        </instruction>
1582    </instructions>
1583    <table_id>0</table_id>
1584    <id>31</id>
1585    <match>
1586        <ethernet-match>
1587            <ethernet-type>
1588                <type>2048</type>
1589            </ethernet-type>
1590            <ethernet-destination>
1591                <address>FF:FF:29:01:19:61</address>
1592            </ethernet-destination>
1593            <ethernet-source>
1594                <address>00:00:00:11:23:AE</address>
1595            </ethernet-source>
1596        </ethernet-match>
1597      <in-port>1</in-port>
1598    </match>
1599    <flow-name>vlan_flow</flow-name>
1600    <priority>2</priority>
1601 </flow>
1602 -----
1603
1604 [[push-mpls]]
1605 ====== Push MPLS
1606
1607 [source,xml]
1608 ------------------------------------------------------------------------
1609 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1610 <flow
1611     xmlns="urn:opendaylight:flow:inventory">
1612     <flow-name>push-mpls-action</flow-name>
1613     <instructions>
1614         <instruction>
1615             <order>3</order>
1616             <apply-actions>
1617                 <action>
1618                     <push-mpls-action>
1619                         <ethernet-type>34887</ethernet-type>
1620                     </push-mpls-action>
1621                     <order>0</order>
1622                 </action>
1623                 <action>
1624                     <set-field>
1625                         <protocol-match-fields>
1626                             <mpls-label>27</mpls-label>
1627                         </protocol-match-fields>
1628                     </set-field>
1629                     <order>1</order>
1630                 </action>
1631                 <action>
1632                     <output-action>
1633                         <output-node-connector>2</output-node-connector>
1634                     </output-action>
1635                     <order>2</order>
1636                 </action>
1637             </apply-actions>
1638         </instruction>
1639     </instructions>
1640     <strict>false</strict>
1641     <id>100</id>
1642     <match>
1643         <ethernet-match>
1644             <ethernet-type>
1645                 <type>2048</type>
1646             </ethernet-type>
1647         </ethernet-match>
1648         <in-port>1</in-port>
1649         <ipv4-destination>10.0.0.4/32</ipv4-destination>
1650     </match>
1651     <idle-timeout>0</idle-timeout>
1652     <cookie_mask>255</cookie_mask>
1653     <cookie>401</cookie>
1654     <priority>8</priority>
1655     <hard-timeout>0</hard-timeout>
1656     <installHw>false</installHw>
1657     <table_id>0</table_id>
1658 </flow>
1659 ------------------------------------------------------------------------
1660
1661 [[swap-mpls]]
1662 ====== Swap MPLS
1663
1664 * Note that ethernet-type MUST be 34887
1665
1666 [source,xml]
1667 ------------------------------------------------------------------------
1668 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1669 <flow
1670     xmlns="urn:opendaylight:flow:inventory">
1671     <flow-name>push-mpls-action</flow-name>
1672     <instructions>
1673         <instruction>
1674             <order>2</order>
1675             <apply-actions>
1676                 <action>
1677                     <set-field>
1678                         <protocol-match-fields>
1679                             <mpls-label>37</mpls-label>
1680                         </protocol-match-fields>
1681                     </set-field>
1682                     <order>1</order>
1683                 </action>
1684                 <action>
1685                     <output-action>
1686                         <output-node-connector>2</output-node-connector>
1687                     </output-action>
1688                     <order>2</order>
1689                 </action>
1690             </apply-actions>
1691         </instruction>
1692     </instructions>
1693     <strict>false</strict>
1694     <id>101</id>
1695     <match>
1696         <ethernet-match>
1697             <ethernet-type>
1698                 <type>34887</type>
1699             </ethernet-type>
1700         </ethernet-match>
1701         <in-port>1</in-port>
1702         <protocol-match-fields>
1703             <mpls-label>27</mpls-label>
1704         </protocol-match-fields>
1705     </match>
1706     <idle-timeout>0</idle-timeout>
1707     <cookie_mask>255</cookie_mask>
1708     <cookie>401</cookie>
1709     <priority>8</priority>
1710     <hard-timeout>0</hard-timeout>
1711     <installHw>false</installHw>
1712     <table_id>0</table_id>
1713 </flow>
1714 ------------------------------------------------------------------------
1715
1716 [[pop-mpls]]
1717 ====== Pop MPLS
1718
1719 * Note that ethernet-type MUST be 34887
1720 * Issue with OVS 2.1
1721 http://git.openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=b3f2fc93e3f357f8d05a92f53ec253339a40887f[OVS
1722 fix]
1723
1724 [source,xml]
1725 ------------------------------------------------------------------------
1726 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1727 <flow
1728     xmlns="urn:opendaylight:flow:inventory">
1729     <flow-name>FooXf10</flow-name>
1730     <instructions>
1731         <instruction>
1732             <order>0</order>
1733             <apply-actions>
1734                 <action>
1735                     <pop-mpls-action>
1736                         <ethernet-type>2048</ethernet-type>
1737                     </pop-mpls-action>
1738                     <order>1</order>
1739                 </action>
1740                 <action>
1741                     <output-action>
1742                         <output-node-connector>2</output-node-connector>
1743                         <max-length>60</max-length>
1744                     </output-action>
1745                     <order>2</order>
1746                 </action>
1747             </apply-actions>
1748         </instruction>
1749     </instructions>
1750     <id>11</id>
1751     <strict>false</strict>
1752     <match>
1753         <ethernet-match>
1754             <ethernet-type>
1755                 <type>34887</type>
1756             </ethernet-type>
1757         </ethernet-match>
1758         <in-port>1</in-port>
1759         <protocol-match-fields>
1760             <mpls-label>37</mpls-label>
1761         </protocol-match-fields>
1762     </match>
1763     <idle-timeout>0</idle-timeout>
1764     <cookie>889</cookie>
1765     <cookie_mask>255</cookie_mask>
1766     <installHw>false</installHw>
1767     <hard-timeout>0</hard-timeout>
1768     <priority>10</priority>
1769     <table_id>0</table_id>
1770 </flow>
1771 ------------------------------------------------------------------------
1772
1773 [[learn]]
1774 ====== Learn
1775 * Nicira extension defined in https://github.com/osrg/openvswitch/blob/master/include/openflow/nicira-ext.h 
1776 * Example section is - https://github.com/osrg/openvswitch/blob/master/include/openflow/nicira-ext.h#L788
1777
1778 [source,xml]
1779 ------------------------------------------------------------------------
1780 <flow>
1781   <id>ICMP_Ingress258a5a5ad-08a8-4ff7-98f5-ef0b96ca3bb8</id>
1782   <hard-timeout>0</hard-timeout>
1783   <idle-timeout>0</idle-timeout>
1784   <match>
1785     <ethernet-match>
1786       <ethernet-type>
1787         <type>2048</type>
1788       </ethernet-type>
1789     </ethernet-match>
1790     <metadata>
1791       <metadata>2199023255552</metadata>
1792       <metadata-mask>2305841909702066176</metadata-mask>
1793     </metadata>
1794     <ip-match>
1795       <ip-protocol>1</ip-protocol>
1796     </ip-match>
1797   </match>
1798   <cookie>110100480</cookie>
1799   <instructions>
1800     <instruction>
1801       <order>0</order>
1802       <apply-actions>
1803         <action>
1804           <order>1</order>
1805           <nx-resubmit
1806             xmlns="urn:opendaylight:openflowplugin:extension:nicira:action">
1807             <table>220</table>
1808           </nx-resubmit>
1809         </action>
1810         <action>
1811           <order>0</order>
1812           <nx-learn
1813             xmlns="urn:opendaylight:openflowplugin:extension:nicira:action">
1814             <idle-timeout>60</idle-timeout>
1815             <fin-idle-timeout>0</fin-idle-timeout>
1816             <hard-timeout>60</hard-timeout>
1817             <flags>0</flags>
1818             <table-id>41</table-id>
1819             <priority>61010</priority>
1820             <fin-hard-timeout>0</fin-hard-timeout>
1821             <flow-mods>
1822               <flow-mod-add-match-from-value>
1823                 <src-ofs>0</src-ofs>
1824                 <value>2048</value>
1825                 <src-field>1538</src-field>
1826                 <flow-mod-num-bits>16</flow-mod-num-bits>
1827               </flow-mod-add-match-from-value>
1828             </flow-mods>
1829             <flow-mods>
1830               <flow-mod-add-match-from-field>
1831                 <src-ofs>0</src-ofs>
1832                 <dst-ofs>0</dst-ofs>
1833                 <dst-field>4100</dst-field>
1834                 <src-field>3588</src-field>
1835                 <flow-mod-num-bits>32</flow-mod-num-bits>
1836               </flow-mod-add-match-from-field>
1837             </flow-mods>
1838             <flow-mods>
1839               <flow-mod-add-match-from-field>
1840                 <src-ofs>0</src-ofs>
1841                 <dst-ofs>0</dst-ofs>
1842                 <dst-field>518</dst-field>
1843                 <src-field>1030</src-field>
1844                 <flow-mod-num-bits>48</flow-mod-num-bits>
1845               </flow-mod-add-match-from-field>
1846             </flow-mods>
1847             <flow-mods>
1848               <flow-mod-add-match-from-field>
1849                 <src-ofs>0</src-ofs>
1850                 <dst-ofs>0</dst-ofs>
1851                 <dst-field>3073</dst-field>
1852                 <src-field>3073</src-field>
1853                 <flow-mod-num-bits>8</flow-mod-num-bits>
1854               </flow-mod-add-match-from-field>
1855             </flow-mods>
1856             <flow-mods>
1857               <flow-mod-copy-value-into-field>
1858                 <dst-ofs>0</dst-ofs>
1859                 <value>1</value>
1860                 <dst-field>65540</dst-field>
1861                 <flow-mod-num-bits>8</flow-mod-num-bits>
1862               </flow-mod-copy-value-into-field>
1863             </flow-mods>
1864             <cookie>110100480</cookie>
1865           </nx-learn>
1866         </action>
1867       </apply-actions>
1868     </instruction>
1869   </instructions>
1870   <installHw>true</installHw>
1871   <barrier>false</barrier>
1872   <strict>false</strict>
1873   <priority>61010</priority>
1874   <table_id>253</table_id>
1875   <flow-name>ACL</flow-name>
1876 </flow>
1877 ------------------------------------------------------------------------