<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: How do I add, delete, modify a flow using the ODL API or Curl? in ExtremeWireless (General)</title>
    <link>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28259#M112</link>
    <description>Can you please reply to my next comment.</description>
    <pubDate>Thu, 29 Oct 2015 23:27:00 GMT</pubDate>
    <dc:creator>Emad</dc:creator>
    <dc:date>2015-10-29T23:27:00Z</dc:date>
    <item>
      <title>How do I add, delete, modify a flow using the ODL API or Curl?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28256#M109</link>
      <description>A question people frequently ask is "how to add a flow in OpenDaylight?".  This can be a little confusing because the UI for changing flows in DLUX only works with ADSAL in the Helium release and not MDSAL (which is what you will usually be using).  &lt;BR /&gt;
&lt;BR /&gt;
There are 2 workarounds.  &lt;BR /&gt;
&lt;UL&gt; 
&lt;LI&gt;If you want to use DLUX, you can enter flow information using the Yang UI.   
&lt;/LI&gt;&lt;LI&gt;If you want to use the API directly or send commands to the API using curl, you can follow the directions/examples below.&lt;/LI&gt;&lt;/UL&gt;
&lt;BR /&gt;
You can use the below curl commands to create/retrieve/delete a flow.  For more information on creating  flows and flow matches you can refer the below links.&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:End_to_End_Flows" target="_blank" rel="nofollow noreferrer noopener"&gt;https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:End_to_End_Flows&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="https://wiki.opendaylight.org/view/Editing_OpenDaylight_OpenFlow_Plugin:End_to_End_Flows:Example_Flows" target="_blank" rel="nofollow noreferrer noopener"&gt;https://wiki.opendaylight.org/view/Editing_OpenDaylight_OpenFlow_Plugin:End_to_End_Flows:Example_Flows&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Program a  flow in config datastore:&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
Create a file L3Flow and configure flow parameters&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
curl -X PUT -d&lt;B&gt;@L3Flow&lt;/B&gt; -H "Content-Type: application/xml" -H "Accept: application/xml" --user admin:abc123 &lt;A href="http://10.127.13.240:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:19701787512/table/0/flow/1" target="_blank" rel="nofollow noreferrer noopener"&gt;http://10.127.13.240:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:19701787512/table/0/flow/1&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;[openflow@10-127-13-225 ~]$ cat L3Flow&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;FLOW xmlns="urn:opendaylight:flow:inventory"&gt;&lt;BR /&gt;
&lt;BR /&gt;
    &lt;STRICT&gt;false&lt;/STRICT&gt;&lt;BR /&gt;
&lt;BR /&gt;
    &lt;FLOW-NAME&gt;flow1&lt;/FLOW-NAME&gt;&lt;BR /&gt;
&lt;BR /&gt;
    &lt;I&gt;1&lt;/I&gt;&lt;/FLOW&gt;&lt;BR /&gt;
&lt;BR /&gt;
    &lt;COOKIE_MASK&gt;255&lt;/COOKIE_MASK&gt;&lt;BR /&gt;
&lt;BR /&gt;
    &lt;COOKIE&gt;103&lt;/COOKIE&gt;&lt;BR /&gt;
&lt;BR /&gt;
    &lt;TABLE_ID&gt;0&lt;/TABLE_ID&gt;&lt;BR /&gt;
&lt;BR /&gt;
    20&lt;BR /&gt;
&lt;BR /&gt;
    &lt;HARD-TIMEOUT&gt;1800&lt;/HARD-TIMEOUT&gt;&lt;BR /&gt;
&lt;BR /&gt;
    &lt;I&gt;1800&lt;BR /&gt;
&lt;BR /&gt;
    &lt;I&gt;true&lt;BR /&gt;
&lt;BR /&gt;
    &lt;I&gt;&lt;BR /&gt;
&lt;BR /&gt;
        &lt;I&gt;&lt;BR /&gt;
&lt;BR /&gt;
            &lt;ORDER&gt;0&lt;/ORDER&gt;&lt;BR /&gt;
&lt;BR /&gt;
            &lt;APPLY-ACTIONS&gt;&lt;BR /&gt;
&lt;BR /&gt;
                &lt;ACTION&gt;&lt;BR /&gt;
&lt;BR /&gt;
                    &lt;ORDER&gt;0&lt;/ORDER&gt;&lt;BR /&gt;
&lt;BR /&gt;
                    &lt;OUTPUT-ACTION&gt;&lt;BR /&gt;
&lt;BR /&gt;
                        &lt;OUTPUT-NODE-CONNECTOR&gt;22&lt;/OUTPUT-NODE-CONNECTOR&gt;&lt;BR /&gt;
&lt;BR /&gt;
                        &lt;MAX-LENGTH&gt;60&lt;/MAX-LENGTH&gt;&lt;BR /&gt;
&lt;BR /&gt;
                    &lt;/OUTPUT-ACTION&gt;&lt;BR /&gt;
