.. _ofp-flow-examples: Flow Examples ------------- Overview ~~~~~~~~ The flow examples on this page are tested to work with OVS. Use, for example, POSTMAN with the following parameters: :: PUT http://:8181/restconf/config/opendaylight-inventory:nodes/node//table//flow/ - Accept: application/xml - Content-Type: application/xml For example: :: PUT http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/flow/127 Use RFC 8040 URL, for example, POSTMAN with the following parameters: :: PUT http://:8181/rests/data/opendaylight-inventory:nodes/node=/table=/flow= - Accept: application/json - Content-Type: application/json For example: :: PUT http://localhost:8181/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/table=2/flow=127 Make sure that the Table-# and Flow-# in the URL and in the XML match. The format of the flow-programming XML is determined by the grouping *flow* in the opendaylight-flow-types yang model: MISSING LINK. Match Examples ~~~~~~~~~~~~~~ The format of the XML that describes OpenFlow matches is determined by the opendaylight-match-types yang model: . IPv4 Dest Address ^^^^^^^^^^^^^^^^^ - Flow=124, Table=2, Priority=2, Instructions=\\{Apply\_Actions={dec\_nw\_ttl}}, match=\\{ipv4\_destination\_address=10.0.1.1/24} - Note that ethernet-type MUST be 2048 (0x800) .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 2 124 255 false 2048 10.0.1.1/24 12 1 34 FooXf1 2 false .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "124", "table_id": 2, "installHw": false, "barrier": false, "flow-name": "FooXf1", "strict": false, "idle-timeout": 34, "priority": 2, "hard-timeout": 12, "cookie_mask": 255, "match": { "ipv4-destination": "10.0.1.1/24", "ethernet-match": { "ethernet-type": { "type": 2048 } } }, "cookie": 1, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } Ethernet Src Address ^^^^^^^^^^^^^^^^^^^^ - Flow=126, Table=2, Priority=2, Instructions=\\{Apply\_Actions={drop}}, match=\\{ethernet-source=00:00:00:00:00:01} .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 2 126 255 false
00:00:00:00:00:01
12 3 34 FooXf3 2 false
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "126", "table_id": 2, "installHw": false, "barrier": false, "flow-name": "FooXf3", "strict": false, "idle-timeout": 34, "priority": 2, "hard-timeout": 12, "cookie_mask": 255, "match": { "ethernet-match": { "ethernet-source": { "address": "00:00:00:00:00:01" } } }, "cookie": 3, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "drop-action": {} } ] } } ] } } ] } Ethernet Src & Dest Addresses, Ethernet Type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Flow=127, Table=2, Priority=2, Instructions=\\{Apply\_Actions={drop}}, match=\\{ethernet-source=00:00:00:00:23:ae, ethernet-destination=ff:ff:ff:ff:ff:ff, ethernet-type=45} .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 2 127 255 false 45
ff:ff:ff:ff:ff:ff
00:00:00:00:23:ae
12 4 34 FooXf4 2 false
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "127", "table_id": 2, "installHw": false, "barrier": false, "flow-name": "FooXf4", "strict": false, "idle-timeout": 34, "priority": 2, "hard-timeout": 12, "cookie_mask": 255, "match": { "ethernet-match": { "ethernet-type": { "type": 45 }, "ethernet-source": { "address": "00:00:00:00:23:ae" }, "ethernet-destination": { "address": "ff:ff:ff:ff:ff:ff" } } }, "cookie": 4, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-mpls-ttl": {} } ] } } ] } } ] } Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, Input Port ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Note that ethernet-type MUST be 34887 (0x8847) .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 2 128 255 34887
ff:ff:ff:ff:ff:ff
00:00:00:00:23:ae
10.1.2.3/24 20.4.5.6/16 0
12 5 34 FooXf5 2 false
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "128", "table_id": 2, "barrier": false, "flow-name": "FooXf5", "strict": false, "idle-timeout": 34, "priority": 2, "hard-timeout": 12, "cookie_mask": 255, "match": { "ipv4-source": "10.1.2.3/24", "ipv4-destination": "20.4.5.6/16", "in-port": "0", "ethernet-match": { "ethernet-type": { "type": 34887 }, "ethernet-source": { "address": "00:00:00:00:23:ae" }, "ethernet-destination": { "address": "ff:ff:ff:ff:ff:ff" } } }, "cookie": 5, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-mpls-ttl": {} } ] } } ] } } ] } Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, IP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Protocol #, IP DSCP, IP ECN, Input Port - Note that ethernet-type MUST be 2048 (0x800) .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 2 130 255 2048
ff:ff:ff:ff:ff:aa
00:00:00:11:23:ae
10.1.2.3/24 20.4.5.6/16 56 15 1 0
12000 7 12000 FooXf7 2 false
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "130", "table_id": 2, "barrier": false, "flow-name": "FooXf7", "strict": false, "idle-timeout": 12000, "priority": 2, "hard-timeout": 12000, "cookie_mask": 255, "match": { "ipv4-source": "10.1.2.3/24", "ipv4-destination": "20.4.5.6/16", "ip-match": { "ip-dscp": 15, "ip-protocol": 56, "ip-ecn": 1 }, "in-port": "0", "ethernet-match": { "ethernet-type": { "type": 2048 }, "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-destination": { "address": "ff:ff:ff:ff:ff:aa" } } }, "cookie": 7, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, TCP Src & ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dest Ports, IP DSCP, IP ECN, Input Port - Note that ethernet-type MUST be 2048 (0x800) - Note that IP Protocol Type MUST be 6 .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 2 131 255 2048
ff:ff:29:01:19:61
00:00:00:11:23:ae
17.1.2.3/8 172.168.5.6/16 6 2 2 25364 8080 0
1200 8 3400 FooXf8 2 false
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "131", "table_id": 2, "barrier": false, "flow-name": "FooXf8", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "ipv4-source": "17.1.2.3/8", "ipv4-destination": "172.168.5.6/16", "ip-match": { "ip-dscp": 2, "ip-protocol": 6, "ip-ecn": 2 }, "in-port": "0", "tcp-source-port": 25364, "tcp-destination-port": 8080, "ethernet-match": { "ethernet-type": { "type": 2048 }, "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-destination": { "address": "ff:ff:29:01:19:61" } } }, "cookie": 8, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, UDP Src & ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Dest Ports, IP DSCP, IP ECN, Input Port - Note that ethernet-type MUST be 2048 (0x800) - Note that IP Protocol Type MUST be 17 .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 2 132 255 2048
20:14:29:01:19:61
00:00:00:11:23:ae
19.1.2.3/10 172.168.5.6/18 17 8 3 25364 8080 0
1200 9 3400 FooXf9 2 false
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "132", "table_id": 2, "barrier": false, "flow-name": "FooXf9", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "ipv4-source": "19.1.2.3/10", "ipv4-destination": "172.168.5.6/18", "ip-match": { "ip-dscp": 8, "ip-protocol": 17, "ip-ecn": 3 }, "in-port": "0", "udp-source-port": 25364, "udp-destination-port": 8080, "ethernet-match": { "ethernet-type": { "type": 2048 }, "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-destination": { "address": "20:14:29:01:19:61" } } }, "cookie": 9, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } Ethernet Src & Dest Addresses, IPv4 Src & Dest Addresses, ICMPv4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type & Code, IP DSCP, IP ECN, Input Port - Note that ethernet-type MUST be 2048 (0x800) - Note that IP Protocol Type MUST be 1 .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 2 134 255 2048
ff:ff:29:01:19:61
00:00:00:11:23:ae
17.1.2.3/8 172.168.5.6/16 1 27 3 6 3 0
1200 11 3400 FooXf11 2
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "134", "table_id": 2, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "ipv4-source": "17.1.2.3/8", "ipv4-destination": "172.168.5.6/16", "ip-match": { "ip-dscp": 27, "ip-protocol": 1, "ip-ecn": 3 }, "icmpv4-match": { "icmpv4-type": 6, "icmpv4-code": 3 }, "in-port": "0", "ethernet-match": { "ethernet-type": { "type": 2048 }, "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-destination": { "address": "ff:ff:29:01:19:61" } } }, "cookie": 11, "flow-name": "FooXf11", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] }, "idle-timeout": 3400 } ] } Ethernet Src & Dest Addresses, ARP Operation, ARP Src & Target ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Transport Addresses, ARP Src & Target Hw Addresses - Note that ethernet-type MUST be 2054 (0x806) .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 1 2 137 255 2054
ff:ff:ff:ff:FF:ff
00:00:FC:01:23:ae
1 192.168.4.1/10 10.21.22.23/25
12:34:56:78:98:AB
FE:DC:BA:98:76:54
12 14 34 FooXf14 2 false
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "137", "table_id": 2, "priority": 2, "hard-timeout": 12, "cookie_mask": 255, "match": { "arp-source-transport-address": "192.168.4.1/10", "arp-target-hardware-address": { "address": "FE:DC:BA:98:76:54" }, "arp-op": 1, "arp-source-hardware-address": { "address": "12:34:56:78:98:AB" }, "arp-target-transport-address": "10.21.22.23/25", "ethernet-match": { "ethernet-source": { "address": "00:00:FC:01:23:ae" }, "ethernet-type": { "type": 2054 }, "ethernet-destination": { "address": "ff:ff:ff:ff:FF:ff" } } }, "barrier": false, "cookie": 14, "flow-name": "FooXf14", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} }, { "order": 1, "dec-mpls-ttl": {} } ] } } ] }, "idle-timeout": 34 } ] } Ethernet Src & Dest Addresses, Ethernet Type, VLAN ID, VLAN PCP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. tabs:: .. tab:: XML .. code-block:: xml false 0 0 2 138 255 2048
ff:ff:29:01:19:61
00:00:00:11:23:ae
78 true 3
1200 15 3400 FooXf15 2 false
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "138", "table_id": 2, "barrier": false, "flow-name": "FooXf15", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "vlan-match": { "vlan-id": { "vlan-id-present": true, "vlan-id": 78 }, "vlan-pcp": 3 }, "ethernet-match": { "ethernet-type": { "type": 2048 }, "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-destination": { "address": "ff:ff:29:01:19:61" } } }, "cookie": 15, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } Ethernet Src & Dest Addresses, MPLS Label, MPLS TC, MPLS BoS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. tabs:: .. tab:: XML .. code-block:: xml FooXf17 140 255 17 1200 3400 2 2 false 0 0 34887
ff:ff:29:01:19:61
00:00:00:11:23:ae
567 3 1
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "140", "table_id": 2, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "protocol-match-fields": { "mpls-bos": 1, "mpls-tc": 3, "mpls-label": 567 }, "ethernet-match": { "ethernet-type": { "type": 34887 }, "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-destination": { "address": "ff:ff:29:01:19:61" } } }, "cookie": 17, "flow-name": "FooXf17", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] }, "idle-timeout": 3400 } ] } IPv6 Src & Dest Addresses ^^^^^^^^^^^^^^^^^^^^^^^^^ - Note that ethernet-type MUST be 34525 .. tabs:: .. tab:: XML .. code-block:: xml false FooXf18 141 255 18 2 2 1200 3400 false 0 0 34525 fe80::2acf:e9ff:fe21:6431/128 aabb:1234:2acf:e9ff::fe21:6431/64 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "141", "table_id": 2, "installHw": false, "flow-name": "FooXf18", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "ipv6-source": "fe80::2acf:e9ff:fe21:6431/128", "ipv6-destination": "aabb:1234:2acf:e9ff::fe21:6431/64", "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 18, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } Metadata ^^^^^^^^ .. tabs:: .. tab:: XML .. code-block:: xml false FooXf19 142 255 19 2 1 1200 3400 false 0 0 12345 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "142", "table_id": 2, "installHw": false, "flow-name": "FooXf19", "strict": false, "idle-timeout": 3400, "priority": 1, "hard-timeout": 1200, "cookie_mask": 255, "match": { "metadata": { "metadata": 12345 } }, "cookie": 19, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } Metadata, Metadata Mask ^^^^^^^^^^^^^^^^^^^^^^^ .. tabs:: .. tab:: XML .. code-block:: xml false FooXf20 143 255 20 2 2 1200 3400 false 0 0 12345 0xFF .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "143", "table_id": 2, "installHw": false, "flow-name": "FooXf20", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "metadata": { "metadata": 12345, "metadata-mask": 255 } }, "cookie": 20, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, UDP Src & Dest Ports ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Note that ethernet-type MUST be 34525 .. tabs:: .. tab:: XML .. code-block:: xml false FooXf21 144 255 21 2 2 1200 3400 false 0 0 34525 1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76 fe80::2acf:e9ff:fe21:6431/128 12345 17 8 3 25364 8080 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "144", "table_id": 2, "installHw": false, "flow-name": "FooXf21", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "ipv6-source": "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76", "ipv6-destination": "fe80::2acf:e9ff:fe21:6431/128", "metadata": { "metadata": 12345 }, "ip-match": { "ip-dscp": 8, "ip-protocol": 17, "ip-ecn": 3 }, "udp-source-port": 25364, "udp-destination-port": 8080, "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 21, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, TCP Src & Dest Ports ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Note that ethernet-type MUST be 34525 - Note that IP Protocol MUST be 6 .. tabs:: .. tab:: XML .. code-block:: xml false FooXf22 145 255 22 2 2 1200 3400 false 0 0 34525 1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76 fe80:2acf:e9ff:fe21::6431/94 12345 6 60 3 183 8080 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "145", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv6-source": "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76", "ipv6-destination": "fe80:2acf:e9ff:fe21::6431/94", "metadata": { "metadata": 12345 }, "ip-match": { "ip-dscp": 60, "ip-protocol": 6, "ip-ecn": 3 }, "tcp-source-port": 183, "tcp-destination-port": 8080, "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 22, "flow-name": "FooXf22", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] }, "idle-timeout": 3400 } ] } IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, TCP Src & Dest Ports, IPv6 Label ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Note that ethernet-type MUST be 34525 - Note that IP Protocol MUST be 6 .. tabs:: .. tab:: XML .. code-block:: xml false FooXf23 146 255 23 2 2 1200 3400 false 0 0 34525 1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76 fe80:2acf:e9ff:fe21::6431/94 12345 33 6 60 3 183 8080 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "146", "table_id": 2, "installHw": false, "flow-name": "FooXf23", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "ipv6-source": "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76", "ipv6-destination": "fe80:2acf:e9ff:fe21::6431/94", "ipv6-label": { "ipv6-flabel": 33 }, "metadata": { "metadata": 12345 }, "ip-match": { "ip-dscp": 60, "ip-protocol": 6, "ip-ecn": 3 }, "tcp-source-port": 183, "tcp-destination-port": 8080, "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 23, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } Tunnel ID ^^^^^^^^^ .. tabs:: .. tab:: XML .. code-block:: xml false FooXf24 147 255 24 2 2 1200 3400 false 0 0 2591 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "147", "table_id": 2, "installHw": false, "flow-name": "FooXf24", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "tunnel": { "tunnel-id": 2591 } }, "cookie": 24, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, ICMPv6 Type & Code, IPv6 Label ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Note that ethernet-type MUST be 34525 - Note that IP Protocol MUST be 58 .. tabs:: .. tab:: XML .. code-block:: xml false FooXf25 148 255 25 2 2 1200 3400 false 0 0 34525 1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76 fe80:2acf:e9ff:fe21::6431/94 12345 33 58 60 3 6 3 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "148", "table_id": 2, "installHw": false, "flow-name": "FooXf25", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "ipv6-source": "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76", "ipv6-destination": "fe80:2acf:e9ff:fe21::6431/94", "ipv6-label": { "ipv6-flabel": 33 }, "metadata": { "metadata": 12345 }, "ip-match": { "ip-dscp": 60, "ip-protocol": 58, "ip-ecn": 3 }, "icmpv6-match": { "icmpv6-type": 6, "icmpv6-code": 3 }, "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 25, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } IPv6 Src & Dest Addresses, Metadata, IP DSCP, IP ECN, TCP Src & Dst Ports, IPv6 Label, IPv6 Ext Header ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Note that ethernet-type MUST be 34525 - Note that IP Protocol MUST be 58 .. tabs:: .. tab:: XML .. code-block:: xml false FooXf27 150 255 27 2 2 1200 3400 false 0 0 34525 1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76 fe80:2acf:e9ff:fe21::6431/94 12345 33 0 6 60 3 183 8080 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "150", "table_id": 2, "installHw": false, "flow-name": "FooXf27", "strict": false, "idle-timeout": 3400, "priority": 2, "hard-timeout": 1200, "cookie_mask": 255, "match": { "ipv6-source": "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76", "ipv6-destination": "fe80:2acf:e9ff:fe21::6431/94", "ipv6-label": { "ipv6-flabel": 33 }, "ipv6-ext-header": { "ipv6-exthdr": 0 }, "metadata": { "metadata": 12345 }, "ip-match": { "ip-dscp": 60, "ip-protocol": 6, "ip-ecn": 3 }, "tcp-source-port": 183, "tcp-destination-port": 8080, "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 27, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "dec-nw-ttl": {} } ] } } ] } } ] } Actions ~~~~~~~ The format of the XML that describes OpenFlow actions is determined by the opendaylight-action-types yang model: Apply Actions ^^^^^^^^^^^^^ Output to TABLE ''''''''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false FooXf101 256 255 101 2 2 1200 3400 false 0 0 TABLE 60 34525 1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76 fe80:2acf:e9ff:fe21::6431/94 12345 6 60 3 183 8080 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "256", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv6-source": "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76", "ipv6-destination": "fe80:2acf:e9ff:fe21::6431/94", "metadata": { "metadata": 12345 }, "ip-match": { "ip-dscp": 60, "ip-protocol": 6, "ip-ecn": 3 }, "tcp-source-port": 183, "tcp-destination-port": 8080, "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 101, "flow-name": "FooXf101", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "output-action": { "output-node-connector": "TABLE", "max-length": 60 } } ] } } ] }, "idle-timeout": 3400 } ] } Output to INPORT '''''''''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false FooXf102 257 255 102 2 2 1200 3400 false 0 0 INPORT 60 2048
ff:ff:29:01:19:61
00:00:00:11:23:ae
17.1.2.3/8 172.168.5.6/16 6 2 2 25364 8080
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "257", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv4-source": "17.1.2.3/8", "ipv4-destination": "172.168.5.6/16", "ip-match": { "ip-dscp": 2, "ip-protocol": 6, "ip-ecn": 2 }, "tcp-source-port": 25364, "tcp-destination-port": 8080, "ethernet-match": { "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-type": { "type": 2048 }, "ethernet-destination": { "address": "ff:ff:29:01:19:61" } } }, "cookie": 102, "flow-name": "FooXf102", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "output-action": { "output-node-connector": "INPORT", "max-length": 60 } } ] } } ] }, "idle-timeout": 3400 } ] } Output to Physical Port ''''''''''''''''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false FooXf103 258 255 103 2 2 1200 3400 false 0 0 1 60 2048
ff:ff:29:01:19:61
00:00:00:11:23:ae
17.1.2.3/8 172.168.5.6/16 6 2 2 25364 8080
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "258", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv4-source": "17.1.2.3/8", "ipv4-destination": "172.168.5.6/16", "ip-match": { "ip-dscp": 2, "ip-protocol": 6, "ip-ecn": 2 }, "tcp-source-port": 25364, "tcp-destination-port": 8080, "ethernet-match": { "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-type": { "type": 2048 }, "ethernet-destination": { "address": "ff:ff:29:01:19:61" } } }, "cookie": 103, "flow-name": "FooXf103", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "output-action": { "output-node-connector": "1", "max-length": 60 } } ] } } ] }, "idle-timeout": 3400 } ] } Output to LOCAL ''''''''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false FooXf104 259 255 104 2 2 1200 3400 false 0 0 LOCAL 60 34525 1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76 fe80:2acf:e9ff:fe21::6431/94 12345 6 60 3 183 8080 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "259", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv6-source": "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76", "ipv6-destination": "fe80:2acf:e9ff:fe21::6431/94", "metadata": { "metadata": 12345 }, "ip-match": { "ip-dscp": 60, "ip-protocol": 6, "ip-ecn": 3 }, "tcp-source-port": 183, "tcp-destination-port": 8080, "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 104, "flow-name": "FooXf104", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "output-action": { "output-node-connector": "LOCAL", "max-length": 60 } } ] } } ] }, "idle-timeout": 3400 } ] } Output to NORMAL '''''''''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false FooXf105 260 255 105 2 2 1200 3400 false 0 0 NORMAL 60 34525 1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/84 fe80:2acf:e9ff:fe21::6431/90 12345 6 45 2 20345 80 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "260", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv6-source": "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/84", "ipv6-destination": "fe80:2acf:e9ff:fe21::6431/90", "metadata": { "metadata": 12345 }, "ip-match": { "ip-dscp": 45, "ip-protocol": 6, "ip-ecn": 2 }, "tcp-source-port": 20345, "tcp-destination-port": 80, "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 105, "flow-name": "FooXf105", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "output-action": { "output-node-connector": "NORMAL", "max-length": 60 } } ] } } ] }, "idle-timeout": 3400 } ] } Output to FLOOD ''''''''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false FooXf106 261 255 106 2 2 1200 3400 false 0 0 FLOOD 60 34525 1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/100 fe80:2acf:e9ff:fe21::6431/67 12345 6 45 2 20345 80 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "261", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv6-source": "1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/100", "ipv6-destination": "fe80:2acf:e9ff:fe21::6431/67", "metadata": { "metadata": 12345 }, "ip-match": { "ip-dscp": 45, "ip-protocol": 6, "ip-ecn": 2 }, "tcp-source-port": 20345, "tcp-destination-port": 80, "ethernet-match": { "ethernet-type": { "type": 34525 } } }, "cookie": 106, "flow-name": "FooXf106", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "output-action": { "output-node-connector": "FLOOD", "max-length": 60 } } ] } } ] }, "idle-timeout": 3400 } ] } Output to ALL ''''''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false FooXf107 262 255 107 2 2 1200 3400 false 0 0 ALL 60 2048
20:14:29:01:19:61
00:00:00:11:23:ae
19.1.2.3/10 172.168.5.6/18 17 8 3 25364 8080 0
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "262", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv4-source": "19.1.2.3/10", "ipv4-destination": "172.168.5.6/18", "ip-match": { "ip-dscp": 8, "ip-protocol": 17, "ip-ecn": 3 }, "in-port": "0", "udp-source-port": 25364, "udp-destination-port": 8080, "ethernet-match": { "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-type": { "type": 2048 }, "ethernet-destination": { "address": "20:14:29:01:19:61" } } }, "cookie": 107, "flow-name": "FooXf107", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "output-action": { "output-node-connector": "ALL", "max-length": 60 } } ] } } ] }, "idle-timeout": 3400 } ] } Output to CONTROLLER '''''''''''''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false FooXf108 263 255 108 2 2 1200 3400 false 0 0 CONTROLLER 60 2048
20:14:29:01:19:61
00:00:00:11:23:ae
19.1.2.3/10 172.168.5.6/18 17 8 3 25364 8080 0
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "263", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv4-source": "19.1.2.3/10", "ipv4-destination": "172.168.5.6/18", "ip-match": { "ip-dscp": 8, "ip-protocol": 17, "ip-ecn": 3 }, "in-port": "0", "udp-source-port": 25364, "udp-destination-port": 8080, "ethernet-match": { "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-type": { "type": 2048 }, "ethernet-destination": { "address": "20:14:29:01:19:61" } } }, "cookie": 108, "flow-name": "FooXf108", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "output-action": { "output-node-connector": "CONTROLLER", "max-length": 60 } } ] } } ] }, "idle-timeout": 3400 } ] } Output to ANY ''''''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false FooXf109 264 255 109 2 2 1200 3400 false 0 0 ANY 60 2048
20:14:29:01:19:61
00:00:00:11:23:ae
19.1.2.3/10 172.168.5.6/18 17 8 3 25364 8080 0
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "264", "table_id": 2, "priority": 2, "hard-timeout": 1200, "installHw": false, "cookie_mask": 255, "match": { "ipv4-source": "19.1.2.3/10", "ipv4-destination": "172.168.5.6/18", "ip-match": { "ip-dscp": 8, "ip-protocol": 17, "ip-ecn": 3 }, "in-port": "0", "udp-source-port": 25364, "udp-destination-port": 8080, "ethernet-match": { "ethernet-source": { "address": "00:00:00:11:23:ae" }, "ethernet-type": { "type": 2048 }, "ethernet-destination": { "address": "20:14:29:01:19:61" } } }, "cookie": 109, "flow-name": "FooXf109", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "output-action": { "output-node-connector": "ANY", "max-length": 60 } } ] } } ] }, "idle-timeout": 3400 } ] } Push VLAN ''''''''' .. tabs:: .. tab:: XML .. code-block:: xml false 0 33024 0 79 true 1 5 2 0 31 2048
FF:FF:29:01:19:61
00:00:00:11:23:AE
1
vlan_flow 2
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "31", "table_id": 0, "priority": 2, "match": { "in-port": "1", "ethernet-match": { "ethernet-source": { "address": "00:00:00:11:23:AE" }, "ethernet-type": { "type": 2048 }, "ethernet-destination": { "address": "FF:FF:29:01:19:61" } } }, "flow-name": "vlan_flow", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "push-vlan-action": { "ethernet-type": 33024 } }, { "order": 1, "set-field": { "vlan-match": { "vlan-id": { "vlan-id-present": true, "vlan-id": 79 } } } }, { "order": 2, "output-action": { "output-node-connector": "5" } } ] } } ] } } ] } Push MPLS ''''''''' .. tabs:: .. tab:: XML .. code-block:: xml push-mpls-action 3 34887 0 27 1 2 2 false 100 2048 1 10.0.0.4/32 0 255 401 8 0 false 0 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "100", "table_id": 0, "priority": 8, "hard-timeout": 0, "installHw": false, "cookie_mask": 255, "match": { "ipv4-destination": "10.0.0.4/32", "in-port": "1", "ethernet-match": { "ethernet-type": { "type": 2048 } } }, "cookie": 401, "flow-name": "push-mpls-action", "strict": false, "instructions": { "instruction": [ { "order": 3, "apply-actions": { "action": [ { "order": 0, "push-mpls-action": { "ethernet-type": 34887 } }, { "order": 1, "set-field": { "protocol-match-fields": { "mpls-label": 27 } } }, { "order": 2, "output-action": { "output-node-connector": "2" } } ] } } ] }, "idle-timeout": 0 } ] } Swap MPLS ''''''''' - Note that ethernet-type MUST be 34887 .. tabs:: .. tab:: XML .. code-block:: xml push-mpls-action 2 37 1 2 2 false 101 34887 1 27 0 255 401 8 0 false 0 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "101", "table_id": 0, "priority": 8, "hard-timeout": 0, "installHw": false, "cookie_mask": 255, "match": { "in-port": "1", "protocol-match-fields": { "mpls-label": 27 }, "ethernet-match": { "ethernet-type": { "type": 34887 } } }, "cookie": 401, "flow-name": "push-mpls-action", "strict": false, "instructions": { "instruction": [ { "order": 2, "apply-actions": { "action": [ { "order": 1, "set-field": { "protocol-match-fields": { "mpls-label": 37 } } }, { "order": 2, "output-action": { "output-node-connector": "2" } } ] } } ] }, "idle-timeout": 0 } ] } Pop MPLS '''''''' - Note that ethernet-type MUST be 34887 - Issue with OVS 2.1 `OVS fix `_ .. tabs:: .. tab:: XML .. code-block:: xml FooXf10 0 2048 1 2 60 2 11 false 34887 1 37 0 889 255 false 0 10 0 .. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "11", "table_id": 0, "priority": 10, "hard-timeout": 0, "installHw": false, "cookie_mask": 255, "match": { "in-port": "1", "protocol-match-fields": { "mpls-label": 37 }, "ethernet-match": { "ethernet-type": { "type": 34887 } } }, "cookie": 889, "flow-name": "FooXf10", "strict": false, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 1, "pop-mpls-action": { "ethernet-type": 2048 } }, { "order": 2, "output-action": { "output-node-connector": "2", "max-length": 60 } } ] } } ] }, "idle-timeout": 0 } ] } Learn ''''' - Nicira extension defined in https://github.com/osrg/openvswitch/blob/master/include/openflow/nicira-ext.h - Example section is - https://github.com/osrg/openvswitch/blob/master/include/openflow/nicira-ext.h#L788 .. tabs:: .. tab:: XML .. code-block:: xml ICMP_Ingress258a5a5ad-08a8-4ff7-98f5-ef0b96ca3bb8 0 0 2048 2199023255552 2305841909702066176 1 110100480 0 1 220
0 60 0 60 0 41 61010 0 0 2048 1538 16 0 0 4100 3588 32 0 0 518 1030 48 0 0 3073 3073 8 0 1 65540 8 110100480
true false false 61010 253 ACL
.. tab:: JSON .. code-block:: json { "flow-node-inventory:flow": [ { "id": "ICMP_Ingress258a5a5ad-08a8-4ff7-98f5-ef0b96ca3bb8", "table_id": 253, "installHw": true, "barrier": false, "flow-name": "ACL", "strict": false, "idle-timeout": 0, "priority": 61010, "hard-timeout": 0, "match": { "metadata": { "metadata": 2199023255552, "metadata-mask": 2305841909702066176 }, "ip-match": { "ip-protocol": 1 }, "ethernet-match": { "ethernet-type": { "type": 2048 } } }, "cookie": 110100480, "instructions": { "instruction": [ { "order": 0, "apply-actions": { "action": [ { "order": 0, "openflowplugin-extension-nicira-action:nx-learn": { "flags": 0, "idle-timeout": 60, "fin-idle-timeout": 0, "hard-timeout": 60, "fin-hard-timeout": 0, "flow-mods": [ { "flow-mod-add-match-from-value": { "src-ofs": 0, "src-field": 1538, "flow-mod-num-bits": 16, "value": 2048 } }, { "flow-mod-add-match-from-field": { "dst-ofs": 0, "src-ofs": 0, "dst-field": 4100, "src-field": 3588, "flow-mod-num-bits": 32 } }, { "flow-mod-add-match-from-field": { "dst-ofs": 0, "src-ofs": 0, "dst-field": 518, "src-field": 1030, "flow-mod-num-bits": 48 } }, { "flow-mod-add-match-from-field": { "dst-ofs": 0, "src-ofs": 0, "dst-field": 3073, "src-field": 3073, "flow-mod-num-bits": 8 } }, { "flow-mod-copy-value-into-field": { "dst-ofs": 0, "dst-field": 65540, "flow-mod-num-bits": 8, "value": 1 } } ], "cookie": 110100480, "priority": 61010, "table-id": 41 } }, { "order": 1, "openflowplugin-extension-nicira-action:nx-resubmit": { "table": 220 } } ] } } ] } } ] }