&lt;BR /&gt;
                &lt;/ACTION&gt;&lt;BR /&gt;
&lt;BR /&gt;
            &lt;/APPLY-ACTIONS&gt;&lt;BR /&gt;
&lt;BR /&gt;
        &lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
&lt;BR /&gt;
    &lt;MATCH&gt;&lt;BR /&gt;
&lt;BR /&gt;
        &lt;ETHERNET-MATCH&gt;&lt;BR /&gt;
&lt;BR /&gt;
            &lt;ETHERNET-TYPE&gt;&lt;BR /&gt;
&lt;BR /&gt;
                &lt;TYPE&gt;2048&lt;/TYPE&gt;&lt;BR /&gt;
&lt;BR /&gt;
            &lt;/ETHERNET-TYPE&gt;&lt;BR /&gt;
&lt;BR /&gt;
        &lt;/ETHERNET-MATCH&gt;&lt;BR /&gt;
&lt;BR /&gt;
        &lt;I&gt;2.1.1.10/32&lt;/I&gt;&lt;/MATCH&gt;&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
* (Engineering) SW1.133 # show openflow flows&lt;BR /&gt;
&lt;BR /&gt;
Total number of OpenFlow flows : 1&lt;BR /&gt;
&lt;BR /&gt;
Total number of default flows  : 2&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
Flow name        Type     Duration (secs)  Prio              Packets&lt;BR /&gt;
&lt;BR /&gt;
---------------- ---- ------------------- ----- --------------------&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;of_0             ACL                   12    20                    0&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;    Match  :  Ethernet Type       : 0x0800 (IPv4)&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;              IP Dst Address      : 2.1.1.10&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;    Actions:  output:22&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
    Timeout (secs/remaining secs) : hard:1800:1787,idle:1800:1787&lt;BR /&gt;
&lt;BR /&gt;
    Cookie                        : 0x67&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Retrieve a  flow in config datastore:&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
curl -X GET -H "Content-Type: application/json" -H "Accept: application/json" --user admin:abc123 &lt;A href="http://10.127.13.240:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:19701787512/table/0/flow/1" target="_blank" rel="nofollow noreferrer noopener"&gt;http://10.127.13.240:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:19701787512/table/0/flow/1&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Retrieve a  flow in operational datastore:&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
curl -X GET -H "Content-Type: application/json" -H "Accept: application/json" --user admin:abc123 &lt;A href="http://10.127.13.240:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:19701787512/table/0/flow/1" target="_blank" rel="nofollow noreferrer noopener"&gt;http://10.127.13.240:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:19701787512/table/0/flow/1&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Delete a  flow in operational datastore:&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
curl -X DELETE -H "Content-Type: application/json" -H "Accept: application/json" --user admin:abc123 &lt;A href="http://10.127.13.240:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:19701787512/table/0/flow/1" target="_blank" rel="nofollow noreferrer noopener"&gt;http://10.127.13.240:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:19701787512/table/0/flow/1&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;</description>
      <pubDate>Sat, 21 Feb 2015 03:52:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28256#M109</guid>
      <dc:creator>Andrew_Kinard</dc:creator>
      <dc:date>2015-02-21T03:52:00Z</dc:date>
    </item>
    <item>
      <title>RE: How do I add, delete, modify a flow using the ODL API or Curl?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28257#M110</link>
      <description>Hello, can you please elaborate the rest API body if a user needs to change the MAC/IP address of an incoming packet at switch ?&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Sep 2015 09:46:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28257#M110</guid>
      <dc:creator>Sanjay_kumar</dc:creator>
      <dc:date>2015-09-28T09:46:00Z</dc:date>
    </item>
    <item>
      <title>RE: How do I add, delete, modify a flow using the ODL API or Curl?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28258#M111</link>
      <description>Sanjay,  Sorry you haven't been replied to yet.  You can just add more actions like the ones i have below.  I included IP and MAC change actions.&lt;BR /&gt;
&lt;BR /&gt;
MAC destination address change:&lt;BR /&gt;
&lt;ACTION&gt;&lt;BR /&gt;
    &lt;ORDER&gt;1&lt;/ORDER&gt;&lt;BR /&gt;
    &lt;SET-DL-DST-ACTION&gt;&lt;BR /&gt;
         &lt;ADDRESS&gt;11:22:33:44:55:66&lt;/ADDRESS&gt;&lt;BR /&gt;
    &lt;/SET-DL-DST-ACTION&gt;&lt;BR /&gt;
&lt;/ACTION&gt;&lt;BR /&gt;
&lt;BR /&gt;
MAC source address change:&lt;BR /&gt;
&lt;ACTION&gt;&lt;BR /&gt;
    &lt;ORDER&gt;2&lt;/ORDER&gt;&lt;BR /&gt;
    &lt;SET-DL-SRC-ACTION&gt;&lt;BR /&gt;
         &lt;ADDRESS&gt;11:22:33:44:55:66&lt;/ADDRESS&gt;&lt;BR /&gt;
    &lt;/SET-DL-SRC-ACTION&gt;&lt;BR /&gt;
&lt;/ACTION&gt;&lt;BR /&gt;
&lt;BR /&gt;
IP source change:&lt;BR /&gt;
&lt;ACTION&gt;&lt;BR /&gt;
    &lt;ORDER&gt;3&lt;/ORDER&gt;&lt;BR /&gt;
    &lt;SET-NW-SRC-ACTION&gt;&lt;BR /&gt;
        &lt;ADDRESS&gt;1.1.1.1&lt;/ADDRESS&gt;&lt;BR /&gt;
    &lt;/SET-NW-SRC-ACTION&gt;&lt;BR /&gt;
&lt;/ACTION&gt;&lt;BR /&gt;
&lt;BR /&gt;
IP destination change:&lt;BR /&gt;
&lt;ACTION&gt;&lt;BR /&gt;
    &lt;ORDER&gt;4&lt;/ORDER&gt;&lt;BR /&gt;
    &lt;SET-NW-DST-ACTION&gt;&lt;BR /&gt;
        &lt;ADDRESS&gt;1.1.1.1&lt;/ADDRESS&gt;&lt;BR /&gt;
    &lt;/SET-NW-DST-ACTION&gt;&lt;BR /&gt;
&lt;/ACTION&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Oct 2015 23:27:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28258#M111</guid>
      <dc:creator>StephenW</dc:creator>
      <dc:date>2015-10-29T23:27:00Z</dc:date>
    </item>
    <item>
      <title>RE: How do I add, delete, modify a flow using the ODL API or Curl?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28259#M112</link>
      <description>Can you please reply to my next comment.</description>
      <pubDate>Thu, 29 Oct 2015 23:27:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28259#M112</guid>
      <dc:creator>Emad</dc:creator>
      <dc:date>2015-10-29T23:27:00Z</dc:date>
    </item>
    <item>
      <title>RE: How do I add, delete, modify a flow using the ODL API or Curl?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28260#M113</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
 Based on previous comment, I try to use this xml, to force the flow to go to another destination, so I want to modify the destination address:&lt;BR /&gt;
&lt;BR /&gt;
 &lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt; &lt;FLOW xmlns="urn:opendaylight:flow:inventory"&gt;     33000&lt;/FLOW&gt;     &lt;FLOW-NAME&gt;Foo&lt;/FLOW-NAME&gt;     &lt;MATCH&gt;         &lt;ETHERNET-MATCH&gt;             &lt;ETHERNET-TYPE&gt;                 &lt;TYPE&gt;2048&lt;/TYPE&gt;             &lt;/ETHERNET-TYPE&gt;          &lt;/ETHERNET-MATCH&gt;          &lt;I&gt;10.0.0.8/32&lt;/I&gt;&lt;/MATCH&gt;          &lt;I&gt;1     &lt;TABLE_ID&gt;0&lt;/TABLE_ID&gt;     &lt;I&gt;         &lt;I&gt;             &lt;ORDER&gt;1&lt;/ORDER&gt;             &lt;APPLY-ACTIONS&gt;                 &lt;ACTION&gt;                    &lt;ORDER&gt;1&lt;/ORDER&gt;                    &lt;SET-NW-DST-ACTION&gt;                    &lt;I&gt;10.0.0.7/32&lt;/I&gt;&lt;/SET-NW-DST-ACTION&gt;                   &lt;/ACTION&gt;                &lt;/APPLY-ACTIONS&gt;                            &lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;/DIV&gt; however sending REST GET request to 10.0.0.8 is not redirected to 10.0.0.7 &lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;&lt;U&gt;sudo ovs-ofctl -O OpenFlow13 dump-flows br-int&lt;/U&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;U&gt;: &lt;/U&gt;&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;cookie=0x0, duration=63.453s, table=0, n_packets=0, n_bytes=0, priority=33000,ip,nw_dst=10.0.0.8 actions=output:8,set_field:10.0.0.7-&amp;gt;ip_dst&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
  Is there any source that I can refer for adding flows, &lt;A href="https://wiki.opendaylight.org/view/Editing_OpenDaylight_OpenFlow_Plugin:End_to_End_Flows:Example_Flows" target="_blank" rel="nofollow noreferrer noopener"&gt;this&lt;/A&gt;&lt;A href="https://wiki.opendaylight.org/view/Editing_OpenDaylight_OpenFlow_Plugin:End_to_End_Flows:Example_Flows" target="_blank" rel="nofollow noreferrer noopener"&gt; &lt;/A&gt;seems to be incomplete. &lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Nov 2015 21:14:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-general/how-do-i-add-delete-modify-a-flow-using-the-odl-api-or-curl/m-p/28260#M113</guid>
      <dc:creator>Emad</dc:creator>
      <dc:date>2015-11-13T21:14:00Z</dc:date>
    </item>
  </channel>
</rss>

